LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/macroblock.c
// Function: quant_4x4(short (*) [4], int, int)
static void quant_4x4(int16_t dct[4][4], int i_qscale, int b_intra) {LOG_CALL;
    const int i_qbits = 15 + i_qscale / 6;
    const int i_mf = i_qscale % 6;
    const int f = (1 << i_qbits) / (b_intra ? 3 : 6);

    int x, y;
    for (y = 0; y < 4; y++)
    {
        for (x = 0; x < 4; x++)
        {
            if (dct[y][x] > 0)
            {
                dct[y][x] = (f + dct[y][x] * quant_mf[i_mf][y][x]) >> i_qbits;
            } else
            {
                dct[y][x] = -((f - dct[y][x] * quant_mf[i_mf][y][x]) >> i_qbits);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
leaq 0xaaef(%rip), %rdi      # 0x1b1b4
leaq 0x1129c(%rip), %rsi     # 0x21968
leaq 0xb560(%rip), %rdx      # 0x1bc33
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x39ba
pushq $0x6
popq %rcx
movl %r15d, %eax
cltd
idivl %ecx
movl %edx, %esi
movl %eax, %ecx
addl $0xf, %ecx
pushq $0x1
popq %rax
shll %cl, %eax
xorl %edx, %edx
testl %r14d, %r14d
sete %dl
leal (%rdx,%rdx,2), %edi
addl $0x3, %edi
cltd
idivl %edi
movslq %esi, %rsi
shlq $0x6, %rsi
leaq 0xf48f(%rip), %rdx      # 0x1fba0
addq %rsi, %rdx
cmpq $0x4, %r12
je 0x1075e
xorl %esi, %esi
cmpq $0x4, %rsi
je 0x10751
movswl (%rbx,%rsi,2), %r8d
movl (%rdx,%rsi,4), %edi
imull %r8d, %edi
testl %r8d, %r8d
jle 0x10739
addl %eax, %edi
sarl %cl, %edi
jmp 0x10748
movl %eax, %r8d
subl %edi, %r8d
sarl %cl, %r8d
negl %r8d
movl %r8d, %edi
movw %di, (%rbx,%rsi,2)
incq %rsi
jmp 0x1071c
incq %r12
addq $0x8, %rbx
addq $0x10, %rdx
jmp 0x10714
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/macroblock.c
// Function: scan_zigzag_4x4full(int*, short (*) [4])
static inline void scan_zigzag_4x4full(int level[16], int16_t dct[4][4]) {LOG_CALL;
    int i;

    for (i = 0; i < 16; i++)
    {
        level[i] = dct[scan_zigzag_y[i]][scan_zigzag_x[i]];
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xaa36(%rip), %rdi      # 0x1b1b4
leaq 0x111e3(%rip), %rsi     # 0x21968
leaq 0xdc54(%rip), %rdx      # 0x1e3e0
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x39ba
leaq 0xf583(%rip), %rax      # 0x1fd20
leaq 0xf5bc(%rip), %rcx      # 0x1fd60
cmpq $0x40, %r15
je 0x107c4
movslq (%r15,%rax), %rdx
movslq (%r15,%rcx), %rsi
leaq (%rbx,%rdx,8), %rdx
movswl (%rdx,%rsi,2), %edx
movl %edx, (%r14,%r15)
addq $0x4, %r15
jmp 0x107a4
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/macroblock.c
// Function: x264_mb_decimate_score(int*, int)
static int x264_mb_decimate_score(int *dct, int i_max) {LOG_CALL;
    static const int i_ds_table[16] = {3, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

    int i_score = 0;
    int idx = i_max - 1;

    while (idx >= 0 && dct[idx] == 0)
    {
        idx--;
    }

    while (idx >= 0)
    {
        int i_run;

        if (abs(dct[idx--]) > 1)
        {
            return 9;
        }

        i_run = 0;
        while (idx >= 0 && dct[idx] == 0)
        {
            idx--;
            i_run++;
        }
        i_score += i_ds_table[i_run];
    }

    return i_score;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x9e03(%rip), %rdi      # 0x1b1b4
leaq 0x105b0(%rip), %rsi     # 0x21968
leaq 0x10961(%rip), %rdx     # 0x21d20
xorl %eax, %eax
callq 0x39ba
movl %r14d, %eax
movl %r14d, %ecx
sarl $0x1f, %ecx
andl %r14d, %ecx
decl %ecx
decq %rax
testl %r14d, %r14d
jle 0x113ec
movl %eax, %edx
decl %r14d
decq %rax
cmpl $0x0, (%rbx,%rdx,4)
je 0x113d7
jmp 0x113ef
movl %ecx, %r14d
leaq -0x4(%rbx), %rcx
xorl %eax, %eax
pushq $0x9
popq %rdx
pushq $-0x1
popq %rsi
leaq 0xe99e(%rip), %rdi      # 0x1fda0
testl %r14d, %r14d
js 0x11455
movl %r14d, %r8d
movl (%rbx,%r8,4), %r9d
movl %r9d, %r10d
negl %r10d
cmovsl %r9d, %r10d
cmpl $0x1, %r10d
ja 0x11453
movq %r8, %r10
negq %r10
leaq (%rcx,%r8,4), %r11
xorl %r9d, %r9d
cmpq %r9, %r10
je 0x1143c
cmpl $0x0, (%r11,%r9,4)
jne 0x11441
decq %r9
jmp 0x1142b
movl %esi, %r14d
jmp 0x1144d
addl %r9d, %r14d
decl %r14d
negq %r9
movq %r9, %r8
addl (%rdi,%r8,4), %eax
jmp 0x11402
movl %edx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/macroblock.c
// Function: array_non_zero_count(int*, int)
static inline int array_non_zero_count(int *v, int i_count) {LOG_CALL;
    int i;
    int i_nz;

    for (i = 0, i_nz = 0; i < i_count; i++)
    {
        if (v[i])
        {
            i_nz++;
        }
    }
    return i_nz;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x9d44(%rip), %rdi      # 0x1b1b4
leaq 0x104f1(%rip), %rsi     # 0x21968
leaq 0x108cc(%rip), %rdx     # 0x21d4a
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x39ba
testl %ebx, %ebx
cmovlel %r15d, %ebx
xorl %eax, %eax
cmpq %r15, %rbx
je 0x114a2
cmpl $0x1, (%r14,%r15,4)
sbbl $-0x1, %eax
incq %r15
jmp 0x11490
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/../core/bs.h
// Function: bs_write_te(bs_s*, int, int, char const*)
static inline void
bs_write_te(bs_t *s, int x, int val, const char str[]) {
    myPrintf( "bs_write_te %d %s\n", val,str);
    if (x == 1)
    {
        _bs_write(s, 1, ~val);
    }
    else if (x > 1)
    {
        _bs_write_ue(s, val);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
leaq 0xfa29(%rip), %rdi      # 0x21d5f
movl %edx, %esi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x39ba
cmpl $0x1, %r15d
jne 0x12361
notl %ebx
pushq $0x1
popq %rsi
movq %r14, %rdi
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x13b98
jle 0x12377
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x13bf7
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/macroblock.c
// Function: x264_cabac_mb_skip(x264_t*, x264_macroblock_t*, int)
void x264_cabac_mb_skip(x264_t *h, x264_macroblock_t *mb, int b_skip) {LOG_CALL;
    x264_macroblock_t *mba = mb->context->mba;
    x264_macroblock_t *mbb = mb->context->mbb;
    int i_ctxIdxInc = 0;

    if (mba != NULL && !IS_SKIP(mba->i_type))
    {
        i_ctxIdxInc++;
    }
    if (mbb != NULL && !IS_SKIP(mbb->i_type))
    {
        i_ctxIdxInc++;
    }

    if (h->sh.i_type == SLICE_TYPE_P)
    {
        x264_cabac_encode_decision(&h->cabac, 11 + i_ctxIdxInc, b_skip ? 1 : 0);
    } else /* SLICE_TYPE_B */
    {
        x264_cabac_encode_decision(&h->cabac, 24 + i_ctxIdxInc, b_skip ? 1 : 0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r14d
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x898d(%rip), %rdi      # 0x1b1b4
leaq 0xf13a(%rip), %rsi      # 0x21968
leaq 0xf45a(%rip), %rdx      # 0x21c8f
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x39ba
movq 0x10(%r12), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
testq %rcx, %rcx
je 0x12865
movl 0x18(%rcx), %ecx
cmpl $0x5, %ecx
setne %dl
cmpl $0x11, %ecx
setne %cl
andb %dl, %cl
movzbl %cl, %r15d
testq %rax, %rax
je 0x1287a
movl 0x18(%rax), %eax
cmpl $0x5, %eax
je 0x1287a
cmpl $0x11, %eax
je 0x1287a
incl %r15d
xorl %edx, %edx
testl %r14d, %r14d
setne %dl
leal 0x18(%r15), %eax
addl $0xb, %r15d
cmpl $0x0, 0x10db00(%rbx)
cmovnel %eax, %r15d
leaq 0x10db60(%rbx), %rdi
movl %r15d, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x30bc
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/macroblock.c
// Function: scan_zigzag_4x4(int*, short (*) [4])
static inline void scan_zigzag_4x4(int level[15], int16_t dct[4][4]) {LOG_CALL;
    int i;

    for (i = 1; i < 16; i++)
    {
        level[i - 1] = dct[scan_zigzag_y[i]][scan_zigzag_x[i]];
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x766e(%rip), %rdi      # 0x1b1b4
leaq 0xde1b(%rip), %rsi      # 0x21968
leaq 0xa8a2(%rip), %rdx      # 0x1e3f6
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x39ba
leaq 0xc1bb(%rip), %rax      # 0x1fd20
leaq 0xc1f4(%rip), %rcx      # 0x1fd60
cmpq $0xf, %r15
je 0x13b8d
movslq 0x4(%rax,%r15,4), %rdx
movslq 0x4(%rcx,%r15,4), %rsi
leaq (%rbx,%rdx,8), %rdx
movswl (%rdx,%rsi,2), %edx
movl %edx, (%r14,%r15,4)
incq %r15
jmp 0x13b6c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/macroblock.c
// Function: x264_cabac_mb_mvd(x264_t*, int, int, int)
static void x264_cabac_mb_mvd(x264_t *h, int i_ctx, int i_ctx_inc, int mvd) {LOG_CALL;
    int i_abs = abs(mvd);
    int i_prefix = X264_MIN(i_abs, 9);
    int i;

    for (i = 0; i < i_prefix; i++)
    {
        x264_cabac_encode_decision(&h->cabac, i_ctx + i_ctx_inc, 1);
        if (i_ctx_inc < 3)
        {
            i_ctx_inc = 3;
        } else if (i_ctx_inc < 6)
        {
            i_ctx_inc++;
        }
    }
    if (i_prefix < 9)
    {
        x264_cabac_encode_decision(&h->cabac, i_ctx + i_ctx_inc, 0);
    }

    if (i_prefix >= 9)
    {
        int k = 3;
        int i_suffix = i_abs - 9;

        while (i_suffix >= (1 << k))
        {
            x264_cabac_encode_bypass(&h->cabac, 1);
            i_suffix -= 1 << k;
            k++;
        }
        x264_cabac_encode_bypass(&h->cabac, 0);
        while (k--)
        {
            x264_cabac_encode_bypass(&h->cabac, (i_suffix >> k)&0x01);
        }
    }

    /* sign */
    if (mvd > 0)
    {
        x264_cabac_encode_bypass(&h->cabac, 0);
    } else if (mvd < 0)
    {
        x264_cabac_encode_bypass(&h->cabac, 1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r15d
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x74ef(%rip), %rdi      # 0x1b1b4
leaq 0xdc9c(%rip), %rsi      # 0x21968
leaq 0xe24d(%rip), %rdx      # 0x21f20
xorl %eax, %eax
callq 0x39ba
movl %r15d, %r14d
negl %r14d
movl %r15d, -0x2c(%rbp)
cmovsl %r15d, %r14d
cmpl $0x9, %r14d
pushq $0x9
popq %r15
cmovbl %r14d, %r15d
addq $0x10db60, %rbx         # imm = 0x10DB60
subl $0x1, %r15d
jb 0x13d2b
leal (%r12,%r13), %esi
movq %rbx, %rdi
pushq $0x1
popq %rdx
callq 0x30bc
xorl %eax, %eax
cmpl $0x6, %r13d
setl %al
addl %r13d, %eax
cmpl $0x3, %r13d
pushq $0x3
popq %rcx
cmovll %ecx, %eax
movl %eax, %r13d
jmp 0x13cfb
cmpl $0x8, %r14d
ja 0x13d63
addl %r12d, %r13d
movq %rbx, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x30bc
pushq $0x1
popq %r13
xorl %esi, %esi
cmpl $0x0, -0x2c(%rbp)
jle 0x13db3
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31cc
addl $-0x9, %r14d
pushq $0x2
popq %r12
movl %r14d, %r15d
pushq $0x1
popq %r13
leal 0x1(%r12), %ecx
movl %r13d, %eax
shll %cl, %eax
subl %eax, %r15d
jl 0x13d94
movq %rbx, %rdi
movl %r13d, %esi
callq 0x31cc
incl %r12d
movl %r15d, %r14d
jmp 0x13d72
xorl %esi, %esi
movq %rbx, %rdi
callq 0x31cc
cmpl $-0x1, %r12d
je 0x13d45
xorl %esi, %esi
btl %r12d, %r14d
setb %sil
decl %r12d
jmp 0x13d96
movl %r13d, %esi
js 0x13d4d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/me.c
// Function: me_mv_test(x264_t*, int*, int*, int*, int, unsigned char*, int, unsigned char*, int, int, int, int, int, int)
static inline int me_mv_test( x264_t *h,  
                                  int *pi_sad, int *pi_mvx, int *pi_mvy,  
                                  int i_sad_mode, uint8_t *img, int i_img, uint8_t *test, int i_test_stride,  
                                  int mvx, int mvy,  
                                  int i_lambda_motion, int mvxp, int mvyp )  
    {  
        int i_sad;  
      
        i_sad = h->pixf.sad[i_sad_mode]( img, i_img, &test[mvy*i_test_stride+mvx], i_test_stride );  
        if( i_sad + i_lambda_motion * ( bs_size_se((mvx<<2) - mvxp)+bs_size_se((mvy<<2) - mvyp) ) <  
           *pi_sad + i_lambda_motion * ( bs_size_se(((*pi_mvx)<<2) - mvxp)+bs_size_se(((*pi_mvy)<<2) - mvyp) ) )  
        {  
            *pi_sad = i_sad;  
            *pi_mvx = mvx;  
            *pi_mvy = mvy;  
            return 1;  
        }  
      
        return 0;  
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, -0x38(%rbp)
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rax
movl 0x30(%rbp), %r13d
movl 0x28(%rbp), %ebx
movl 0x20(%rbp), %ecx
movslq %r8d, %r8
movl %r13d, %edx
imull %ecx, %edx
addl %ebx, %edx
movslq %edx, %rdx
addq 0x18(%rbp), %rdx
movl 0x10(%rbp), %esi
movq %r9, %rdi
callq *0x10f2a8(%rax,%r8,8)
movl %eax, %r15d
leal (,%rbx,4), %edi
subl 0x40(%rbp), %edi
callq 0x15763
movl %eax, %ebx
leal (,%r13,4), %edi
subl 0x48(%rbp), %edi
callq 0x15763
movl %eax, %r13d
addl %ebx, %r13d
imull 0x38(%rbp), %r13d
movl %r15d, -0x2c(%rbp)
addl %r15d, %r13d
movq %r14, -0x40(%rbp)
movl (%r14), %r14d
movq %r12, -0x48(%rbp)
movl (%r12), %edi
shll $0x2, %edi
subl 0x40(%rbp), %edi
callq 0x15763
movl %eax, %ebx
movq -0x38(%rbp), %rax
movl (%rax), %edi
shll $0x2, %edi
subl 0x48(%rbp), %edi
callq 0x15763
movl %eax, %ecx
addl %ebx, %ecx
imull 0x38(%rbp), %ecx
addl %r14d, %ecx
xorl %eax, %eax
cmpl %ecx, %r13d
jge 0x15754
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
movl 0x28(%rbp), %ecx
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
movl 0x30(%rbp), %ecx
movl %ecx, (%rax)
pushq $0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/ratecontrol.c
// Function: x264_ratecontrol_new(x264_param_t*)
x264_ratecontrol_t *x264_ratecontrol_new( x264_param_t *param )
{
    x264_ratecontrol_t *rc = (x264_ratecontrol_t *)x264_malloc( sizeof( x264_ratecontrol_t ) );

    rc->fps = param->f_fps > 0.1 ? param->f_fps : 25.0;
    rc->i_iframe = param->i_iframe;
    rc->i_bitrate = param->i_bitrate * 1000;

    rc->i_qp_last = 26;
    rc->i_qp      = param->i_qp_constant;

    rc->i_frames  = 0;
    rc->i_size    = 0;

    return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x28
popq %rdi
callq 0x35f2
movss 0x14(%rbx), %xmm0
cvtss2sd %xmm0, %xmm1
ucomisd 0xcd1e(%rip), %xmm1     # 0x22550
ja 0x1583c
movss 0xcd1c(%rip), %xmm0     # 0x22558
movss %xmm0, (%rax)
movl 0x20(%rbx), %ecx
movl %ecx, 0x4(%rax)
imull $0x3e8, 0x38(%rbx), %ecx # imm = 0x3E8
movl %ecx, 0x8(%rax)
movl $0x1a, 0xc(%rax)
movl 0x34(%rbx), %ecx
movl %ecx, 0x10(%rax)
andl $0x0, 0x18(%rax)
andq $0x0, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/../core/bs.h
// Function: bs_rbsp_trailing(bs_s*)
static inline void
bs_rbsp_trailing(bs_t *s) {LOG_CALL;
    _bs_write(s, 1, 1);
    if (s->i_left != 8)
    {
        _bs_write(s, s->i_left, 0x00);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x510e(%rip), %rdi      # 0x1b1b4
leaq 0x8f6f(%rip), %rsi      # 0x1f01c
leaq 0x933a(%rip), %rdx      # 0x1f3ee
xorl %eax, %eax
callq 0x39ba
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %edx, %esi
callq 0x16408
movl 0x18(%rbx), %esi
cmpl $0x8, %esi
jne 0x160d7
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x16408
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/./sh_merge.h
// Function: merge
void *
merge(const void *arr_a, size_t num_el_a,
      const void *arr_b, size_t num_el_b,
      size_t el_size, int (*compare) (const void *, const void *))
{
    char *ac = (char *) arr_a;
    char *bc = (char *) arr_b;
    char *ah = ac + (num_el_a * el_size);
    char *bh = bc + (num_el_b * el_size);
    char *r = NULL;
    char *rc = NULL;

    ASSERT_MERGE_ARGS();

    r = (char *) malloc((num_el_a + num_el_b) * el_size);
    if (!r || !((num_el_a + num_el_b) * el_size)) {
        return NULL;
    }
    rc = r;

    while ((ac < ah) && (bc < bh)) {
        if ((*compare) (ac, bc) > 0) {
            memcpy(rc, bc, el_size);
            bc += el_size;
        } else {
            memcpy(rc, ac, el_size);
            ac += el_size;
        }
        rc += el_size;
    }

    if (ac < ah) {
        memcpy(rc, ac, ah - ac);
    } else if (bc < bh) {
        memcpy(rc, bc, bh - bc);
    }

    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %r8, %r8
je 0x139e
movq %r9, 0x10(%rsp)
testq %r9, %r9
je 0x13a7
movq %r8, %r15
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
leaq (%rcx,%rsi), %rbp
imulq %r8, %rbp
movq %rbp, %rdi
callq 0x1130
testq %rax, %rax
sete %dl
testq %rbp, %rbp
sete %cl
orb %dl, %cl
je 0x1307
xorl %eax, %eax
jmp 0x138f
imulq %r15, %r12
addq %r13, %r12
imulq %r15, %rbx
addq %r14, %rbx
movq %rax, 0x8(%rsp)
movq %rax, %rbp
cmpq %r12, %r13
jae 0x135b
cmpq %rbx, %r14
jae 0x135b
movq %r13, %rdi
movq %r14, %rsi
callq *0x10(%rsp)
movq %rbp, %rdi
testl %eax, %eax
jle 0x1348
movq %r14, %rsi
movq %r15, %rdx
callq 0x1110
addq %r15, %r14
jmp 0x1356
movq %r13, %rsi
movq %r15, %rdx
callq 0x1110
addq %r15, %r13
addq %r15, %rbp
jmp 0x131d
cmpq %rbx, %r14
setb %al
cmpq %r12, %r13
setb %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x138a
cmpq %r12, %r13
cmovbq %r13, %r14
cmovbq %r12, %rbx
subq %r14, %rbx
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1110
movq 0x8(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1cd3(%rip), %rdi      # 0x3078
jmp 0x13ae
leaq 0x1d49(%rip), %rdi      # 0x30f7
leaq 0x1cd0(%rip), %rsi      # 0x3085
leaq 0x1cd6(%rip), %rcx      # 0x3092
pushq $0x62
popq %rdx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/./sh_merge.h
// Function: merge_into
void *
merge_into(void *dst, size_t num_el_dst,
           const void *src, size_t num_el_src,
           size_t el_size, int (*compare) (const void *, const void *))
{
    char *dl;
    char *sl = (char *) src;
    char *dc;
    char *sc = sl + (num_el_src * el_size);
    char *r = NULL;
    char *rc = NULL;

    ASSERT_MERGE_ARGS();

    r = (char *) realloc(dst, (num_el_dst + num_el_src) * el_size);
    if (!r || !((num_el_dst + num_el_src) * el_size)) {
        return NULL;
    }
    rc = r + (num_el_dst + num_el_src) * el_size;

    dl = (char *) r;
    dc = dl + (num_el_dst * el_size);

    while ((dl < dc) && (sl < sc)) {
        if ((*compare) (dc - el_size, sc - el_size) > 0) {
            memcpy(rc - el_size, dc - el_size, el_size);
            dc -= el_size;
        } else {
            memcpy(rc - el_size, sc - el_size, el_size);
            sc -= el_size;
        }
        rc -= el_size;
    }

    if (sl < sc) {
        memcpy(r, sl, sc - sl);
    }

    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %r8, %r8
je 0x14e4
movq %r9, %rbx
testq %r9, %r9
je 0x14ed
movq %r8, %r13
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbp
leaq (%rcx,%rsi), %r14
imulq %r8, %r14
movq %r14, %rsi
callq 0x1160
movq %rax, %rdi
testq %rax, %rax
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
je 0x141d
xorl %edi, %edi
jmp 0x14d2
movq %rbx, 0x18(%rsp)
movq %r13, %rdx
imulq %r15, %rdx
addq %r12, %rdx
movq %r15, %rcx
movq %r13, %r15
imulq %rbp, %r15
addq %rdi, %r15
movq %r13, %rax
negq %rax
addq %rcx, %rbp
decq %rbp
imulq %r13, %rbp
addq %rdi, %rbp
movq %r12, 0x20(%rsp)
movq %rdi, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movq %rax, (%rsp)
cmpq %r15, %rdi
jae 0x14b7
cmpq %r12, %rdx
jbe 0x14b7
leaq (%r15,%rax), %r14
movq %rdx, %rbx
leaq (%rdx,%rax), %r13
movq %r14, %rdi
movq %r13, %rsi
callq *0x18(%rsp)
movq %r14, %r12
testl %eax, %eax
jg 0x148e
movq %r13, %r14
movq %r15, %r12
movq %r13, %rbx
movq %rbp, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
callq 0x1110
movq (%rsp), %rax
addq %rax, %rbp
movq %r12, %r15
movq 0x20(%rsp), %r12
movq 0x10(%rsp), %rdi
movq %rbx, %rdx
jmp 0x145f
subq %r12, %rdx
jbe 0x14d2
movq %r12, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1110
movq %rdi, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1b8d(%rip), %rdi      # 0x3078
jmp 0x14f4
leaq 0x1c03(%rip), %rdi      # 0x30f7
leaq 0x1b8a(%rip), %rsi      # 0x3085
leaq 0x1c05(%rip), %rcx      # 0x3107
movl $0x8a, %edx
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/tests/test_merge.c
// Function: merge_suite
SUITE(merge_suite)
{
    int i;
    int c;

    for (i = 0; i < TEST_NUM; i++) {
        c = (rand() % ARR_SZ);
        if ((c < 0) || (c > ARR_SZ))
            continue;
        RUN_TEST1(do_merge_test, c);
    }

    RUN_TEST1(do_merge_test, 0);
    RUN_TEST1(do_merge_test, ARR_SZ);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0x80, %r14d
movl $0x78fb, %r15d          # imm = 0x78FB
leaq 0x1c35(%rip), %rbx      # 0x316b
subl $0x1, %r14d
jb 0x1568
callq 0x1190
cltd
idivl %r15d
testl %edx, %edx
js 0x1536
movl %edx, %ebp
movq %rbx, %rdi
callq 0x15be
cmpl $0x1, %eax
jne 0x1536
movl %ebp, %edi
callq 0x17a2
movl %eax, %edi
callq 0x196b
jmp 0x1536
leaq 0x1bfc(%rip), %rdi      # 0x316b
callq 0x15be
cmpl $0x1, %eax
jne 0x1587
xorl %edi, %edi
callq 0x17a2
movl %eax, %edi
callq 0x196b
leaq 0x1bdd(%rip), %rdi      # 0x316b
callq 0x15be
cmpl $0x1, %eax
jne 0x15b3
movl $0x78fb, %edi           # imm = 0x78FB
callq 0x17a2
movl %eax, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x196b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/tests/test_merge.c
// Function: main
int
main(int argc, char *argv[])
{
    GREATEST_MAIN_BEGIN();
#if defined(__STDC_VERSION__)
    printf("Compiler Standard version - %ld\n", __STDC_VERSION__);
#endif

    srand(time(NULL));

    RUN_SUITE(merge_suite);
    RUN_SUITE(merge_into_suite);

    GREATEST_MAIN_END();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
callq 0x210e
movb 0x21f27(%rip), %al      # 0x24510
pushq $0x1
popq %rdi
movb 0x21f1f(%rip), %cl      # 0x24511
leaq 0xa17(%rip), %rdx       # 0x3010
leaq 0xa60(%rip), %rsi       # 0x3060
cmpl %ebp, %edi
jge 0x26d9
movslq %edi, %r8
movq (%rbx,%r8,8), %r14
cmpb $0x2d, (%r14)
jne 0x26a9
movzbl 0x1(%r14), %r15d
leal -0x65(%r15), %r8d
cmpl $0x13, %r8d
ja 0x266d
movslq (%rdx,%r8,4), %r8
addq %rdx, %r8
jmpq *%r8
leal 0x1(%rdi), %r8d
cmpl %ebp, %r8d
jge 0x2766
leal -0x73(%r15), %r9d
cmpl $0x5, %r9d
ja 0x26b0
movslq (%rsi,%r9,4), %r10
addq %rsi, %r10
movslq %r8d, %r9
jmpq *%r10
movq (%rbx,%r9,8), %rdi
movq %rdi, 0x21f37(%rip)     # 0x24598
jmp 0x26a6
incb %cl
movb %cl, 0x21ea6(%rip)      # 0x24511
jmp 0x26a9
cmpl $0x61, %r15d
jne 0x26b0
orb $0x4, %al
jmp 0x2686
orb $0x2, %al
jmp 0x2686
movb $0x1, 0x21e91(%rip)     # 0x24513
jmp 0x26a9
orb $0x1, %al
movb %al, 0x21e84(%rip)      # 0x24510
jmp 0x26a9
movq (%rbx,%r9,8), %rdi
movq %rdi, 0x21f07(%rip)     # 0x245a0
jmp 0x26a6
movq (%rbx,%r9,8), %rdi
movq %rdi, 0x21f02(%rip)     # 0x245a8
movl %r8d, %edi
incl %edi
jmp 0x2600
leaq 0xd42(%rip), %rdi       # 0x33f9
pushq $0x6
popq %rdx
movq %r14, %rsi
callq 0x1050
testl %eax, %eax
je 0x273c
subl $0x2d, %r15d
jne 0x26d1
movzbl 0x2(%r14), %r15d
negl %r15d
testl %r15d, %r15d
jne 0x274b
leaq 0xbdc(%rip), %rdi       # 0x32bc
movl $0x313ee, %esi          # imm = 0x313EE
xorl %eax, %eax
callq 0x1090
xorl %edi, %edi
callq 0x1120
movl %eax, %edi
callq 0x10e0
leaq -0x11e5(%rip), %rdi     # 0x151c
leaq 0xbd5(%rip), %rsi       # 0x32dd
callq 0x2167
leaq -0xb49(%rip), %rdi      # 0x1bcb
leaq 0xbce(%rip), %rsi       # 0x32e9
callq 0x2167
callq 0x22f9
xorl %eax, %eax
cmpl $0x0, 0x21e1e(%rip)     # 0x2454c
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rdi
callq 0x2776
xorl %edi, %edi
callq 0x1170
movq 0x3886(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
leaq 0xca4(%rip), %rsi       # 0x3400
movq %r14, %rdx
xorl %eax, %eax
callq 0x1100
movq (%rbx), %rdi
callq 0x2776
pushq $0x1
popq %rdi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/tests/test_merge.c
// Function: do_merge_test
TEST
do_merge_test(int c)
{
    size_t i;
    void *la, *ra, *r;

    for (i = 0; i < ARR_SZ; i++) {
        arint[i] = rand();
    }

    qsort(&arint[0], c, sizeof (int), cmp_int);
    qsort(&arint[c], ARR_SZ - c, sizeof (int), cmp_int);

    la = malloc(c * sizeof (int));
    ra = malloc((ARR_SZ - c) * sizeof (int));

    memcpy(la, &arint[0], c * sizeof (int));
    memcpy(ra, &arint[c], (ARR_SZ - c) * sizeof (int));

    r = merge(la, c, ra, ARR_SZ - c, sizeof (int), cmp_int);

    ASSERT(r);

    qsort(&arint[0], ARR_SZ, sizeof (int), cmp_int);
    ASSERT_MEM_EQ(&arint[0], r, ARR_SZ * sizeof (int));

    free(la);
    free(ra);
    free(r);

    PASS();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, %r14d
xorl %r15d, %r15d
leaq 0x4963(%rip), %rbx      # 0x6120
cmpq $0x1e3ec, %r15          # imm = 0x1E3EC
je 0x17d5
callq 0x1190
movl %eax, (%r15,%rbx)
addq $0x4, %r15
jmp 0x17bd
movl %r14d, %r12d
leaq -0x2d3(%rip), %rbp      # 0x150c
pushq $0x4
popq %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x1060
leaq (%rbx,%r12,4), %rdi
movq %rdi, (%rsp)
movq %r12, 0x8(%rsp)
movl $0x78fb, %r15d          # imm = 0x78FB
subl %r14d, %r15d
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x1060
leaq (,%r12,4), %rbp
movq %rbp, %rdi
callq 0x1130
movq %rax, %r14
movl %r15d, %r12d
shll $0x2, %r12d
movq %r12, %rdi
callq 0x1130
movq %rax, %r13
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x1110
movq %r13, %rdi
movq (%rsp), %rsi
movq %r12, %rdx
callq 0x1110
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
movq %r15, %rcx
pushq $0x4
popq %r8
leaq -0x367(%rip), %r9       # 0x150c
callq 0x12ac
incl 0x22cd6(%rip)           # 0x24554
testq %rax, %rax
je 0x18f1
movq %rax, %r12
leaq -0x381(%rip), %rcx      # 0x150c
pushq $0x4
popq %rdx
movl $0x78fb, %esi           # imm = 0x78FB
movq %rbx, %rdi
callq 0x1060
leaq 0x10(%rsp), %rcx
movq %rbx, (%rcx)
movq %r12, 0x8(%rcx)
movq $0x1e3ec, 0x10(%rcx)    # imm = 0x1E3EC
incl 0x22c9d(%rip)           # 0x24554
leaq 0x483a(%rip), %rdx      # 0x60f8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1ea0
testl %eax, %eax
je 0x1912
movq %r14, %rdi
callq 0x1030
movq %r13, %rdi
callq 0x1030
movq %r12, %rdi
callq 0x1030
andq $0x0, 0x22c7b(%rip)     # 0x24568
xorl %eax, %eax
jmp 0x1957
leaq 0x1a02(%rip), %rax      # 0x32fa
movq %rax, 0x22c61(%rip)     # 0x24560
movl $0x32, 0x22c4f(%rip)    # 0x24558
leaq 0x1a2d(%rip), %rax      # 0x333d
jmp 0x1944
cmpq $0x0, 0x47de(%rip)      # 0x60f8
leaq 0x19d9(%rip), %rax      # 0x32fa
movq %rax, 0x22c38(%rip)     # 0x24560
movl $0x35, 0x22c26(%rip)    # 0x24558
je 0x193d
leaq 0x19f5(%rip), %rax      # 0x3330
jmp 0x1944
leaq 0x19c9(%rip), %rax      # 0x330d
movq %rax, 0x22c1d(%rip)     # 0x24568
testb $0x4, 0x22bbe(%rip)     # 0x24510
jne 0x1966
pushq $-0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1040
// File: /workspace/github_c_makefile_star2_O2/JulStrat[P]bams/tests/test_merge.c
// Function: merge_into_suite
SUITE(merge_into_suite)
{
    int i;
    int c;

    for (i = 0; i < TEST_NUM; i++) {
        c = (rand() % ARR_SZ);
        if ((c < 0) || (c > ARR_SZ))
            continue;
        RUN_TEST1(do_merge_into_test, c);
    }

    RUN_TEST1(do_merge_into_test, 0);
    RUN_TEST1(do_merge_into_test, ARR_SZ);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0x80, %r14d
movl $0x78fb, %r15d          # imm = 0x78FB
leaq 0x1594(%rip), %rbx      # 0x3179
subl $0x1, %r14d
jb 0x1c17
callq 0x1190
cltd
idivl %r15d
testl %edx, %edx
js 0x1be5
movl %edx, %ebp
movq %rbx, %rdi
callq 0x15be
cmpl $0x1, %eax
jne 0x1be5
movl %ebp, %edi
callq 0x1c6d
movl %eax, %edi
callq 0x196b
jmp 0x1be5
leaq 0x155b(%rip), %rdi      # 0x3179
callq 0x15be
cmpl $0x1, %eax
jne 0x1c36
xorl %edi, %edi
callq 0x1c6d
movl %eax, %edi
callq 0x196b
leaq 0x153c(%rip), %rdi      # 0x3179
callq 0x15be
cmpl $0x1, %eax
jne 0x1c62
movl $0x78fb, %edi           # imm = 0x78FB
callq 0x1c6d
movl %eax, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x196b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/run-tests.c
// Function: report_corruptions
static void report_corruptions(int ckey_corruptions, int pos_corruptions, int nelems) {
  printf("\nTotal number of ckey corruptions: %d\nFraction corrupted: %4.3f\n", ckey_corruptions,
         (double)ckey_corruptions/nelems);
  printf("\nTotal number of positional corruptions: %d\nFraction corrupted: %4.3f\n", pos_corruptions,
         (double)pos_corruptions/nelems);
  printf("\n");
}

// Assembly:
pushq %rbx
movl %esi, %ebx
movl %edi, %esi
cvtsi2sd %edi, %xmm0
mulsd 0x9c2(%rip), %xmm0      # 0x2010
leaq 0x9f3(%rip), %rdi       # 0x2048
movb $0x1, %al
callq 0x1070
cvtsi2sd %ebx, %xmm0
mulsd 0x9a8(%rip), %xmm0      # 0x2010
leaq 0xa1a(%rip), %rdi       # 0x2089
movl %ebx, %esi
movb $0x1, %al
callq 0x1070
pushq $0xa
popq %rdi
popq %rbx
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/softheap.c
// Function: makeheap
softheap *makeheap(int elem, double epsilon) {
  softheap *s = makeheap_empty(epsilon);
  s->first = maketree(elem);
  s->rank = 0;
  return s;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x16b0
movq %rax, %r14
movl %ebx, %edi
callq 0x172a
movq %rax, (%r14)
andl $0x0, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/softheap.c
// Function: makeheap_empty
softheap *makeheap_empty(double epsilon) {
  // Ensure error parameter is valid
  if(epsilon <= 0 || epsilon >= 1) error(1,0, "Soft heap error parameter must fall in (0,1)");
  
  softheap *s = malloc(sizeof(softheap));
  s->first = NULL;
  s->rank = -1; // Ensures that any insertion will just return the SH containing the inserted elem
  s->epsilon = epsilon;
  s->r = get_r(epsilon);
  return s;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
movsd %xmm0, 0x8(%rsp)
jae 0x16cf
ucomisd 0xc13(%rip), %xmm0      # 0x22e0
jb 0x16e2
leaq 0xc3a(%rip), %rdx       # 0x2310
pushq $0x1
popq %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x10e0
pushq $0x20
popq %rdi
callq 0x10c0
movq %rax, %rbx
andq $0x0, (%rax)
orl $-0x1, 0x8(%rax)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
callq 0x1090
divsd 0xbdb(%rip), %xmm0      # 0x22e8
callq 0x10f0
addsd 0xbd6(%rip), %xmm0      # 0x22f0
cvttsd2si %xmm0, %eax
movl %eax, 0x18(%rbx)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/softheap.c
// Function: maketree
static tree *maketree(int elem) {
  tree *T = malloc(sizeof(tree));
  T->root = makenode(elem);
  T->prev = T->next = NULL;
  T->rank = 0;
  T->sufmin = T;
  return T;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %ebx
pushq $0x28
popq %rdi
callq 0x10c0
movq %rax, %r14
pushq $0x30
popq %rdi
callq 0x10c0
movq %rax, %r15
pushq $0x10
popq %rdi
callq 0x10c0
movl %ebx, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x18(%r15)
movq %rax, 0x10(%r15)
movl %ebx, 0x20(%r15)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x24(%r15)
movl $0x1, 0x2c(%r15)
xorps %xmm0, %xmm0
movq %r15, 0x18(%r14)
andl $0x0, 0x20(%r14)
movups %xmm0, (%r15)
movups %xmm0, (%r14)
movq %r14, 0x10(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/softheap.c
// Function: destroy_heap
void destroy_heap(softheap *P) {
  if(P == NULL) return;

  tree *curr = P->first, *next;
  while(curr != NULL) {
    next = curr->next;
    destroy_node(curr->root);
    free(curr);
    curr = next;
  }  

  free(P);
}

// Assembly:
testq %rdi, %rdi
je 0x17d5
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x17c8
movq 0x8(%r14), %r15
movq 0x18(%r14), %rdi
callq 0x17d6
movq %r14, %rdi
callq 0x1030
movq %r15, %r14
jmp 0x17a9
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1030
retq
// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/softheap.c
// Function: destroy_node
static void destroy_node(node *treenode) {
  if(treenode == NULL) return;
  
  cell *curr = treenode->first, *next;
  while(curr != NULL) {
    next = curr->next;
    free(curr);
    curr = next;
  }

  destroy_node(treenode->left);
  destroy_node(treenode->right);
  free(treenode);
}

// Assembly:
testq %rdi, %rdi
je 0x1819
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x17f9
movq 0x8(%rdi), %r14
callq 0x1030
movq %r14, %rdi
jmp 0x17e6
movq (%rbx), %rdi
callq 0x17d6
movq 0x8(%rbx), %rdi
callq 0x17d6
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1030
retq
// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/softheap.c
// Function: insert
void insert(softheap *P, int elem) {
  if(empty(P)) { 
    P->first = maketree(elem);
    P->rank = 0;
  } else meld(P, makeheap(elem, P->epsilon));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x1844
movsd 0x10(%rbx), %xmm0
movl %esi, %edi
callq 0x1688
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0x1854
movl %esi, %edi
callq 0x172a
movq %rax, (%rbx)
andl $0x0, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/softheap.c
// Function: meld
softheap *meld(softheap *P, softheap *Q) {
  // Do not allow melding if the soft heaps don't seem to have the same error parameter.
  double max_eps = max(P->epsilon, Q->epsilon), min_eps = min(P->epsilon, Q->epsilon);
  double eps_off = 1 - min_eps/max_eps; 
  if(eps_off > 0.001) error(1,0, "Tried to combine soft heaps with different epsilons");

  // If both softheaps empty, just destroy one and return the other
  if(empty(P) && empty(Q)) {
    free(P);
    return Q;
  }

  softheap *result;
  if(P->rank >= Q->rank) { // meld Q into P
    merge_into(Q, P);
    repeated_combine(P, Q->rank, P->r);
    free(Q);
    result = P;
  } else { // meld P into Q
    merge_into(P, Q);
    repeated_combine(Q, P->rank, Q->r);
    free(P);
    result = Q;
  }

  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movsd 0x10(%rdi), %xmm0
movsd 0x10(%rsi), %xmm1
movapd %xmm1, %xmm2
cmplesd %xmm0, %xmm2
movapd %xmm2, %xmm3
andpd %xmm0, %xmm3
andnpd %xmm1, %xmm2
orpd %xmm3, %xmm2
movapd %xmm0, %xmm3
cmplesd %xmm1, %xmm3
andpd %xmm3, %xmm0
andnpd %xmm1, %xmm3
orpd %xmm0, %xmm3
divsd %xmm2, %xmm3
movsd 0xa3d(%rip), %xmm0      # 0x22e0
subsd %xmm3, %xmm0
ucomisd 0xa49(%rip), %xmm0      # 0x22f8
jbe 0x18c4
leaq 0xa85(%rip), %rdx       # 0x233d
pushq $0x1
popq %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x10e0
cmpq $0x0, (%rbx)
jne 0x18d0
cmpq $0x0, (%r14)
je 0x1910
movl 0x8(%rbx), %eax
cmpl 0x8(%r14), %eax
jge 0x18ec
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1921
movq %r14, %r15
movq %rbx, %r14
jmp 0x18fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1921
movq %rbx, %r15
movq %r14, %rbx
movl 0x8(%r14), %esi
movl 0x18(%r15), %edx
movq %r15, %rdi
callq 0x195f
movq %r15, %r14
movq %rbx, %rdi
callq 0x1030
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/softheap.c
// Function: merge_into
static void merge_into(softheap *P, softheap *Q) {
  tree *currP = P->first, *currQ = Q->first;

  while(currP != NULL) {
    while(currQ->rank < currP->rank) currQ = currQ->next;
    // currQ is now the first tree in Q with rank >= currP. Insert currP before it.
    tree *next = currP->next;
    insert_tree(Q, currP, currQ);
    currP = next;
  }
}

// Assembly:
movq (%rdi), %rcx
movq (%rsi), %rax
testq %rcx, %rcx
je 0x195e
movl 0x20(%rcx), %edx
cmpl %edx, 0x20(%rax)
jge 0x193a
movq 0x8(%rax), %rax
jmp 0x192f
movq 0x8(%rcx), %rdx
movq %rax, 0x8(%rcx)
movq (%rax), %rdi
leaq 0x8(%rdi), %r8
testq %rdi, %rdi
cmoveq %rsi, %r8
movq %rcx, (%r8)
movq %rdi, (%rcx)
movq %rcx, (%rax)
movq %rdx, %rcx
jmp 0x1927
retq
// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/softheap.c
// Function: repeated_combine
static void repeated_combine(softheap *Q, int smaller_rank, int r) {
  tree *curr = Q->first;

  while(curr->next != NULL) {
    bool two = (curr->rank == curr->next->rank);
    bool three = (two && curr->next->next != NULL && curr->rank == curr->next->next->rank);

    if(!two) { // only one tree of this rank
      if(curr->rank > smaller_rank) break; // no more combines to do and no carries
      else curr = curr->next;
    } else if(!three) { // exactly two trees of this rank
      // combine them to make a carry, then delete curr->next. 
      // carry may need to be merged with its next tree, so do not advance curr.
      curr->root = combine(curr->root, curr->next->root, r);
      curr->rank = curr->root->rank;
      tree *tofree = curr->next;
      remove_tree(Q, curr->next); // will change what curr->next points to
      free(tofree);
    } else { // exactly three trees of this rank
      // skip the first so that we can combine the second and third to form a carry
      curr = curr->next;
    }
  }

  if(curr->rank > Q->rank) Q->rank = curr->rank; // Q might have a new highest-rank tree
  update_suffix_min(curr); // this is final tree affected by merge, so update sufmin backwds from here
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, 0x4(%rsp)
movq %rdi, %rbx
movq (%rdi), %rax
movq %rax, %r12
movq 0x8(%r12), %rax
movl 0x20(%r12), %ecx
testq %rax, %rax
je 0x1a3c
cmpl 0x20(%rax), %ecx
jne 0x1a32
movq 0x8(%rax), %rdx
testq %rdx, %rdx
je 0x19a3
cmpl 0x20(%rdx), %ecx
je 0x1976
movq 0x18(%r12), %r15
movq 0x18(%rax), %r14
pushq $0x30
popq %rdi
callq 0x10c0
movq %rax, %r13
movq %r15, (%rax)
movq %r14, 0x8(%rax)
movl 0x24(%r15), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x24(%r13)
andl $0x0, 0x2c(%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r13)
pushq $0x1
popq %rax
cmpl %ebp, %ecx
jl 0x19ec
movl 0x28(%r15), %eax
leal (%rax,%rax,2), %eax
incl %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movl %eax, 0x28(%r13)
movq %r13, %rdi
callq 0x1b8f
movq %r13, 0x18(%r12)
movl 0x24(%r13), %eax
movl %eax, 0x20(%r12)
movq 0x8(%r12), %rdi
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
leaq 0x8(%rax), %rdx
testq %rax, %rax
cmoveq %rbx, %rdx
movq %rcx, (%rdx)
testq %rcx, %rcx
je 0x1a28
movq %rax, (%rcx)
callq 0x1030
jmp 0x1979
cmpl 0x4(%rsp), %ecx
jle 0x1976
cmpl 0x8(%rbx), %ecx
jle 0x1a44
movl %ecx, 0x8(%rbx)
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1c5c
// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/softheap.c
// Function: extract_min_with_ckey
int extract_min_with_ckey(softheap *P, int *ckey_into) {
  if(empty(P)) error(1,0, "Tried to extract an element from an empty soft heap");

  tree *T = P->first->sufmin; // tree with lowest root ckey
  node *x = T->root;
  int e = extract_elem(x);
  *ckey_into = x->ckey;

  if(x->nelems <= x->size / 2) { // x is deficient; rescue it if possible
    if(!leaf(x)) {
      sift(x);
      update_suffix_min(T);
    } else if(x->nelems == 0) { // x is a leaf and empty; it must be destroyed
      free(x);
      remove_tree(P, T);

      if(T->next == NULL) { // we removed the highest-ranked tree; reset heap rank and clean up
        if(T->prev == NULL) P->rank = -1; // Heap now empty. Rank -1 is sentinel for future melds
        else P->rank = T->prev->rank;
      }

      if(T->prev != NULL) update_suffix_min(T->prev);
      free(T);
    }
  }

  return e;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r13
movq %rdi, %r15
movq (%rdi), %rax
testq %rax, %rax
jne 0x1a94
leaq 0x8ec(%rip), %rdx       # 0x2371
pushq $0x1
popq %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x10e0
movq (%r15), %rax
movq 0x10(%rax), %r14
movq 0x18(%r14), %r12
movq 0x10(%r12), %rdi
testq %rdi, %rdi
je 0x1b70
movl (%rdi), %ebx
movq 0x8(%rdi), %rax
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0x1ac1
cmpq $0x0, 0x8(%rax)
jne 0x1ac6
movq %rax, 0x18(%r12)
callq 0x1030
decl 0x2c(%r12)
movl 0x20(%r12), %eax
movl %eax, (%r13)
movl 0x28(%r12), %eax
movl 0x2c(%r12), %ecx
pushq $0x2
popq %rsi
cltd
idivl %esi
cmpl %eax, %ecx
jg 0x1b0c
cmpq $0x0, (%r12)
jne 0x1afc
cmpq $0x0, 0x8(%r12)
je 0x1b18
movq %r12, %rdi
callq 0x1b8f
movq %r14, %rdi
callq 0x1c5c
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
testl %ecx, %ecx
jne 0x1b0c
movq %r12, %rdi
callq 0x1030
movq (%r14), %rax
movq 0x8(%r14), %rcx
leaq 0x8(%rax), %rdx
testq %rax, %rax
cmoveq %r15, %rdx
movq %rcx, (%rdx)
testq %rcx, %rcx
je 0x1b4b
movq %rax, (%rcx)
movq (%r14), %rdi
testq %rdi, %rdi
jne 0x1b5a
jmp 0x1b5f
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1b69
movl 0x20(%rdi), %eax
movl %eax, 0x8(%r15)
callq 0x1c5c
movq %r14, %rdi
callq 0x1030
jmp 0x1b0c
orl $-0x1, 0x8(%r15)
jmp 0x1b5f
leaq 0x82e(%rip), %rdi       # 0x23a5
leaq 0x838(%rip), %rsi       # 0x23b6
leaq 0x83c(%rip), %rcx       # 0x23c1
movl $0x1a6, %edx            # imm = 0x1A6
callq 0x1080
// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/softheap.c
// Function: sift
static void sift(node *x) {
  while(x->nelems < x->size && !leaf(x)) {
    // For simplicity, switch left and right children so that left child exists & has smaller ckey
    if(x->left == NULL || (x->right != NULL && x->left->ckey > x->right->ckey)) swapLR(x);
    moveList(x->left, x); // concat left's list to x's to replenish x
    x->ckey = x->left->ckey;

    // if left was a leaf, it can't be repaired, so destroy it
    if(leaf(x->left)) {
      free(x->left);
      x->left = NULL;
    } else {
      sift(x->left);
    }
  } // Repeat as necessary until x is repaired or until x is a leaf and no more repairs are possible
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
movl 0x2c(%rbx), %eax
cmpl 0x28(%rbx), %eax
jge 0x1c35
movq (%rbx), %rdx
movq 0x8(%rbx), %rcx
testq %rdx, %rdx
je 0x1bc4
testq %rcx, %rcx
je 0x1bbf
movl 0x20(%rdx), %esi
cmpl 0x20(%rcx), %esi
jg 0x1bc9
movq %rdx, %rcx
jmp 0x1bd0
testq %rcx, %rcx
je 0x1c35
movq %rcx, (%rbx)
movq %rdx, 0x8(%rbx)
movq 0x10(%rcx), %rdx
testq %rdx, %rdx
je 0x1c3d
movq 0x18(%rbx), %rsi
leaq 0x8(%rsi), %rdi
testq %rsi, %rsi
cmoveq %r14, %rdi
movq %rdx, (%rdi)
movq 0x18(%rcx), %rdx
movq %rdx, 0x18(%rbx)
addl 0x2c(%rcx), %eax
movl %eax, 0x2c(%rbx)
andl $0x0, 0x2c(%rcx)
leaq 0x10(%rcx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq (%rbx), %rdi
movl 0x20(%rdi), %eax
movl %eax, 0x20(%rbx)
cmpq $0x0, (%rdi)
jne 0x1c1d
cmpq $0x0, 0x8(%rdi)
je 0x1c27
callq 0x1b8f
jmp 0x1b9a
callq 0x1030
andq $0x0, (%rbx)
jmp 0x1b9a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x796(%rip), %rdi       # 0x23da
leaq 0x76b(%rip), %rsi       # 0x23b6
leaq 0x79b(%rip), %rcx       # 0x23ed
movl $0xf8, %edx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/softheap.c
// Function: update_suffix_min
static void update_suffix_min(tree *T) {
  while(T != NULL) {
    if(T->next == NULL || T->root->ckey <= T->next->sufmin->root->ckey) T->sufmin = T;
    else T->sufmin = T->next->sufmin;
    T = T->prev;
  }
}

// Assembly:
testq %rdi, %rdi
je 0x1c8c
movq 0x8(%rdi), %rcx
movq %rdi, %rax
testq %rcx, %rcx
je 0x1c83
movq 0x18(%rdi), %rax
movl 0x20(%rax), %edx
movq 0x10(%rcx), %rax
movq 0x18(%rax), %rcx
cmpl 0x20(%rcx), %edx
cmovleq %rdi, %rax
movq %rax, 0x10(%rdi)
movq (%rdi), %rdi
jmp 0x1c5c
retq
// File: /workspace/github_c_makefile_star2_O2/cirocosta[P]stress/src/./common.h
// Function: stress_wait_until_signalized
void
stress_wait_until_signalized()
{
	struct sigaction action;
	memset(&action, 0, sizeof(struct sigaction));
	action.sa_handler = stress_handle_sigint;
	sigaction(SIGINT, &action, NULL);

	printf("[%d] Waiting for SIGINT\n", getpid());
	sleep(36000);
}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
leaq 0x10(%rsp), %rbx
movl $0x90, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10f0
leaq -0x33(%rip), %rax       # 0x15ee
movq %rax, -0x8(%rbx)
pushq $0x2
popq %rdi
leaq 0x8(%rsp), %rsi
xorl %edx, %edx
callq 0x1080
callq 0x10b0
leaq 0xab4(%rip), %rdi       # 0x20f4
movl %eax, %esi
xorl %eax, %eax
callq 0x10e0
movl $0x8ca0, %edi           # imm = 0x8CA0
callq 0x11c0
addq $0xa0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/cirocosta[P]stress/src/./common.h
// Function: stress_write_n
ssize_t
stress_write_n(int fd, const void* vptr, size_t n)
{
	size_t nleft;
	ssize_t nwritten;
	const char* ptr;

	ptr = vptr;
	nleft = n;

	while (nleft > 0) {
		nwritten = write(fd, ptr, nleft);
		if (nwritten < 0) {
			if (errno == EINTR) {
				nwritten = 0;
				break;
			}

			return nwritten;
		}

		nleft -= nwritten;
		ptr += nwritten;
	}

	return n - nleft;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movl %edi, %ebp
movq %rdx, %r14
testq %r14, %r14
je 0x169b
movl %ebp, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x10a0
movq %rax, %r12
testq %rax, %rax
js 0x1691
subq %r12, %r14
addq %r12, %r15
jmp 0x166f
callq 0x1040
cmpl $0x4, (%rax)
jne 0x16a1
subq %r14, %rbx
movq %rbx, %r12
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cirocosta[P]stress/src/./common.h
// Function: stress_read_n
ssize_t
stress_read_n(int fd, void* vptr, size_t n)
{
	size_t nleft;
	ssize_t nread;
	char* ptr;

	ptr = vptr;
	nleft = n;

	while (nleft > 0) {
		nread = read(fd, ptr, nleft);
		if (nread < 0) {
			if (errno == EINTR) {
				nread = 0;
				break;
			}

			return nread;
		}

		nleft -= nread;
		ptr += nread;
	}

	return n - nleft;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movl %edi, %ebp
movq %rdx, %r14
testq %r14, %r14
je 0x16ec
movl %ebp, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1110
movq %rax, %r12
testq %rax, %rax
js 0x16e2
subq %r12, %r14
addq %r12, %r15
jmp 0x16c0
callq 0x1040
cmpl $0x4, (%rax)
jne 0x16f2
subq %r14, %rbx
movq %rbx, %r12
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq