// File: /workspace/github_c_makefile_star2_O0/akumrao[P]videoAnalyzer/encoder/macroblock.c
// Function: x264_cabac_mb_mvd(x264_t*, int, int, int)
static void x264_cabac_mb_mvd(x264_t *h, int i_ctx, int i_ctx_inc, int mvd) {LOG_CALL;
    int i_abs = abs(mvd);
    int i_prefix = X264_MIN(i_abs, 9);
    int i;

    for (i = 0; i < i_prefix; i++)
    {
        x264_cabac_encode_decision(&h->cabac, i_ctx + i_ctx_inc, 1);
        if (i_ctx_inc < 3)
        {
            i_ctx_inc = 3;
        } else if (i_ctx_inc < 6)
        {
            i_ctx_inc++;
        }
    }
    if (i_prefix < 9)
    {
        x264_cabac_encode_decision(&h->cabac, i_ctx + i_ctx_inc, 0);
    }

    if (i_prefix >= 9)
    {
        int k = 3;
        int i_suffix = i_abs - 9;

        while (i_suffix >= (1 << k))
        {
            x264_cabac_encode_bypass(&h->cabac, 1);
            i_suffix -= 1 << k;
            k++;
        }
        x264_cabac_encode_bypass(&h->cabac, 0);
        while (k--)
        {
            x264_cabac_encode_bypass(&h->cabac, (i_suffix >> k)&0x01);
        }
    }

    /* sign */
    if (mvd > 0)
    {
        x264_cabac_encode_bypass(&h->cabac, 0);
    } else if (mvd < 0)
    {
        x264_cabac_encode_bypass(&h->cabac, 1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
leaq 0x84f4(%rip), %rdi      # 0x28eb0
leaq 0xf111(%rip), %rsi      # 0x2fad4
leaq 0xf6dd(%rip), %rdx      # 0x300a7
movb $0x0, %al
callq 0x4d20
movl -0x14(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, -0x18(%rbp)
cmpl $0x9, -0x18(%rbp)
jge 0x209ec
movl -0x18(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x209f6
movl $0x9, %eax
movl %eax, -0x2c(%rbp)
jmp 0x209f6
movl -0x2c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x20a53
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl -0xc(%rbp), %esi
addl -0x10(%rbp), %esi
movl $0x1, %edx
callq 0x3970
cmpl $0x3, -0x10(%rbp)
jge 0x20a35
movl $0x3, -0x10(%rbp)
jmp 0x20a46
cmpl $0x6, -0x10(%rbp)
jge 0x20a44
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x20a46
jmp 0x20a48
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x20a03
cmpl $0x9, -0x1c(%rbp)
jge 0x20a71
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl -0xc(%rbp), %esi
addl -0x10(%rbp), %esi
xorl %edx, %edx
callq 0x3970
cmpl $0x9, -0x1c(%rbp)
jl 0x20b13
movl $0x3, -0x24(%rbp)
movl -0x18(%rbp), %eax
subl $0x9, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl -0x24(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
cmpl %ecx, %eax
jl 0x20ad2
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x1, %esi
callq 0x3ba0
movl -0x24(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
movl -0x28(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x20a8b
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
xorl %esi, %esi
callq 0x3ba0
movl -0x24(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x24(%rbp)
cmpl $0x0, %eax
je 0x20b11
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl -0x28(%rbp), %esi
movl -0x24(%rbp), %ecx
sarl %cl, %esi
andl $0x1, %esi
callq 0x3ba0
jmp 0x20ae4
jmp 0x20b13
cmpl $0x0, -0x14(%rbp)
jle 0x20b2d
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
xorl %esi, %esi
callq 0x3ba0
jmp 0x20b4a
cmpl $0x0, -0x14(%rbp)
jge 0x20b48
movq -0x8(%rbp), %rdi
addq $0x10db60, %rdi         # imm = 0x10DB60
movl $0x1, %esi
callq 0x3ba0
jmp 0x20b4a
addq $0x30, %rsp
popq %rbp
retq