// File: /workspace/github_c_makefile_star2_O1/akumrao[P]videoAnalyzer/encoder/macroblock.c
// Function: x264_mb_partition_mvd(x264_macroblock_t*, int, int, int, int*)
void x264_mb_partition_mvd(x264_macroblock_t *mb, int i_list, int i_part, int i_sub, int mvd[2]) {LOG_CALL;
    int mvp[2];

    int x, y;
    int w, h;
    int dx, dy;

    x264_mb_partition_getxy(mb, i_part, i_sub, &x, &y);
    x264_mb_partition_size(mb, i_part, i_sub, &w, &h);
    x264_mb_predict_mv(mb, i_list, i_part, i_sub, mvp);

    mvd[0] = mb->partition[x][y].mv[i_list][0] - mvp[0];
    mvd[1] = mb->partition[x][y].mv[i_list][1] - mvp[1];

    for (dx = 0; dx < w; dx++)
    {
        for (dy = 0; dy < h; dy++)
        {
            mb->partition[x + dx][y + dy].mvd[i_list][0] = mvd[0];
            mb->partition[x + dx][y + dy].mvd[i_list][1] = mvd[1];
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, -0x34(%rbp)
movq %rdi, %r14
leaq 0xeb49(%rip), %rdi      # 0x251b4
leaq 0x153a6(%rip), %rsi     # 0x2ba18
leaq 0x153b4(%rip), %rdx     # 0x2ba2d
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x4c22
movl 0x1c(%r14), %eax
cmpl $0xd, %eax
je 0x166b1
cmpl $0xf, %eax
je 0x166a5
cmpl $0xe, %eax
movl %r15d, %ecx
movq %r12, %rdx
jne 0x166a0
leal (%rdx,%rdx), %r13d
xorl %r9d, %r9d
jmp 0x1671e
movq %r12, %rdx
leal (%r12,%r12), %r9d
movl %r15d, %ecx
jmp 0x1671e
movq %r12, %rdx
movl %edx, %r13d
shrl $0x1f, %r13d
addl %edx, %r13d
andl $-0x2, %r13d
movl %edx, %r9d
subl %r13d, %r9d
addl %r9d, %r9d
movslq %edx, %rcx
movl 0x20(%r14,%rcx,4), %esi
cmpl $0xa, %esi
ja 0x166ac
movl $0x111, %ecx            # imm = 0x111
btl %esi, %ecx
movl %r15d, %ecx
jb 0x166fe
movl $0x222, %edi            # imm = 0x222
btl %esi, %edi
jb 0x1671b
movl $0x444, %edi            # imm = 0x444
btl %esi, %edi
jae 0x1671e
addl %ecx, %r9d
jmp 0x1671e
movl %ecx, %edi
shrl $0x1f, %edi
addl %ecx, %edi
movl %edi, %r8d
andl $-0x2, %r8d
movl %ecx, %esi
subl %r8d, %esi
addl %esi, %r9d
sarl %edi
addl %edi, %r13d
jmp 0x1671e
addl %ecx, %r13d
movl %r13d, -0x30(%rbp)
cmpl $0xd, %eax
movl %r9d, -0x2c(%rbp)
je 0x16751
movl $0x4, %r13d
cmpl $0xf, %eax
je 0x16749
cmpl $0xe, %eax
jne 0x16741
movl $0x2, %r13d
movl $0x4, %r15d
jmp 0x16781
movl $0x2, %r15d
jmp 0x16781
movslq %edx, %rax
movl 0x20(%r14,%rax,4), %eax
movl $0x2, %r15d
movl $0x2, %r13d
cmpq $0xa, %rax
ja 0x16781
leaq 0x151f6(%rip), %rsi     # 0x2b968
movq (%rsi,%rax,8), %r15
leaq 0x15243(%rip), %rsi     # 0x2b9c0
movq (%rsi,%rax,8), %r13
leaq -0x3c(%rbp), %r8
movq %r14, %rdi
movq %r14, %r12
movl -0x34(%rbp), %r14d
movl %r14d, %esi
callq 0x6de8
movslq -0x2c(%rbp), %rax
movslq -0x30(%rbp), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
leaq (%rax,%rcx,8), %rax
leaq (%r12,%rax), %rcx
movslq %r14d, %rdx
movl 0x38(%rcx,%rdx,8), %esi
leaq -0x3c(%rbp), %rdi
subl (%rdi), %esi
movl %esi, (%rbx)
movl 0x3c(%rcx,%rdx,8), %ecx
subl 0x4(%rdi), %ecx
movl %ecx, 0x4(%rbx)
leaq (%rax,%rdx,8), %rax
addq %r12, %rax
addq $0x4c, %rax
xorl %ecx, %ecx
movq %r13, %rdx
movq %rax, %rsi
movl (%rbx), %edi
movl %edi, -0x4(%rsi)
movl 0x4(%rbx), %edi
movl %edi, (%rsi)
addq $0x28, %rsi
decq %rdx
jne 0x167df
incq %rcx
addq $0xa0, %rax
cmpq %r15, %rcx
jne 0x167d9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq