LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/../core/bs.h
// Function: bs_read_ue(bs_s*, char const*)
static inline int
bs_read_ue(bs_t *s, const char str[]) {
    int i = 0;

    while (_bs_read1(s) == 0 && s->p < s->p_end && i < 32)
    {
        i++;
    }
    int ret =( (1 << i) - 1 + _bs_read(s, i));
    myPrintf("bs_read_ue %d %s\n", ret, str);
    return ret;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq %r14, %rdi
callq 0xa8f1
testl %eax, %eax
jne 0xa6ed
movq 0x8(%r14), %rax
cmpq 0x10(%r14), %rax
jae 0xa6ed
cmpl $0x1f, %r15d
ja 0xa6ed
incl %r15d
jmp 0xa6cc
pushq $-0x1
popq %r12
movl %r15d, %ecx
shll %cl, %r12d
notl %r12d
movq %r14, %rdi
movl %r15d, %esi
callq 0xa928
movl %eax, %r14d
addl %r12d, %r14d
leaq 0x132e4(%rip), %rdi     # 0x1d9f6
movl %r14d, %esi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x39ba
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/../core/bs.h
// Function: bs_read(bs_s*, int, char const*)
static inline uint32_t
bs_read(bs_t *s, int i_count, const char str[]) {
    static uint32_t i_mask[33] = {0x00,
                                  0x01, 0x03, 0x07, 0x0f,
                                  0x1f, 0x3f, 0x7f, 0xff,
                                  0x1ff, 0x3ff, 0x7ff, 0xfff,
                                  0x1fff, 0x3fff, 0x7fff, 0xffff,
                                  0x1ffff, 0x3ffff, 0x7ffff, 0xfffff,
                                  0x1fffff, 0x3fffff, 0x7fffff, 0xffffff,
                                  0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff,
                                  0x1fffffff, 0x3fffffff, 0x7fffffff, 0xffffffff};
    int i_shr;
    uint32_t i_result = 0;

    while (i_count > 0)
    {
        if (s->p >= s->p_end)
        {
            break;
        }

        if ((i_shr = s->i_left - i_count) >= 0)
        {
            /* more in the buffer than requested */
            i_result |= (*s->p >> i_shr) & i_mask[i_count];
            s->i_left -= i_count;
            if (s->i_left == 0)
            {
                s->p++;
                s->i_left = 8;
            }
             myPrintf("bs_read %d, %u, %s \n", i_count, i_result, str);
            return ( i_result);
        }
        else
        {
            /* less in the buffer than requested */
            i_result |= (*s->p & i_mask[s->i_left]) << -i_shr;
            i_count -= s->i_left;
            s->p++;
            s->i_left = 8;
        }
    }
    myPrintf("bs_read %d, %u, %s\n", i_count, i_result, str);
    return ( i_result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rax
xorl %ebx, %ebx
leaq 0x12ef9(%rip), %rdx     # 0x1d670
testl %esi, %esi
jle 0xa7b3
movq 0x8(%rdi), %r8
cmpq 0x10(%rdi), %r8
jae 0xa7b3
movslq 0x18(%rdi), %r9
movl %r9d, %ecx
subl %esi, %ecx
movzbl (%r8), %r14d
jns 0xa7cb
andl (%rdx,%r9,4), %r14d
negb %cl
shll %cl, %r14d
orl %r14d, %ebx
subl %r9d, %esi
incq %r8
movq %r8, 0x8(%rdi)
movl $0x8, 0x18(%rdi)
jmp 0xa777
leaq 0x1326a(%rip), %rdi     # 0x1da24
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x39ba
movl %ebx, %r14d
jmp 0xa802
shrl %cl, %r14d
movl %esi, %r10d
andl (%rdx,%r10,4), %r14d
orl %ebx, %r14d
movl %ecx, 0x18(%rdi)
cmpl %esi, %r9d
jne 0xa7ee
incq %r8
movq %r8, 0x8(%rdi)
movl $0x8, 0x18(%rdi)
leaq 0x1321a(%rip), %rdi     # 0x1da0f
movl %r14d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x39ba
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/../core/bs.h
// Function: bs_read1(bs_s*, char const*)
static inline uint32_t
bs_read1(bs_t *s, const char str[]) {

    if (s->p < s->p_end)
    {
        unsigned int i_result;

        s->i_left--;
        i_result = (*s->p >> s->i_left)&0x01;
        if (s->i_left == 0)
        {
            s->p++;
            s->i_left = 8;
        }
        

        myPrintf("bs_read1 %u %s\n", i_result, str);
    
        return i_result;
    }
    myPrintf("bs_read1 %u %s\n", 0,str);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rdx
movq 0x8(%rdi), %rax
xorl %ebx, %ebx
cmpq 0x10(%rdi), %rax
jae 0xa844
movl 0x18(%rdi), %ecx
decl %ecx
movl %ecx, 0x18(%rdi)
movzbl (%rax), %esi
xorl %ebx, %ebx
btl %ecx, %esi
setb %bl
testl %ecx, %ecx
jne 0xa844
incq %rax
movq %rax, 0x8(%rdi)
movl $0x8, 0x18(%rdi)
leaq 0x131ed(%rip), %rdi     # 0x1da38
movl %ebx, %esi
xorl %eax, %eax
callq 0x39ba
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/../core/bs.h
// Function: bs_read_se(bs_s*, char const*)
static inline int
bs_read_se(bs_t *s, const char str[]) {
    int val = _bs_read_ue(s);
    int ret = val & 0x01 ? (val + 1) / 2 : -(val / 2);
    myPrintf("bs_read_se %d %s \n", ret,str);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq %r14, %rdi
callq 0xa8f1
testl %eax, %eax
jne 0xa895
movq 0x8(%r14), %rax
cmpq 0x10(%r14), %rax
jae 0xa895
cmpl $0x1f, %r15d
ja 0xa895
incl %r15d
jmp 0xa874
pushq $-0x1
popq %r12
movl %r15d, %ecx
shll %cl, %r12d
movl %r12d, %r13d
notl %r13d
movq %r14, %rdi
movl %r15d, %esi
callq 0xa928
movl %eax, %r14d
addl %eax, %r13d
subl %r12d, %r14d
sarl %r14d
movl %r13d, %eax
sarl %eax
negl %eax
testb $0x1, %r13b
cmovel %eax, %r14d
leaq 0x13176(%rip), %rdi     # 0x1da48
movl %r14d, %esi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x39ba
movl %r14d, %eax
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/decoder/../core/bs.h
// Function: bs_read1(bs_s*)
static inline uint32_t
_bs_read1(bs_t *s) {

    if (s->p < s->p_end)
    {
        unsigned int i_result;

        s->i_left--;
        i_result = (*s->p >> s->i_left)&0x01;
        if (s->i_left == 0)
        {
            s->p++;
            s->i_left = 8;
        }
        

    
        return i_result;
    }
    return 0;
}

// Assembly:
movq 0x8(%rdi), %rcx
xorl %eax, %eax
cmpq 0x10(%rdi), %rcx
jae 0xa927
pushq %rbp
movq %rsp, %rbp
movl 0x18(%rdi), %edx
decl %edx
movl %edx, 0x18(%rdi)
movzbl (%rcx), %esi
xorl %eax, %eax
btl %edx, %esi
setb %al
testl %edx, %edx
jne 0xa926
incq %rcx
movq %rcx, 0x8(%rdi)
movl $0x8, 0x18(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/macroblock.c
// Function: x264_mb_partition_ref_set(x264_macroblock_t*, int, int, int)
void x264_mb_partition_ref_set(x264_macroblock_t *mb, int i_list, int i_part, int i_ref) {LOG_CALL;
    int x, y;
    int w, h;
    int dx, dy;

    x264_mb_partition_getxy(mb, i_part, 0, &x, &y);
    if (mb->i_partition == D_16x16)
    {
        w = 4;
        h = 4;
    } else if (mb->i_partition == D_16x8)
    {
        w = 4;
        h = 2;
    } else if (mb->i_partition == D_8x16)
    {
        w = 2;
        h = 4;
    } else
    {
        /* D_8x8 */
        w = 2;
        h = 2;
    }

    for (dx = 0; dx < w; dx++)
    {
        for (dy = 0; dy < h; dy++)
        {
            mb->partition[x + dx][y + dy].i_ref[i_list] = i_ref;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebx
movl %edx, %r12d
movl %esi, %r15d
movq %rdi, %r14
leaq 0x107fb(%rip), %rdi     # 0x1b1b4
leaq 0x137ac(%rip), %rsi     # 0x1e16c
leaq 0x137ba(%rip), %rdx     # 0x1e181
xorl %eax, %eax
callq 0x39ba
leaq -0x28(%rbp), %rcx
leaq -0x24(%rbp), %r8
movq %r14, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0xaa67
movl 0x1c(%r14), %eax
addl $-0xe, %eax
cmpl $0x2, %eax
ja 0xaa09
movl %eax, %ecx
leaq 0x13688(%rip), %rax     # 0x1e080
movq (%rax,%rcx,8), %rax
leaq 0x13695(%rip), %rdx     # 0x1e098
movq (%rdx,%rcx,8), %rcx
jmp 0xaa0f
pushq $0x2
popq %rax
movq %rax, %rcx
movslq -0x28(%rbp), %rdx
movslq -0x24(%rbp), %rsi
movslq %r15d, %rdi
imulq $0xa0, %rdx, %rdx
imulq $0x28, %rsi, %rsi
addq %rdx, %rsi
leaq (%rsi,%rdi,4), %rdx
addq %r14, %rdx
addq $0x30, %rdx
xorl %esi, %esi
cmpq %rax, %rsi
je 0xaa5a
movq %rdx, %rdi
movq %rcx, %r8
subq $0x1, %r8
jb 0xaa4e
movl %ebx, (%rdi)
addq $0x28, %rdi
jmp 0xaa40
incq %rsi
addq $0xa0, %rdx
jmp 0xaa35
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/macroblock.c
// Function: x264_mb_partition_mv_set(x264_macroblock_t*, int, int, int, int*)
void x264_mb_partition_mv_set(x264_macroblock_t *mb, int i_list, int i_part, int i_sub, int mv[2]) {LOG_CALL;
    int x, y;
    int w, h;
    int dx, dy;

    x264_mb_partition_getxy(mb, i_part, i_sub, &x, &y);
    x264_mb_partition_size(mb, i_part, i_sub, &w, &h);

    for (dx = 0; dx < w; dx++)
    {
        for (dy = 0; dy < h; dy++)
        {
            mb->partition[x + dx][y + dy].mv[i_list][0] = mv[0];
            mb->partition[x + dx][y + dy].mv[i_list][1] = mv[1];
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %r13d
movl %edx, %r12d
movl %esi, %r15d
movq %rdi, %r14
leaq 0x10687(%rip), %rdi     # 0x1b1b4
leaq 0x13638(%rip), %rsi     # 0x1e16c
leaq 0x13660(%rip), %rdx     # 0x1e19b
xorl %eax, %eax
callq 0x39ba
leaq -0x30(%rbp), %rcx
leaq -0x2c(%rbp), %r8
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0xaa67
movl 0x1c(%r14), %ecx
cmpl $0xd, %ecx
je 0xab7b
pushq $0x4
popq %rax
cmpl $0xf, %ecx
je 0xab76
cmpl $0xe, %ecx
jne 0xaba1
movq %rax, %rcx
pushq $0x2
popq %rax
jmp 0xabac
pushq $0x2
popq %rcx
jmp 0xabac
movslq %r12d, %rax
movl 0x20(%r14,%rax,4), %eax
cmpq $0xa, %rax
ja 0xaba6
leaq 0x13520(%rip), %rcx     # 0x1e0b0
movq (%rcx,%rax,8), %rcx
leaq 0x1356d(%rip), %rdx     # 0x1e108
movq (%rdx,%rax,8), %rax
jmp 0xabac
movq %rax, %rcx
jmp 0xabac
pushq $0x2
popq %rcx
movq %rcx, %rax
movslq -0x30(%rbp), %rdx
movslq -0x2c(%rbp), %rsi
movslq %r15d, %rdi
imulq $0xa0, %rdx, %rdx
imulq $0x28, %rsi, %rsi
addq %rdx, %rsi
leaq (%rsi,%rdi,8), %rdx
addq %r14, %rdx
addq $0x3c, %rdx
xorl %esi, %esi
cmpq %rcx, %rsi
je 0xac03
movq %rdx, %rdi
movq %rax, %r8
subq $0x1, %r8
jb 0xabf7
movl (%rbx), %r9d
movl %r9d, -0x4(%rdi)
movl 0x4(%rbx), %r9d
movl %r9d, (%rdi)
addq $0x28, %rdi
jmp 0xabdd
incq %rsi
addq $0xa0, %rdx
jmp 0xabd2
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/decoder/../core/bs.h
// Function: bs_read_te(bs_s*, int, char const*)
static inline int
bs_read_te(bs_t *s, int x, const char str[]) {LOG_CALL;
    if (x == 1)
    {
        return 1 - _bs_read1(s);
    }
    else if (x > 1)
    {
        return _bs_read_ue(s);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
leaq 0xfc3d(%rip), %rdi      # 0x1b1b4
leaq 0x1228a(%rip), %rsi     # 0x1d808
leaq 0x12d94(%rip), %rdx     # 0x1e319
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x39ba
cmpl $0x1, %r15d
jne 0xb5a6
movq %rbx, %rdi
callq 0xc2b1
movl %eax, %r14d
xorl $0x1, %r14d
jmp 0xb5ba
jle 0xb5ba
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xc356
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/macroblock.c
// Function: array_zero_set(int*, int)
static inline void array_zero_set(int *l, int i_count) {LOG_CALL;
    int i;

    for (i = 0; i < i_count; i++)
    {
        l[i] = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0xf7e6(%rip), %rdi      # 0x1b1b4
leaq 0x12797(%rip), %rsi     # 0x1e16c
leaq 0x129bc(%rip), %rdx     # 0x1e398
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x39ba
testl %ebx, %ebx
cmovlel %r15d, %ebx
cmpq %r15, %rbx
je 0xb9fb
andl $0x0, (%r14,%r15,4)
incq %r15
jmp 0xb9ec
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/macroblock.c
// Function: unscan_zigzag_4x4full(short (*) [4], int*)
static inline void unscan_zigzag_4x4full(int16_t dct[4][4], int level[16]) {LOG_CALL;
    int i;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xf100(%rip), %rdi      # 0x1b1b4
leaq 0x120b1(%rip), %rsi     # 0x1e16c
leaq 0x1231c(%rip), %rdx     # 0x1e3de
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x39ba
leaq 0x11eed(%rip), %rax     # 0x1dfc0
leaq 0x11f26(%rip), %rcx     # 0x1e000
cmpq $0x40, %r15
je 0xc0fb
movzwl (%rbx,%r15), %edx
movslq (%r15,%rax), %rsi
movslq (%r15,%rcx), %rdi
leaq (%r14,%rsi,8), %rsi
movw %dx, (%rsi,%rdi,2)
addq $0x4, %r15
jmp 0xc0da
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/macroblock.c
// Function: unscan_zigzag_4x4(short (*) [4], int*)
static inline void unscan_zigzag_4x4(int16_t dct[4][4], int level[15]) {LOG_CALL;
    int i;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xf097(%rip), %rdi      # 0x1b1b4
leaq 0x12048(%rip), %rsi     # 0x1e16c
leaq 0x122c9(%rip), %rdx     # 0x1e3f4
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x39ba
leaq 0x11e84(%rip), %rax     # 0x1dfc0
leaq 0x11ebd(%rip), %rcx     # 0x1e000
cmpq $0xf, %r15
je 0xc165
movzwl (%rbx,%r15,4), %edx
movslq 0x4(%rax,%r15,4), %rsi
movslq 0x4(%rcx,%r15,4), %rdi
leaq (%r14,%rsi,8), %rsi
movw %dx, (%rsi,%rdi,2)
incq %r15
jmp 0xc143
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/macroblock.c
// Function: x264_macroblock_decode_skip(x264_t*, x264_macroblock_t*)
void x264_macroblock_decode_skip(x264_t *h, x264_macroblock_t *mb) {LOG_CALL;
    int i;
    int x, y;
    int mv[2];

    /* decode it as a 16x16 with no luma/chroma */
    mb->i_type = P_L0;
    mb->i_partition = D_16x16;
    mb->i_cbp_luma = 0;
    mb->i_cbp_chroma = 0;
    for (i = 0; i < 16 + 8; i++)
    {
        mb->block[i].i_non_zero_count = 0;
    }
    for (i = 0; i < 16; i++)
    {
        array_zero_set(mb->block[i].luma4x4, 16);
    }
    array_zero_set(mb->chroma_dc[0], 4);
    array_zero_set(mb->chroma_dc[1], 4);
    for (i = 0; i < 8; i++)
    {
        array_zero_set(mb->block[16 + i].residual_ac, 15);
    }

    /* set ref0 */
    for (x = 0; x < 4; x++)
    {
        for (y = 0; y < 4; y++)
        {
            mb->partition[x][y].i_ref[0] = 0;
        }
    }
    /* get mv */
    x264_mb_predict_mv_pskip(mb, mv);

    x264_mb_partition_mv_set(mb, 0, 0, 0, mv);

    /* Motion compensation */
    x264_mb_mc(h, mb);

    mb->i_type = P_SKIP;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xf028(%rip), %rdi      # 0x1b1b4
leaq 0x11fd9(%rip), %rsi     # 0x1e16c
leaq 0x12147(%rip), %rdx     # 0x1e2e1
xorl %eax, %eax
callq 0x39ba
movabsq $0x1000000003, %rax     # imm = 0x1000000003
movq %rax, 0x18(%rbx)
andq $0x0, 0x2b4(%rbx)
movl $0x328, %eax            # imm = 0x328
cmpq $0xf88, %rax            # imm = 0xF88
je 0xc1d0
andl $0x0, (%rbx,%rax)
addq $0x84, %rax
jmp 0xc1bc
movl $0x368, %r12d           # imm = 0x368
pushq $0x10
popq %r15
cmpq $0xba8, %r12            # imm = 0xBA8
je 0xc1f8
leaq (%rbx,%r12), %rdi
movl %r15d, %esi
callq 0xb9b8
addq $0x84, %r12
jmp 0xc1da
leaq 0x304(%rbx), %rdi
pushq $0x4
popq %r15
movl %r15d, %esi
callq 0xb9b8
leaq 0x314(%rbx), %rdi
movl %r15d, %esi
callq 0xb9b8
movl $0xb6c, %r12d           # imm = 0xB6C
pushq $0xf
popq %r15
cmpq $0xf8c, %r12            # imm = 0xF8C
je 0xc242
leaq (%rbx,%r12), %rdi
movl %r15d, %esi
callq 0xb9b8
addq $0x84, %r12
jmp 0xc224
xorl %eax, %eax
pushq $0x30
popq %rcx
movq %rbx, %rdx
cmpq $0x4, %rax
je 0xc272
movq %rcx, %rsi
cmpq $0xd0, %rsi
je 0xc266
andl $0x0, (%rdx,%rsi)
addq $0x28, %rsi
jmp 0xc253
incq %rax
addq $0xa0, %rdx
jmp 0xc24a
leaq -0x28(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5eca
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0xab09
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6011
movl $0x5, 0x18(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/../core/bs.h
// Function: bs_read_ue(bs_s*)
static inline int
_bs_read_ue(bs_t *s) {
    int i = 0;

    while (_bs_read1(s) == 0 && s->p < s->p_end && i < 32)
    {
        i++;
    }
    int ret =( (1 << i) - 1 + _bs_read(s, i));
    return ret;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0xc2b1
testl %eax, %eax
jne 0xc387
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
jae 0xc387
cmpl $0x1f, %r14d
ja 0xc387
incl %r14d
jmp 0xc366
pushq $-0x1
popq %r15
movl %r14d, %ecx
shll %cl, %r15d
notl %r15d
movq %rbx, %rdi
movl %r14d, %esi
callq 0xc2e8
addl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/macroblock.c
// Function: bs_read_vlc(bs_s*, x264_vlc_table_t*)
static int bs_read_vlc(bs_t *s, x264_vlc_table_t *table) {LOG_CALL;
    int i_nb_bits;
    int i_value = 0;
    int i_bits;
    int i_index;
    int i_level = 0;

    i_index = bs_show(s, table->i_lookup_bits);
    if (i_index >= table->i_lookup)
    {
        return ( -1);
    }
    i_value = table->lookup[i_index].i_value;
    i_bits = table->lookup[i_index].i_size;

    myPrintf( "bits=%d, value=%d", i_bits, i_value);
    
    while (i_bits < 0)
    {
        myPrintf( "bits=%d, value=%d", i_bits, i_value);
        
        i_level++;
        if (i_level > 5)
        {
            return ( -1); // FIXME what to do ?
        }
        bs_skip(s, table->i_lookup_bits);
        i_nb_bits = -i_bits;

        i_index = bs_show(s, i_nb_bits) + i_value;
        if (i_index >= table->i_lookup)
        {
            return ( -1);
        }
        i_value = table->lookup[i_index].i_value;
        i_bits = table->lookup[i_index].i_size;
    }
    bs_skip(s, i_bits);

    return ( i_value);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xedec(%rip), %rdi      # 0x1b1b4
leaq 0x11d9d(%rip), %rsi     # 0x1e16c
leaq 0x11f8b(%rip), %rdx     # 0x1e361
xorl %eax, %eax
callq 0x39ba
movl (%r14), %esi
movq %rbx, %rdi
callq 0xc492
pushq $-0x1
popq %r15
cmpl 0x4(%r14), %eax
jge 0xc480
movq 0x8(%r14), %rcx
cltq
movl (%rcx,%rax,8), %r15d
movl 0x4(%rcx,%rax,8), %r13d
leaq 0x11f61(%rip), %rdi     # 0x1e36d
movl %r13d, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x39ba
pushq $0x5
popq %r12
testl %r13d, %r13d
jns 0xc475
leaq 0x11f44(%rip), %rdi     # 0x1e36d
movl %r13d, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x39ba
subl $0x1, %r12d
jb 0xc46f
movl (%r14), %esi
movq %rbx, %rdi
callq 0xc4f0
negl %r13d
movq %rbx, %rdi
movl %r13d, %esi
callq 0xc492
addl %r15d, %eax
cmpl 0x4(%r14), %eax
jge 0xc46f
movq 0x8(%r14), %rcx
cltq
movl (%rcx,%rax,8), %r15d
movl 0x4(%rcx,%rax,8), %r13d
jmp 0xc41d
pushq $-0x1
popq %r15
jmp 0xc480
movq %rbx, %rdi
movl %r13d, %esi
callq 0xc4f0
movl %r15d, %eax
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/decoder/../core/bs.h
// Function: bs_show(bs_s*, int)
static inline uint32_t
bs_show(bs_t *s, int i_count) {LOG_CALL;
#if 0
    bs_t s_tmp = *s;
    return bs_read(&s_tmp, i_count);
#else
    if (s->p < s->p_end && i_count > 0)
    {
        uint32_t i_cache = ((s->p[0] << 24)+(s->p[1] << 16)+(s->p[2] << 8) + s->p[3]) << (8 - s->i_left);
        return ( i_cache >> (32 - i_count));
    }
    return 0;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %r15
leaq 0xed0b(%rip), %rdi      # 0x1b1b4
leaq 0x11358(%rip), %rsi     # 0x1d808
leaq 0x11ec8(%rip), %rdx     # 0x1e37f
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x39ba
testl %r14d, %r14d
jle 0xc4e3
movq 0x8(%r15), %rax
cmpq 0x10(%r15), %rax
jae 0xc4e3
movl (%rax), %ebx
bswapl %ebx
movb $0x8, %cl
subb 0x18(%r15), %cl
shll %cl, %ebx
negb %r14b
movl %r14d, %ecx
shrl %cl, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/../core/bs.h
// Function: bs_skip(bs_s*, int)
static inline void
bs_skip(bs_t *s, int i_count) {
    s->i_left -= i_count;

    while (s->i_left <= 0)
    {
        s->p++;
        s->i_left += 8;
    }
    
    myPrintf("bs_skip %d, %u \n", i_count, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x18(%rdi), %eax
subl %esi, %eax
testl %eax, %eax
jg 0xc506
incq 0x8(%rdi)
addl $0x8, %eax
jmp 0xc4f9
movl %eax, 0x18(%rdi)
leaq 0x11e77(%rip), %rdi     # 0x1e387
xorl %edx, %edx
xorl %eax, %eax
popq %rbp
jmp 0x39ba
nop
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/decoder/vlc.c
// Function: x264_vlc_table_lookup_new(vlc_t const*, int, int)
x264_vlc_table_t *x264_vlc_table_lookup_new( const vlc_t *vlc, int i_vlc, int i_lookup_bits )
{
    x264_vlc_table_t *table = (x264_vlc_table_t *)x264_aligned_alloc( sizeof( x264_vlc_table_t ) );

    table->i_lookup_bits = i_lookup_bits;
    table->i_lookup = 0;
    table->lookup   = NULL;

    vlc_table_create_part( table, vlc, i_lookup_bits, i_vlc, 0, 0 );

    return table;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
pushq $0x10
popq %rdi
callq 0x34d2
movq %rax, %r12
movl %ebx, (%rax)
andl $0x0, 0x4(%rax)
andq $0x0, 0x8(%rax)
movq %rax, %rdi
movq %r15, %rsi
movl %ebx, %edx
movl %r14d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xcfe3
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/../core/bs.h
// Function: bs_size_te(int, int)
static inline int
bs_size_te(int x, int val) {LOG_CALL;
    if (x == 1)
    {
        return 1;
    }
    else if (x > 1)
    {
        return bs_size_ue(val);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %r15d
leaq 0xcbc9(%rip), %rdi      # 0x1b1b4
leaq 0x10a2a(%rip), %rsi     # 0x1f01c
leaq 0x10a43(%rip), %rdx     # 0x1f03c
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x39ba
cmpl $0x1, %r15d
jne 0xe60f
pushq $0x1
popq %r14
jmp 0xe622
jle 0xe622
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xe55a
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/encoder.c
// Function: x264_nal_encode(unsigned char*, int*, int, x264_nal_t*)
int x264_nal_encode(uint8_t *p_data, int *pi_data, int b_annexeb, x264_nal_t *nal) {LOG_CALL;
    uint8_t *dst = p_data;
    uint8_t *src = nal->p_payload;
    uint8_t *end = &nal->p_payload[nal->i_payload];

    int i_count = 0;

    /* FIXME this code doesn't check overflow */

    if (b_annexeb)
    {
        /* long nal start code (we always use long ones)*/
        *dst++ = 0x00;
        *dst++ = 0x00;
        *dst++ = 0x00;
        *dst++ = 0x01;
    }

    /* nal header */
    *dst++ = (0x00 << 7) | (nal->i_ref_idc << 5) | nal->i_type;

    while (src < end)
    {
        if (i_count == 2 && *src <= 0x03)
        {
            *dst++ = 0x03;
            i_count = 0;
        }
        if (*src == 0)
        {
            i_count++;
        } else
        {
            i_count = 0;
        }
        *dst++ = *src++;
    }
    *pi_data = dst - (uint8_t*) p_data;

    return *pi_data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movl %edx, %r12d
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xc7fa(%rip), %rdi      # 0x1b1b4
leaq 0x106a7(%rip), %rsi     # 0x1f068
leaq 0x10746(%rip), %rdx     # 0x1f10e
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x39ba
movq 0x10(%r15), %rcx
movslq 0x8(%r15), %rdx
movq %r14, %rdi
testl %r12d, %r12d
je 0xe9ed
movl $0x1000000, (%r14)      # imm = 0x1000000
leaq 0x4(%r14), %rdi
movl (%r15), %eax
shll $0x5, %eax
orl 0x4(%r15), %eax
addq %rcx, %rdx
movb %al, (%rdi)
pushq $0x2
popq %rsi
xorl %r8d, %r8d
leaq 0x1(%rdi), %rax
cmpq %rdx, %rcx
jae 0xea43
movb (%rcx), %r9b
cmpl $0x2, %r8d
jne 0xea2e
movl %esi, %r8d
cmpb $0x3, %r9b
ja 0xea2e
movb $0x3, 0x1(%rdi)
addq $0x2, %rdi
movb (%rcx), %r9b
xorl %r8d, %r8d
movq %rdi, %rax
incl %r8d
testb %r9b, %r9b
cmovnel %r13d, %r8d
incq %rcx
movb %r9b, (%rax)
movq %rax, %rdi
jmp 0xea02
subl %r14d, %eax
movl %eax, (%rbx)
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/encoder.c
// Function: x264_encoder_headers(x264_t*, x264_nal_t**, int*)
int x264_encoder_headers(x264_t *h, x264_nal_t **pp_nal, int *pi_nal) {LOG_CALL;
    /* init bitstream context */
    h->i_nal = 0;
    bs_init(&h->bs, h->p_bitstream, h->i_bitstream);

    /* Put SPS and PPS */
    if (h->i_frame == 0)
    {
        /* generate sequence parameters */
        x264_nal_start(h, NAL_SPS, NAL_PRIORITY_HIGHEST);
        x264_sps_write(&h->bs, h->sps);
        x264_nal_end(h);

        /* generate picture parameters */
        x264_nal_start(h, NAL_PPS, NAL_PRIORITY_HIGHEST);
        x264_pps_write(&h->bs, h->pps);
        x264_nal_end(h);
    }
    /* now set output*/
    *pi_nal = h->i_nal;
    *pp_nal = &h->nal[0];

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xc73f(%rip), %rdi      # 0x1b1b4
leaq 0x105ec(%rip), %rsi     # 0x1f068
leaq 0x1069b(%rip), %rdx     # 0x1f11e
xorl %eax, %eax
callq 0x39ba
andl $0x0, 0x4(%r14)
leaq 0x60(%r14), %r12
movq 0x58(%r14), %rsi
movl 0x50(%r14), %edx
movq %r12, %rdi
callq 0xeb1a
cmpl $0x0, 0xc0(%r14)
jne 0xeafb
pushq $0x7
popq %rsi
pushq $0x3
popq %r13
movq %r14, %rdi
movl %r13d, %edx
callq 0xeb6c
movq 0x8ed8(%r14), %rsi
movq %r12, %rdi
callq 0x15a72
movq %r14, %rdi
callq 0xebe5
pushq $0x8
popq %rsi
movq %r14, %rdi
movl %r13d, %edx
callq 0xeb6c
movq 0x10dae0(%r14), %rsi
movq %r12, %rdi
callq 0x16170
movq %r14, %rdi
callq 0xebe5
movl 0x4(%r14), %eax
movl %eax, (%r15)
addq $0x8, %r14
movq %r14, (%rbx)
xorl %eax, %eax
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/../core/bs.h
// Function: bs_init(bs_s*, unsigned char*, int)
static inline void
bs_init(bs_t *s, uint8_t *p_data, int i_data) {LOG_CALL;
    s->p_start = p_data;
    s->p = p_data;
    s->p_end = s->p + i_data;
    s->i_left = 8;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0xc681(%rip), %rdi      # 0x1b1b4
leaq 0x104e2(%rip), %rsi     # 0x1f01c
leaq 0xecdc(%rip), %rdx      # 0x1d81d
xorl %eax, %eax
callq 0x39ba
movq %r14, (%r15)
movq %r14, 0x8(%r15)
movslq %ebx, %rax
addq %r14, %rax
movq %rax, 0x10(%r15)
movl $0x8, 0x18(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/encoder.c
// Function: x264_nal_start(x264_t*, int, int)
static void x264_nal_start(x264_t *h, int i_type, int i_ref_idc) {LOG_CALL;
    x264_nal_t *nal = &h->nal[h->i_nal];

    nal->i_ref_idc = i_ref_idc;
    nal->i_type = i_type;

    bs_align_0(&h->bs); /* not needed */

    nal->i_payload = 0;
    nal->p_payload = &h->p_bitstream[bs_pos(&h->bs) / 8];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
leaq 0xc62d(%rip), %rdi      # 0x1b1b4
leaq 0x104da(%rip), %rsi     # 0x1f068
leaq 0x106a1(%rip), %rdx     # 0x1f236
xorl %eax, %eax
callq 0x39ba
movslq 0x4(%rbx), %rax
imulq $0x18, %rax, %r12
movl %r14d, 0x8(%rbx,%r12)
movl %r15d, 0xc(%rbx,%r12)
leaq 0x60(%rbx), %r14
movq %r14, %rdi
callq 0x10201
andl $0x0, 0x10(%rbx,%r12)
movq 0x58(%rbx), %r15
movq %r14, %rdi
callq 0xfecf
pushq $0x8
popq %rcx
cltd
idivl %ecx
cltq
addq %r15, %rax
movq %rax, 0x18(%rbx,%r12)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/encoder.c
// Function: x264_nal_end(x264_t*)
static void x264_nal_end(x264_t *h) {LOG_CALL;
    x264_nal_t *nal = &h->nal[h->i_nal];

    bs_align_0(&h->bs); /* not needed */

    nal->i_payload = &h->p_bitstream[bs_pos(&h->bs) / 8] - nal->p_payload;

    h->i_nal++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0xc5ba(%rip), %rdi      # 0x1b1b4
leaq 0x10467(%rip), %rsi     # 0x1f068
leaq 0x1063d(%rip), %rdx     # 0x1f245
xorl %eax, %eax
callq 0x39ba
movslq 0x4(%rbx), %rax
imulq $0x18, %rax, %r15
leaq 0x60(%rbx), %r14
movq %r14, %rdi
callq 0x10201
movl 0x58(%rbx), %r12d
movq %r14, %rdi
callq 0xfecf
pushq $0x8
popq %rcx
cltd
idivl %ecx
addl %r12d, %eax
subl 0x18(%rbx,%r15), %eax
movl %eax, 0x10(%rbx,%r15)
incl 0x4(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/encoder.c
// Function: x264_encoder_frame_get(x264_frame_t**)
static x264_frame_t *x264_encoder_frame_get(x264_frame_t *buffer[X264_BFRAME_MAX]) {LOG_CALL;
    int i;
    x264_frame_t *frame = buffer[0];

    for (i = 0; i < X264_BFRAME_MAX - 1; i++)
    {
        buffer[i] = buffer[i + 1];
    }
    buffer[X264_BFRAME_MAX - 1] = NULL;

    return frame;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xb4be(%rip), %rdi      # 0x1b1b4
leaq 0xf36b(%rip), %rsi      # 0x1f068
leaq 0xf572(%rip), %rdx      # 0x1f276
xorl %eax, %eax
callq 0x39ba
movq (%rbx), %rax
pushq $0x1
popq %rcx
cmpq $0x10, %rcx
je 0xfd25
movq (%rbx,%rcx,8), %rdx
movq %rdx, -0x8(%rbx,%rcx,8)
incq %rcx
jmp 0xfd11
andq $0x0, 0x78(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/encoder.c
// Function: x264_encoder_frame_put(x264_frame_t**, x264_frame_t*)
static void x264_encoder_frame_put(x264_frame_t *buffer[X264_BFRAME_MAX], x264_frame_t *frame) {LOG_CALL;
    int i;

    /* put the frame in buffer */
    for (i = 0; buffer[i] != NULL; i++)
    {
        if (i >= X264_BFRAME_MAX)
        {
            fprintf(stderr, "not enough room\n");
            return;
        }
    }
    buffer[i] = frame;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xb46c(%rip), %rdi      # 0x1b1b4
leaq 0xf319(%rip), %rsi      # 0x1f068
leaq 0xf537(%rip), %rdx      # 0x1f28d
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x39ba
cmpq $0x0, (%r14,%r15,8)
je 0xfd96
incq %r15
cmpq $0x11, %r15
jne 0xfd60
movq 0x18259(%rip), %rax     # 0x27fd0
movq (%rax), %rcx
leaq 0xf523(%rip), %rdi      # 0x1f2a4
pushq $0x10
popq %rsi
pushq $0x1
popq %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21e0
movq %rbx, (%r14,%r15,8)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/encoder.c
// Function: x264_slice_header_init(x264_slice_header_t*, x264_param_t*, x264_sps_t*, x264_pps_t*, int, int, int)
static void x264_slice_header_init(x264_slice_header_t *sh, x264_param_t *param,
        x264_sps_t *sps, x264_pps_t *pps,
        int i_type, int i_idr_pic_id, int i_frame) {LOG_CALL;
    /* First we fill all field */
    sh->sps = sps;
    sh->pps = pps;

    sh->i_type = i_type;
    sh->i_first_mb = 0;
    sh->i_pps_id = pps->i_id;

    sh->i_frame_num = i_frame;

    sh->b_field_pic = 0; /* Not field support for now */
    sh->b_bottom_field = 1; /* not yet used */

    sh->i_idr_pic_id = i_idr_pic_id;

    /* poc stuff, fixed later */
    sh->i_poc_lsb = 0;
    sh->i_delta_poc_bottom = 0;
    sh->i_delta_poc[0] = 0;
    sh->i_delta_poc[1] = 0;

    sh->i_redundant_pic_cnt = 0;

    sh->b_direct_spatial_mv_pred = 0;

    sh->b_num_ref_idx_override = 0;
    sh->i_num_ref_idx_l0_active = 1;
    sh->i_num_ref_idx_l1_active = 1;

    sh->i_cabac_init_idc = param->i_cabac_init_idc;

    sh->i_qp_delta = 0;
    sh->b_sp_for_swidth = 0;
    sh->i_qs_delta = 0;

    if (param->b_deblocking_filter)
    {
        sh->i_disable_deblocking_filter_idc = 0;
    } else
    {
        sh->i_disable_deblocking_filter_idc = 1;
    }
    sh->i_alpha_c0_offset = 0;
    sh->i_beta_offset = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, -0x2c(%rbp)
movl %r8d, %r12d
movq %rcx, %r13
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xb3e7(%rip), %rdi      # 0x1b1b4
leaq 0xf294(%rip), %rsi      # 0x1f068
leaq 0xf4da(%rip), %rdx      # 0x1f2b5
xorl %eax, %eax
callq 0x39ba
movq %r15, (%rbx)
movq %r13, 0x8(%rbx)
movl %r12d, 0x10(%rbx)
andl $0x0, 0x14(%rbx)
movl (%r13), %eax
movl %eax, 0x18(%rbx)
movl 0x10(%rbp), %eax
movl %eax, 0x1c(%rbx)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x20(%rbx)
movl -0x2c(%rbp), %eax
movl %eax, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x2c(%rbx)
movups %xmm0, 0x38(%rbx)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x48(%rbx)
movl 0x30(%r14), %eax
movl %eax, 0x50(%rbx)
andq $0x0, 0x54(%rbx)
andl $0x0, 0x5c(%rbx)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %ecx, 0x28(%r14)
sete %al
movl %eax, 0x60(%rbx)
andq $0x0, 0x64(%rbx)
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/../core/bs.h
// Function: bs_write_ue(bs_s*, unsigned int, char const*)
static inline void
bs_write_ue(bs_t *s, unsigned int val, const char str[]) {
    myPrintf( "bs_write_ue %u %s\n", val, str);
    int i_size = 0;
    static const int i_size0_255[256] = {
                                         1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
                                         6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
                                         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                                         7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
                                         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
                                         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
                                         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
                                         8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
    };

    if (val == 0)
    {
        _bs_write(s, 1, 1);
    }
    else
    {
        unsigned int tmp = ++val;

        if (tmp >= 0x00010000)
        {
            i_size += 16;
            tmp >>= 16;
        }
        if (tmp >= 0x100)
        {
            i_size += 8;
            tmp >>= 8;
        }
        i_size += i_size0_255[tmp];

        _bs_write(s, 2 * i_size - 1, val);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leaq 0xf54e(%rip), %rdi      # 0x1f3be
xorl %eax, %eax
callq 0x39ba
testl %ebx, %ebx
je 0xfebe
incl %ebx
movl %ebx, %eax
shrl $0x10, %eax
xorl %ecx, %ecx
cmpl $0x10000, %ebx          # imm = 0x10000
setae %cl
cmovbl %ebx, %eax
shll $0x4, %ecx
leal 0x8(%rcx), %edx
movl %eax, %esi
shrl $0x8, %esi
cmpl $0x100, %eax            # imm = 0x100
cmovbl %ecx, %edx
cmovbl %eax, %esi
leaq 0xf563(%rip), %rax      # 0x1f410
addl (%rax,%rsi,4), %edx
leal -0x1(,%rdx,2), %esi
movq %r14, %rdi
movl %ebx, %edx
jmp 0xfec6
pushq $0x1
popq %rdx
movq %r14, %rdi
movl %edx, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x10242
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/../core/bs.h
// Function: bs_write(bs_s*, int, unsigned int, char const*)
static inline void
bs_write(bs_t *s, int i_count, uint32_t i_bits, const char str[]) {

    myPrintf( "bs_write %d , %u, %s\n",  i_count, i_bits, str);

    while (i_count > 0)
    {
        if (s->p >= s->p_end)
        {
            break;
        }

        i_count--;

        if ((i_bits >> i_count)&0x01)
        {
            *s->p |= 1 << (s->i_left - 1);
        }
        else
        {
            *s->p &= ~(1 << (s->i_left - 1));
        }
        s->i_left--;
        if (s->i_left == 0)
        {
            s->p++;
            s->i_left = 8;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
leaq 0xf4b6(%rip), %rdi      # 0x1f3d8
xorl %eax, %eax
callq 0x39ba
pushq $0x1
popq %rax
testl %r14d, %r14d
jle 0xff83
movq 0x8(%r15), %rdx
cmpq 0x10(%r15), %rdx
jae 0xff83
movb 0x18(%r15), %cl
decb %cl
movl %eax, %esi
shll %cl, %esi
leal -0x1(%r14), %ecx
movzbl %cl, %ecx
movb (%rdx), %dil
movl %esi, %r8d
notb %r8b
andb %dil, %r8b
orb %sil, %dil
btl %ecx, %ebx
movzbl %dil, %ecx
movzbl %r8b, %esi
cmovbl %ecx, %esi
movb %sil, (%rdx)
decl 0x18(%r15)
jne 0xff7e
incq 0x8(%r15)
movl $0x8, 0x18(%r15)
decl %r14d
jmp 0xff2c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/encoder.c
// Function: x264_psnr(unsigned char*, int, unsigned char*, int, int, int)
static float x264_psnr(uint8_t *pix1, int i_pix_stride, uint8_t *pix2, int i_pix2_stride, int i_width, int i_height) {LOG_CALL;
    int64_t i_sqe = 0;

    int x, y;

    for (y = 0; y < i_height; y++)
    {
        for (x = 0; x < i_width; x++)
        {
            int tmp;

            tmp = pix1[y * i_pix_stride + x] - pix2[y * i_pix2_stride + x];

            i_sqe += tmp * tmp;
        }
    }

    if (i_sqe == 0)
    {
        return -1.0;
    }
    return (float) (10.0 * log((double) 65025.0 * (double) i_height * (double) i_width / (double) i_sqe) / log(10.0));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movl %r8d, %r13d
movl %ecx, -0x30(%rbp)
movq %rdx, %r15
movl %esi, -0x2c(%rbp)
movq %rdi, %r12
leaq 0xb1ff(%rip), %rdi      # 0x1b1b4
leaq 0xf0ac(%rip), %rsi      # 0x1f068
leaq 0xf43c(%rip), %rdx      # 0x1f3ff
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x39ba
testl %r13d, %r13d
movl $0x0, %eax
cmovgl %r13d, %eax
movslq -0x30(%rbp), %rcx
movslq -0x2c(%rbp), %rsi
testl %ebx, %ebx
movl $0x0, %edi
cmovgl %ebx, %edi
xorl %edx, %edx
cmpq %rdi, %r14
je 0x1001e
xorl %r8d, %r8d
cmpq %r8, %rax
je 0x10013
movzbl (%r12,%r8), %r9d
movzbl (%r15,%r8), %r10d
subl %r10d, %r9d
imull %r9d, %r9d
addq %r9, %rdx
incq %r8
jmp 0xfff5
incq %r14
addq %rcx, %r15
addq %rsi, %r12
jmp 0xffed
testq %rdx, %rdx
je 0x1005c
cvtsi2sd %ebx, %xmm1
mulsd 0xf021(%rip), %xmm1     # 0x1f050
cvtsi2sd %r13d, %xmm0
mulsd %xmm1, %xmm0
cvtsi2sd %rdx, %xmm1
divsd %xmm1, %xmm0
callq 0x2090
mulsd 0xf00a(%rip), %xmm0     # 0x1f058
divsd 0xf00a(%rip), %xmm0     # 0x1f060
cvtsd2ss %xmm0, %xmm0
jmp 0x10064
movss 0xefe4(%rip), %xmm0     # 0x1f048
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/../core/bs.h
// Function: bs_write(bs_s*, int, unsigned int)
static inline void
_bs_write(bs_t *s, int i_count, uint32_t i_bits) {

    while (i_count > 0)
    {
        if (s->p >= s->p_end)
        {
            break;
        }

        i_count--;

        if ((i_bits >> i_count)&0x01)
        {
            *s->p |= 1 << (s->i_left - 1);
        }
        else
        {
            *s->p &= ~(1 << (s->i_left - 1));
        }
        s->i_left--;
        if (s->i_left == 0)
        {
            s->p++;
            s->i_left = 8;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x1, %eax
testl %esi, %esi
jle 0x1029f
movq 0x8(%rdi), %r8
cmpq 0x10(%rdi), %r8
jae 0x1029f
movb 0x18(%rdi), %cl
decb %cl
movl %eax, %r9d
shll %cl, %r9d
leal -0x1(%rsi), %ecx
movzbl %cl, %ecx
movb (%r8), %r10b
movl %r9d, %r11d
notb %r11b
andb %r10b, %r11b
orb %r9b, %r10b
btl %ecx, %edx
movzbl %r10b, %ecx
movzbl %r11b, %r9d
cmovbl %ecx, %r9d
movb %r9b, (%r8)
decl 0x18(%rdi)
jne 0x1029b
incq 0x8(%rdi)
movl $0x8, 0x18(%rdi)
decl %esi
jmp 0x1024b
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/../core/bs.h
// Function: bs_write1(bs_s*, unsigned int, char const*)
static inline void
bs_write1(bs_t *s, uint32_t i_bits, const char str[]) {

    myPrintf( "bs_write1 %d , %u ,%s\n",  1, i_bits, str);

    if (s->p < s->p_end)
    {
        s->i_left--;

        if (i_bits & 0x01)
        {
            *s->p |= 1 << s->i_left;
        }
        else
        {
            *s->p &= ~(1 << s->i_left);
        }
        if (s->i_left == 0)
        {
            s->p++;
            s->i_left = 8;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leaq 0xd0e5(%rip), %rdi      # 0x1f39c
leaq 0xf76c(%rip), %rcx      # 0x21a2a
pushq $0x1
popq %r15
movl %r15d, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x39ba
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
jae 0x12312
movl 0x18(%rbx), %ecx
decl %ecx
shll %cl, %r15d
movl %ecx, 0x18(%rbx)
movb (%rax), %cl
movl %ecx, %edx
orb %r15b, %dl
notb %r15b
andb %cl, %r15b
testb $0x1, %r14b
movzbl %dl, %ecx
movzbl %r15b, %edx
cmovnel %ecx, %edx
movb %dl, (%rax)
cmpl $0x0, 0x18(%rbx)
jne 0x12312
incq 0x8(%rbx)
movl $0x8, 0x18(%rbx)
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_partition_mvd(x264_macroblock_t*, int, int, int, int*)
void x264_mb_partition_mvd(x264_macroblock_t *mb, int i_list, int i_part, int i_sub, int mvd[2]) {LOG_CALL;
    int mvp[2];

    int x, y;
    int w, h;
    int dx, dy;

    x264_mb_partition_getxy(mb, i_part, i_sub, &x, &y);
    x264_mb_partition_size(mb, i_part, i_sub, &w, &h);
    x264_mb_predict_mv(mb, i_list, i_part, i_sub, mvp);

    mvd[0] = mb->partition[x][y].mv[i_list][0] - mvp[0];
    mvd[1] = mb->partition[x][y].mv[i_list][1] - mvp[1];

    for (dx = 0; dx < w; dx++)
    {
        for (dy = 0; dy < h; dy++)
        {
            mb->partition[x + dx][y + dy].mvd[i_list][0] = mvd[0];
            mb->partition[x + dx][y + dy].mvd[i_list][1] = mvd[1];
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, -0x34(%rbp)
movq %rdi, %r14
leaq 0xaded(%rip), %rdi      # 0x1b1b4
leaq 0x1159a(%rip), %rsi     # 0x21968
leaq 0x115a8(%rip), %rdx     # 0x2197d
xorl %eax, %eax
callq 0x39ba
leaq -0x3c(%rbp), %rcx
leaq -0x38(%rbp), %r8
movq %r14, %rdi
movl %r12d, -0x2c(%rbp)
movl %r12d, %esi
movl %r15d, -0x30(%rbp)
movl %r15d, %edx
callq 0x104ec
movl 0x1c(%r14), %eax
cmpl $0xd, %eax
je 0x10426
pushq $0x4
popq %r13
cmpl $0xf, %eax
je 0x1041d
cmpl $0xe, %eax
movl -0x2c(%rbp), %edx
jne 0x1044f
movq %r13, %r12
pushq $0x2
popq %r13
jmp 0x1045b
pushq $0x2
popq %r12
movl -0x2c(%rbp), %edx
jmp 0x1045b
movl -0x2c(%rbp), %edx
movslq %edx, %rax
movl 0x20(%r14,%rax,4), %eax
cmpq $0xa, %rax
ja 0x10454
leaq 0x1147a(%rip), %rcx     # 0x218b8
movq (%rcx,%rax,8), %r12
leaq 0x114c7(%rip), %rcx     # 0x21910
movq (%rcx,%rax,8), %r13
jmp 0x1045b
movq %r13, %r12
jmp 0x1045b
pushq $0x2
popq %r12
movq %r12, %r13
leaq -0x44(%rbp), %r8
movq %r14, %rdi
movl -0x34(%rbp), %r15d
movl %r15d, %esi
movl -0x30(%rbp), %ecx
callq 0x5acc
movslq -0x3c(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
imulq $0xa0, %rax, %rax
addq %rcx, %rax
leaq (%r14,%rax), %rcx
movslq %r15d, %rdx
movl 0x38(%rcx,%rdx,8), %esi
leaq -0x44(%rbp), %rdi
subl (%rdi), %esi
movl %esi, (%rbx)
movl 0x3c(%rcx,%rdx,8), %ecx
subl 0x4(%rdi), %ecx
movl %ecx, 0x4(%rbx)
leaq (%rax,%rdx,8), %rax
addq %r14, %rax
addq $0x4c, %rax
xorl %ecx, %ecx
cmpq %r12, %rcx
je 0x104dd
movq %rax, %rdx
movq %r13, %rsi
subq $0x1, %rsi
jb 0x104d2
movl (%rbx), %edi
movl %edi, -0x4(%rdx)
movl 0x4(%rbx), %edi
movl %edi, (%rdx)
addq $0x28, %rdx
jmp 0x104bc
incq %rcx
addq $0xa0, %rax
jmp 0x104b1
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/macroblock.c
// Function: x264_mb_encode_i4x4(x264_t*, x264_macroblock_t*, int, int)
void x264_mb_encode_i4x4(x264_t *h, x264_macroblock_t *mb, int idx, int i_qscale) {LOG_CALL;
    x264_mb_context_t *ctx = mb->context;

    uint8_t *p_src = ctx->p_img[0] + 4 * block_idx_x[idx] + 4 * block_idx_y[idx] * ctx->i_img[0];
    int i_src = ctx->i_img[0];
    uint8_t *p_dst = ctx->p_fdec[0] + 4 * block_idx_x[idx] + 4 * block_idx_y[idx] * ctx->i_fdec[0];
    int i_dst = ctx->i_fdec[0];

    int16_t luma[4][4];
    int16_t dct4x4[4][4];

    /* we calculate diff */
    h->pixf.sub4x4(luma, p_src, i_src, p_dst, i_dst);

    /* calculate dct coeffs */
    h->dctf.dct4x4(dct4x4, luma);
    quant_4x4(dct4x4, i_qscale, 1);

    scan_zigzag_4x4full(mb->block[idx].luma4x4, dct4x4);

    /* output samples to fdec */
    x264_mb_dequant_4x4(dct4x4, i_qscale);
    h->dctf.idct4x4(luma, dct4x4);

    /* put pixel to fdec */
    h->pixf.add4x4(p_dst, i_dst, luma);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %ecx, -0x2c(%rbp)
movl %edx, %r14d
movq %rsi, %r15
movq %rsi, -0x40(%rbp)
movq %rdi, %rbx
leaq 0xabfe(%rip), %rdi      # 0x1b1b4
leaq 0x113ab(%rip), %rsi     # 0x21968
leaq 0x113cf(%rip), %rdx     # 0x21993
xorl %eax, %eax
callq 0x39ba
movq 0x10(%r15), %rax
movslq %r14d, %rsi
movq %rsi, -0x38(%rbp)
leaq 0xded3(%rip), %rcx      # 0x1e4b0
movzbl (%rsi,%rcx), %ecx
shll $0x2, %ecx
movq 0x18(%rax), %rdi
addq %rcx, %rdi
leaq 0xdeae(%rip), %rdx      # 0x1e4a0
movzbl (%rsi,%rdx), %r8d
shll $0x2, %r8d
movslq 0x30(%rax), %rdx
movq %rdx, %rsi
imulq %r8, %rsi
addq %rdi, %rsi
addq 0x40(%rax), %rcx
movl 0x58(%rax), %r12d
imull %r12d, %r8d
movslq %r8d, %r13
addq %rcx, %r13
leaq -0x60(%rbp), %r14
movq %r14, %rdi
movq %r13, %rcx
movl %r12d, %r8d
callq *0x10f350(%rbx)
leaq -0x80(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq *0x10f398(%rbx)
movq %rbx, %r14
pushq $0x1
popq %rdx
movq %r15, %rdi
movl -0x2c(%rbp), %ebx
movl %ebx, %esi
callq 0x106aa
imulq $0x84, -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
leaq (%rcx,%rax), %rdi
addq $0x368, %rdi            # imm = 0x368
movq %r15, %rsi
callq 0x10767
movq %r15, %rdi
movl %ebx, %esi
callq 0x5735
leaq -0x60(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq *0x10f3a8(%r14)
movq %r13, %rdi
movl %r12d, %esi
movq %rbx, %rdx
callq *0x10f368(%r14)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq