// File: /workspace/github_c_makefile_star2_O3/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, %r12d
movl %edx, %r15d
movl %esi, %r13d
movq %rdi, %r14
leaq 0x10565(%rip), %rdi     # 0x271b4
leaq 0x16b0e(%rip), %rsi     # 0x2d764
leaq 0x16b1c(%rip), %rdx     # 0x2d779
xorl %eax, %eax
callq 0x4a56
movl 0x1c(%r14), %eax
cmpl $0xd, %eax
je 0x16cc7
movl %r13d, %edx
movl $0x0, -0x30(%rbp)
movq %r14, %r13
cmpl $0xf, %eax
je 0x16ca8
movl %edx, %r14d
cmpl $0xe, %eax
movq %r15, %rdx
movl %r12d, %ecx
jne 0x16d11
leal (%rdx,%rdx), %eax
movl %eax, -0x2c(%rbp)
movl $0x2, %r12d
movl $0x4, %r15d
jmp 0x16dc2
movl %r12d, %ecx
movl %edx, %r14d
movq %r15, %rdx
leal (%r15,%r15), %eax
movl %eax, -0x30(%rbp)
movl $0x2, %r15d
movl $0x0, -0x2c(%rbp)
jmp 0x16d1e
movq %r15, %rdx
movl %edx, %r9d
shrl $0x1f, %r9d
addl %edx, %r9d
andl $-0x2, %r9d
movl %edx, %r8d
subl %r9d, %r8d
addl %r8d, %r8d
movslq %edx, %rax
movl 0x20(%r14,%rax,4), %eax
cmpl $0xa, %eax
ja 0x16d49
movl $0x111, %ecx            # imm = 0x111
btl %eax, %ecx
jb 0x16d29
movl $0x222, %ecx            # imm = 0x222
btl %eax, %ecx
jb 0x16d46
movl $0x444, %ecx            # imm = 0x444
btl %eax, %ecx
jae 0x16d49
addl %r12d, %r8d
jmp 0x16d49
movl $0x0, -0x2c(%rbp)
movl $0x4, %r15d
movl $0x4, %r12d
jmp 0x16dc2
movl %r12d, %ecx
shrl $0x1f, %ecx
addl %r12d, %ecx
movl %ecx, %edi
andl $-0x2, %edi
movl %r12d, %esi
subl %edi, %esi
addl %esi, %r8d
sarl %ecx
addl %ecx, %r9d
jmp 0x16d49
addl %r12d, %r9d
cmpl $0xa, %eax
movl %r8d, -0x30(%rbp)
movl %r9d, -0x2c(%rbp)
ja 0x16e4f
movl $0x111, %ecx            # imm = 0x111
btl %eax, %ecx
jb 0x16d96
movl $0x222, %ecx            # imm = 0x222
btl %eax, %ecx
jb 0x16daa
movl $0x444, %ecx            # imm = 0x444
btl %eax, %ecx
jae 0x16e4f
movl %r12d, %ecx
movl %r13d, %eax
movq %r14, %r13
movl %eax, %r14d
movl $0x2, %r12d
movl $0x1, %r15d
jmp 0x16dc2
movl %r12d, %ecx
movl %r13d, %eax
movq %r14, %r13
movl %eax, %r14d
movl $0x1, %r15d
jmp 0x16dbc
movl %r12d, %ecx
movl %r13d, %eax
movq %r14, %r13
movl %eax, %r14d
movl $0x2, %r15d
movl $0x1, %r12d
leaq -0x38(%rbp), %r8
movq %r13, %rdi
movl %r14d, %esi
callq 0x6c10
movslq -0x30(%rbp), %rax
movslq -0x2c(%rbp), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rax,4), %rax
shlq $0x5, %rax
leaq (%rax,%rcx,8), %rax
leaq (%rax,%r13), %rcx
movslq %r14d, %rdx
movl 0x38(%rcx,%rdx,8), %esi
leaq -0x38(%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 %r13, %rax
addq $0x4c, %rax
shll $0x3, %r12d
leaq (%r12,%r12,4), %rcx
xorl %edx, %edx
xorl %esi, %esi
movl (%rbx), %edi
movl %edi, -0x4(%rax,%rsi)
movl 0x4(%rbx), %edi
movl %edi, (%rax,%rsi)
addq $0x28, %rsi
cmpq %rsi, %rcx
jne 0x16e1d
incq %rdx
addq $0xa0, %rax
cmpq %r15, %rdx
jne 0x16e1b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r12d, %ecx
movl %r13d, %eax
movq %r14, %r13
movl %eax, %r14d
movl $0x2, %r15d
movl $0x2, %r12d
jmp 0x16dc2