LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_scaling_matrices_4x4(ymn::istream<0>&, ymn::h264::scaling_matrices&)
void h264_parser::parse_scaling_matrices_4x4(istream_be& s, h264::scaling_matrices& sm)
{
    do {
        parse_scaling_list_4x4(s, sm.scaling_matrices_4x4, SL_4x4_INTRA_Y);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        parse_scaling_list_4x4(s, sm.scaling_matrices_4x4, SL_4x4_INTRA_Cb);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        parse_scaling_list_4x4(s, sm.scaling_matrices_4x4, SL_4x4_INTRA_Cr);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        parse_scaling_list_4x4(s, sm.scaling_matrices_4x4, SL_4x4_INTER_Y);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        parse_scaling_list_4x4(s, sm.scaling_matrices_4x4, SL_4x4_INTER_Cb);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        parse_scaling_list_4x4(s, sm.scaling_matrices_4x4, SL_4x4_INTER_Cr);
        if (s.status() != ISTREAM_STATUS_OK)
            break;
    } while (0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
addq $0x10, %rbx
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x3d54
cmpl $0x0, 0x20(%r14)
jne 0x3ff5
movq %r14, %rsi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x3d54
cmpl $0x0, 0x20(%r14)
jne 0x3ff5
movq %r14, %rsi
movq %rbx, %rdx
movl $0x2, %ecx
callq 0x3d54
cmpl $0x0, 0x20(%r14)
jne 0x3ff5
movq %r14, %rsi
movq %rbx, %rdx
movl $0x3, %ecx
callq 0x3d54
cmpl $0x0, 0x20(%r14)
jne 0x3ff5
movq %r14, %rsi
movq %rbx, %rdx
movl $0x4, %ecx
callq 0x3d54
cmpl $0x0, 0x20(%r14)
je 0x3ffd
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rsi
movq %rbx, %rdx
movl $0x5, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3d54
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_scaling_matrices_8x8(ymn::istream<0>&, ymn::h264::scaling_matrices&, unsigned int)
void h264_parser::parse_scaling_matrices_8x8(istream_be& s, h264::scaling_matrices& sm, uint32_t chroma_format_idc)
{
    do {
        parse_scaling_list_8x8(s, sm.scaling_matrices_8x8, SL_8x8_INTRA_Y);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        parse_scaling_list_8x8(s, sm.scaling_matrices_8x8, SL_8x8_INTER_Y);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        if (3 == chroma_format_idc) {
            parse_scaling_list_8x8(s, sm.scaling_matrices_8x8, SL_8x8_INTRA_Cb);
            if (s.status() != ISTREAM_STATUS_OK)
                break;

            parse_scaling_list_8x8(s, sm.scaling_matrices_8x8, SL_8x8_INTER_Cb);
            if (s.status() != ISTREAM_STATUS_OK)
                break;

            parse_scaling_list_8x8(s, sm.scaling_matrices_8x8, SL_8x8_INTRA_Cr);
            if (s.status() != ISTREAM_STATUS_OK)
                break;

            parse_scaling_list_8x8(s, sm.scaling_matrices_8x8, SL_8x8_INTER_Cr);
            if (s.status() != ISTREAM_STATUS_OK)
                break;
        }
    } while (0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
addq $0xd0, %rbx
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x3e5a
cmpl $0x0, 0x20(%r14)
je 0x403d
popq %rbx
popq %r14
popq %rbp
retq
movq %r14, %rsi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x3e5a
cmpl $0x3, %ebp
jne 0x4038
cmpl $0x0, 0x20(%r14)
jne 0x4038
movq %r14, %rsi
movq %rbx, %rdx
movl $0x2, %ecx
callq 0x3e5a
cmpl $0x0, 0x20(%r14)
jne 0x4038
movq %r14, %rsi
movq %rbx, %rdx
movl $0x3, %ecx
callq 0x3e5a
cmpl $0x0, 0x20(%r14)
jne 0x4038
movq %r14, %rsi
movq %rbx, %rdx
movl $0x4, %ecx
callq 0x3e5a
cmpl $0x0, 0x20(%r14)
jne 0x4038
movq %r14, %rsi
movq %rbx, %rdx
movl $0x5, %ecx
popq %rbx
popq %r14
popq %rbp
jmp 0x3e5a
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_scaling_matrices(ymn::istream<0>&, ymn::h264::scaling_matrices&, bool, unsigned int)
bool h264_parser::parse_scaling_matrices(istream_be& s, h264::scaling_matrices& sm, bool parse8x8, uint32_t chroma_format_idc)
{
    bool retval = false;

    do {
        parse_scaling_matrices_4x4(s, sm);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        if (parse8x8) {
            parse_scaling_matrices_8x8(s, sm, chroma_format_idc);
            if (s.status() != ISTREAM_STATUS_OK)
                break;
        }

        sm.set_valid(true);
        retval = true;
    } while (0);

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %r15d
movq %rdx, %rbx
movq %rsi, %r14
callq 0x3f7a
cmpl $0x0, 0x20(%r14)
je 0x40d5
xorl %eax, %eax
jmp 0x40f4
testb %r15b, %r15b
je 0x40ee
movq %r14, %rsi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x4014
cmpl $0x0, 0x20(%r14)
jne 0x40d1
movb $0x1, 0x8(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_ref_pic_list_modification(ymn::istream<0>&, ymn::h264::ref_pic_list_modification&)
bool h264_parser::parse_ref_pic_list_modification(istream_be& s, h264::ref_pic_list_modification& rplm)
{
    bool retval = false;

    do {
        s.read_bits(1, rplm.ref_pic_list_modification_flag_lx);
        if (rplm.ref_pic_list_modification_flag_lx) {
            size_t i = 0;
            uint32_t modification_of_pic_nums_idc;
            uint32_t abs_diff_pic_num_minus1;
            uint32_t long_term_pic_num;

            do {
                s.read_exp_golomb_u(modification_of_pic_nums_idc);

                if (modification_of_pic_nums_idc == 0 || modification_of_pic_nums_idc == 1)
                    s.read_exp_golomb_u(abs_diff_pic_num_minus1);
                else
                if (modification_of_pic_nums_idc == 2)
                    s.read_exp_golomb_u(long_term_pic_num);

                if (i < TABLE_ELEMENTS(rplm.m)) {
                    rplm.m[i].modification_of_pic_nums_idc = modification_of_pic_nums_idc;
                    if (modification_of_pic_nums_idc == 0 || modification_of_pic_nums_idc == 1)
                        rplm.m[i].u.abs_diff_pic_num_minus1 = abs_diff_pic_num_minus1;
                    else
                    if (modification_of_pic_nums_idc == 2)
                        rplm.m[i].u.long_term_pic_num = long_term_pic_num;
                }

                i++;
            } while ((s.status() == ISTREAM_STATUS_OK) && (modification_of_pic_nums_idc != 3));
        }

        if (s.status() != ISTREAM_STATUS_OK)
            break;

        rplm.set_valid(true);
        retval = true;
    }while (0);

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
addq $0xc, %rdx
movq %rsi, %rdi
movl $0x1, %esi
callq 0x70a0
cmpl $0x0, 0xc(%rbx)
je 0x4635
xorl %r12d, %r12d
leaq 0xc(%rsp), %r15
leaq 0x14(%rsp), %r13
leaq 0x10(%rsp), %rbp
movq %r14, %rdi
movq %r15, %rsi
callq 0x727a
cmpl $0x2, 0xc(%rsp)
movq %r13, %rsi
jb 0x45f9
movq %rbp, %rsi
jne 0x4601
movq %r14, %rdi
callq 0x727a
cmpq $0x3, %r12
ja 0x4624
movl 0xc(%rsp), %ecx
movl %ecx, 0x10(%rbx,%r12,8)
movq %r13, %rax
cmpl $0x2, %ecx
jb 0x461d
movq %rbp, %rax
jne 0x4624
movl (%rax), %eax
movl %eax, 0x14(%rbx,%r12,8)
cmpl $0x0, 0x20(%r14)
jne 0x4635
incq %r12
cmpl $0x3, 0xc(%rsp)
jne 0x45df
movl 0x20(%r14), %eax
testl %eax, %eax
jne 0x4641
movb $0x1, 0x8(%rbx)
testl %eax, %eax
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_pred_weight_table(ymn::istream<0>&, ymn::h264::pred_weight_table&)
bool h264_parser::parse_pred_weight_table(istream_be& s, h264::pred_weight_table& pwt)
{
    bool retval = false;

    do {
        s.read_exp_golomb_u(pwt.luma_log2_weight_denom);
        if (pwt.chroma_components_present)
            s.read_exp_golomb_u(pwt.chroma_log2_weight_denom);

        h264_parser_parse_pred_weight_table_lx(s, pwt.l0, pwt.num_ref_idx_l0_active_minus1, pwt.chroma_components_present);

        if (s.status() != ISTREAM_STATUS_OK)
            break;

        if (h264::slice_type_e::B == pwt.slice_type)
            h264_parser_parse_pred_weight_table_lx(s, pwt.l1, pwt.num_ref_idx_l1_active_minus1, pwt.chroma_components_present);

        if (s.status() != ISTREAM_STATUS_OK)
            break;

        pwt.set_valid(true);
        retval = true;
    } while (0);

    return retval;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x14(%rdx), %rsi
movq %r14, %rdi
callq 0x727a
cmpb $0x1, 0x10(%rbx)
jne 0x467e
leaq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x727a
leaq 0x20(%rbx), %rsi
movl 0x1c(%rbx), %edx
movzbl 0x10(%rbx), %ecx
movq %r14, %rdi
callq 0x46d0
cmpl $0x0, 0x20(%r14)
jne 0x46be
cmpl $0x1, 0xc(%rbx)
jne 0x46b7
leaq 0x424(%rbx), %rsi
movl 0x420(%rbx), %edx
movzbl 0x10(%rbx), %ecx
movq %r14, %rdi
callq 0x46d0
cmpl $0x0, 0x20(%r14)
je 0x46c8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movb $0x1, 0x8(%rbx)
movb $0x1, %al
jmp 0x46c0
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: h264_parser_parse_pred_weight_table_lx(ymn::istream<0>&, ymn::h264::pred_weight_table::lx&, unsigned int, bool)
static void h264_parser_parse_pred_weight_table_lx(
    istream_be& s, h264::pred_weight_table::lx& lx, uint32_t num_ref_idx_lx_active_minus1, bool chroma_components_present)
{
    for (uint32_t i = 0;
        (i <= num_ref_idx_lx_active_minus1) && (s.status() == ISTREAM_STATUS_OK);
       ++i) {
        s.read_bits(1, lx.luma_weight_lx_flag[i]);
        if (lx.luma_weight_lx_flag[i]) {
            s.read_exp_golomb_s(lx.luma_weight_lx[i]);
            s.read_exp_golomb_s(lx.luma_offset_lx[i]);
        }
        if (chroma_components_present) {
            s.read_bits(1, lx.chroma_weight_lx_flag[i]);
            if (lx.chroma_weight_lx_flag[i]) {
                s.read_exp_golomb_s(lx.chroma_weight_lx[i][0]);
                s.read_exp_golomb_s(lx.chroma_offset_lx[i][0]);
                s.read_exp_golomb_s(lx.chroma_weight_lx[i][1]);
                s.read_exp_golomb_s(lx.chroma_offset_lx[i][1]);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, 0x4(%rsp)
cmpl $0x0, 0x20(%rdi)
jne 0x480d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x80(%rsi), %rax
movq %rax, 0x30(%rsp)
leaq 0x100(%rsi), %rax
movq %rax, 0x28(%rsp)
leaq 0x180(%rsi), %rax
movq %rax, 0x20(%rsp)
leaq 0x200(%rsi), %rax
movq %rax, 0x18(%rsp)
leaq 0x300(%rsi), %rax
movq %rax, 0x10(%rsp)
movl $0x1, %r13d
movq %rsi, 0x8(%rsp)
leal -0x1(%r13), %ebx
leaq (%r14,%rbx,4), %r12
movq %r15, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x70a0
cmpl $0x0, (%r12)
je 0x477c
movq 0x30(%rsp), %rax
leaq (%rax,%rbx,4), %rsi
movq %r15, %rdi
callq 0x7600
movq 0x28(%rsp), %rax
leaq (%rax,%rbx,4), %rsi
movq %r15, %rdi
callq 0x7600
cmpb $0x0, 0x4(%rsp)
je 0x47fa
movq 0x20(%rsp), %rax
leaq (%rax,%rbx,4), %r12
movq %r15, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x70a0
cmpl $0x0, (%r12)
je 0x47fa
movq 0x18(%rsp), %r12
leaq (%r12,%rbx,8), %rsi
movq %r15, %rdi
callq 0x7600
movl %ebp, %r14d
movq 0x10(%rsp), %rbp
leaq (,%rbx,8), %rsi
addq %rbp, %rsi
movq %r15, %rdi
callq 0x7600
leaq (%r12,%rbx,8), %rsi
addq $0x4, %rsi
movq %r15, %rdi
callq 0x7600
leaq 0x4(,%rbx,8), %rsi
addq %rbp, %rsi
movl %r14d, %ebp
movq 0x8(%rsp), %r14
movq %r15, %rdi
callq 0x7600
cmpl %ebp, %r13d
ja 0x480d
incl %r13d
cmpl $0x0, 0x20(%r15)
je 0x473b
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_dec_ref_pic_marking_idr(ymn::istream<0>&, ymn::h264::dec_ref_pic_marking_idr&)
bool h264_parser::parse_dec_ref_pic_marking_idr(istream_be& s, h264::dec_ref_pic_marking_idr& drpm)
{
    bool retval = false;

    do {
        s.read_bits(1, drpm.no_output_of_prior_pics_flag);
        s.read_bits(1, drpm.long_term_reference_flag);

        if (s.status() != ISTREAM_STATUS_OK)
            break;

        drpm.set_valid(true);
        retval = true;
    } while (0);

    return retval;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
addq $0xc, %rdx
movq %rsi, %rdi
movl $0x1, %esi
callq 0x70a0
leaq 0x10(%rbx), %rdx
movq %r14, %rdi
movl $0x1, %esi
callq 0x70a0
movl 0x20(%r14), %eax
testl %eax, %eax
jne 0x4854
movb $0x1, 0x8(%rbx)
testl %eax, %eax
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_aud(ymn::istream<0>&)
h264_parser_status_e h264_parser::parse_aud(istream_be& s)
{
    h264_parser_status_e retval = h264_parser_status_e::NAL_UNIT_CORRUPTED;

    do {
        h264::aud& aud = m_aud;
        aud.reset();

        if (!CHK_EXPR(s.read_bits(3, aud.primary_pic_type), std::cout) ||
            !CHK_STRUCT_RANGE(aud, primary_pic_type, 0U, 7U, std::cout)) {
            s.mark_corrupted();
            break;
        }

        if (s.status() != ISTREAM_STATUS_OK)
            break;

        aud.set_valid(true);
        retval = h264_parser_status_e::AUD_PARSED;
    } while (0);

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movb $0x0, 0x120(%rdi)
leaq 0x124(%rdi), %r15
movq %rsi, %rdi
movl $0x3, %esi
movq %r15, %rdx
callq 0x70a0
testb %al, %al
jne 0x4a4c
movl %eax, %ebp
movq 0x1d5ed(%rip), %r12     # 0x21fc0
movq (%r12), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r12,%rax)
jne 0x4a47
leaq 0x15377(%rip), %rsi     # 0x19d61
movl $0x7, %edx
movq %r12, %rdi
callq 0x21d0
leaq 0x14c52(%rip), %rsi     # 0x19650
movl $0x24, %edx
movq %r12, %rdi
callq 0x21d0
leaq 0x15357(%rip), %rsi     # 0x19d69
movl $0x7, %edx
movq %r12, %rdi
callq 0x21d0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
testb %bpl, %bpl
je 0x4a87
movl (%r15), %esi
leaq 0x14c1f(%rip), %rdi     # 0x19675
movq 0x1d563(%rip), %r8      # 0x21fc0
xorl %edx, %edx
movl $0x7, %ecx
callq 0x735c
testb %al, %al
je 0x4a87
movl $0x2, %eax
cmpl $0x0, 0x20(%r14)
jne 0x4a91
movb $0x1, 0x120(%rbx)
movl $0x3, %eax
jmp 0x4a91
orb $0x4, 0x20(%r14)
movl $0x2, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_sei(ymn::istream<0>&)
h264_parser_status_e h264_parser::parse_sei(istream_be& s)
{
    h264_parser_status_e retval = h264_parser_status_e::NAL_UNIT_CORRUPTED;

    do {
        bool status;
        uint8_t last;

        h264::sei& sei = m_sei;
        sei.reset();

        sei.payload_type = 0;
        sei.payload_size = 0;

        while ((true == (status = s.read_u8(last))) && 0xff == last)
            sei.payload_type += 255;

        if (status)
            sei.payload_type += last;
        else
            break;

        while ((true == (status = s.read_u8(last))) && 0xff == last)
            sei.payload_size += 255;

        if (status)
            sei.payload_size += last;
        else
            break;

        uint32_t i = 0;
        while ((i < sei.payload_size) && (i < sizeof(sei.payload_data)) && (true == (status = s.read_u8(sei.payload_data[i]))))
            ++i;

        if (!status)
            break;

        sei.set_valid(true);
        retval = h264_parser_status_e::SEI_PARSED;
    } while (0);

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movb $0x0, 0x87940(%rdi)
movq $0x0, 0x87944(%rdi)
leaq 0xf(%rsp), %r15
movq %rsi, %rdi
movq %r15, %rsi
callq 0x7b70
movb (%r15), %cl
cmpb $-0x1, %cl
sete %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x61fb
leaq 0xf(%rsp), %r15
addl $0xff, 0x87944(%rbx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x7b70
movb 0xf(%rsp), %cl
testb %al, %al
je 0x61fb
cmpb $-0x1, %cl
je 0x61d9
movl $0x2, %ebp
testb %al, %al
je 0x62a5
movzbl %cl, %eax
addl %eax, 0x87944(%rbx)
leaq 0xf(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x7b70
movb (%r15), %cl
cmpb $-0x1, %cl
sete %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x6258
leaq 0xf(%rsp), %r15
addl $0xff, 0x87948(%rbx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x7b70
movb 0xf(%rsp), %cl
testb %al, %al
je 0x6258
cmpb $-0x1, %cl
je 0x6236
testb %al, %al
je 0x62a5
movzbl %cl, %ecx
addl %ecx, 0x87948(%rbx)
je 0x6295
leaq 0x8794c(%rbx), %r15
xorl %r12d, %r12d
leaq (%r15,%r12), %rsi
movq %r14, %rdi
callq 0x7b70
testb %al, %al
je 0x6295
cmpq $0xe, %r12
ja 0x6295
incq %r12
movl 0x87948(%rbx), %ecx
cmpq %rcx, %r12
jb 0x6271
testb %al, %al
je 0x62a5
movb $0x1, 0x87940(%rbx)
movl $0x6, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_byte_stream_nal_units()
h264_parser_status_e h264_parser::parse_byte_stream_nal_units()
{
    h264_parser_status_e status = h264_parser_status_e::NEED_BYTES;
    int num_bytes_in_nal_unit;

    if ((num_bytes_in_nal_unit = find_nal_unit()) > 0) {
        int rbsp_size;
        uint8_t* rbsp_buf;
        const uint8_t* p = m_flatbuffer.get_bookmark();

        rbsp_buf = new uint8_t[num_bytes_in_nal_unit];
        rbsp_size = h264_parser_nal_to_rbsp(rbsp_buf, num_bytes_in_nal_unit, p, num_bytes_in_nal_unit);

        if (rbsp_size > 0) {
            istream_be s(rbsp_buf, rbsp_size);

            status = parse_nal_unit(s);
        }
        else
            status = h264_parser_status_e::NAL_UNIT_CORRUPTED;

        delete [] rbsp_buf;
        m_flatbuffer.clear_bookmark();
    }

    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
callq 0x3c40
testl %eax, %eax
jle 0x6fcb
movq 0xa0(%rbx), %rcx
movq 0xc0(%rbx), %r12
addq %rcx, %r12
xorl %r13d, %r13d
testq %rcx, %rcx
cmovsq %r13, %r12
movl %eax, %r15d
movq %r15, %rdi
callq 0x2030
movq %rax, %r14
leaq -0x1(%r15), %rcx
xorl %esi, %esi
xorl %eax, %eax
xorl %edx, %edx
cmpq $0x2, %rsi
jne 0x6fa3
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
cmpb $0x3, (%r12,%rdx)
jb 0x6fd7
movl $0x2, %esi
jne 0x6fa3
cmpq %rcx, %rdx
jae 0x6f99
cmpb $0x3, 0x1(%r12,%rdx)
ja 0x6fd7
cmpq %rcx, %rdx
je 0x6fc7
incq %rdx
xorl %esi, %esi
cmpq %rax, %r15
je 0x6fd2
movb (%r12,%rdx), %dil
movb %dil, (%r14,%rax)
incq %rsi
cmpb $0x0, (%r12,%rdx)
cmovneq %r13, %rsi
incq %rdx
incq %rax
cmpq %r15, %rdx
jb 0x6f73
movl %eax, %edi
jmp 0x6fd7
xorl %ebp, %ebp
jmp 0x708f
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
testl %edi, %edi
jle 0x7077
movl %edi, %eax
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0x48(%rsp), %r15
movq %r14, -0x28(%r15)
movq %rax, -0x20(%r15)
movups %xmm0, (%r15)
movups %xmm0, 0x10(%r15)
movups %xmm0, -0x18(%r15)
movl $0x0, -0x8(%r15)
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x7035
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0x2, %edx
callq *%rax
movaps 0x10(%r12), %xmm0
movups %xmm0, 0x58(%rsp)
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x704c
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x20(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6d86
movl %eax, %ebp
movq 0x38(%r12), %rax
testq %rax, %rax
je 0x707c
movq %r15, %rdi
movq %r15, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x707c
movl $0x2, %ebp
movq %r14, %rdi
callq 0x21f0
movq $-0x1, 0xa0(%rbx)
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/./utilities.hpp
// Function: ymn::chk_expr(char const*, bool, std::ostream&)
inline bool chk_expr(const char* expr, bool status, std::ostream& ostream)
{
    if (!status)
        if (ostream)
            ostream << "error: " << expr << " failed" << std::endl;

    return status;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
testl %esi, %esi
jne 0x7272
movq %rdx, %r14
movq (%rdx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rdx,%rax)
jne 0x7272
movq %rdi, %r15
leaq 0x12b6c(%rip), %rsi     # 0x19d61
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
testq %r15, %r15
je 0x721f
movq %r15, %rdi
callq 0x20b0
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x21d0
jmp 0x7237
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x2290
leaq 0x12b2b(%rip), %rsi     # 0x19d69
movl $0x7, %edx
movq %r14, %rdi
callq 0x21d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/./istream.hpp
// Function: ymn::istream<0>::read_exp_golomb_u(unsigned int&)
bool read_exp_golomb_u(uint32_t& value)
    {
        bool status;
        uint32_t leading_zero_bits;
        uint32_t v;

        leading_zero_bits = 0;
        while ((status = read_bits(1, v)) && (0 == v))
            leading_zero_bits++;

        if (!status) {
            m_position -= leading_zero_bits;
            return false;
        }

        if (leading_zero_bits) {
            status = read_bits(leading_zero_bits, v);
            if (!status) {
                m_position -= leading_zero_bits + 1;
                return false;
            }
            v += (1U << leading_zero_bits) - 1;
        } else
            v = 0;

        value = v;
        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %r12d, %r12d
leaq 0xc(%rsp), %r15
movq %rbx, %rdi
movl $0x1, %esi
movq %r15, %rdx
callq 0x70a0
decl %r12d
testb %al, %al
je 0x72b2
cmpl $0x0, 0xc(%rsp)
je 0x7294
movl %r12d, %ebp
notl %ebp
testb %al, %al
je 0x72e5
cmpl $-0x1, %r12d
je 0x7313
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x70a0
testb %al, %al
je 0x7320
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %ebp, %ecx
shll %cl, %eax
notl %eax
addl 0xc(%rsp), %eax
jmp 0x7315
movl %ebp, %eax
movq 0x18(%rbx), %rcx
subq %rax, %rcx
movq %rcx, %rax
shrq $0x3, %rax
addq 0x10(%rbx), %rax
movabsq $0x1fffffffffffffff, %rdx # imm = 0x1FFFFFFFFFFFFFFF
andq %rax, %rdx
movq %rdx, 0x10(%rbx)
andl $0x7, %ecx
movq %rcx, 0x18(%rbx)
jmp 0x734d
xorl %eax, %eax
movl %eax, 0xc(%rsp)
movl %eax, (%r14)
movb $0x1, %al
jmp 0x734f
negl %r12d
movq 0x18(%rbx), %rax
subq %r12, %rax
movq %rax, %rcx
shrq $0x3, %rcx
addq 0x10(%rbx), %rcx
movabsq $0x1fffffffffffffff, %rdx # imm = 0x1FFFFFFFFFFFFFFF
andq %rcx, %rdx
movq %rdx, 0x10(%rbx)
andl $0x7, %eax
movq %rax, 0x18(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/./istream.hpp
// Function: ymn::istream<0>::read_exp_golomb_s(int&)
bool read_exp_golomb_s(int32_t& value)
    {
        bool status;
        uint32_t leading_zero_bits;
        uint32_t v;

        leading_zero_bits = 0;
        while ((status = read_bits(1, v)) && (0 == v))
            leading_zero_bits++;

        if (!status) {
            m_position -= leading_zero_bits;
            return false;
        }

        if (leading_zero_bits) {
            status = read_bits(leading_zero_bits, v);
            if (!status) {
                m_position -= leading_zero_bits + 1;
                return false;
            }

            v += (1U << leading_zero_bits) - 1;
            if (v & 0x01)
                v = (v + 1) / 2;
            else
                v = -(v / 2);
        } else
            v = 0;

        value = v;
        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %r12d, %r12d
leaq 0xc(%rsp), %r15
movq %rbx, %rdi
movl $0x1, %esi
movq %r15, %rdx
callq 0x70a0
decl %r12d
testb %al, %al
je 0x7638
cmpl $0x0, 0xc(%rsp)
je 0x761a
movl %r12d, %ebp
notl %ebp
testb %al, %al
je 0x7680
cmpl $-0x1, %r12d
je 0x76ae
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x70a0
testb %al, %al
je 0x76b8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %ebp, %ecx
shll %cl, %eax
movl %eax, %ecx
notl %ecx
movl 0xc(%rsp), %edx
addl %edx, %ecx
movl %ecx, 0xc(%rsp)
testb $0x1, %cl
jne 0x76e9
shrl %ecx
negl %ecx
movl %ecx, 0xc(%rsp)
jmp 0x76f1
movl %ebp, %eax
movq 0x18(%rbx), %rcx
subq %rax, %rcx
movq %rcx, %rax
shrq $0x3, %rax
addq 0x10(%rbx), %rax
movabsq $0x1fffffffffffffff, %rdx # imm = 0x1FFFFFFFFFFFFFFF
andq %rax, %rdx
movq %rdx, 0x10(%rbx)
andl $0x7, %ecx
movq %rcx, 0x18(%rbx)
jmp 0x76e5
movl $0x0, 0xc(%rsp)
jmp 0x76f1
negl %r12d
movq 0x18(%rbx), %rax
subq %r12, %rax
movq %rax, %rcx
shrq $0x3, %rcx
addq 0x10(%rbx), %rcx
movabsq $0x1fffffffffffffff, %rdx # imm = 0x1FFFFFFFFFFFFFFF
andq %rcx, %rdx
movq %rdx, 0x10(%rbx)
andl $0x7, %eax
movq %rax, 0x18(%rbx)
xorl %eax, %eax
jmp 0x76fa
subl %eax, %edx
shrl %edx
movl %edx, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl %eax, (%r14)
movb $0x1, %al
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/./istream.hpp
// Function: bool ymn::istream<0>::read<unsigned char>(unsigned char&)
bool read(T& value)
    {
        if (m_position.m_bit_position) {
            m_status |= ISTREAM_STATUS_IMPROPER_ALLIGMENT;
            if (m_error_function)
                m_error_function(m_position, m_position + sizeof(T) * BITS_PER_BYTE);
            return false;
        }

        const void* p = readbytes(sizeof(T));
        if (p) {
            value = *(reinterpret_cast<const T*>(p));
            return true;
        }
        else {
            m_status |= ISTREAM_STATUS_EOS_REACHED;
            if (m_error_function)
                m_error_function(m_position, m_position + sizeof(T) * BITS_PER_BYTE);
            return false;
        }
    }

// Assembly:
subq $0x18, %rsp
movq %rsi, %rcx
movq %rdi, %rax
leaq 0x10(%rdi), %rsi
cmpq $0x0, 0x18(%rdi)
je 0x7bc7
orb $0x2, 0x20(%rax)
cmpq $0x0, 0x38(%rax)
je 0x7bc3
leaq 0x28(%rax), %rdi
movq 0x18(%rax), %rcx
leaq 0x8(%rcx), %rdx
shrq $0x3, %rdx
addq 0x10(%rax), %rdx
movabsq $0x1fffffffffffffff, %r8 # imm = 0x1FFFFFFFFFFFFFFF
andq %rdx, %r8
andl $0x7, %ecx
leaq 0x8(%rsp), %rdx
movq %r8, (%rdx)
movq %rcx, 0x8(%rdx)
callq *0x40(%rax)
xorl %eax, %eax
jmp 0x7beb
movq 0x10(%rax), %rdx
leaq 0x1(%rdx), %rdi
cmpq 0x8(%rax), %rdi
jbe 0x7bd9
xorl %edx, %edx
jmp 0x7be0
addq (%rax), %rdx
movq %rdi, 0x10(%rax)
testq %rdx, %rdx
je 0x7bf0
movb (%rdx), %al
movb %al, (%rcx)
movb $0x1, %al
addq $0x18, %rsp
retq
orb $0x1, 0x20(%rax)
jmp 0x7b89
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_cabac_decoder.cpp
// Function: ymn::h264_cabac_decoder::decode_bypass()
int h264_cabac_decoder::decode_bypass()
{
    uint32_t bits = 0;

    m_codIOffset <<= 1;
    m_stream.read_bits(1, bits);
    m_codIOffset |= bits;

    if (m_codIOffset < m_codIRange)
        return 0;
    else {
        m_codIOffset -= m_codIRange;
        return 1;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4(%rsp), %r14
movl $0x0, (%r14)
shll 0x4c(%rdi)
movl $0x1, %esi
movq %r14, %rdx
callq 0x70a0
movl 0x4c(%rbx), %ecx
orl (%r14), %ecx
movl 0x48(%rbx), %edx
movl %ecx, 0x4c(%rbx)
xorl %eax, %eax
subl %edx, %ecx
jb 0x7ca5
movl %ecx, 0x4c(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_cabac_decoder.cpp
// Function: ymn::h264_cabac_decoder::decode_terminate()
int h264_cabac_decoder::decode_terminate()
{
    m_codIRange -= 2;

    if (m_codIOffset < m_codIRange) {

        // renormalization process
        uint8_t shift = renormalization_shift_table[m_codIRange];
        m_codIRange <<= shift;
        m_codIOffset <<= shift;
        if (shift > 0) {
            uint32_t bits = 0;
            m_stream.read_bits(shift, bits);
            m_codIOffset |= bits;
        }

        return 0;
    }
    else
        return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl 0x48(%rdi), %eax
movl 0x4c(%rdi), %edx
addl $-0x2, %eax
movl %eax, 0x48(%rdi)
movl $0x1, %ebp
cmpl %eax, %edx
jae 0x7d0a
movq %rdi, %rbx
movl %eax, %ecx
leaq 0x143f9(%rip), %rsi     # 0x1c0d0
movzbl (%rcx,%rsi), %ecx
shll %cl, %eax
shll %cl, %edx
xorl %ebp, %ebp
movl %eax, 0x48(%rdi)
movl %edx, 0x4c(%rdi)
testl %ecx, %ecx
je 0x7d0a
leaq 0xc(%rsp), %r14
movl $0x0, (%r14)
movq %rbx, %rdi
movl %ecx, %esi
movq %r14, %rdx
callq 0x70a0
movl (%r14), %eax
orl %eax, 0x4c(%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_cabac_decoder.cpp
// Function: ymn::h264_cabac_decoder::decode_decision(int)
int h264_cabac_decoder::decode_decision(int ctxIdx)
{
    context_variable& state = m_context_variables[ctxIdx];
    int codIRangeLPS = range_tab_lps[(m_codIRange & 0xC0) + state.pStateIdx];
    int binVal;

    m_codIRange -= codIRangeLPS;

    if (m_codIOffset >= m_codIRange) {
        binVal = 1 - state.valMPS;
        m_codIOffset -= m_codIRange;
        m_codIRange = codIRangeLPS;
        state.pStateIdx = trans_idx_lps[state.pStateIdx];
        if (0 == state.pStateIdx)
            state.valMPS ^= 1;
    }
    else {
        binVal = state.valMPS;
        state.pStateIdx = trans_idx_mps[state.pStateIdx];
    }

    // renormalization process
    uint8_t shift = renormalization_shift_table[m_codIRange];
    m_codIRange <<= shift;
    m_codIOffset <<= shift;
    if (shift > 0) {
        uint32_t bits = 0;
        m_stream.read_bits(shift, bits);
        m_codIOffset |= bits;
    }

    return binVal;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movslq %esi, %rax
movl 0x48(%rdi), %r8d
movl 0x4c(%rdi), %edx
movl %r8d, %esi
andl $0xc0, %esi
movslq 0x50(%rdi,%rax,8), %rcx
addl %ecx, %esi
leaq 0x1220e(%rip), %rdi     # 0x19f50
movzbl (%rsi,%rdi), %edi
subl %edi, %r8d
movl %r8d, 0x48(%rbx)
movl 0x54(%rbx,%rax,8), %esi
subl %r8d, %edx
jae 0x7d69
leaq 0x12333(%rip), %rdx     # 0x1a090
movzbl (%rcx,%rdx), %ecx
movl %ecx, 0x50(%rbx,%rax,8)
movl %esi, %ebp
jmp 0x7d91
movl $0x1, %ebp
subl %esi, %ebp
movl %edx, 0x4c(%rbx)
movl %edi, 0x48(%rbx)
leaq 0x122d3(%rip), %rdx     # 0x1a050
movzbl (%rcx,%rdx), %edx
movl %edx, 0x50(%rbx,%rax,8)
cmpl $0x1, %ecx
ja 0x7d91
xorl $0x1, %esi
movl %esi, 0x54(%rbx,%rax,8)
movl 0x48(%rbx), %eax
leaq 0x14335(%rip), %rcx     # 0x1c0d0
movzbl (%rax,%rcx), %ecx
shll %cl, %eax
shll %cl, 0x4c(%rbx)
movl %eax, 0x48(%rbx)
testl %ecx, %ecx
je 0x7dca
leaq 0xc(%rsp), %r14
movl $0x0, (%r14)
movq %rbx, %rdi
movl %ecx, %esi
movq %r14, %rdx
callq 0x70a0
movl (%r14), %eax
orl %eax, 0x4c(%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_cabac_decoder.cpp
// Function: ymn::h264_cabac_decoder::init_context_variables(ymn::h264::slice_header const&, int)
void h264_cabac_decoder::init_context_variables(const h264::slice_header& slice_header, int32_t slice_qp)
{
    const int8_t (*table)[2];
    h264::slice_type_e slice_type = h264::to_slice_type_e(slice_header.slice_type);

    if ((slice_type == h264::slice_type_e::I) || (slice_type == h264::slice_type_e::SI))
        table = init_tab_context_variables_I;
    else
        table = init_tab_context_variables_PB[slice_header.cabac_init_idc];

    for (size_t ctxIdx = 0; ctxIdx < m_context_variables.size(); ++ctxIdx) {
        int preCtxState = (((table[ctxIdx][0]/*m*/ * slice_qp) >> 4) + table[ctxIdx][1]/*n*/);
        preCtxState = std::clamp(preCtxState, 1, 126);

        if (preCtxState <= 63) {
            m_context_variables[ctxIdx].pStateIdx = 63 - preCtxState; // 0 ... 62
            m_context_variables[ctxIdx].valMPS = 0;
        }
        else {
            m_context_variables[ctxIdx].pStateIdx = preCtxState - 64; // 0 ... 62
            m_context_variables[ctxIdx].valMPS = 1;
        }
    }
}

// Assembly:
movl 0x18(%rsi), %ecx
movl $0xcccccccd, %eax       # imm = 0xCCCCCCCD
imulq %rcx, %rax
shrq $0x22, %rax
leal (%rax,%rax,4), %eax
subl %eax, %ecx
leaq 0x122de(%rip), %rax     # 0x1a0d0
cmpl $0x2, %ecx
je 0x7e10
cmpl $0x4, %ecx
je 0x7e10
movl 0x958(%rsi), %ecx
shlq $0xb, %rcx
leaq 0x12ac3(%rip), %rax     # 0x1a8d0
addq %rcx, %rax
xorl %ecx, %ecx
movsbl (%rax,%rcx,2), %esi
imull %edx, %esi
sarl $0x4, %esi
movsbl 0x1(%rax,%rcx,2), %r8d
addl %esi, %r8d
cmpl $0x7e, %r8d
movl $0x7e, %esi
cmovll %r8d, %esi
cmpl $0x2, %esi
jge 0x7e3c
movl $0x1, %esi
movl $0x3f, %r9d
subl %esi, %r9d
addl $-0x40, %esi
xorl %r10d, %r10d
cmpl $0x40, %r8d
setge %r10b
cmovll %r9d, %esi
movl %esi, 0x50(%rdi,%rcx,8)
movl %r10d, 0x54(%rdi,%rcx,8)
incq %rcx
cmpq $0x400, %rcx            # imm = 0x400
jne 0x7e12
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_cabac_decoder.cpp
// Function: ymn::h264_cabac_decoder::init_decoding_engine(ymn::h264::slice_data const&)
void h264_cabac_decoder::init_decoding_engine(const h264::slice_data& slice_data)
{
    if (slice_data.bit_pos > 0)
    {
        /* realign and init stream */
        m_stream = istream(slice_data.data + 1, slice_data.size - 1);
    }
    else
    {
        /* init stream (it's already aligned) */
        m_stream = istream(slice_data.data, slice_data.size);
    }

    m_codIRange = 0x1FE; // 510
    m_stream.read_bits(9, m_codIOffset);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x20(%rsi)
je 0x7eb8
movq 0x10(%rsi), %rax
movq 0x18(%rsi), %rcx
incq %rax
decq %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0x50(%rsp), %r14
movq %rax, -0x28(%r14)
movq %rcx, -0x20(%r14)
movups %xmm0, (%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, -0x18(%r14)
jmp 0x7ee0
movups 0x10(%rsi), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movaps %xmm1, (%rsp)
leaq 0x50(%rsp), %r14
movups %xmm0, -0x28(%r14)
movups %xmm1, (%r14)
movups %xmm1, 0x10(%r14)
movups %xmm1, -0x18(%r14)
movl $0x0, -0x8(%r14)
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x7f0c
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0x2, %edx
callq *%rax
movaps 0x10(%r15), %xmm0
movups %xmm0, 0x60(%rsp)
movq 0x28(%rsp), %rax
movq %rax, (%rbx)
movups 0x30(%rsp), %xmm0
movups %xmm0, 0x8(%rbx)
movq 0x40(%rsp), %rax
movq %rax, 0x18(%rbx)
movl 0x48(%rsp), %eax
movl %eax, 0x20(%rbx)
leaq 0x28(%rbx), %rdi
movq %r14, %rsi
callq 0x7f8a
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x7f50
movq %r14, %rdi
movq %r14, %rsi
movl $0x3, %edx
callq *%rax
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x7f67
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movl $0x1fe, 0x48(%rbx)      # imm = 0x1FE
leaq 0x4c(%rbx), %rdx
movq %rbx, %rdi
movl $0x9, %esi
callq 0x70a0
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_decoder.cpp
// Function: ymn::h264_decoder::feed(unsigned char const*, unsigned long)
void h264_decoder::feed(const uint8_t* data, std::size_t count)
{
    size_t n_written;

    do {
        n_written = m_parser.write(data, count);
        if (0 == n_written) {
            m_parser.reset();
            continue;
        }

        if (n_written > count) {
            std::cerr << "error: parser swallowed more data then requested (this is really bad)" << std::endl;
            m_parser.reset();
            continue;
        }

        parse();

        data += n_written;
        count -= n_written;
    } while (count > 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x80(%rdi), %r13
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x370a
testq %rax, %rax
je 0x80e3
movq %rax, %rbp
movq %r12, %r15
subq %rax, %r15
jae 0x8110
movl $0x45, %edx
movq 0x19f43(%rip), %r15     # 0x21ff0
movq %r15, %rdi
leaq 0x11449(%rip), %rsi     # 0x19500
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq 0x40(%r14), %rax
xorl %ecx, %ecx
movq %rcx, 0x10(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, (%r13)
movq %rax, 0x98(%r14)
movq $-0x1, 0xa0(%r14)
movq %rcx, 0x100(%r14)
jmp 0x811e
movq %r14, %rdi
callq 0x8136
addq %rbp, %rbx
movq %r15, %r12
testq %r12, %r12
jne 0x8083
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_decoder.cpp
// Function: ymn::h264_decoder::init_chroma_qp_tables()
void h264_decoder::init_chroma_qp_tables()
{
    const int depth = m_active_sps->bit_depth_luma_minus8;
    const int max_qp = 51 + 6 * depth;
    int offset;

#define QP(qp, depth) ((qp) + 6 * (depth))
#define CHROMA_QP_TABLE_END(d)                                        \
    QP(0,  d), QP(1,  d), QP(2,  d), QP(3,  d), QP(4,  d), QP(5,  d), \
    QP(6,  d), QP(7,  d), QP(8,  d), QP(9,  d), QP(10, d), QP(11, d), \
    QP(12, d), QP(13, d), QP(14, d), QP(15, d), QP(16, d), QP(17, d), \
    QP(18, d), QP(19, d), QP(20, d), QP(21, d), QP(22, d), QP(23, d), \
    QP(24, d), QP(25, d), QP(26, d), QP(27, d), QP(28, d), QP(29, d), \
    QP(29, d), QP(30, d), QP(31, d), QP(32, d), QP(32, d), QP(33, d), \
    QP(34, d), QP(34, d), QP(35, d), QP(35, d), QP(36, d), QP(36, d), \
    QP(37, d), QP(37, d), QP(37, d), QP(38, d), QP(38, d), QP(38, d), \
    QP(39, d), QP(39, d), QP(39, d), QP(39, d)

    /* One chroma qp table for each supported bit depth (8, 9, 10). */
    static const uint8_t chroma_qp[3][H264_QP_MAX + 1] =
    {
        {CHROMA_QP_TABLE_END(0)},
        {0, 1, 2, 3, 4, 5, CHROMA_QP_TABLE_END(1)},
        {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, CHROMA_QP_TABLE_END(2)}
    };

    offset = m_active_pps->chroma_qp_index_offset;
    for (int q = 0; q < max_qp + 1; ++q)
        m_chroma_qp_table[0][q] = chroma_qp[depth][std::clamp(q + offset, 0, max_qp)];

    offset = m_active_pps->second_chroma_qp_index_offset;
    for (int q = 0; q < max_qp + 1; ++q)
        m_chroma_qp_table[1][q] = chroma_qp[depth][std::clamp(q + offset, 0, max_qp)];

#undef CHROMA_QP_TABLE_END
#undef QP
}

// Assembly:
pushq %rbx
movq 0x88358(%rdi), %rax
movq 0x88360(%rdi), %rdx
movslq 0x18(%rax), %rcx
leal (%rcx,%rcx,2), %eax
leal 0x33(,%rax,2), %eax
cmpq $-0x8, %rcx
jl 0x8548
movl 0x440(%rdx), %esi
movslq %esi, %rsi
xorl %r8d, %r8d
testl %eax, %eax
movl $0x0, %r9d
cmovgl %eax, %r9d
incl %r9d
movq %rcx, %r11
shlq $0x6, %r11
leaq 0x13e5c(%rip), %r10     # 0x1c370
addq %r11, %r10
leal (%rsi,%r8), %r11d
cmpl %r11d, %eax
cmovll %eax, %r11d
movq %rsi, %rbx
addq %r8, %rbx
movslq %r11d, %r11
movl $0x0, %ebx
cmovnsq %r11, %rbx
movb (%rbx,%r10), %r11b
movb %r11b, 0xa63d0(%rdi,%r8)
incq %r8
cmpq %r8, %r9
jne 0x8517
cmpl $-0x8, %ecx
jl 0x85a3
movl 0x708(%rdx), %edx
movslq %edx, %rdx
xorl %esi, %esi
testl %eax, %eax
movl $0x0, %r8d
cmovgl %eax, %r8d
incl %r8d
shlq $0x6, %rcx
leaq 0x13dfe(%rip), %r9      # 0x1c370
addq %rcx, %r9
leal (%rdx,%rsi), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movq %rdx, %r10
addq %rsi, %r10
movslq %ecx, %rcx
movl $0x0, %r10d
cmovnsq %rcx, %r10
movb (%r10,%r9), %cl
movb %cl, 0xa6410(%rdi,%rsi)
incq %rsi
cmpq %rsi, %r8
jne 0x8575
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_decoder.cpp
// Function: ymn::h264_decoder::init_dequant4x4_coeff_table()
void h264_decoder::init_dequant4x4_coeff_table()
{
    int i, j;
    const int depth = m_active_sps->bit_depth_luma_minus8;
    const int max_qp = 51 + 6 * depth;

    static const uint8_t v[6][3] =
    {
        {10, 13, 16},
        {11, 14, 18},
        {13, 16, 20},
        {14, 18, 23},
        {16, 20, 25},
        {18, 23, 29},
    };

    for (i = 0; i < SL_4x4_NUM; ++i) {
        m_dequant4x4_coeff[i] = &m_dequant4x4_buffer[i];
        for (j = 0; j < i; ++j) {
            if (0 == std::memcmp(m_active_pps->sm.scaling_matrices_4x4[j].scaling_list,
                                 m_active_pps->sm.scaling_matrices_4x4[i].scaling_list, 16)) {
                m_dequant4x4_coeff[i] = &m_dequant4x4_buffer[j];
                break;
            }
        }
        if (j < i)
            continue;

        for (int q = 0; q < max_qp + 1; ++q) {
            int shift = q / 6;
            int idx   = q % 6;
            for (int x = 0; x < 16; ++x) {
                uint8_t idx2 = (x & 1) + ((x >> 2) & 1);
                uint8_t level_scale_4x4 =
                    m_active_pps->sm.scaling_matrices_4x4[i].scaling_list[x] * v[idx][idx2];
                (*m_dequant4x4_coeff[i])[q][x] = level_scale_4x4 << shift;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x88358(%rdi), %rax
movq 0x88360(%rdi), %rdx
movl 0x18(%rax), %eax
movq %rax, -0x8(%rsp)
leal (%rax,%rax,2), %eax
leaq 0x88370(%rdi), %r8
leaq 0x468(%rdx), %rcx
movq %rcx, -0x10(%rsp)
leal 0x33(,%rax,2), %r10d
xorl %r11d, %r11d
testl %r10d, %r10d
cmovlel %r11d, %r10d
incl %r10d
addq $0x478, %rdx            # imm = 0x478
movl $0xaaaaaaab, %ebx       # imm = 0xAAAAAAAB
leaq 0x13e2c(%rip), %r14     # 0x1c430
movq %rdx, %r15
xorl %r12d, %r12d
movq %r12, %rax
shlq $0xc, %rax
addq %r8, %rax
movq %rax, 0xa6370(%rdi,%r12,8)
testq %r12, %r12
je 0x8660
movq %r12, %rax
shlq $0x5, %rax
movq -0x10(%rsp), %rcx
addq %rcx, %rax
addq $0x10, %rax
movdqu (%rax), %xmm0
movq %rdx, %rcx
xorl %eax, %eax
movdqu (%rcx), %xmm1
pcmpeqb %xmm0, %xmm1
pmovmskb %xmm1, %esi
cmpl $0xffff, %esi           # imm = 0xFFFF
je 0x86c4
addq $-0x1000, %rax          # imm = 0xF000
addq $0x20, %rcx
cmpq %rax, %r11
jne 0x863d
cmpl $-0x8, -0x8(%rsp)
jl 0x86d2
movq 0xa6370(%rdi,%r12,8), %r13
xorl %ebp, %ebp
movl %ebp, %ecx
imulq %rbx, %rcx
shrq $0x22, %rcx
leal (%rcx,%rcx), %eax
leal (%rax,%rax,2), %eax
movl %ebp, %esi
subl %eax, %esi
leaq (%rsi,%rsi,2), %r9
addq %r14, %r9
xorl %esi, %esi
movl %esi, %eax
andl $0x1, %eax
btl $0x2, %esi
adcq $0x0, %rax
movb (%rax,%r9), %al
mulb (%r15,%rsi)
movzbl %al, %eax
shll %cl, %eax
movl %eax, (%r13,%rsi,4)
incq %rsi
cmpq $0x10, %rsi
jne 0x868e
incq %rbp
addq $0x40, %r13
cmpq %r10, %rbp
jne 0x8671
jmp 0x86d2
movq %r8, %rcx
subq %rax, %rcx
movq %rcx, 0xa6370(%rdi,%r12,8)
incq %r12
addq $-0x1000, %r11          # imm = 0xF000
addq $0x20, %r15
cmpq $0x6, %r12
jne 0x860a
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/h264_decoder.cpp
// Function: ymn::h264_decoder::init_dequantisation_tables()
void h264_decoder::init_dequantisation_tables()
{
    init_dequant4x4_coeff_table();
    if (m_active_pps->transform_8x8_mode_flag)
        init_dequant8x8_coeff_table();

    if (m_active_sps->qpprime_y_zero_transform_bypass_flag) {
        for (int i = 0; i < SL_4x4_NUM; ++i)
            for (int x = 0; x < 16; ++x)
                (*m_dequant4x4_coeff[i])[0][x] = 1 << 6;

        if (m_active_pps->transform_8x8_mode_flag)
            for (int i = 0; i < SL_8x8_NUM; ++i)
                for (int x = 0; x < 64; ++x)
                    (*m_dequant8x8_coeff[i])[0][x] = 1 << 6;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x85a6
movq 0x88360(%rbx), %rax
cmpl $0x0, 0x450(%rax)
je 0x88c7
movq %rbx, %rdi
callq 0x86f6
movq 0x88358(%rbx), %rax
cmpl $0x0, 0x20(%rax)
je 0x8931
xorl %eax, %eax
movaps 0x13a53(%rip), %xmm0    # 0x1c330
movq 0xa6370(%rbx,%rax,8), %rcx
xorl %edx, %edx
movups %xmm0, (%rcx,%rdx,4)
addq $0x4, %rdx
cmpq $0x10, %rdx
jne 0x88e7
incq %rax
cmpq $0x6, %rax
jne 0x88dd
movq 0x88360(%rbx), %rax
cmpl $0x0, 0x450(%rax)
je 0x8931
xorl %eax, %eax
movq 0xa63a0(%rbx,%rax,8), %rcx
xorl %edx, %edx
movups %xmm0, (%rcx,%rdx,4)
addq $0x4, %rdx
cmpq $0x40, %rdx
jne 0x891a
incq %rax
cmpq $0x6, %rax
jne 0x8910
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/./aud.hpp
// Function: ymn::h264::aud::to_string[abi:cxx11]() const
inline std::string aud::to_string() const
{
    std::ostringstream stream;

    stream << "aud (access unit delimiter):" << std::endl;
    stream << P1_INFO(primary_pic_type, primary_pic_type_to_string(primary_pic_type));

    return stream.str();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %r15
movq %r15, %rdi
callq 0x2220
leaq 0x13ae6(%rip), %rsi     # 0x1c63c
movl $0x1c, %edx
movq %r15, %rdi
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x10(%rsp,%rax)
leaq 0x15116(%rip), %rsi     # 0x1dcb7
movq %r15, %rdi
xorl %edx, %edx
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rcx
movq $0x2e, 0x10(%rsp,%rcx)
movq -0x18(%rax), %rax
movl $0xffffff4f, %ecx       # imm = 0xFFFFFF4F
andl 0x18(%rsp,%rax), %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%rsp,%rax)
leaq 0x10aa3(%rip), %rsi     # 0x19679
movl $0x10, %edx
movq %r15, %rdi
callq 0x21d0
leaq 0x104bd(%rip), %r12     # 0x190a7
movl $0x2, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21d0
leaq 0x10423(%rip), %rsi     # 0x19024
movl $0x2, %edx
movq %r15, %rdi
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rsp,%rax)
movl 0xc(%r14), %esi
movq %r15, %rdi
callq 0x2100
movq %rax, %r15
leaq 0x103ee(%rip), %rsi     # 0x19027
movl $0x2, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%r15,%rax)
movl 0xc(%r14), %esi
movq %r15, %rdi
callq 0x2100
movq %rax, %r15
leaq 0x10e03(%rip), %rsi     # 0x19a76
movl $0x1, %edx
movq %rax, %rdi
callq 0x21d0
movl $0x2, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21d0
movl 0xc(%r14), %eax
cmpq $0x7, %rax
ja 0x8caa
leaq 0x137d3(%rip), %rcx     # 0x1c474
movslq (%rcx,%rax,4), %r14
addq %rcx, %r14
jmp 0x8cb1
leaq 0x14a17(%rip), %r14     # 0x1d6c8
movq %r14, %rdi
callq 0x20b0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2260
movq 0x192b6(%rip), %rsi     # 0x21fb8
movq %rsp, %rdi
callq 0x20d0
leaq 0x70(%rsp), %rdi
callq 0x20a0
movq %rbx, %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture.cpp
// Function: ymn::h264::picture::picture(ymn::h264_decoder const&, ymn::h264::slice_header const&)
picture::picture(const h264_decoder& decoder, const h264::slice_header& sh) :
    m_decoder{decoder},
    m_picture_structure{},
    m_context_variables{},
    m_mbs{nullptr}
{
    init_coxtext_variables(sh);
    m_mbs = new h264::mb[m_decoder.m_dimensions.mb_num];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
leaq 0xb957(%rip), %rax      # 0x21d20
movq %rax, (%rdi)
movq %rsi, 0x8(%rdi)
movl $0x0, 0x10(%rdi)
addq $0x18, %rdi
movl $0xda0, %edx            # imm = 0xDA0
xorl %esi, %esi
callq 0x20e0
movq $0x0, 0xdb8(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x16430
movq 0x8(%rbx), %rax
movslq 0x88348(%rax), %rax
movl $0xb0, %ecx
mulq %rcx
movq $-0x1, %rdi
cmovnoq %rax, %rdi
callq 0x2030
movq %rax, 0xdb8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop