LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/Cyan4973[P]FiniteStateEntropy/programs/../lib/huf_decompress.c
// Function: HUF_decompress1X2_DCtx_wksp
size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* DCtx, void* dst, size_t dstSize,
                                   const void* cSrc, size_t cSrcSize,
                                   void* workSpace, size_t wkspSize)
{
    const BYTE* ip = (const BYTE*) cSrc;

    size_t const hSize = HUF_readDTableX2_wksp(DCtx, cSrc, cSrcSize,
                                               workSpace, wkspSize);
    if (HUF_isError(hSize)) return hSize;
    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
    ip += hSize; cSrcSize -= hSize;

    return HUF_decompress1X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, /* bmi2 */ 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
movq 0x30(%rsp), %r8
movq %rcx, %rsi
movq %rbx, %rdx
movq %r9, %rcx
callq 0xcd19
movq %rax, %rcx
cmpq $-0x9, %rax
ja 0xd533
movq $-0x3, %rcx
subq %rax, %rbx
jbe 0xd533
addq %rax, %r14
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r15, %r8
xorl %r9d, %r9d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xd18b
movq %rcx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Cyan4973[P]FiniteStateEntropy/programs/../lib/huf_decompress.c
// Function: HUF_decompress4X2_DCtx_wksp_bmi2
static size_t HUF_decompress4X2_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize,
                                   const void* cSrc, size_t cSrcSize,
                                   void* workSpace, size_t wkspSize, int bmi2)
{
    const BYTE* ip = (const BYTE*) cSrc;

    size_t hSize = HUF_readDTableX2_wksp(dctx, cSrc, cSrcSize,
                                         workSpace, wkspSize);
    if (HUF_isError(hSize)) return hSize;
    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
    ip += hSize; cSrcSize -= hSize;

    return HUF_decompress4X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
movl 0x48(%rsp), %ebp
movq 0x40(%rsp), %r8
movq %rcx, %rsi
movq %rbx, %rdx
movq %r9, %rcx
callq 0xcd19
movq %rax, %rcx
cmpq $-0x9, %rax
ja 0xeb7d
movq $-0x3, %rcx
subq %rax, %rbx
jbe 0xeb7d
addq %rax, %r14
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r15, %r8
movl %ebp, %r9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd5ea
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Cyan4973[P]FiniteStateEntropy/programs/../lib/huf_decompress.c
// Function: HUF_selectDecoder
U32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize)
{
    assert(dstSize > 0);
    assert(dstSize <= 128*1024);
#if defined(HUF_FORCE_DECOMPRESS_X1)
    (void)dstSize;
    (void)cSrcSize;
    return 0;
#elif defined(HUF_FORCE_DECOMPRESS_X2)
    (void)dstSize;
    (void)cSrcSize;
    return 1;
#else
    /* decoder timing evaluation */
    {   U32 const Q = (cSrcSize >= dstSize) ? 15 : (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 */
        U32 const D256 = (U32)(dstSize >> 8);
        U32 const DTime0 = algoTime[Q][0].tableTime + (algoTime[Q][0].decode256Time * D256);
        U32 DTime1 = algoTime[Q][1].tableTime + (algoTime[Q][1].decode256Time * D256);
        DTime1 += DTime1 >> 3;  /* advantage to algorithm using less memory, to reduce cache eviction */
        return DTime1 < DTime0;
    }
#endif
}

// Assembly:
movl $0xf, %eax
cmpq %rdi, %rsi
jae 0xec5d
shlq $0x4, %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
movl %eax, %eax
shrq $0x8, %rdi
leaq (%rax,%rax,2), %rax
leaq 0x55d4(%rip), %rcx      # 0x14240
movl 0x4(%rcx,%rax,8), %edx
imull %edi, %edx
addl (%rcx,%rax,8), %edx
imull 0xc(%rcx,%rax,8), %edi
addl 0x8(%rcx,%rax,8), %edi
movl %edi, %ecx
shrl $0x3, %ecx
addl %edi, %ecx
xorl %eax, %eax
cmpl %edx, %ecx
setb %al
retq
// File: /workspace/github_c_makefile_star2_O1/Cyan4973[P]FiniteStateEntropy/programs/../lib/huf_decompress.c
// Function: HUF_decompress
size_t HUF_decompress (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
{
#if !defined(HUF_FORCE_DECOMPRESS_X1) && !defined(HUF_FORCE_DECOMPRESS_X2)
    static const decompressionAlgo decompress[2] = { HUF_decompress4X1, HUF_decompress4X2 };
#endif

    /* validation checks */
    if (dstSize == 0) return ERROR(dstSize_tooSmall);
    if (cSrcSize > dstSize) return ERROR(corruption_detected);   /* invalid */
    if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; }   /* not compressed */
    if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */

    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
#if defined(HUF_FORCE_DECOMPRESS_X1)
        (void)algoNb;
        assert(algoNb == 0);
        return HUF_decompress4X1(dst, dstSize, cSrc, cSrcSize);
#elif defined(HUF_FORCE_DECOMPRESS_X2)
        (void)algoNb;
        assert(algoNb == 1);
        return HUF_decompress4X2(dst, dstSize, cSrc, cSrcSize);
#else
        return decompress[algoNb](dst, dstSize, cSrc, cSrcSize);
#endif
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0xecc5
movq %rcx, %r15
movq %rsi, %rbx
movq $-0x4, %rax
cmpq %rsi, %rcx
ja 0xece6
movq %rdx, %r14
movq %rdi, %r12
jne 0xecce
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1130
jmp 0xece3
movq $-0x2, %rax
jmp 0xece6
cmpq $0x1, %r15
jne 0xecf2
movzbl (%r14), %esi
movq %r12, %rdi
movq %rbx, %rdx
callq 0x10c0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
movq %r15, %rsi
callq 0xec45
movl %eax, %eax
leaq 0xa0ca(%rip), %r8       # 0x18dd0
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmpq *(%r8,%rax,8)
// File: /workspace/github_c_makefile_star2_O1/Cyan4973[P]FiniteStateEntropy/programs/../lib/huf_decompress.c
// Function: HUF_decompress4X_DCtx
size_t HUF_decompress4X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
{
    /* validation checks */
    if (dstSize == 0) return ERROR(dstSize_tooSmall);
    if (cSrcSize > dstSize) return ERROR(corruption_detected);   /* invalid */
    if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; }   /* not compressed */
    if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */

    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
#if defined(HUF_FORCE_DECOMPRESS_X1)
        (void)algoNb;
        assert(algoNb == 0);
        return HUF_decompress4X1_DCtx(dctx, dst, dstSize, cSrc, cSrcSize);
#elif defined(HUF_FORCE_DECOMPRESS_X2)
        (void)algoNb;
        assert(algoNb == 1);
        return HUF_decompress4X2_DCtx(dctx, dst, dstSize, cSrc, cSrcSize);
#else
        return algoNb ? HUF_decompress4X2_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) :
                        HUF_decompress4X1_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) ;
#endif
    }
}

// Assembly:
testq %rdx, %rdx
je 0xed60
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x800, %rsp            # imm = 0x800
movq %r8, %r15
movq %rdx, %rbx
movq $-0x4, %rax
cmpq %rdx, %r8
ja 0xedc4
movq %rcx, %r14
movq %rsi, %r12
jne 0xed68
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1130
jmp 0xed7d
movq $-0x2, %rax
retq
cmpq $0x1, %r15
jne 0xed82
movzbl (%r14), %esi
movq %r12, %rdi
movq %rbx, %rdx
callq 0x10c0
movq %rbx, %rax
jmp 0xedc4
movq %rdi, %r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0xec45
movq %rsp, %r9
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r14, %rcx
movq %r15, %r8
testl %eax, %eax
je 0xedb4
pushq $0x0
pushq $0x800                  # imm = 0x800
callq 0xeb0f
jmp 0xedc0
pushq $0x0
pushq $0x800                  # imm = 0x800
callq 0xcc11
addq $0x10, %rsp
addq $0x800, %rsp            # imm = 0x800
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Cyan4973[P]FiniteStateEntropy/programs/../lib/huf_decompress.c
// Function: HUF_decompress4X_hufOnly_wksp
size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst,
                                     size_t dstSize, const void* cSrc,
                                     size_t cSrcSize, void* workSpace,
                                     size_t wkspSize)
{
    /* validation checks */
    if (dstSize == 0) return ERROR(dstSize_tooSmall);
    if (cSrcSize == 0) return ERROR(corruption_detected);

    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
#if defined(HUF_FORCE_DECOMPRESS_X1)
        (void)algoNb;
        assert(algoNb == 0);
        return HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize);
#elif defined(HUF_FORCE_DECOMPRESS_X2)
        (void)algoNb;
        assert(algoNb == 1);
        return HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize);
#else
        return algoNb ? HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc,
                            cSrcSize, workSpace, wkspSize):
                        HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize);
#endif
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0xee4b
movq %r8, %r14
testq %r8, %r8
je 0xee54
movq %r9, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movq %rdx, %rdi
movq %r14, %rsi
callq 0xec45
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
testl %eax, %eax
je 0xee61
pushq $0x0
pushq 0x48(%rsp)
callq 0xeb0f
jmp 0xee6c
movq $-0x2, %rax
jmp 0xee5b
movq $-0x4, %rax
addq $0x8, %rsp
jmp 0xee70
pushq $0x0
pushq 0x48(%rsp)
callq 0xcc11
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Cyan4973[P]FiniteStateEntropy/programs/../lib/huf_decompress.c
// Function: HUF_decompress1X_DCtx_wksp
size_t HUF_decompress1X_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,
                                  const void* cSrc, size_t cSrcSize,
                                  void* workSpace, size_t wkspSize)
{
    /* validation checks */
    if (dstSize == 0) return ERROR(dstSize_tooSmall);
    if (cSrcSize > dstSize) return ERROR(corruption_detected);   /* invalid */
    if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; }   /* not compressed */
    if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */

    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
#if defined(HUF_FORCE_DECOMPRESS_X1)
        (void)algoNb;
        assert(algoNb == 0);
        return HUF_decompress1X1_DCtx_wksp(dctx, dst, dstSize, cSrc,
                                cSrcSize, workSpace, wkspSize);
#elif defined(HUF_FORCE_DECOMPRESS_X2)
        (void)algoNb;
        assert(algoNb == 1);
        return HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc,
                                cSrcSize, workSpace, wkspSize);
#else
        return algoNb ? HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc,
                                cSrcSize, workSpace, wkspSize):
                        HUF_decompress1X1_DCtx_wksp(dctx, dst, dstSize, cSrc,
                                cSrcSize, workSpace, wkspSize);
#endif
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdx, %rdx
je 0xeeb8
movq %r8, %r12
movq %rdx, %rbx
movq $-0x4, %rax
cmpq %rdx, %r8
ja 0xeed9
movq %rcx, %r15
movq %rsi, %r13
jne 0xeec1
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1130
jmp 0xeed6
movq $-0x2, %rax
jmp 0xeed9
cmpq $0x1, %r12
jne 0xeee8
movzbl (%r15), %esi
movq %r13, %rdi
movq %rbx, %rdx
callq 0x10c0
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r9, %r14
movq %rdi, %rbp
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xec45
testl %eax, %eax
je 0xef2c
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
movq %r12, %r8
movq %r14, %r9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd4d0
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
movq %r12, %r8
movq %r14, %r9
callq 0xbb10
jmp 0xeed9
// File: /workspace/github_c_makefile_star2_O1/Cyan4973[P]FiniteStateEntropy/programs/../lib/huf_decompress.c
// Function: HUF_decompress1X1_DCtx_wksp_bmi2
size_t HUF_decompress1X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2)
{
    const BYTE* ip = (const BYTE*) cSrc;

    size_t const hSize = HUF_readDTableX1_wksp(dctx, cSrc, cSrcSize, workSpace, wkspSize);
    if (HUF_isError(hSize)) return hSize;
    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
    ip += hSize; cSrcSize -= hSize;

    return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, bmi2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
movl 0x48(%rsp), %ebp
movq 0x40(%rsp), %r8
movq %rcx, %rsi
movq %rbx, %rdx
movq %r9, %rcx
callq 0xb72c
movq %rax, %rcx
cmpq $-0x9, %rax
ja 0xefed
movq $-0x3, %rcx
subq %rax, %rbx
jbe 0xefed
addq %rax, %r14
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r15, %r8
movl %ebp, %r9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb8c6
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Cyan4973[P]FiniteStateEntropy/programs/../lib/huf_decompress.c
// Function: HUF_decompress4X_hufOnly_wksp_bmi2
size_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2)
{
    /* validation checks */
    if (dstSize == 0) return ERROR(dstSize_tooSmall);
    if (cSrcSize == 0) return ERROR(corruption_detected);

    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
#if defined(HUF_FORCE_DECOMPRESS_X1)
        (void)algoNb;
        assert(algoNb == 0);
        return HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2);
