// File: /workspace/github_c_makefile_star2_O0/akumrao[P]videoAnalyzer/encoder/macroblock.c
// Function: x264_cabac_mb_qp_delta(x264_t*, x264_macroblock_t*)
static void x264_cabac_mb_qp_delta(x264_t *h, x264_macroblock_t *mb) {LOG_CALL;
    x264_macroblock_t *mbp = NULL;
    int i_slice_qp = h->pps->i_pic_init_qp + h->sh.i_qp_delta;
    int i_last_dqp = 0;
    int i_ctxIdxInc = 0;
    int val;

    if (mb->i_mb_x > 0 || mb->i_mb_y > 0)
    {
        mbp = mb - 1;
        if (mbp->i_mb_x > 0 || mbp->i_mb_y > 0)
        {
            i_last_dqp = mbp->i_qp - (mbp - 1)->i_qp;
        } else
        {
            i_last_dqp = mbp->i_qp - i_slice_qp;
        }
    }

    if (mbp != NULL &&
            !IS_SKIP(mbp->i_type) && mbp->i_type != I_PCM &&
            i_last_dqp != 0 &&
            (mbp->i_type == I_16x16 || mbp->i_cbp_luma != 0 || mbp->i_cbp_chroma != 0))
    {
        i_ctxIdxInc = 1;
    }
    if (mbp)
        val = (mb->i_qp - mbp->i_qp) <= 0 ? (-2 * (mb->i_qp - mbp->i_qp)) : (2 * (mb->i_qp - mbp->i_qp) - 1);
    else
        val = (mb->i_qp - i_slice_qp) <= 0 ? (-2 * (mb->i_qp - i_slice_qp)) : (2 * (mb->i_qp - i_slice_qp) - 1);

    while (val > 0)
    {
        x264_cabac_encode_decision(&h->cabac, 60 + i_ctxIdxInc, 1);
        if (i_ctxIdxInc < 2)
        {
            i_ctxIdxInc = 2;
        } else
        {
            i_ctxIdxInc = 3;
        }
        val--;
    }
    x264_cabac_encode_decision(&h->cabac, 60 + i_ctxIdxInc, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x9289(%rip), %rdi      # 0x28eb0
leaq 0xfea6(%rip), %rsi      # 0x2fad4
leaq 0x104b4(%rip), %rdx     # 0x300e9
movb $0x0, %al
callq 0x4d20
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10dae0(%rax), %rax
movl 0x1034(%rax), %eax
movq -0x8(%rbp), %rcx
addl 0x10db44(%rcx), %eax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jg 0x1fc83
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jle 0x1fccf
movq -0x10(%rbp), %rax
addq $-0xf88, %rax           # imm = 0xF078
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jg 0x1fca4
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jle 0x1fcbd
movq -0x18(%rbp), %rax
movl 0x2b0(%rax), %eax
movq -0x18(%rbp), %rcx
subl -0xcd8(%rcx), %eax
movl %eax, -0x20(%rbp)
jmp 0x1fccd
movq -0x18(%rbp), %rax
movl 0x2b0(%rax), %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x1fccf
cmpq $0x0, -0x18(%rbp)
je 0x1fd25
movq -0x18(%rbp), %rax
cmpl $0x5, 0x18(%rax)
je 0x1fd25
movq -0x18(%rbp), %rax
cmpl $0x11, 0x18(%rax)
je 0x1fd25
movq -0x18(%rbp), %rax
cmpl $0x2, 0x18(%rax)
je 0x1fd25
cmpl $0x0, -0x20(%rbp)
je 0x1fd25
movq -0x18(%rbp), %rax
cmpl $0x1, 0x18(%rax)
je 0x1fd1e
movq -0x18(%rbp), %rax
cmpl $0x0, 0x2b8(%rax)
jne 0x1fd1e
movq -0x18(%rbp), %rax
cmpl $0x0, 0x2b4(%rax)
je 0x1fd25
movl $0x1, -0x24(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1fd88
movq -0x10(%rbp), %rax
movl 0x2b0(%rax), %eax
movq -0x18(%rbp), %rcx
subl 0x2b0(%rcx), %eax
cmpl $0x0, %eax
jg 0x1fd64
movq -0x10(%rbp), %rax
movl 0x2b0(%rax), %eax
movq -0x18(%rbp), %rcx
subl 0x2b0(%rcx), %eax
imull $0xfffffffe, %eax, %eax # imm = 0xFFFFFFFE
movl %eax, -0x2c(%rbp)
jmp 0x1fd80
movq -0x10(%rbp), %rax
movl 0x2b0(%rax), %eax
movq -0x18(%rbp), %rcx
subl 0x2b0(%rcx), %eax
shll %eax
subl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x1fdcd
movq -0x10(%rbp), %rax
movl 0x2b0(%rax), %eax
subl -0x1c(%rbp), %eax
cmpl $0x0, %eax
jg 0x1fdb2
movq -0x10(%rbp), %rax
movl 0x2b0(%rax), %eax
subl -0x1c(%rbp), %eax
imull $0xfffffffe, %eax, %eax # imm = 0xFFFFFFFE
movl %eax, -0x30(%rbp)
jmp 0x1fdc7
movq -0x10(%rbp), %rax
movl 0x2b0(%rax), %eax
subl -0x1c(%rbp), %eax
shll %eax
subl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x1fdcf
cmpl $0x0, -0x28(%rbp)
jle 0x1fe11
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl -0x24(%rbp), %esi
addl $0x3c, %esi
movl $0x1, %edx
callq 0x3970
cmpl $0x2, -0x24(%rbp)
jge 0x1fdff
movl $0x2, -0x24(%rbp)
jmp 0x1fe06
movl $0x3, -0x24(%rbp)
movl -0x28(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1fdcf
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl -0x24(%rbp), %esi
addl $0x3c, %esi
xorl %edx, %edx
callq 0x3970
addq $0x30, %rsp
popq %rbp
retq
nop