LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture.cpp
// Function: ymn::h264::picture::update_mb_pos()
void picture::update_mb_pos()
{
    m_context_variables.mb_pos =
        m_context_variables.mb_x +
        m_context_variables.mb_y * m_decoder.m_dimensions.mb_width;

    if (m_context_variables.mb_pos < m_decoder.m_dimensions.mb_num)
        m_context_variables.curr_mb = &m_mbs[m_context_variables.mb_pos];
    else
        m_context_variables.curr_mb = nullptr;
}

// Assembly:
movslq 0x1c(%rdi), %rax
movslq 0x20(%rdi), %rcx
movq 0x8(%rdi), %rdx
movslq 0x88340(%rdx), %rsi
imulq %rcx, %rsi
addq %rax, %rsi
movl %esi, 0x24(%rdi)
imulq $0xb0, %rsi, %rax
addq 0xdb8(%rdi), %rax
xorl %ecx, %ecx
cmpl 0x88348(%rdx), %esi
cmovlq %rax, %rcx
movq %rcx, 0x28(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture.cpp
// Function: ymn::h264::picture::advance_mb_pos()
mb* picture::advance_mb_pos()
{
    if (m_context_variables.mb_aff_frame) {
        if ((m_context_variables.mb_y & 1) == 0)
            m_context_variables.mb_y++; /* move to bottom macroblock of a macroblock pair */
        else {
            m_context_variables.mb_y--; /* move to top macroblock of a macroblock pair */
            m_context_variables.mb_x++; /* move to right macroblock pair */
            if (m_context_variables.mb_x >= m_decoder.m_dimensions.mb_width) {
                m_context_variables.mb_x = 0;
                m_context_variables.mb_y +=2;
            }
        }
    }
    else {
        m_context_variables.mb_x++; /* move to right macroblock */
        if (m_context_variables.mb_x >= m_decoder.m_dimensions.mb_width) {
            m_context_variables.mb_x = 0;
            m_context_variables.mb_y++;
            if (m_picture_structure != picture_structure_e::frame)
                m_context_variables.mb_y++;
        }
    }

    update_mb_pos();

    return m_context_variables.curr_mb;
}

// Assembly:
cmpb $0x1, 0x18(%rdi)
jne 0x165b6
movl 0x20(%rdi), %eax
testb $0x1, %al
jne 0x165e5
orl $0x1, %eax
jmp 0x16608
movl 0x1c(%rdi), %eax
incl %eax
movl %eax, 0x1c(%rdi)
movq 0x8(%rdi), %rcx
cmpl 0x88340(%rcx), %eax
jl 0x1660b
movl $0x0, 0x1c(%rdi)
movl 0x20(%rdi), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x20(%rdi)
cmpl $0x0, 0x10(%rdi)
je 0x1660b
addl $0x2, %eax
jmp 0x16608
leal -0x1(%rax), %ecx
movl %ecx, 0x20(%rdi)
movl 0x1c(%rdi), %ecx
incl %ecx
movl %ecx, 0x1c(%rdi)
movq 0x8(%rdi), %rdx
cmpl 0x88340(%rdx), %ecx
jl 0x1660b
movl $0x0, 0x1c(%rdi)
incl %eax
movl %eax, 0x20(%rdi)
movslq 0x1c(%rdi), %rax
movslq 0x20(%rdi), %rcx
movq 0x8(%rdi), %rdx
movslq 0x88340(%rdx), %rsi
imulq %rcx, %rsi
addq %rax, %rsi
movl %esi, 0x24(%rdi)
imulq $0xb0, %rsi, %rcx
addq 0xdb8(%rdi), %rcx
xorl %eax, %eax
cmpl 0x88348(%rdx), %esi
cmovlq %rcx, %rax
movq %rax, 0x28(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::decode(ymn::h264::slice_header const&, ymn::h264::slice_data const&)
void picture_cabac::decode(const h264::slice_header& sh, const h264::slice_data& sd)
{
    mb* curr_mb;

    int slice_qp = std::clamp(
        m_context_variables.QPy - 6 * static_cast<int>(m_decoder.m_active_sps->bit_depth_luma_minus8), 0, 51);

    m_cabac_decoder.init_context_variables(sh, slice_qp);
    m_cabac_decoder.init_decoding_engine(sd);

    for (curr_mb = m_context_variables.curr_mb; curr_mb != nullptr; curr_mb = advance_mb_pos()) {

        curr_mb->x = m_context_variables.mb_x;
        curr_mb->y = m_context_variables.mb_y;
        curr_mb->pos = m_context_variables.mb_pos;
        curr_mb->slice_num = 0;

        calculate_neighbours_part1();

        if ((sh.slice_type != h264::slice_type_e::I) && (sh.slice_type != h264::slice_type_e::SI)) {
            bool is_skipped = true; /* TODO: check for skipped macroblocks */
            if (is_skipped)
                continue;
        }

        if ((m_context_variables.mb_aff_frame) && ((m_context_variables.mb_y & 1) == 0))
            m_context_variables.mb_field_decoding_flag = decode_mb_field_decoding_flag();

        calculate_neighbours_part2();

        decode_mb(sh); /* macroblock_layer */

        //std::cout << mb->to_string();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movl 0x34(%rdi), %eax
movq 0x8(%rdi), %rcx
movq 0x88358(%rcx), %rcx
movl 0x18(%rcx), %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
cmpl $0x33, %eax
movl $0x33, %ecx
cmovll %eax, %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovgl %ecx, %edx
leaq 0xdc0(%rdi), %r12
movq %r12, %rdi
callq 0x7dd6
movq %r12, %rdi
movq %r15, %rsi
callq 0x7e6e
movq 0x28(%r14), %rax
testq %rax, %rax
je 0x16bc9
movl $0xcccccccd, %r15d      # imm = 0xCCCCCCCD
movq 0x1c(%r14), %rcx
movq %rcx, (%rax)
movl 0x24(%r14), %ecx
movl %ecx, 0x8(%rax)
movl $0x0, 0xc(%rax)
movq %r14, %rdi
callq 0x16648
movl 0x18(%rbx), %eax
movq %rax, %rcx
imulq %r15, %rcx
shrq $0x22, %rcx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
cmpl $0x4, %eax
je 0x16b8c
cmpl $0x2, %eax
jne 0x16bbc
cmpb $0x1, 0x18(%r14)
jne 0x16ba9
testb $0x1, 0x20(%r14)
jne 0x16ba9
movq %r14, %rdi
callq 0x16bd6
testl %eax, %eax
setne 0x19(%r14)
movq %r14, %rdi
callq 0x1681c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x16c1a
movq %r14, %rdi
callq 0x165a4
testq %rax, %rax
jne 0x16b52
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::decode_mb_field_decoding_flag()
int picture_cabac::decode_mb_field_decoding_flag()
{
    const int ctxIdxOffset = 70;
    int ctxIdxInc = 0;
    mb* curr_mb = m_context_variables.curr_mb;

    ctxIdxInc += (curr_mb->A != nullptr) && (curr_mb->A->type & MB_TYPE_INTERLACED);
    ctxIdxInc += (curr_mb->B != nullptr) && (curr_mb->B->type & MB_TYPE_INTERLACED);

    return m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc);
}

// Assembly:
movq 0x28(%rdi), %rax
movq 0x18(%rax), %rcx
testq %rcx, %rcx
je 0x16bf1
movl 0x10(%rcx), %esi
shrl $0x8, %esi
andl $0x1, %esi
orl $0x46, %esi
jmp 0x16bf6
movl $0x46, %esi
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x16c0a
movl 0x10(%rax), %eax
shrl $0x8, %eax
andl $0x1, %eax
jmp 0x16c0c
xorl %eax, %eax
addl %eax, %esi
addq $0xdc0, %rdi            # imm = 0xDC0
jmp 0x7d16
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::get_intra4x4_pred_mode(int)
int picture_cabac::get_intra4x4_pred_mode(int pred_mode)
{
    if (decode_prev_intra4x4_pred_mode_flag())
        return pred_mode;

    int mode = decode_rem_intra4x4_pred_mode();

    return mode + (mode >= pred_mode);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
addq $0xdc0, %rdi            # imm = 0xDC0
movl $0x44, %esi
callq 0x7d16
testl %eax, %eax
jne 0x17159
movq %r14, %rdi
callq 0x17176
xorl %ecx, %ecx
cmpl %ebx, %eax
setge %cl
addl %eax, %ecx
movl %ecx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::decode_rem_intra4x4_pred_mode()
int picture_cabac::decode_rem_intra4x4_pred_mode()
{
    const int ctxIdxOffset = 69;
    int mode = 0;
    int ctxIdxInc = 0;

    mode += 1 * m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc);
    mode += 2 * m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc);
    mode += 4 * m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc);

    return mode;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0xdc0, %rbx            # imm = 0xDC0
movq %rbx, %rdi
movl $0x45, %esi
callq 0x7d16
movl %eax, %r14d
movq %rbx, %rdi
movl $0x45, %esi
callq 0x7d16
leal (%r14,%rax,2), %r14d
movq %rbx, %rdi
movl $0x45, %esi
callq 0x7d16
leal (%r14,%rax,4), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::get_intra8x8_pred_mode(int)
int picture_cabac::get_intra8x8_pred_mode(int pred_mode)
{
    if (decode_prev_intra8x8_pred_mode_flag())
        return pred_mode;

    int mode = decode_rem_intra8x8_pred_mode();

    return mode + (mode >= pred_mode);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
addq $0xdc0, %rdi            # imm = 0xDC0
movl $0x44, %esi
callq 0x7d16
testl %eax, %eax
jne 0x171ef
movq %r14, %rdi
callq 0x1720c
xorl %ecx, %ecx
cmpl %ebx, %eax
setge %cl
addl %eax, %ecx
movl %ecx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::non_zero_count_save()
void picture_cabac::non_zero_count_save()
{
    mb* curr_mb = m_context_variables.curr_mb;
    uint8_t* nzc = curr_mb->non_zero_count;

    const mb_cache& nzc_cache_y  = m_context_variables.non_zero_count_cache[CC_Y];
    const mb_cache& nzc_cache_cb = m_context_variables.non_zero_count_cache[CC_Cb];
    const mb_cache& nzc_cache_cr = m_context_variables.non_zero_count_cache[CC_Cr];

    nzc[MB_NZC_DC_BLOCK_IDX(CC_Y)] = nzc_cache_y[0];

    std::memcpy(&nzc[0 * 4], &nzc_cache_y[1 * 8 + 4], 4);
    std::memcpy(&nzc[1 * 4], &nzc_cache_y[2 * 8 + 4], 4);
    std::memcpy(&nzc[2 * 4], &nzc_cache_y[3 * 8 + 4], 4);
    std::memcpy(&nzc[3 * 4], &nzc_cache_y[4 * 8 + 4], 4);

    if (m_context_variables.chroma_array_type == 0)
        return;

    nzc[MB_NZC_DC_BLOCK_IDX(CC_Cb)] = nzc_cache_cb[0];
    nzc[MB_NZC_DC_BLOCK_IDX(CC_Cr)] = nzc_cache_cr[0];

    std::memcpy(&nzc[4 * 4], &nzc_cache_cb[1 * 8 + 4], 4);
    std::memcpy(&nzc[5 * 4], &nzc_cache_cb[2 * 8 + 4], 4);
    std::memcpy(&nzc[8 * 4], &nzc_cache_cr[1 * 8 + 4], 4);
    std::memcpy(&nzc[9 * 4], &nzc_cache_cr[2 * 8 + 4], 4);

    if (m_context_variables.chroma_array_type < 3)
        return;

    std::memcpy(&nzc[ 6 * 4], &nzc_cache_cb[3 * 8 + 4], 4);
    std::memcpy(&nzc[ 7 * 4], &nzc_cache_cb[4 * 8 + 4], 4);
    std::memcpy(&nzc[10 * 4], &nzc_cache_cr[3 * 8 + 4], 4);
    std::memcpy(&nzc[11 * 4], &nzc_cache_cr[4 * 8 + 4], 4);
}

// Assembly:
movq 0x28(%rdi), %rax
movb 0x80(%rdi), %cl
movb %cl, 0xa8(%rax)
movl 0x8c(%rdi), %ecx
movl %ecx, 0x78(%rax)
movl 0x94(%rdi), %ecx
movl %ecx, 0x7c(%rax)
movl 0x9c(%rdi), %ecx
movl %ecx, 0x80(%rax)
movl 0xa4(%rdi), %ecx
movl %ecx, 0x84(%rax)
cmpl $0x0, 0x40(%rdi)
je 0x17526
movb 0xa8(%rdi), %cl
movb %cl, 0xa9(%rax)
movb 0xd0(%rdi), %cl
movb %cl, 0xaa(%rax)
movl 0xb4(%rdi), %ecx
movl %ecx, 0x88(%rax)
movl 0xbc(%rdi), %ecx
movl %ecx, 0x8c(%rax)
movl 0xdc(%rdi), %ecx
movl %ecx, 0x98(%rax)
movl 0xe4(%rdi), %ecx
movl %ecx, 0x9c(%rax)
cmpl $0x3, 0x40(%rdi)
jl 0x17526
movl 0xc4(%rdi), %ecx
movl %ecx, 0x90(%rax)
movl 0xcc(%rdi), %ecx
movl %ecx, 0x94(%rax)
movl 0xec(%rdi), %ecx
movl %ecx, 0xa0(%rax)
movl 0xf4(%rdi), %ecx
movl %ecx, 0xa4(%rax)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::decode_mb_type_si_slice()
int picture_cabac::decode_mb_type_si_slice()
{
    const int ctxIdxOffset = 0;
    int ctxIdxInc = 0;
    mb* curr_mb = m_context_variables.curr_mb;

    ctxIdxInc += ((curr_mb->left != nullptr) && ((curr_mb->left->type & MB_TYPE_SWITCHING) == 0));
    ctxIdxInc += ((curr_mb->top != nullptr) && ((curr_mb->top->type & MB_TYPE_SWITCHING) == 0));

    if (m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc) == 0)
        return 0; /* SI 4x4 */

    return 1 + decode_mb_type_i_slice();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rcx
movq 0x38(%rcx), %rdx
xorl %esi, %esi
movl $0x0, %eax
testq %rdx, %rdx
je 0x17549
xorl %eax, %eax
testb $0x10, 0x12(%rdx)
sete %al
movq 0x50(%rcx), %rcx
testq %rcx, %rcx
je 0x1755c
xorl %esi, %esi
testb $0x10, 0x12(%rcx)
sete %sil
addl %eax, %esi
leaq 0xdc0(%rbx), %rdi
callq 0x7d16
testl %eax, %eax
je 0x1757a
movq %rbx, %rdi
callq 0x1757e
incl %eax
jmp 0x1757c
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::decode_mb_type_i_slice()
int picture_cabac::decode_mb_type_i_slice()
{
    const int ctxIdxOffset = 3;
    int ctxIdxInc = 0;
    mb* curr_mb = m_context_variables.curr_mb;

    ctxIdxInc += ((curr_mb->left != nullptr) && ((curr_mb->left->type & MB_TYPE_INTRA_NxN) == 0));
    ctxIdxInc += ((curr_mb->top != nullptr) && ((curr_mb->top->type & MB_TYPE_INTRA_NxN) == 0));

    if (m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc) == 0)
        return 0; /* I 4x4 */

    if (m_cabac_decoder.decode_terminate() == 1)
        return 25; /* PCM */

    int mb_type = 1; /* I16x16 */

    mb_type += 12 * m_cabac_decoder.decode_decision(ctxIdxOffset + 3); /* cbp_luma */
    if (m_cabac_decoder.decode_decision(ctxIdxOffset + 4)) /* cbp_chroma */
        mb_type += 4 + 4 * m_cabac_decoder.decode_decision(ctxIdxOffset + 5);

    mb_type += 2 * m_cabac_decoder.decode_decision(ctxIdxOffset + 6);
    mb_type += 1 * m_cabac_decoder.decode_decision(ctxIdxOffset + 7);

    return mb_type;

}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq 0x38(%rax), %rcx
testq %rcx, %rcx
je 0x175a2
movb 0x10(%rcx), %cl
andb $0x3, %cl
xorl %esi, %esi
cmpb $0x1, %cl
adcl $0x3, %esi
jmp 0x175a7
movl $0x3, %esi
movq 0x50(%rax), %rcx
xorl %ebp, %ebp
movl $0x0, %eax
testq %rcx, %rcx
je 0x175c0
xorl %eax, %eax
testb $0x3, 0x10(%rcx)
sete %al
addl %eax, %esi
addq $0xdc0, %rbx            # imm = 0xDC0
movq %rbx, %rdi
callq 0x7d16
testl %eax, %eax
je 0x17651
movq %rbx, %rdi
callq 0x7cae
movl $0x19, %ebp
cmpl $0x1, %eax
je 0x17651
movq %rbx, %rdi
movl $0x6, %esi
callq 0x7d16
movl %eax, %r14d
shll $0x2, %r14d
movq %rbx, %rdi
movl $0x7, %esi
callq 0x7d16
testl %eax, %eax
je 0x17627
leal (%r14,%r14,2), %r14d
movq %rbx, %rdi
movl $0x8, %esi
callq 0x7d16
leal (%r14,%rax,4), %r14d
addl $0x5, %r14d
jmp 0x1762e
leal (%r14,%r14,2), %r14d
incl %r14d
movq %rbx, %rdi
movl $0x9, %esi
callq 0x7d16
leal (%r14,%rax,2), %r14d
movq %rbx, %rdi
movl $0xa, %esi
callq 0x7d16
movl %eax, %ebp
addl %r14d, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::decode_transform_size_8x8_flag()
int picture_cabac::decode_transform_size_8x8_flag()
{
    const int ctxIdxOffset = 399;
    int ctxIdxInc = 0;
    mb* curr_mb = m_context_variables.curr_mb;

    ctxIdxInc += (curr_mb->A != nullptr) && (MB_IS_INTRA_8x8(curr_mb->A->type));
    ctxIdxInc += (curr_mb->B != nullptr) && (MB_IS_INTRA_8x8(curr_mb->B->type));

    return m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc);
}

// Assembly:
movq 0x28(%rdi), %rax
movq 0x18(%rax), %rcx
testq %rcx, %rcx
je 0x1767c
movl 0x10(%rcx), %ecx
andl $0x3, %ecx
xorl %esi, %esi
cmpl $0x2, %ecx
sete %sil
addl $0x18f, %esi            # imm = 0x18F
jmp 0x17681
movl $0x18f, %esi            # imm = 0x18F
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x1769a
movl 0x10(%rax), %ecx
andl $0x3, %ecx
xorl %eax, %eax
cmpl $0x2, %ecx
sete %al
jmp 0x1769c
xorl %eax, %eax
addl %eax, %esi
addq $0xdc0, %rdi            # imm = 0xDC0
jmp 0x7d16
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::decode_cbp_luma()
int picture_cabac::decode_cbp_luma()
{
    const int ctxIdxOffset = 73;
    int cbp_a, cbp_b, cbp = 0;
    int ctxIdxInc = 0;
    mb* curr_mb = m_context_variables.curr_mb;

    if (curr_mb->left)
        cbp_a = (((curr_mb->left_pair[0]->cbp_luma >> (m_context_variables.left_blocks[0] & (~1))) & 2) << 0) |
                (((curr_mb->left_pair[1]->cbp_luma >> (m_context_variables.left_blocks[2] & (~1))) & 2) << 2);
    else
        cbp_a = 0x0F;

    if (curr_mb->top)
        cbp_b = curr_mb->top->cbp_luma;
    else
        cbp_b = 0x0F;

    ctxIdxInc = !(cbp_a & 0x02) + 2 * !(cbp_b & 0x04);
    cbp += m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc);
    ctxIdxInc = !(cbp   & 0x01) + 2 * !(cbp_b & 0x08);
    cbp += m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc) << 1;
    ctxIdxInc = !(cbp_a & 0x08) + 2 * !(cbp   & 0x01);
    cbp += m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc) << 2;
    ctxIdxInc = !(cbp   & 0x04) + 2 * !(cbp   & 0x02);
    cbp += m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc) << 3;

    return cbp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movl $0xf, %r15d
cmpq $0x0, 0x38(%rax)
movl $0xf, %ebp
je 0x176f4
movq 0x40(%rax), %rcx
movl 0x6c(%rcx), %edx
movq 0x48(%rbx), %rsi
movb (%rsi), %cl
andb $-0x2, %cl
sarl %cl, %edx
movq 0x48(%rax), %rdi
movb 0x8(%rsi), %cl
movl 0x6c(%rdi), %esi
andb $-0x2, %cl
sarl %cl, %esi
andl $0x2, %edx
andl $0x2, %esi
leal (%rdx,%rsi,4), %ebp
movq 0x50(%rax), %rax
testq %rax, %rax
je 0x17701
movl 0x6c(%rax), %r15d
movl %ebp, %esi
shll $0x1e, %esi
sarl $0x1f, %esi
movl %r15d, %eax
shrl %eax
andl $0x2, %eax
subl %eax, %esi
addq $0xdc0, %rbx            # imm = 0xDC0
addl $0x4c, %esi
movq %rbx, %rdi
callq 0x7d16
movl %eax, %r14d
andl $0x1, %eax
shrl $0x2, %r15d
andl $0x2, %r15d
orl %eax, %r15d
movl $0x4c, %esi
subl %r15d, %esi
movq %rbx, %rdi
callq 0x7d16
leal (%r14,%rax,2), %r15d
shll $0x1c, %ebp
sarl $0x1f, %ebp
addl %r14d, %r14d
andl $0x2, %r14d
subl %r14d, %ebp
addl $0x4c, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x7d16
leal (%r15,%rax,4), %r14d
movl %r14d, %esi
shll $0x1d, %esi
sarl $0x1f, %esi
andl $0x2, %r15d
subl %r15d, %esi
addl $0x4c, %esi
movq %rbx, %rdi
callq 0x7d16
leal (%r14,%rax,8), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::decode_cbp_chroma()
int picture_cabac::decode_cbp_chroma()
{
    const int ctxIdxOffset = 77;
    int cbp_a, cbp_b;
    int ctxIdxInc = 0;
    mb* curr_mb = m_context_variables.curr_mb;

    if (curr_mb->left)
        cbp_a = curr_mb->left->cbp_chroma & 0x03;
    else
        cbp_a = 0;

    if (curr_mb->top)
        cbp_b = curr_mb->top->cbp_chroma & 0x03;
    else
        cbp_b = 0;

    ctxIdxInc = 0;
    if (cbp_a > 0)
        ctxIdxInc++;
    if (cbp_b > 0)
        ctxIdxInc += 2;
    if (m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc) == 0)
        return 0;

    ctxIdxInc = 4;
    if (cbp_a == 2)
        ctxIdxInc++;
    if (cbp_b == 2)
        ctxIdxInc += 2;
    return 1 + m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq 0x38(%rax), %rcx
xorl %ebp, %ebp
movl $0x0, %r14d
testq %rcx, %rcx
je 0x177ba
movl 0x70(%rcx), %r14d
andl $0x3, %r14d
movq 0x50(%rax), %rax
testq %rax, %rax
je 0x177c9
movl 0x70(%rax), %ebp
andl $0x3, %ebp
xorl %eax, %eax
testl %r14d, %r14d
setne %al
leal 0x2(%rax), %esi
testl %ebp, %ebp
cmovel %eax, %esi
addq $0xdc0, %rbx            # imm = 0xDC0
addl $0x4d, %esi
movq %rbx, %rdi
callq 0x7d16
testl %eax, %eax
je 0x17812
xorl %eax, %eax
cmpl $0x2, %r14d
sete %al
xorl %ecx, %ecx
cmpl $0x2, %ebp
sete %cl
leal (%rax,%rcx,2), %esi
addl $0x51, %esi
movq %rbx, %rdi
callq 0x7d16
incl %eax
jmp 0x17814
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::decode_mb_qp_delta()
int picture_cabac::decode_mb_qp_delta()
{
    const int ctxIdxOffset = 60;
    int qp_delta = 0;
    int ctxIdxInc;

    ctxIdxInc = (m_context_variables.lastQPdelta != 0) ? 1 : 0;
    if (m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc)) {
        ctxIdxInc = 2;
        qp_delta = 1;
        while (m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc)) {
            ctxIdxInc = 3;
            qp_delta++;
        }

        /* Table 9-3 Assignment of syntax element to codeNum for signed Exp-Golomb coded syntax elements se(v) */
        if (qp_delta & 0x01)
            qp_delta =  ((qp_delta + 1) >> 1);
        else
            qp_delta = -((qp_delta + 1) >> 1);
    }

    return qp_delta;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x1, 0x30(%rdi)
leaq 0xdc0(%rdi), %r14
movl $0x3d, %esi
sbbl $0x0, %esi
movq %r14, %rdi
callq 0x7d16
testl %eax, %eax
je 0x17862
movl $0x3e, %esi
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x7d16
incl %ebx
movl $0x3f, %esi
testl %eax, %eax
jne 0x17844
testb $0x1, %bl
jne 0x17866
shrl %ebx
negl %ebx
jmp 0x1786a
xorl %ebx, %ebx
jmp 0x1786a
incl %ebx
shrl %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::decode_intra_chroma_pred_mode()
int picture_cabac::decode_intra_chroma_pred_mode()
{
    const int ctxIdxOffset = 64;
    int ctxIdxInc = 0;
    mb* curr_mb = m_context_variables.curr_mb;

    /* No need to test for MB_IS_INTRA_NxN and MB_IS_INTRA_16x16,
       as intra_chroma_pred_mode shall be set to 0 for those macroblocks */

    ctxIdxInc += (curr_mb->left != nullptr) && (curr_mb->left->intra_chroma_pred_mode != 0);
    ctxIdxInc += (curr_mb->top != nullptr) && (curr_mb->top->intra_chroma_pred_mode != 0);

    if (m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc) == 0)
        return 0;

    ctxIdxInc = 3;

    if (m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc) == 0)
        return 1;

    if (m_cabac_decoder.decode_decision(ctxIdxOffset + ctxIdxInc) == 0)
        return 2;
    else
        return 3;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdx
movq 0x38(%rdx), %rsi
xorl %eax, %eax
movl $0x0, %ecx
testq %rsi, %rsi
je 0x17895
xorl %ecx, %ecx
cmpb $0x0, 0x68(%rsi)
setne %cl
movq 0x50(%rdx), %rdx
testq %rdx, %rdx
je 0x178a7
xorl %eax, %eax
cmpb $0x0, 0x68(%rdx)
setne %al
addq $0xdc0, %rbx            # imm = 0xDC0
leal (%rax,%rcx), %esi
addl $0x40, %esi
movq %rbx, %rdi
callq 0x7d16
testl %eax, %eax
je 0x178eb
movq %rbx, %rdi
movl $0x43, %esi
callq 0x7d16
testl %eax, %eax
je 0x178ef
movq %rbx, %rdi
movl $0x43, %esi
callq 0x7d16
cmpl $0x1, %eax
movl $0x3, %eax
sbbl $0x0, %eax
jmp 0x178f4
xorl %eax, %eax
jmp 0x178f4
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::decode_coded_block_flag(ymn::h264::ctx_block_cat_e, int)
int picture_cabac::decode_coded_block_flag(const enum ctx_block_cat_e ctxBlockCat, int idx)
{
    /* Table 9-34 – Syntax elements and associated types of binarization, maxBinIdxCtx, and ctxIdxOffset
       Table 9-40 – Assignment of ctxIdxBlockCatOffset to ctxBlockCat for syntax elements coded_block_flag,
       significant_coeff_flag, last_significant_coeff_flag, and coeff_abs_level_minus1 */
    static const int base_ctx[CAT_NUM] =
    {
        85 + 0, 85 + 4, 85 + 8, 85 + 12, 85 + 16, // ctxBlockCat < 5
        1012,                                     // ctxBlockCat == 5
        460 + 0, 460 + 4, 460 + 8,                // 5 < ctxBlockCat < 9
        1012 + 4,                                 // ctxBlockCat == 9
        472 + 0, 472 + 4, 472 + 8,                // 9 < ctxBlockCat < 13
        1012 + 8                                  // ctxBlockCat == 13
    };

    int nza, nzb;
    int ctxIdxInc = 0;

    if (idx < 16 * CC_MAX) { /* ac */
        mb_cache& nzc_cache = m_context_variables.non_zero_count_cache[idx / 16];
        const int cache_idx = mb_cache_idx[idx % 16];

        nza = nzc_cache[cache_idx - 1];
        nzb = nzc_cache[cache_idx - 8];
    }
    else { /* dc */
        mb* curr_mb = m_context_variables.curr_mb;

        if (curr_mb->left)
            nza = curr_mb->left->non_zero_count[idx];
        else
            nza = MB_IS_INTRA(curr_mb->type);

        if (curr_mb->top)
            nzb = curr_mb->top->non_zero_count[idx];
        else
            nzb = MB_IS_INTRA(curr_mb->type);
    }

    if (nza > 0)
        ctxIdxInc += 1;

    if (nzb > 0)
        ctxIdxInc += 2;

    return m_cabac_decoder.decode_decision(base_ctx[ctxBlockCat] + ctxIdxInc);
}