#elif defined(HUF_FORCE_DECOMPRESS_X2)
        (void)algoNb;
        assert(algoNb == 1);
        return HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2);
#else
        return algoNb ? HUF_decompress4X2_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2) :
                        HUF_decompress4X1_DCtx_wksp_bmi2(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, bmi2);
#endif
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdx, %rdx
je 0xf080
movq %r8, %r14
testq %r8, %r8
je 0xf089
movq %r9, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movl 0x58(%rsp), %eax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rdx, %rdi
movq %r14, %rsi
callq 0xec45
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
testl %eax, %eax
je 0xf09f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xeb0f
movq $-0x2, %rax
jmp 0xf090
movq $-0x4, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq 0x8(%rsp)
pushq 0x18(%rsp)
callq 0xcc11
addq $0x28, %rsp
jmp 0xf094
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_time_funcs.c
// Function: test_normalised
int test_normalised(time_t start, time_t end, time_t incr) {
    time_t i, j;
    struct tm *utc;

    for (i = start; i < end; i += incr) {
        utc = gmtime(&i);
        j = hts_time_gm(utc);
        if (i != j) {
            fprintf(stderr,
                    "hts_time_gm() failed, got %"PRId64" expected %"PRId64"\n",
                    (int64_t) j, (int64_t) i);
            return 1;
        }
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, (%rsp)
xorl %ebx, %ebx
cmpq %rsi, %rdi
jge 0x119d
movq %rdx, %r14
movq %rsi, %r15
movq %rsp, %r12
movq %r12, %rdi
callq 0x1050
movq %rax, %rdi
callq 0x11cd
movq (%rsp), %rcx
cmpq %rax, %rcx
jne 0x11ab
addq %r14, %rcx
movq %rcx, (%rsp)
cmpq %r15, %rcx
jl 0x1178
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x2e46(%rip), %rdx      # 0x3ff8
movq (%rdx), %rdi
leaq 0xe48(%rip), %rsi       # 0x2004
movq %rax, %rdx
xorl %eax, %eax
callq 0x1040
movl $0x1, %ebx
jmp 0x119d
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_time_funcs.c
// Function: test_specific
int test_specific(int year, int mon, int mday, int hour, int min, int sec,
                  time_t expected) {
    struct tm utc = { sec, min, hour, mday, mon - 1, year - 1900, 0, 0, 0 };
    time_t res = hts_time_gm(&utc);
    if (res != expected) {
        fprintf(stderr,
                "hts_time_gm() failed for %4d/%02d/%02d %02d:%02d:%02d :"
                " got %"PRId64" expected %"PRId64"\n",
                year, mon, mday, hour, min, sec,
                (int64_t) res, (int64_t) expected);
        return 1;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, %r14d
movl %r8d, %ebx
movl %ecx, %ebp
movl %edx, %r15d
movl %esi, %r12d
movl %edi, %r13d
movq %rsp, %rdi
movl %r9d, (%rdi)
movl %r8d, 0x4(%rdi)
movl %ecx, 0x8(%rdi)
movl %edx, 0xc(%rdi)
leal -0x1(%r12), %eax
movl %eax, 0x10(%rdi)
leal -0x76c(%r13), %eax
movl %eax, 0x14(%rdi)
movq $0x0, 0x18(%rdi)
movl $0x0, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
callq 0x11cd
movq 0x70(%rsp), %r11
movq %rax, %r10
xorl %eax, %eax
cmpq %r11, %r10
jne 0x1687
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x296a(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x998(%rip), %rsi       # 0x2030
movl %r13d, %edx
movl %r12d, %ecx
movl %r15d, %r8d
movl %ebp, %r9d
xorl %eax, %eax
pushq %r11
pushq %r10
pushq %r14
pushq %rbx
callq 0x1040
addq $0x20, %rsp
movl $0x1, %eax
jmp 0x1678
// File: /workspace/github_c_makefile_star2_O1/antonblanchard[P]will-it-scale/tests/brk1.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	void *addr = sbrk(0);
	unsigned long page_size = getpagesize();

	while (1) {
		addr += page_size;
		assert(brk(addr) == 0);

		addr -= page_size;
		assert(brk(addr) == 0);

		(*iterations) += 2;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %edi, %edi
callq 0x2170
movq %rax, %r14
callq 0x2280
movslq %eax, %r15
addq %r14, %r15
movq %r15, %rdi
callq 0x2150
testl %eax, %eax
jne 0x2c27
movq %r14, %rdi
callq 0x2150
testl %eax, %eax
jne 0x2c46
addq $0x2, (%rbx)
jmp 0x2c09
leaq 0x65c(%rip), %rdi       # 0x328a
leaq 0x664(%rip), %rsi       # 0x3299
leaq 0x66a(%rip), %rcx       # 0x32a6
movl $0xe, %edx
callq 0x2120
leaq 0x63d(%rip), %rdi       # 0x328a
leaq 0x645(%rip), %rsi       # 0x3299
leaq 0x64b(%rip), %rcx       # 0x32a6
movl $0x11, %edx
callq 0x2120
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_07/readlines.c
// Function: main
int main()
{
  int nr_of_lines;             // # of input lines read
  char stored_lines[MAXSTORE]; // # of chars to be stored for all lines

  if ((nr_of_lines = readlines(line_ptr, MAXLINES, stored_lines)) >= 0)
  {
    quick_sort(line_ptr, 0, nr_of_lines - 1);
    printf("-----\n");
    writelines(line_ptr, nr_of_lines);
    return 0;
  }
  else
  {
    printf("Error: input too big to sort.\n");
    return 1;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x2710, %rsp           # imm = 0x2710
leaq 0x2ed1(%rip), %rdi      # 0x4060
movq %rsp, %rdx
movl $0x1388, %esi           # imm = 0x1388
callq 0x1206
testl %eax, %eax
js 0x11e6
movl %eax, %r14d
leal -0x1(%r14), %edx
leaq 0x2eb2(%rip), %r15      # 0x4060
xorl %ebx, %ebx
movq %r15, %rdi
xorl %esi, %esi
callq 0x12c1
leaq 0xe61(%rip), %rdi       # 0x2022
callq 0x1040
cmpl $0x1, %r14d
jb 0x11f7
incl %r14d
movq (%r15), %rdi
addq $0x8, %r15
callq 0x1040
decl %r14d
cmpl $0x1, %r14d
jg 0x11cf
jmp 0x11f7
leaq 0xe17(%rip), %rdi       # 0x2004
callq 0x1040
movl $0x1, %ebx
movl %ebx, %eax
addq $0x2710, %rsp           # imm = 0x2710
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_07/readlines.c
// Function: readlines
int readlines(char *line_ptr[], int max_nr_of_lines, char *stored_lines)
{
  int len;
  int nr_of_lines;

  char *p = stored_lines + strlen(stored_lines); // Init p with the first empty position from stored_lines
  char line[MAXLEN];

  nr_of_lines = 0;
  while ((len = get_line(line, MAXLEN)) > 0)
  {
    // Checking if the current # of lines exceeds the max # of lines that can be stored
    // Also checking if the max # of chars from the stored_lines buffer is not exceeded
    if (nr_of_lines >= max_nr_of_lines || stored_lines + MAXSTORE - p < len)
    {
      return -1;
    }
    else
    {
      line[len - 1] = '\0'; // Delete newline
      strcpy(p, line);
      line_ptr[nr_of_lines++] = p;
      p += len; // Move p to the next empty position
    }
  }

  return nr_of_lines;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
movq %rdx, %r12
movl %esi, %ebx
movq %rdi, 0x8(%rsp)
movq %rdx, %rdi
callq 0x1050
movq %rax, %r15
leaq 0x10(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x13a9
testl %eax, %eax
jle 0x12ab
leaq 0x2710(%r12), %r13
addq %r12, %r15
xorl %ebp, %ebp
testl %ebx, %ebx
cmovlel %ebp, %ebx
leaq 0x10(%rsp), %r12
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rbp, %rbx
je 0x12ad
movq %r13, %rdx
subq %r15, %rdx
movl %eax, %r14d
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
cmpq %r14, %rdx
jl 0x12ad
decl %eax
movb $0x0, 0x10(%rsp,%rax)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1030
movq 0x8(%rsp), %rax
movq %r15, (%rax,%rbp,8)
incq %rbp
addq %r14, %r15
movl $0x3e8, %esi            # imm = 0x3E8
movq %r12, %rdi
callq 0x13a9
testl %eax, %eax
jg 0x1256
movl %ebp, %ecx
jmp 0x12ad
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_07/readlines.c
// Function: quick_sort
void quick_sort(char *v[], int left, int right)
{
  int i;
  int last;

  // Do nothing if the array contains less than 2 elements
  if (left >= right)
  {
    return;
  }

  swap(v, left, (left + right) / 2);
  last = left;

  for (i = left + 1; i <= right; ++i)
  {
    if (strcmp(v[i], v[left]) < 0)
    {
      swap(v, ++last, i);
    }
  }

  swap(v, left, last);
  quick_sort(v, left, last - 1);
  quick_sort(v, last + 1, right);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movslq %edx, %r13
movq %rdx, 0x8(%rsp)
cmpl %edx, %esi
jge 0x1370
leal (%rdx,%rsi), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movslq %esi, %r15
movq (%r14,%r15,8), %rax
movslq %ecx, %rcx
movq (%r14,%rcx,8), %rdx
movq %rdx, (%r14,%r15,8)
movq %rax, (%r14,%rcx,8)
movq %r15, %rbp
movq %rsi, 0x10(%rsp)
movl %esi, %ebx
movq 0x8(%r14,%rbp,8), %r12
movq (%r14,%r15,8), %rsi
movq %r12, %rdi
callq 0x1060
testl %eax, %eax
jns 0x1337
movslq %ebx, %rax
incl %ebx
movq 0x8(%r14,%rax,8), %rcx
movq %r12, 0x8(%r14,%rax,8)
movq %rcx, 0x8(%r14,%rbp,8)
incq %rbp
cmpq %rbp, %r13
jne 0x130e
movq (%r14,%r15,8), %rax
movslq %ebx, %rbx
movq (%r14,%rbx,8), %rcx
movq %rcx, (%r14,%r15,8)
movq %rax, (%r14,%rbx,8)
leal -0x1(%rbx), %edx
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x12c1
incl %ebx
movl %ebx, %esi
movq 0x8(%rsp), %rdx
jmp 0x12da
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_07/readlines.c
// Function: get_line
size_t get_line(char line[], size_t max_line_len)
{
  int c;
  size_t i;

  for (i = 0; i < max_line_len - 1 && (c = getc(stdin)) != EOF && c != '\n'; ++i)
  {
    line[i] = c;
  }

  if (c == '\n')
  {
    line[i] = c;
    ++i;
  }

  line[i] = '\0';

  return i;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
xorl %r14d, %r14d
decq %r15
je 0x13ed
movq 0x2c1a(%rip), %r12      # 0x3fe0
movq (%r12), %rdi
callq 0x1070
cmpl $-0x1, %eax
je 0x13e5
cmpl $0xa, %eax
je 0x13e5
movb %al, (%rbx,%r14)
incq %r14
cmpq %r14, %r15
jne 0x13c6
cmpl $0xa, %eax
sete %al
jmp 0x13ed
testb $0x1, %al
je 0x13f9
movb $0xa, (%rbx,%r14)
incq %r14
movb $0x0, (%rbx,%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/extracters/sdsdump/sdsdump.c
// Function: getfc
int getfc (FILE *ifile)
{
int k;
unsigned char by;

k = fread (&by, sizeof (char), 1, ifile);
if (k == 0) {
	printf ("End of physical tape\n");
	return -1;  }
return by;
}

// Assembly:
pushq %rax
movq %rdi, %rcx
leaq 0x7(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x1050
testl %eax, %eax
je 0x11bf
movzbl 0x7(%rsp), %eax
jmp 0x11d0
leaq 0xf61(%rip), %rdi       # 0x2127
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/checker/readfile.hpp
// Function: readchar2buf(char const*, char*&, long*)
int readchar2buf(const char* _path_, char*& buf, long* length)
{
	ifstream inFile;
	inFile.open(_path_);
	if (!inFile.is_open()) return 0;

	inFile.seekg(0, ios::end);
	long size = inFile.tellg();
	inFile.clear();
	inFile.seekg(0, ios::beg);

	buf = new char[size+1];
	inFile.read(buf, size);
	buf[size] = '\0';
	*length = strlen(buf);

	inFile.close();
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x228(%rbp), %r12
movq %r12, %rdi
callq 0x2180
movq %r12, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x20d0
leaq -0x1b0(%rbp), %rdi
callq 0x2080
xorl %r15d, %r15d
testb %al, %al
je 0x2432
leaq -0x228(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x21b0
movq %r12, %rdi
callq 0x21f0
movq %rax, %r15
movq -0x228(%rbp), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x21e0
leaq -0x228(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21b0
leaq 0x1(%r15), %rax
cmpq $-0x1, %r15
movq $-0x1, %rdi
cmovgeq %rax, %rdi
callq 0x2030
movq %rax, (%r14)
leaq -0x228(%rbp), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x21a0
movq (%r14), %rax
movb $0x0, (%rax,%r15)
movq (%r14), %rdi
callq 0x20c0
movq %rax, (%rbx)
movl $0x1, %r15d
leaq -0x228(%rbp), %rdi
callq 0x2070
leaq -0x228(%rbp), %rdi
callq 0x2090
movl %r15d, %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2455
jmp 0x2455
movq %rax, %rbx
leaq -0x228(%rbp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x2200
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/checker/readfile.hpp
// Function: readbyte2buf(char const*, unsigned char*&, long*)
int readbyte2buf(const char* _path_, unsigned char*& buf, long* length)
{
	ifstream inFile;
	inFile.open(_path_);
	if (!inFile.is_open()) return 0;

	inFile.seekg(0, ios::end);
	long size = inFile.tellg();
	inFile.clear();
	inFile.seekg(0, ios::beg);

	buf = new unsigned char[size+1];
	inFile.read((char*)buf, size);
	buf[size] = '\0';
	*length = size;

	inFile.close();
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x228(%rbp), %r12
movq %r12, %rdi
callq 0x2180
movq %r12, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x20d0
leaq -0x1b0(%rbp), %rdi
callq 0x2080
xorl %r15d, %r15d
testb %al, %al
je 0x254a
leaq -0x228(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x21b0
movq %r12, %rdi
callq 0x21f0
movq %rax, %r15
movq -0x228(%rbp), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x21e0
leaq -0x228(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21b0
leaq 0x1(%r15), %rax
cmpq $-0x1, %r15
movq $-0x1, %rdi
cmovgeq %rax, %rdi
callq 0x2030
movq %rax, (%r14)
leaq -0x228(%rbp), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x21a0
movq (%r14), %rax
movb $0x0, (%rax,%r15)
movq %r15, (%rbx)
movl $0x1, %r15d
leaq -0x228(%rbp), %rdi
callq 0x2070
leaq -0x228(%rbp), %rdi
callq 0x2090
movl %r15d, %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x256d
jmp 0x256d
movq %rax, %rbx
leaq -0x228(%rbp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x2200
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/checker/readfile.hpp
// Function: readint2buf(char const*, int*&, long*)
int readint2buf(const char* _path_, int*& buf, long* length)
{
	long tmp;
	long cnt = 0;
	ifstream inFile;

	inFile.open(_path_);
	if (!inFile.is_open()) return 0;

	*length = 0;
	while (inFile >> tmp) (*length)++;
	cout << *length << endl;
	inFile.clear();
	inFile.seekg(0, ios::beg);

	buf = new int[*length];
	while (inFile >> tmp) buf[cnt++] = tmp;

	inFile.close();
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq -0x230(%rbp), %r12
movq %r12, %rdi
callq 0x2180
movq %r12, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x20d0
leaq -0x1b8(%rbp), %rdi
callq 0x2080
xorl %r15d, %r15d
testb %al, %al
je 0x26cb
xorl %esi, %esi
leaq -0x230(%rbp), %r15
leaq -0x28(%rbp), %r12
movq %rsi, (%r14)
movq %r15, %rdi
movq %r12, %rsi
callq 0x2160
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
movq (%r14), %rsi
jne 0x2606
incq %rsi
jmp 0x25e2
movq 0x29cb(%rip), %rdi      # 0x4fd8
callq 0x2130
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20f0
movq -0x230(%rbp), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x21e0
leaq -0x230(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21b0
movq (%r14), %rax
movq %rax, %rcx
shrq $0x3e, %rcx
shlq $0x2, %rax
xorl %edi, %edi
negq %rcx
sbbq %rdi, %rdi
orq %rax, %rdi
callq 0x2030
movq %rax, (%rbx)
xorl %r12d, %r12d
leaq -0x230(%rbp), %r14
leaq -0x28(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2160
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x26b9
movl -0x28(%rbp), %eax
movq (%rbx), %rcx
movl %eax, (%rcx,%r12)
addq $0x4, %r12
jmp 0x2690
movl $0x1, %r15d
leaq -0x230(%rbp), %rdi
callq 0x2070
leaq -0x230(%rbp), %rdi
callq 0x2090
movl %r15d, %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x26ee
jmp 0x26ee
movq %rax, %rbx
leaq -0x230(%rbp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x2200
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/checker/main.cpp
// Function: symbol_counter(unsigned char*, int)
int symbol_counter(uchar* buf, int length)
{
	set<uchar> s;
	int cnt = 0;
	while (cnt < length) s.insert(buf[cnt++]);
/*
	cout << endl;
	for (auto &iter: s) cout << (int)iter << " ";
	cout << endl;
*/
	return s.size();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
leaq -0x40(%rbp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
testl %esi, %esi
jle 0x2a51
movq %rdi, %rbx
movl %esi, %r15d
leaq -0x48(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2b40
incq %rbx
decq %r15
jne 0x2a3e
leaq -0x48(%rbp), %rdi
movl 0x28(%rdi), %ebx
callq 0x2ae8
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x2ae8
movq %rbx, %rdi
callq 0x2200
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/checker/main.cpp
// Function: ceil_log2(int)
int ceil_log2(int n)
{
	assert (n >= 1);
	int last = -1, secondlast = -1, count = 0;
	int log2_n, tmp = n;

	while (tmp) {
	if (tmp & 1) {
		secondlast = last;
		last = count;
	}
	tmp >>= 1;
	++count;
	}
	if (secondlast == -1)
		log2_n = last;
	else
		log2_n = last+1;

	return log2_n;
}

// Assembly:
testl %edi, %edi
jle 0x2ab7
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %edx, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %edi, %esi
movl %eax, %r8d
testb $0x1, %dil
movl %edx, %eax
cmovel %r8d, %eax
cmovnel %r8d, %ecx
shrl %esi
incl %edx
cmpl $0x1, %edi
movl %esi, %edi
ja 0x2a90
xorl %edx, %edx
cmpl $-0x1, %ecx
setne %dl
addl %edx, %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x638(%rip), %rdi       # 0x30fa
leaq 0x638(%rip), %rsi       # 0x3101
leaq 0x646(%rip), %rcx       # 0x3116
movl $0x6c, %edx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O1/millimat[P]Soft-Heap/approx-sort.c
// Function: metric_mispositions
double metric_mispositions(int *output, int n) {
  int mispos = 0;
  for(int i = 0; i < n; i++) {
    if(output[i] != i)
      mispos++;
  }

  return mispos/(double)n;
}

// Assembly:
testl %esi, %esi
jle 0x11f5
movl %esi, %eax
xorl %ecx, %ecx
xorl %edx, %edx
movl (%rdi,%rcx,4), %r8d
xorl %r9d, %r9d
cmpq %r8, %rcx
setne %r9b
addl %r9d, %edx
incq %rcx
cmpq %rcx, %rax
jne 0x11d6
cvtsi2sd %edx, %xmm0
jmp 0x11f9
xorpd %xmm0, %xmm0
cvtsi2sd %esi, %xmm1
divsd %xmm1, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/millimat[P]Soft-Heap/approx-sort.c
// Function: metric_distance
long metric_distance(int *output, int n) {
  long dist = 0;
  for(int i = 0; i < n; i++) {
    dist += (output[i] > i ? output[i] - i : i - output[i]);
  }

  return dist;
}

// Assembly:
testl %esi, %esi
jle 0x122d
movl %esi, %ecx
negq %rcx
xorl %edx, %edx
xorl %eax, %eax
movl (%rdi), %esi
addl %edx, %esi
movl %esi, %r8d
negl %r8d
cmovsl %esi, %r8d
addq %r8, %rax
decq %rdx
addq $0x4, %rdi
cmpq %rdx, %rcx
jne 0x120f
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/millimat[P]Soft-Heap/approx-sort.c
// Function: metric_kendall
double metric_kendall(int *output, int n) {
  long count = 0;
  for(int i = 0; i < n; i++) {
    for(int j = i+1; j < n; j++) {
      if(output[i] > output[j])
        count++;
    }
  }

  return 2*count / (n*(n-1.0));
}

// Assembly:
pushq %rbx
testl %esi, %esi
jle 0x1281
movl %esi, %eax
xorl %r9d, %r9d
movq %rax, %rdx
movq %rdi, %r8
xorl %ecx, %ecx
movq %r9, %r10
incq %r9
cmpq %rax, %r9
jae 0x126b
movl (%rdi,%r10,4), %r10d
movl $0x1, %r11d
xorl %ebx, %ebx
cmpl (%r8,%r11,4), %r10d
setg %bl
addq %rbx, %rcx
incq %r11
cmpq %r11, %rdx
jne 0x1257
addq $0x4, %r8
decq %rdx
cmpq %rax, %r9
jne 0x1242
addq %rcx, %rcx
cvtsi2sd %rcx, %xmm0
jmp 0x1285
xorpd %xmm0, %xmm0
cvtsi2sd %esi, %xmm1
movsd 0xd77(%rip), %xmm2      # 0x2008
addsd %xmm1, %xmm2
mulsd %xmm1, %xmm2
divsd %xmm2, %xmm0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/millimat[P]Soft-Heap/approx-sort.c
// Function: metric_mispositions_threshold
double metric_mispositions_threshold(int *output, int n, int threshold) {
  int mispos = 0;
  for(int i = 0; i < n; i++) {
    if(output[i] > i + threshold || output[i] < i - threshold)
      mispos++;
  }

  return mispos/(double)n;
}

// Assembly:
testl %esi, %esi
jle 0x12e9
pushq %rbx
movslq %edx, %rax
movl %esi, %ecx
movq %rax, %rdx
negq %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
leaq (%rax,%r8), %r10
movslq (%rdi,%r8,4), %r11
cmpq %r11, %r10
setl %r10b
leaq (%rdx,%r8), %rbx
cmpq %r11, %rbx
setg %r11b
orb %r10b, %r11b
movzbl %r11b, %r10d
addl %r10d, %r9d
incq %r8
cmpq %r8, %rcx
jne 0x12b5
cvtsi2sd %r9d, %xmm0
popq %rbx
jmp 0x12ed
xorpd %xmm0, %xmm0
cvtsi2sd %esi, %xmm1
divsd %xmm1, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/millimat[P]Soft-Heap/approx-sort.c
// Function: all_metrics_per_epsilon
void all_metrics_per_epsilon(int *elts, int n) {
  int output[n];

  for(int k = 1; k < n; k *= 2) {
    double epsilon = ((double)k)/n;
    int r = ceil(-log(epsilon)/log(2)) + 5;

    softheap *P = makeheap_empty(epsilon);

    for(int i = 0; i < n; i++)
      insert(P, elts[i]);

    for(int i = 0; i < n; i++)
      output[i] = extract_min(P);

    destroy_heap(P);

    printf("r=%d \t\t %f \t\t %ld \t\t %f \n", r, metric_mispositions(output,n),metric_distance(output,n),metric_mispositions_threshold(output,n,n/100));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %r13d
movq %rsp, %r14
leaq 0xf(,%r13,4), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
cmpl $0x2, %esi
jl 0x1484
movq %rdi, %rbx
cvtsi2sd %esi, %xmm1
imulq $0x51eb851f, %r13, %r15 # imm = 0x51EB851F
shrq $0x25, %r15
movq %r15, %r12
negq %r12
movl $0x1, %eax
movq %rdi, -0x50(%rbp)
movsd %xmm1, -0x38(%rbp)
movq %r15, -0x48(%rbp)
movq %r12, -0x40(%rbp)
movl %eax, -0x30(%rbp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
callq 0x1060
divsd 0xc9a(%rip), %xmm0      # 0x2010
callq 0x10b0
addsd 0xc95(%rip), %xmm0      # 0x2018
cvttsd2si %xmm0, %eax
movl %eax, -0x2c(%rbp)
movsd -0x58(%rbp), %xmm0
callq 0x157f
movq %rax, %r12
movq %rbx, %r15
xorl %ebx, %ebx
movl (%r15,%rbx,4), %esi
movq %r12, %rdi
callq 0x170d
incq %rbx
cmpq %rbx, %r13
jne 0x139c
xorl %ebx, %ebx
movq %r12, %rdi
callq 0x19a9
movl %eax, (%r14,%rbx,4)
incq %rbx
cmpq %rbx, %r13
jne 0x13b2
movq %r12, %rdi
callq 0x167e
xorl %eax, %eax
xorl %ecx, %ecx
movq -0x48(%rbp), %r15
movl (%r14,%rax,4), %edx
xorl %esi, %esi
cmpq %rdx, %rax
setne %sil
addl %esi, %ecx
incq %rax
cmpq %rax, %r13
jne 0x13d6
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd -0x38(%rbp), %xmm2
divsd %xmm2, %xmm0
movq %r14, %rax
xorl %ecx, %ecx
xorl %edx, %edx
movq -0x50(%rbp), %rbx
movq -0x40(%rbp), %r12
movl (%rax), %esi
addl %ecx, %esi
movl %esi, %edi
negl %edi
cmovsl %esi, %edi
addq %rdi, %rdx
decq %rcx
addq $0x4, %rax
movq %r13, %rsi
addq %rcx, %rsi
jne 0x140c
xorl %eax, %eax
xorl %ecx, %ecx
leaq (%r15,%rax), %rsi
movslq (%r14,%rax,4), %rdi
cmpq %rdi, %rsi
setl %sil
leaq (%r12,%rax), %r8
cmpq %rdi, %r8
setg %dil
orb %sil, %dil
movzbl %dil, %esi
addl %esi, %ecx
incq %rax
cmpq %rax, %r13
jne 0x142d
cvtsi2sd %ecx, %xmm1
divsd %xmm2, %xmm1
leaq 0xbc1(%rip), %rdi       # 0x2028
movl -0x2c(%rbp), %esi
movb $0x2, %al
callq 0x1040
movsd -0x38(%rbp), %xmm1
movl -0x30(%rbp), %eax
addl %eax, %eax
cmpl %r13d, %eax
jl 0x1356
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/millimat[P]Soft-Heap/approx-sort.c
// Function: random_permutation
void random_permutation(int *elts, int n) {
  for(int i = 0; i < n; i++) {
    int j = randint(i+1);
    elts[i] = elts[j];
    elts[j] = i;
  }
}

// Assembly:
testl %esi, %esi
jle 0x1512
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %r14d
xorl %r15d, %r15d
leaq 0x1(%r15), %r12
callq 0x10c0
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0xb3e(%rip), %xmm0      # 0x2020
xorps %xmm1, %xmm1
cvtsi2sd %r12d, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
cltq
movl (%rbx,%rax,4), %ecx
movl %ecx, (%rbx,%r15,4)
movl %r15d, (%rbx,%rax,4)
movq %r12, %r15
cmpq %r12, %r14
jne 0x14ca
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/millimat[P]Soft-Heap/approx-sort.c
// Function: main
int main(int argc, char *argv[]) {
  int n = 1000000;

  int elts[n];

  srand(time(NULL));
  random_permutation(elts, n);

  all_metrics_per_epsilon(elts, n);

  return 0;
}

// Assembly:
pushq %rbx
subq $0x3d0900, %rsp         # imm = 0x3D0900
xorl %edi, %edi
callq 0x1080
movl %eax, %edi
callq 0x1070
movq %rsp, %rbx
movq %rbx, %rdi
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x14b5
movq %rbx, %rdi
movl $0xf4240, %esi          # imm = 0xF4240
callq 0x12f6
xorl %eax, %eax
addq $0x3d0900, %rsp         # imm = 0x3D0900
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/vusec[P]fpvi-scsb/fp_reverse_engineering/test_operands/test_operands.c
// Function: print_double
void print_double(char *name, double n)
{
    int64_t  bias = 1023;
    uint64_t hex_n = *((uint64_t *)&n);
    uint64_t unbiased_exp = (hex_n>>52)&0x7FF;
    int64_t  biased_exp   = unbiased_exp == 0 ? -1022 : (int64_t)unbiased_exp - bias;
    uint64_t mantissa = hex_n&0x000FFFFFFFFFFFFFUL;
    
    printf("%9s = 0x%016lx    %16e    ", name, hex_n, n);
    printf("(%8s    biased_exp=%5ld    unbiased_exp=%5ld    mantissa=0x%013lx)\n",
            unbiased_exp == 0 ? "DENORMAL" : "  NORMAL",
            unbiased_exp, biased_exp, mantissa);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rsi
movq %xmm0, %rdx
movq %rdx, %rbx
shrq $0x34, %rbx
andl $0x7ff, %ebx            # imm = 0x7FF
leaq -0x3ff(%rbx), %r15
movabsq $0xfffffffffffff, %r14  # imm = 0xFFFFFFFFFFFFF
andq %rdx, %r14
leaq 0xdb3(%rip), %rdi       # 0x2017
movb $0x1, %al
callq 0x1040
testq %rbx, %rbx
movq $-0x3fe, %rcx           # imm = 0xFC02
cmovneq %r15, %rcx
leaq 0xdf6(%rip), %rax       # 0x2076
leaq 0xdf8(%rip), %rsi       # 0x207f
cmoveq %rax, %rsi
leaq 0xda0(%rip), %rdi       # 0x2032
movq %rbx, %rdx
movq %r14, %r8
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: main.cold.1
static void version(void)
{
	fprintf(stderr, "%s %s\n", __NAME__, __THIS_VERSION__);
	fprintf(stderr, "Copyright (c) 2016-2019 Tudor Ioan Roman\n");
	fprintf(stderr, "Released under the ISC License\n");

	exit(EXIT_SUCCESS);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x88b5(%rip), %r14      # 0xbff0
movq (%r14), %rdi
leaq 0x5a74(%rip), %rsi      # 0x91b9
leaq 0x5a2f(%rip), %rdx      # 0x917b
leaq 0x5a65(%rip), %rcx      # 0x91b8
xorl %eax, %eax
callq 0x3690
movq (%r14), %rcx
leaq 0x5a5c(%rip), %rdi      # 0x91c0
pushq $0x29
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x3660
movq (%r14), %rcx
leaq 0x5a6e(%rip), %rdi      # 0x91ea
pushq $0x1f
popq %rsi
movq %rbx, %rdx
callq 0x3660
xorl %edi, %edi
callq 0x3150
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: cleanup
static void
cleanup(void)
{
	xcb_set_input_focus(conn, XCB_NONE, XCB_INPUT_FOCUS_POINTER_ROOT,
			XCB_CURRENT_TIME);
	ungrab_buttons();
	if (ewmh != NULL)
		xcb_ewmh_connection_wipe(ewmh);
	if (win_list != NULL)
		list_delete_all_items(&win_list, true);
	if (focus_list != NULL)
	    list_delete_all_items(&focus_list, true);
	if (conn != NULL)
		xcb_disconnect(conn);
}

// Assembly:
pushq %rbx
movq 0x8292(%rip), %rdi      # 0xc3b8
xorl %esi, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x3160
callq 0x41a1
movq 0x8280(%rip), %rbx      # 0xc3c0
testq %rbx, %rbx
je 0x4157
movq 0x8(%rbx), %rdi
callq 0x32d0
movq 0x18(%rbx), %rdi
callq 0x32d0
cmpq $0x0, 0x8269(%rip)      # 0xc3c8
je 0x4172
leaq 0x8260(%rip), %rdi      # 0xc3c8
movl $0x1, %esi
callq 0x8660
cmpq $0x0, 0x8256(%rip)      # 0xc3d0
je 0x418d
leaq 0x824d(%rip), %rdi      # 0xc3d0
movl $0x1, %esi
callq 0x8660
movq 0x8224(%rip), %rdi      # 0xc3b8
testq %rdi, %rdi
je 0x419f
popq %rbx
jmp 0x3630
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: ungrab_buttons
static void
ungrab_buttons(void)
{
	struct list_item *item;
	struct client *client;

	for (item = win_list; item != NULL; item = item->next) {
		client = item->data;
		xcb_ungrab_button(conn, XCB_BUTTON_INDEX_ANY, client->window, XCB_MOD_MASK_ANY);
	}
}

// Assembly:
pushq %rbx
movq 0x821f(%rip), %rbx      # 0xc3c8
testq %rbx, %rbx
je 0x41cc
movq (%rbx), %rax
movq 0x8200(%rip), %rdi      # 0xc3b8
movl (%rax), %edx
xorl %esi, %esi
movl $0x8000, %ecx           # imm = 0x8000
callq 0x3500
movq 0x10(%rbx), %rbx
jmp 0x41a9
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: event_destroy_notify
static void
event_destroy_notify(xcb_generic_event_t *ev)
{
	struct client *client;
	xcb_destroy_notify_event_t *e = (xcb_destroy_notify_event_t *)ev;

	client = find_client(&e->window);
	if (conf.last_window_focusing && focused_win != NULL && focused_win == client) {
	    focused_win = NULL;
		set_focused_last_best();
	}

	if (client != NULL) {
		free_window(client);
	}


	update_client_list();
	update_group_list();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x8021(%rip), %rax      # 0xc3c8
testq %rax, %rax
je 0x43bf
movl 0x8(%rdi), %ecx
movq (%rax), %rbx
cmpl %ecx, (%rbx)
je 0x43c1
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x43af
xorl %ebx, %ebx
cmpb $0x1, 0x83fc(%rip)      # 0xc7c4
jne 0x43eb
movq 0x840f(%rip), %rax      # 0xc7e0
testq %rax, %rax
je 0x43eb
cmpq %rbx, %rax
jne 0x43eb
movq $0x0, 0x83fa(%rip) # 0xc7e0
callq 0x5b35
testq %rbx, %rbx
je 0x441e
movq 0x30(%rbx), %r14
movq 0x38(%rbx), %r15
movq %rbx, %rdi
callq 0x32d0
leaq 0x7fc1(%rip), %rdi      # 0xc3c8
movq %r14, %rsi
callq 0x8615
leaq 0x7fba(%rip), %rdi      # 0xc3d0
movq %r15, %rsi
callq 0x8615
callq 0x594d
popq %rbx
popq %r14
popq %r15
jmp 0x5a33
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: event_enter_notify
static void
event_enter_notify(xcb_generic_event_t *ev)
{
	xcb_enter_notify_event_t *e = (xcb_enter_notify_event_t *)ev;
	struct client *client;

	if (conf.sloppy_focus == false)
		return;

	if (focused_win != NULL && e->event == focused_win->window)
		return;

	client = find_client(&e->event);

	if (client != NULL)
		set_focused_no_raise(client);
}

// Assembly:
cmpb $0x0, 0x838c(%rip)      # 0xc7c0
je 0x4473
movq 0x83a3(%rip), %rax      # 0xc7e0
testq %rax, %rax
je 0x4449
movl 0xc(%rdi), %ecx
cmpl (%rax), %ecx
je 0x4473
movq 0x7f78(%rip), %rax      # 0xc3c8
testq %rax, %rax
je 0x4468
movl 0xc(%rdi), %ecx
movq (%rax), %rdi
cmpl %ecx, (%rdi)
je 0x446a
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x4458
xorl %edi, %edi
testq %rdi, %rdi
jne 0x5045
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: event_focus_in
static struct client*
find_client(xcb_window_t *win)
{
	struct list_item *item;

	item = win_list;
	while (item != NULL && ((struct client *)item->data)->window != *win)
		item = item ->next;

	if (item == NULL)
		return NULL;
	else
		return item->data;
}

// Assembly:
movq 0x792a(%rip), %rax      # 0xc3c8
testq %rax, %rax
je 0x4ab6
movl 0x4(%rdi), %edx
movq (%rax), %rcx
cmpl %edx, (%rcx)
je 0x4ab8
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x4aa6
xorl %ecx, %ecx
testq %rcx, %rcx
je 0x4ace
movq 0x78fc(%rip), %rdi      # 0xc3c0
movl 0x58(%rcx), %edx
xorl %esi, %esi
jmp 0x35c0
retq
// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: event_unmap_notify
static void
event_unmap_notify(xcb_generic_event_t *ev)
{
	xcb_map_request_event_t *e = (xcb_map_request_event_t *)ev;
	struct client *client = NULL;

	client = find_client(&e->window);
	if (client == NULL)
		return;

	client->mapped = false;

	if (conf.last_window_focusing && focused_win != NULL && client->window == focused_win->window) {
		focused_win = NULL;
		set_focused_last_best();
	}

	update_client_list();
	update_window_status(client);
}

// Assembly:
pushq %rbx
movq 0x7b12(%rip), %rax      # 0xc3c8
testq %rax, %rax
je 0x48ce
movl 0x8(%rdi), %ecx
movq (%rax), %rbx
cmpl %ecx, (%rbx)
je 0x48d0
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x48be
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x4915
movb $0x0, 0x54(%rbx)
movq 0x7f00(%rip), %rax      # 0xc7e0
testq %rax, %rax
setne %cl
andb 0x7ed8(%rip), %cl       # 0xc7c4
cmpb $0x1, %cl
jne 0x4907
movl (%rbx), %ecx
cmpl (%rax), %ecx
jne 0x4907
movq $0x0, 0x7ede(%rip) # 0xc7e0
callq 0x5b35
callq 0x594d
movq %rbx, %rdi
popq %rbx
jmp 0x51c7
popq %rbx
retq