// File: /workspace/github_c_makefile_star2_O0/akumrao[P]videoAnalyzer/encoder/macroblock.c
// Function: x264_cabac_mb_type(x264_t*, x264_macroblock_t*)
static void x264_cabac_mb_type(x264_t *h, x264_macroblock_t *mb) {LOG_CALL;
    x264_macroblock_t *mba = mb->context->mba;
    x264_macroblock_t *mbb = mb->context->mbb;
    int i_ctxIdxInc = 0;

    if (h->sh.i_type == SLICE_TYPE_I)
    {

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

        if (mb->i_type == I_4x4)
        {
            x264_cabac_encode_decision(&h->cabac, 3 + i_ctxIdxInc, 0);
        } else if (mb->i_type == I_PCM)
        {
            x264_cabac_encode_decision(&h->cabac, 3 + i_ctxIdxInc, 1);
            x264_cabac_encode_terminal(&h->cabac, 1); /*ctxIdx == 276 */
        } else /* I_16x16 */
        {
            x264_cabac_encode_decision(&h->cabac, 3 + i_ctxIdxInc, 1);
            x264_cabac_encode_terminal(&h->cabac, 0); /*ctxIdx == 276 */

            x264_cabac_encode_decision(&h->cabac, 3 + 3, (mb->i_cbp_luma == 0 ? 0 : 1));
            if (mb->i_cbp_chroma == 0)
            {
                x264_cabac_encode_decision(&h->cabac, 3 + 4, 0);
            } else
            {
                x264_cabac_encode_decision(&h->cabac, 3 + 4, 1);
                x264_cabac_encode_decision(&h->cabac, 3 + 5, (mb->i_cbp_chroma == 1 ? 0 : 1));
            }
            x264_cabac_encode_decision(&h->cabac, 3 + 6, ((mb->i_intra16x16_pred_mode / 2) ? 1 : 0));
            x264_cabac_encode_decision(&h->cabac, 3 + 7, ((mb->i_intra16x16_pred_mode % 2) ? 1 : 0));
        }
    } else if (h->sh.i_type == SLICE_TYPE_P)
    {
        /* prefix: 14, suffix: 17 */
        if (mb->i_type == P_L0)
        {
            if (mb->i_partition == D_16x16)
            {
                x264_cabac_encode_decision(&h->cabac, 14, 0);
                x264_cabac_encode_decision(&h->cabac, 15, 0);
                x264_cabac_encode_decision(&h->cabac, 16, 0);
            } else if (mb->i_partition == D_16x8)
            {
                x264_cabac_encode_decision(&h->cabac, 14, 0);
                x264_cabac_encode_decision(&h->cabac, 15, 1);
                x264_cabac_encode_decision(&h->cabac, 17, 1);
            } else if (mb->i_partition == D_8x16)
            {
                x264_cabac_encode_decision(&h->cabac, 14, 0);
                x264_cabac_encode_decision(&h->cabac, 15, 1);
                x264_cabac_encode_decision(&h->cabac, 17, 0);
            }
        } else if (mb->i_type == P_8x8)
        {
            x264_cabac_encode_decision(&h->cabac, 14, 0);
            x264_cabac_encode_decision(&h->cabac, 15, 0);
            x264_cabac_encode_decision(&h->cabac, 16, 1);
        } else if (mb->i_type == I_4x4)
        {
            /* prefix */
            x264_cabac_encode_decision(&h->cabac, 14, 1);

            x264_cabac_encode_decision(&h->cabac, 17, 0);
        } else if (mb->i_type == I_PCM)
        {
            /* prefix */
            x264_cabac_encode_decision(&h->cabac, 14, 1);

            x264_cabac_encode_decision(&h->cabac, 17, 1);
            x264_cabac_encode_terminal(&h->cabac, 1); /*ctxIdx == 276 */
        } else /* intra 16x16 */
        {
            /* prefix */
            x264_cabac_encode_decision(&h->cabac, 14, 1);

            /* suffix */
            x264_cabac_encode_decision(&h->cabac, 17, 1);
            x264_cabac_encode_terminal(&h->cabac, 0); /*ctxIdx == 276 */

            x264_cabac_encode_decision(&h->cabac, 17 + 1, (mb->i_cbp_luma == 0 ? 0 : 1));
            if (mb->i_cbp_chroma == 0)
            {
                x264_cabac_encode_decision(&h->cabac, 17 + 2, 0);
            } else
            {
                x264_cabac_encode_decision(&h->cabac, 17 + 2, 1);
                x264_cabac_encode_decision(&h->cabac, 17 + 2, (mb->i_cbp_chroma == 1 ? 0 : 1));
            }
            x264_cabac_encode_decision(&h->cabac, 17 + 3, ((mb->i_intra16x16_pred_mode / 2) ? 1 : 0));
            x264_cabac_encode_decision(&h->cabac, 17 + 3, ((mb->i_intra16x16_pred_mode % 2) ? 1 : 0));
        }
    } else
    {
        fprintf(stderr, "SLICE_TYPE_B unsupported in x264_macroblock_write_cabac\n");
        return;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xa439(%rip), %rdi      # 0x28eb0
leaq 0x11056(%rip), %rsi     # 0x2fad4
leaq 0x11555(%rip), %rdx     # 0x2ffda
movb $0x0, %al
callq 0x4d20
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, 0x10db00(%rax)
jne 0x1ec95
cmpq $0x0, -0x18(%rbp)
je 0x1eadd
movq -0x18(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x1eadd
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1eaf7
movq -0x20(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x1eaf7
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jne 0x1eb1e
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl -0x24(%rbp), %esi
addl $0x3, %esi
xorl %edx, %edx
callq 0x3970
jmp 0x1ec90
movq -0x10(%rbp), %rax
cmpl $0x2, 0x18(%rax)
jne 0x1eb5d
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl -0x24(%rbp), %esi
addl $0x3, %esi
movl $0x1, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x1, %esi
callq 0x3d10
jmp 0x1ec8e
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl -0x24(%rbp), %esi
addl $0x3, %esi
movl $0x1, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
xorl %esi, %esi
callq 0x3d10
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movq -0x10(%rbp), %rax
movl 0x2b8(%rax), %ecx
movl $0x1, %edx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovel %eax, %edx
movl $0x6, %esi
callq 0x3970
movq -0x10(%rbp), %rax
cmpl $0x0, 0x2b4(%rax)
jne 0x1ebdc
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x7, %esi
xorl %edx, %edx
callq 0x3970
jmp 0x1ec22
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x7, %esi
movl $0x1, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movq -0x10(%rbp), %rax
movl 0x2b4(%rax), %ecx
movl $0x1, %edx
xorl %eax, %eax
cmpl $0x1, %ecx
cmovel %eax, %edx
movl $0x8, %esi
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movq -0x10(%rbp), %rax
movl 0x2bc(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
xorl %edx, %edx
movl $0x1, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edx
movl $0x9, %esi
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movq -0x10(%rbp), %rax
movl 0x2bc(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, %ecx
xorl %edx, %edx
movl $0x1, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edx
movl $0xa, %esi
callq 0x3970
jmp 0x1ec90
jmp 0x1f017
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10db00(%rax)
jne 0x1effb
movq -0x10(%rbp), %rax
cmpl $0x3, 0x18(%rax)
jne 0x1edba
movq -0x10(%rbp), %rax
cmpl $0x10, 0x1c(%rax)
jne 0x1ed08
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0xe, %esi
xorl %edx, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0xf, %esi
xorl %edx, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x10, %esi
xorl %edx, %edx
callq 0x3970
jmp 0x1edb5
movq -0x10(%rbp), %rax
cmpl $0xe, 0x1c(%rax)
jne 0x1ed5f
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0xe, %esi
xorl %edx, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0xf, %esi
movl $0x1, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x11, %esi
movl $0x1, %edx
callq 0x3970
jmp 0x1edb3
movq -0x10(%rbp), %rax
cmpl $0xf, 0x1c(%rax)
jne 0x1edb1
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0xe, %esi
xorl %edx, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0xf, %esi
movl $0x1, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x11, %esi
xorl %edx, %edx
callq 0x3970
jmp 0x1edb3
jmp 0x1edb5
jmp 0x1eff9
movq -0x10(%rbp), %rax
cmpl $0x4, 0x18(%rax)
jne 0x1ee11
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0xe, %esi
xorl %edx, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0xf, %esi
xorl %edx, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x10, %esi
movl $0x1, %edx
callq 0x3970
jmp 0x1eff7
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jne 0x1ee51
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0xe, %esi
movl $0x1, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x11, %esi
xorl %edx, %edx
callq 0x3970
jmp 0x1eff5
movq -0x10(%rbp), %rax
cmpl $0x2, 0x18(%rax)
jne 0x1eea9
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0xe, %esi
movl $0x1, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x11, %esi
movl $0x1, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x1, %esi
callq 0x3d10
jmp 0x1eff3
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0xe, %esi
movl $0x1, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x11, %esi
movl $0x1, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
xorl %esi, %esi
callq 0x3d10
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movq -0x10(%rbp), %rax
movl 0x2b8(%rax), %ecx
movl $0x1, %edx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovel %eax, %edx
movl $0x12, %esi
callq 0x3970
movq -0x10(%rbp), %rax
cmpl $0x0, 0x2b4(%rax)
jne 0x1ef41
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x13, %esi
xorl %edx, %edx
callq 0x3970
jmp 0x1ef87
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x13, %esi
movl $0x1, %edx
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movq -0x10(%rbp), %rax
movl 0x2b4(%rax), %ecx
movl $0x1, %edx
xorl %eax, %eax
cmpl $0x1, %ecx
cmovel %eax, %edx
movl $0x13, %esi
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movq -0x10(%rbp), %rax
movl 0x2bc(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
xorl %edx, %edx
movl $0x1, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edx
movl $0x14, %esi
callq 0x3970
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movq -0x10(%rbp), %rax
movl 0x2bc(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, %ecx
xorl %edx, %edx
movl $0x1, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edx
movl $0x14, %esi
callq 0x3970
jmp 0x1eff5
jmp 0x1eff7
jmp 0x1eff9
jmp 0x1f015
movq 0x16fce(%rip), %rax     # 0x35fd0
movq (%rax), %rdi
leaq 0x10fe1(%rip), %rsi     # 0x2ffed
movb $0x0, %al
callq 0x2160
jmp 0x1f017
jmp 0x1f017
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)