// Assembly:
cmpl $0x2f, %edx
jg 0x17932
leal 0xf(%rdx), %eax
testl %edx, %edx
cmovnsl %edx, %eax
movl %eax, %ecx
sarl $0x4, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rdi,%rcx,8), %rcx
andl $-0x10, %eax
subl %eax, %edx
movslq %edx, %rax
leaq 0x64be(%rip), %rdx      # 0x1dde0
movzbl (%rax,%rdx), %edx
movzbl 0x7f(%rdx,%rcx), %eax
movzbl 0x78(%rdx,%rcx), %ecx
jmp 0x17965
movq 0x28(%rdi), %rcx
movq 0x38(%rcx), %rax
movl %edx, %edx
testq %rax, %rax
je 0x17948
movzbl 0x78(%rax,%rdx), %eax
jmp 0x1794e
movl 0x10(%rcx), %eax
andl $0xf, %eax
movq 0x50(%rcx), %r8
testq %r8, %r8
je 0x1795f
movzbl 0x78(%r8,%rdx), %ecx
jmp 0x17965
movl 0x10(%rcx), %ecx
andl $0xf, %ecx
xorl %edx, %edx
testl %eax, %eax
setg %dl
leal 0x2(%rdx), %eax
testl %ecx, %ecx
cmovel %edx, %eax
addq $0xdc0, %rdi            # imm = 0xDC0
movl %esi, %ecx
leaq 0x646c(%rip), %rdx      # 0x1ddf0
addl (%rdx,%rcx,4), %eax
movl %eax, %esi
jmp 0x7d16
// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::decode_residual_dc(int*, ymn::h264::ctx_block_cat_e, int, unsigned char const*, int)
void picture_cabac::decode_residual_dc(dctcoeff* block,
                                       const enum ctx_block_cat_e ctxBlockCat,
                                       const int idx,
                                       const uint8_t* scantable,
                                       const int max_coeff)
{
    if (decode_coded_block_flag(ctxBlockCat, idx))
        decode_residual_block(block, ctxBlockCat, idx, scantable, max_coeff);
    else {
        mb_cache& nzc_cache = m_context_variables.non_zero_count_cache[idx - 16 * CC_MAX];
        nzc_cache[0] = 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movq %r8, %r14
movl %ecx, %ebp
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %r15
movl %edx, %esi
movl %ecx, %edx
callq 0x178f6
testl %eax, %eax
je 0x17d29
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %ebp, %ecx
movq %r14, %r8
movl %ebx, %r9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x179f4
addl $-0x30, %ebp
movslq %ebp, %rax
leaq (%rax,%rax,4), %rax
movb $0x0, 0x80(%r15,%rax,8)
addq $0x8, %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/picture_cabac.cpp
// Function: ymn::h264::picture_cabac::decode_residual_ac(int*, ymn::h264::ctx_block_cat_e, int, unsigned char const*, int)
void picture_cabac::decode_residual_ac(dctcoeff* block,
                                       const enum ctx_block_cat_e ctxBlockCat,
                                       const int idx,
                                       const uint8_t* scantable,
                                       const int max_coeff)
{
    if (max_coeff != 64 || m_context_variables.chroma_array_type == 3) {
        if (decode_coded_block_flag(ctxBlockCat, idx))
            decode_residual_block(block, ctxBlockCat, idx, scantable, max_coeff);
        else {
            mb_cache& nzc_cache = m_context_variables.non_zero_count_cache[idx / 16];
            const int cache_idx = mb_cache_idx[idx % 16];
            if (max_coeff == 64)
                mb_cache_fill_rectangle_2x2(nzc_cache, cache_idx, 0);
            else
                nzc_cache[cache_idx] = 0;
        }
    }
    else {
        /* When coded_block_flag is not present, it shall be inferred to be equal to 1. */
        decode_residual_block(block, ctxBlockCat, idx, scantable, max_coeff);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movq %r8, %r15
movl %ecx, %r14d
movl %edx, %ebp
movq %rsi, %r13
movq %rdi, %r12
cmpl $0x40, %r9d
jne 0x17d8c
cmpl $0x3, 0x40(%r12)
je 0x17d8c
movq %r12, %rdi
movq %r13, %rsi
movl %ebp, %edx
movl %r14d, %ecx
movq %r15, %r8
movl $0x40, %r9d
jmp 0x17dae
movq %r12, %rdi
movl %ebp, %esi
movl %r14d, %edx
callq 0x178f6
testl %eax, %eax
je 0x17dc1
movq %r12, %rdi
movq %r13, %rsi
movl %ebp, %edx
movl %r14d, %ecx
movq %r15, %r8
movl %ebx, %r9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x179f4
leal 0xf(%r14), %ecx
testl %r14d, %r14d
cmovnsl %r14d, %ecx
movl %ecx, %eax
sarl $0x4, %eax
cltq
leaq (%rax,%rax,4), %rax
leaq (%r12,%rax,8), %rax
addq $0x80, %rax
andl $-0x10, %ecx
subl %ecx, %r14d
movslq %r14d, %rcx
leaq 0x5fef(%rip), %rdx      # 0x1dde0
movzbl (%rcx,%rdx), %ecx
cmpl $0x40, %ebx
jne 0x17e07
xorl %edx, %edx
movw %dx, (%rax,%rcx)
movw %dx, 0x8(%rax,%rcx)
jmp 0x17e0b
movb $0x0, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/cnn/Layer.h
// Function: abcdl::cnn::Layer::~Layer()
virtual ~Layer(){
        for(auto& weight : _batch_weights){delete weight;}
        _batch_weights.clear();
        delete _batch_bias;

        for(auto& weight : _delta_weights){delete weight;}
        _delta_weights.clear();
        delete _delta_bias;

        for(auto& weight : _weights){delete weight;}
        _weights.clear();
        delete _bias;

        for(auto& delta : _deltas){delete delta;}
        _deltas.clear();

        for(auto& activation : _activations){delete activation;}
        _activations.clear();
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x43e04(%rip), %rax     # 0x53f10
movq %rax, (%rdi)
movq 0x98(%rdi), %r15
movq 0xa0(%rdi), %r12
cmpq %r12, %r15
je 0x10140
movq (%r15), %r14
testq %r14, %r14
je 0x1013a
movq %r14, %rdi
callq 0x18696
movq %r14, %rdi
callq 0x8300
addq $0x8, %r15
jmp 0x1011d
movq 0x98(%rbx), %rax
cmpq %rax, 0xa0(%rbx)
je 0x10157
movq %rax, 0xa0(%rbx)
movq 0xb0(%rbx), %r14
testq %r14, %r14
je 0x10173
movq %r14, %rdi
callq 0x18696
movq %r14, %rdi
callq 0x8300
movq 0x78(%rbx), %r15
movq 0x80(%rbx), %r12
cmpq %r12, %r15
je 0x101a1
movq (%r15), %r14
testq %r14, %r14
je 0x1019b
movq %r14, %rdi
callq 0x18696
movq %r14, %rdi
callq 0x8300
addq $0x8, %r15
jmp 0x1017e
movq 0x78(%rbx), %rax
cmpq %rax, 0x80(%rbx)
je 0x101b5
movq %rax, 0x80(%rbx)
movq 0x90(%rbx), %r14
testq %r14, %r14
je 0x101d1
movq %r14, %rdi
callq 0x18696
movq %r14, %rdi
callq 0x8300
movq 0x40(%rbx), %r15
movq 0x48(%rbx), %r12
cmpq %r12, %r15
je 0x101fc
movq (%r15), %r14
testq %r14, %r14
je 0x101f6
movq %r14, %rdi
callq 0x18696
movq %r14, %rdi
callq 0x8300
addq $0x8, %r15
jmp 0x101d9
movq 0x40(%rbx), %rax
cmpq %rax, 0x48(%rbx)
je 0x1020a
movq %rax, 0x48(%rbx)
movq 0x58(%rbx), %r14
testq %r14, %r14
je 0x10223
movq %r14, %rdi
callq 0x18696
movq %r14, %rdi
callq 0x8300
movq 0xb8(%rbx), %r15
movq 0xc0(%rbx), %r12
cmpq %r12, %r15
je 0x10254
movq (%r15), %r14
testq %r14, %r14
je 0x1024e
movq %r14, %rdi
callq 0x18696
movq %r14, %rdi
callq 0x8300
addq $0x8, %r15
jmp 0x10231
movq 0xb8(%rbx), %rax
cmpq %rax, 0xc0(%rbx)
je 0x1026b
movq %rax, 0xc0(%rbx)
movq 0x60(%rbx), %r15
movq 0x68(%rbx), %r12
cmpq %r12, %r15
je 0x10296
movq (%r15), %r14
testq %r14, %r14
je 0x10290
movq %r14, %rdi
callq 0x18696
movq %r14, %rdi
callq 0x8300
addq $0x8, %r15
jmp 0x10273
movq 0x60(%rbx), %rax
cmpq %rax, 0x68(%rbx)
je 0x102a4
movq %rax, 0x68(%rbx)
movq 0xb8(%rbx), %rdi
testq %rdi, %rdi
je 0x102b5
callq 0x8300
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x102c6
callq 0x8300
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x102d4
callq 0x8300
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x102e2
callq 0x8300
movq 0x40(%rbx), %rdi
addq $0x8, %rsp
testq %rdi, %rdi
je 0x102fb
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8300
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/cnn/Layer.cpp
// Function: abcdl::cnn::SubSamplingLayer::initialize(abcdl::cnn::Layer*)
void SubSamplingLayer::initialize(Layer* pre_layer){
    CHECK(pre_layer->get_rows() % _scale == 0 && pre_layer->get_cols() % _scale == 0);
	
    this->_rows = pre_layer->get_rows() / _scale;
    this->_cols = pre_layer->get_cols() / _scale;

    //can't change out_channel_size.
    this->_in_channel_size = this->_out_channel_size = pre_layer->get_out_channel_size();

    this->_deltas.reserve(this->_out_channel_size);
    for(size_t i = 0; i != this->_out_channel_size; i++){
        this->_deltas.push_back(new abcdl::algebra::Mat());
        this->_activations.push_back(new abcdl::algebra::Mat());
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rax
movq 0xd0(%rdi), %rcx
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
jne 0x13dfa
movq 0x10(%r14), %rax
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
jne 0x13dfa
movq 0x8(%r14), %rax
movq 0xd0(%rbx), %rcx
xorl %edx, %edx
divq %rcx
movq %rax, 0x8(%rbx)
movq 0x10(%r14), %rax
xorl %edx, %edx
divq %rcx
movq %rax, 0x10(%rbx)
movq 0x20(%r14), %rsi
movq %rsi, 0x20(%rbx)
movq %rsi, 0x18(%rbx)
leaq 0xb8(%rbx), %r14
movq %r14, %rdi
callq 0x1529a
cmpq $0x0, 0x20(%rbx)
je 0x13de8
leaq 0x60(%rbx), %r15
xorl %ebp, %ebp
movq %rsp, %r12
movl $0x28, %edi
callq 0x8320
movq %rax, %r13
movq %rax, %rdi
callq 0x18440
movq %r13, (%rsp)
movq 0xc0(%rbx), %rsi
cmpq 0xc8(%rbx), %rsi
je 0x13d98
movq %r13, (%rsi)
addq $0x8, 0xc0(%rbx)
jmp 0x13da3
movq %r14, %rdi
movq %r12, %rdx
callq 0x10430
movl $0x28, %edi
callq 0x8320
movq %rax, %r13
movq %rax, %rdi
callq 0x18440
movq %r13, (%rsp)
movq 0x68(%rbx), %rsi
cmpq 0x70(%rbx), %rsi
je 0x13dd0
movq %r13, (%rsi)
addq $0x8, 0x68(%rbx)
jmp 0x13ddb
movq %r15, %rdi
movq %r12, %rdx
callq 0x10430
incq %rbp
cmpq 0x20(%rbx), %rbp
jne 0x13d62
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x25f8b(%rip), %rsi     # 0x39d8c
movq %rsp, %r15
movq %r15, %rdi
movl $0xf, %edx
movl $0x3, %ecx
callq 0x373d6
leaq 0x25f81(%rip), %rsi     # 0x39d9e
movl $0x58, %edx
movq %r15, %rdi
callq 0x8350
movq %rsp, %rdi
callq 0x375fe
jmp 0x13d12
movq %rax, %rbx
movq %rsp, %rdi
callq 0x375fe
jmp 0x13e51
jmp 0x13e46
movq %rax, %rbx
movq %r13, %rdi
callq 0x8300
movq %rbx, %rdi
callq 0x8500
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/cnn/Layer.cpp
// Function: abcdl::cnn::SubSamplingLayer::forward(abcdl::cnn::Layer*)
void SubSamplingLayer::forward(Layer* pre_layer){
	abcdl::algebra::Mat activation;
    for(size_t i = 0; i != this->_out_channel_size; i++){
        _pooling->pool(activation, pre_layer->get_activation(i), this->_rows, this->_cols, this->_scale);
        this->set_activation(i, activation);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %rdi
callq 0x18440
cmpq $0x0, 0x20(%r14)
je 0x13ecf
xorl %r15d, %r15d
leaq 0x8(%rsp), %r12
movq 0xd8(%r14), %r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0x15328
movq 0x8(%r14), %rcx
movq 0x10(%r14), %r8
movq 0xd0(%r14), %r9
movq (%r13), %r10
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq *0x10(%r10)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x153b4
incq %r15
cmpq 0x20(%r14), %r15
jne 0x13e86
leaq 0x8(%rsp), %rdi
callq 0x18696
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x18696
movq %rbx, %rdi
callq 0x8500
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/cnn/Layer.cpp
// Function: abcdl::cnn::ConvolutionLayer::forward(abcdl::cnn::Layer*)
void ConvolutionLayer::forward(Layer* pre_layer){
    for(size_t i = 0; i != this->_out_channel_size; i++){
        abcdl::algebra::Mat activation;
        abcdl::algebra::Mat pre_activation;
        for(size_t j = 0; j != pre_layer->get_out_channel_size(); j++){
            pre_activation = pre_layer->get_activation(j);
            pre_activation.convn(this->get_weight(j, i), _stride, abcdl::algebra::VALID);
            activation += pre_activation;//sum all channels of pre_layer
        }
        //add shared bias of channel in current layer.
        activation += this->_bias->get_data(i, 0);

        _activate_func->activate(activation, activation);
        this->set_activation(i, activation);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
cmpq $0x0, 0x20(%rdi)
je 0x14655
movq %rsi, %rbx
movq %rdi, %r14
movq $0x0, 0x8(%rsp)
leaq 0x38(%rsp), %r12
leaq 0x10(%rsp), %r13
movq %r12, %r15
movq %r12, %rdi
callq 0x18440
movq %r13, %rdi
callq 0x18440
cmpq $0x0, 0x20(%rbx)
je 0x14596
xorl %ebp, %ebp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x15328
movq %r13, %rdi
movq %rax, %rsi
callq 0x20172
movq 0x20(%r14), %r12
imulq %rbp, %r12
addq 0x8(%rsp), %r12
movq 0x48(%r14), %rax
subq 0x40(%r14), %rax
sarq $0x3, %rax
cmpq %rax, %r12
jae 0x14559
movq 0x40(%r14), %rax
movq 0xd0(%r14), %rdx
movq (%rax,%r12,8), %rsi
movq %r13, %rdi
movl $0x1, %ecx
callq 0x2962a
movq %r15, %rdi
movq %r13, %rsi
callq 0x20660
incq %rbp
cmpq 0x20(%rbx), %rbp
jne 0x144f3
jmp 0x14596
leaq 0x60(%rsp), %rdi
leaq 0x258d3(%rip), %rsi     # 0x39e38
movl $0x56, %edx
movl $0x3, %ecx
callq 0x373d6
movl $0x24, %edx
leaq 0x60(%rsp), %rdi
leaq 0x25935(%rip), %rsi     # 0x39eba
callq 0x8350
leaq 0x60(%rsp), %rdi
callq 0x375fe
jmp 0x14527
movq 0x58(%r14), %r12
movq 0x8(%r12), %rax
movq %rax, %rbp
imulq 0x8(%rsp), %rbp
imulq (%r12), %rax
cmpq %rax, %rbp
jae 0x14615
shlq $0x2, %rbp
addq 0x10(%r12), %rbp
movq %r15, %r12
movq %r15, %rdi
movq %rbp, %rsi
callq 0x205d4
movq 0xe0(%r14), %rdi
movq (%rdi), %rax
movq %r12, %rsi
movq %r12, %rdx
callq *0x10(%rax)
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
callq 0x153b4
movq %r13, %rdi
callq 0x18696
movq %r12, %rdi
callq 0x18696
movq 0x8(%rsp), %rcx
incq %rcx
movq %rcx, 0x8(%rsp)
cmpq 0x20(%r14), %rcx
jne 0x144d3
jmp 0x14655
leaq 0x60(%rsp), %rdi
leaq 0x25923(%rip), %rsi     # 0x39f44
movl $0x44, %edx
movl $0x3, %ecx
callq 0x373d6
movl $0x1f, %edx
leaq 0x60(%rsp), %rdi
leaq 0x2591c(%rip), %rsi     # 0x39f5d
callq 0x8350
leaq 0x60(%rsp), %rdi
callq 0x375fe
jmp 0x145b2
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14669
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x375fe
jmp 0x14682
movq %rax, %rbx
jmp 0x1468c
jmp 0x1467f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x18696
leaq 0x38(%rsp), %rdi
callq 0x18696
movq %rbx, %rdi
callq 0x8500
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/cnn/Layer.cpp
// Function: abcdl::cnn::OutputLayer::forward(abcdl::cnn::Layer*)
void OutputLayer::forward(Layer* pre_layer){
    //concatenate pre_layer's all channel mat into array
	size_t size = pre_layer->get_rows() * pre_layer->get_cols() * this->_in_channel_size;
    real* data = new real[size];
    size_t idx = 0;
    for(size_t i = 0; i != this->_in_channel_size; i++){
        size_t activation_size = pre_layer->get_activation(i).get_size();
        memcpy(&data[idx], pre_layer->get_activation(i).data(), sizeof(real) * activation_size);
        idx += activation_size;
    }

    _pre_activation_array.set_shallow_data(data, size, 1);

    auto activation = _helper.dot(this->get_weight(0, 0), _pre_activation_array) + (*this->_bias);
    _activate_func->activate(activation, activation);
    this->set_activation(0, activation);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rsi), %rcx
imulq 0x8(%rsi), %rcx
movq 0x18(%rdi), %r14
imulq %r14, %rcx
movq %rcx, %rax
shrq $0x3e, %rax
movq %rcx, (%rsp)
leaq (,%rcx,4), %rcx
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %rcx, %rdi
callq 0x8030
movq %rax, %rbp
testq %r14, %r14
je 0x14db6
xorl %r14d, %r14d
xorl %r13d, %r13d
movq %rbx, 0x8(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x15328
movq 0x8(%rax), %rbx
imulq (%rax), %rbx
leaq (,%r14,4), %r12
addq %rbp, %r12
movq %r15, %rdi
movq %r13, %rsi
callq 0x15328
movq 0x10(%rax), %rsi
leaq (,%rbx,4), %rdx
movq %r12, %rdi
callq 0x8270
addq %rbx, %r14
movq 0x8(%rsp), %rbx
incq %r13
cmpq 0x18(%rbx), %r13
jne 0x14d68
leaq 0x100(%rbx), %r15
movl $0x1, %ecx
movq %r15, %rdi
movq %rbp, %rsi
movq (%rsp), %rdx
callq 0x18a12
movq 0x48(%rbx), %rax
cmpq 0x40(%rbx), %rax
je 0x14e51
leaq 0x30(%rbx), %rsi
movq 0x40(%rbx), %rax
movq (%rax), %rdx
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
callq 0x2f0be
movq 0x58(%rbx), %rdx
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x202a6
leaq 0x38(%rsp), %rdi
callq 0x18696
movq 0x130(%rbx), %rdi
movq (%rdi), %rax
leaq 0x10(%rsp), %rdx
movq %rdx, %rsi
callq *0x10(%rax)
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x153b4
leaq 0x10(%rsp), %rdi
callq 0x18696
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x24fe0(%rip), %rsi     # 0x39e38
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movl $0x56, %edx
movl $0x3, %ecx
callq 0x373d6
leaq 0x25044(%rip), %rsi     # 0x39eba
movl $0x24, %edx
movq %r14, %rdi
callq 0x8350
leaq 0x60(%rsp), %rdi
callq 0x375fe
jmp 0x14ddb
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x375fe
jmp 0x14eb8
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
jmp 0x14eb3
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x18696
movq %rbx, %rdi
callq 0x8500
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/cnn/CNN.cpp
// Function: abcdl::cnn::CNN::set_layers(std::vector<abcdl::cnn::Layer*, std::allocator<abcdl::cnn::Layer*>>)
void CNN::set_layers(std::vector<abcdl::cnn::Layer*> layers){
    CHECK(layers.size() > 0 && layers[0]->get_layer_type() == abcdl::framework::INPUT);
    CHECK(layers[layers.size() - 1]->get_layer_type() == abcdl::framework::OUTPUT);

    abcdl::cnn::Layer* pre_layer = nullptr;
    for(auto& layer : layers){
        layer->initialize(pre_layer);
        _layers.push_back(layer);
        pre_layer = layer;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x15a6c
movq (%rax), %rax
cmpl $0x0, 0x28(%rax)
jne 0x15a6c
movq 0x8(%r14), %rax
movq -0x8(%rax), %rax
cmpl $0x4, 0x28(%rax)
jne 0x15aa9
movq (%r14), %r15
movq 0x8(%r14), %r12
cmpq %r12, %r15
je 0x15a5d
leaq 0x18(%rbx), %r14
xorl %esi, %esi
movq (%r15), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x20(%rbx), %rsi
cmpq 0x28(%rbx), %rsi
je 0x15a46
movq (%r15), %rax
movq %rax, (%rsi)
addq $0x8, 0x20(%rbx)
jmp 0x15a51
movq %r14, %rdi
movq %r15, %rdx
callq 0x167ec
movq (%r15), %rsi
addq $0x8, %r15
cmpq %r12, %r15
jne 0x15a26
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x24562(%rip), %rsi     # 0x39fd5
movq %rsp, %r15
movq %r15, %rdi
movl $0x13, %edx
movl $0x3, %ecx
callq 0x373d6
leaq 0x24556(%rip), %rsi     # 0x39fe5
movl $0x59, %edx
movq %r15, %rdi
callq 0x8350
movq %rsp, %rdi
callq 0x375fe
jmp 0x15a02
leaq 0x24525(%rip), %rsi     # 0x39fd5
movq %rsp, %r15
movq %r15, %rdi
movl $0x14, %edx
movl $0x3, %ecx
callq 0x373d6
leaq 0x24573(%rip), %rsi     # 0x3a03f
movl $0x55, %edx
movq %r15, %rdi
callq 0x8350
movq %rsp, %rdi
callq 0x375fe
jmp 0x15a14
jmp 0x15ae8
movq %rax, %rbx
movq %rsp, %rdi
callq 0x375fe
movq %rbx, %rdi
callq 0x8500
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/cnn/CNN.cpp
// Function: abcdl::cnn::CNN::backward(abcdl::algebra::Matrix<float> const&)
void CNN::backward(const abcdl::algebra::Mat& mat){
    int layer_size = _layers.size();
    abcdl::cnn::Layer* back_layer = nullptr;
    abcdl::cnn::Layer* pre_layer = nullptr;

    for(int k = layer_size - 1; k >= 0; k--){
        auto layer = _layers[k];
        if(layer->get_layer_type() == abcdl::framework::OUTPUT){
            ((OutputLayer*)layer)->set_y(mat.clone().reshape(mat.cols(), mat.rows()));
        }

        pre_layer = (k > 0) ? _layers[k - 1] : nullptr;
        layer->backward(pre_layer, back_layer);
        back_layer = layer;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rsi, 0x10(%rsp)
movq 0x20(%rdi), %r12
movq %rdi, 0x8(%rsp)
subq 0x18(%rdi), %r12
shrq $0x3, %r12
testl %r12d, %r12d
jle 0x161d9
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
incq %r12
xorl %r13d, %r13d
leaq 0x18(%rsp), %r14
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rax,%r12,8), %rbp
cmpl $0x4, 0x28(%rbp)
jne 0x16157
movq %r14, %rdi
movq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x19530
movq (%rbx), %r15
movq 0x8(%rbx), %rbx
movq %r15, %rax
imulq %rbx, %rax
movq 0x20(%rsp), %rcx
imulq 0x18(%rsp), %rcx
cmpq %rcx, %rax
jne 0x16193
movq %rbx, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq %rbp, %rdi
movq %r14, %rsi
callq 0x164e2
movq %r14, %rdi
callq 0x18696
cmpq $0x2, %r12
jne 0x16161
xorl %esi, %esi
jmp 0x1616f
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rax,%r12,8), %rsi
movq (%rbp), %rax
movq %rbp, %rdi
movq %r13, %rdx
callq *0x20(%rax)
decq %r12
movq %rbp, %r13
cmpq $0x1, %r12
leaq 0x18(%rsp), %r14
jg 0x160f8
jmp 0x161d9
leaq 0x40(%rsp), %rdi
leaq 0x23da5(%rip), %rsi     # 0x39f44
movl $0x88, %edx
movl $0x3, %ecx
callq 0x373d6
movl $0x28, %edx
leaq 0x40(%rsp), %r14
movq %r14, %rdi
leaq 0x2410e(%rip), %rsi     # 0x3a2d0
callq 0x8350
movq %r14, %rdi
callq 0x375fe
leaq 0x18(%rsp), %r14
jmp 0x1613a
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x375fe
jmp 0x161fd
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x18696
movq %rbx, %rdi
callq 0x8500
nop
// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/cnn/CNN.cpp
// Function: abcdl::cnn::CNN::evaluate(abcdl::algebra::MatrixSet<float> const&, abcdl::algebra::MatrixSet<float> const&)
size_t CNN::evaluate(const abcdl::algebra::MatSet& data_mat, const abcdl::algebra::MatSet& label_mat){
    size_t cnt = 0;
    size_t size = data_mat.size();
    for(size_t i = 0; i != size; i++){
        forward(data_mat[i]);
        if(label_mat[i].argmax() == _layers[_layers.size() - 1]->get_activation(0).argmax()){
            cnt++;
        }
    }
    return cnt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, 0x10(%rsp)
movq 0x8(%rsi), %rax
movq %rsi, 0x18(%rsp)
movq (%rsi), %rcx
subq %rcx, %rax
je 0x16317
movq %rdi, %r15
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rcx
movq %rcx, 0x8(%rsp)
xorl %r13d, %r13d
leaq 0x20(%rsp), %rbp
xorl %r12d, %r12d
movq %rbp, %rdi
movq 0x18(%rsp), %rsi
movq %r13, %rdx
callq 0x163e2
movq %r15, %rdi
movq %rbp, %rsi
callq 0x1604c
movq %rbp, %rdi
callq 0x18696
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
movq %r13, %rdx
callq 0x163e2
movq %rbp, %rdi
callq 0x2975c
movq %rax, %rbx
movq 0x20(%r15), %rax
movq -0x8(%rax), %rdi
xorl %esi, %esi
callq 0x15328
movq %rax, %rdi
callq 0x2975c
xorl %r14d, %r14d
cmpq %rax, %rbx
sete %r14b
movq %rbp, %rdi
callq 0x18696
addq %r14, %r12
incq %r13
cmpq %r13, 0x8(%rsp)
jne 0x162a1
jmp 0x1631a
xorl %r12d, %r12d
movq %r12, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1632e
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x18696
movq %rbx, %rdi
callq 0x8500
nop