presto-orc/src/main/java/io/prestosql/orc/stream/DecimalInputStream.java/DecimalInputStream/emitLongDecimal
class DecimalInputStream:    private static void emitLongDecimal(long[] result, int offset, long low, long middle, long high, boolean negative)
    {
        long lower = (low >>> 1) | (middle << 55); // drop the sign bit from low
        long upper = (middle >>> 9) | (high << 47);

        if (negative) {
            if (lower == 0xFFFFFFFFFFFFFFFFL) {
                lower = 0;
                upper += 1;
            }
            else {
                lower += 1;
            }
        }

        result[2 * offset] = lower;
        result[2 * offset + 1] = upper | (negative ? SIGN_LONG_MASK : 0);
    }