// File: /workspace/github_c_makefile_star2_O3/akumrao[P]videoAnalyzer/core/macroblock.c
// Function: x264_mb_mc_partition_lx(x264_t*, x264_macroblock_t*, int, int, int)
static inline void x264_mb_mc_partition_lx(x264_t *h, x264_macroblock_t *mb, int i_list, int i_part, int i_sub) {LOG_CALL;
    const x264_mb_context_t *ctx = mb->context;

    int mx, my;
    int i_ref;
    int i_width, i_height;
    int x, y;
    int ch;
    int i_dst;
    uint8_t *p_dst;
    int i_src;
    uint8_t *p_src;

    x264_mb_partition_get(mb, i_list, i_part, i_sub, &i_ref, &mx, &my);
    x264_mb_partition_getxy(mb, i_part, i_sub, &x, &y);
    x264_mb_partition_size(mb, i_part, i_sub, &i_width, &i_height);

    if ((i_list == 0 && i_ref > h->i_ref0) ||
            (i_list == 1 && i_ref > h->i_ref1) ||
            i_ref < 0)
    {
        fprintf(stderr, "invalid ref frame\n");
        return;
    }

    i_dst = ctx->i_fdec[0];
    p_dst = ctx->p_fdec[0];
    if (i_list == 0)
    {
        i_src = ctx->i_fref0[i_ref][0];
        p_src = ctx->p_fref0[i_ref][0];
    } else
    {
        i_src = ctx->i_fref1[i_ref][0];
        p_src = ctx->p_fref1[i_ref][0];
    }
    h->mc[MC_LUMA](&p_src[4 * (x + y * i_src)], i_src,
            &p_dst[4 * (x + y * i_dst)], i_dst,
            mx, my, 4 * i_width, 4 * i_height);


    for (ch = 0; ch < 2; ch++)
    {
        i_dst = ctx->i_fdec[1 + ch];
        p_dst = ctx->p_fdec[1 + ch];
        if (i_list == 0)
        {
            i_src = ctx->i_fref0[i_ref][1 + ch];
            p_src = ctx->p_fref0[i_ref][1 + ch];
        } else
        {
            i_src = ctx->i_fref1[i_ref][1 + ch];
            p_src = ctx->p_fref1[i_ref][1 + ch];
        }
        h->mc[MC_CHROMA](&p_src[2 * (x + y * i_src)], i_src,
                &p_dst[2 * (x + y * i_dst)], i_dst,
                mx, my, 2 * i_width, 2 * i_height);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, %ebx
movl %ecx, %r14d
movl %edx, %r15d
movq %rsi, %r13
movq %rdi, -0x38(%rbp)
leaq 0x1f5ba(%rip), %rdi     # 0x271b4
leaq 0x1fc2f(%rip), %rsi     # 0x27830
leaq 0x1fe8b(%rip), %rdx     # 0x27a93
movl $0x0, -0x2c(%rbp)
xorl %eax, %eax
callq 0x4a56
movq 0x10(%r13), %rax
movq %rax, -0x50(%rbp)
subq $0x8, %rsp
leaq -0x3c(%rbp), %rax
leaq -0x30(%rbp), %r8
leaq -0x40(%rbp), %r9
movq %r13, %rdi
movl %r15d, %r12d
movl %r15d, %esi
movl %r14d, %r15d
movl %r14d, %edx
movl %ebx, %ecx
pushq %rax
callq 0x6ad0
addq $0x10, %rsp
movl 0x1c(%r13), %eax
cmpl $0xd, %eax
je 0x7c84
movl $0x4, %r10d
cmpl $0xf, %eax
je 0x7c70
cmpl $0xe, %eax
jne 0x7ccc
addl %r15d, %r15d
movl $0x2, %r10d
movl %r15d, %r8d
jmp 0x7ccf
addl %r15d, %r15d
movl $0x2, %ebx
xorl %r8d, %r8d
movl %r15d, -0x2c(%rbp)
jmp 0x7d39
movl %r15d, %r8d
shrl $0x1f, %r8d
addl %r15d, %r8d
andl $-0x2, %r8d
movslq %r15d, %rax
subl %r8d, %r15d
addl %r15d, %r15d
movl %r15d, -0x2c(%rbp)
movl 0x20(%r13,%rax,4), %eax
cmpl $0xa, %eax
ja 0x7cf1
movl $0x111, %ecx            # imm = 0x111
btl %eax, %ecx
jb 0x7cd6
movl $0x222, %ecx            # imm = 0x222
btl %eax, %ecx
jb 0x7cee
movl $0x444, %ecx            # imm = 0x444
btl %eax, %ecx
jae 0x7cf1
addl %ebx, -0x2c(%rbp)
jmp 0x7cf1
xorl %r8d, %r8d
movl $0x4, %ebx
jmp 0x7d39
movl %ebx, %ecx
shrl $0x1f, %ecx
addl %ebx, %ecx
movl %ecx, %edx
andl $-0x2, %edx
subl %edx, %ebx
addl %ebx, -0x2c(%rbp)
sarl %ecx
addl %ecx, %r8d
jmp 0x7cf1
addl %ebx, %r8d
cmpl $0xa, %eax
ja 0x7d2e
movl $0x1, %r10d
movl $0x111, %ecx            # imm = 0x111
btl %eax, %ecx
jb 0x7d20
movl $0x222, %ecx            # imm = 0x222
btl %eax, %ecx
jb 0x7d27
movl $0x444, %ecx            # imm = 0x444
btl %eax, %ecx
jae 0x7d2e
movl $0x2, %r10d
movl $0x1, %ebx
jmp 0x7d39
movl $0x2, %ebx
jmp 0x7d39
movl $0x2, %ebx
movl $0x2, %r10d
testl %r12d, %r12d
movl %r12d, -0x48(%rbp)
je 0x7d64
movl -0x30(%rbp), %eax
cmpl $0x1, %r12d
jne 0x7d8f
testl %eax, %eax
js 0x7ede
movq -0x38(%rbp), %rdx
cmpl 0x10f100(%rdx), %eax
jle 0x7d97
jmp 0x7ede
movl -0x30(%rbp), %eax
testl %eax, %eax
js 0x7ede
movq -0x38(%rbp), %rdx
cmpl 0x10f078(%rdx), %eax
jg 0x7ede
movq -0x38(%rbp), %r11
movl $0x68, %ecx
movl $0x1e8, %edx            # imm = 0x1E8
jmp 0x7da5
testl %eax, %eax
js 0x7ede
movq -0x38(%rbp), %r11
movl $0x2a8, %ecx            # imm = 0x2A8
movl $0x428, %edx            # imm = 0x428
movq -0x50(%rbp), %r15
addq %r15, %rdx
movl %eax, %eax
addq %r15, %rcx
leaq (%rax,%rax,2), %rax
movl (%rdx,%rax,4), %esi
movl %esi, %edx
imull %r8d, %edx
movl -0x2c(%rbp), %r14d
addl %r14d, %edx
shll $0x2, %edx
movslq %edx, %rdi
addq (%rcx,%rax,8), %rdi
movl 0x58(%r15), %ecx
movl %ecx, %eax
imull %r8d, %eax
addl %r14d, %eax
shll $0x2, %eax
movslq %eax, %rdx
addq 0x40(%r15), %rdx
movl %r8d, %r13d
movl -0x40(%rbp), %r8d
movl -0x3c(%rbp), %r9d
leal (,%rbx,4), %eax
movl %r14d, %r12d
movq %r10, %r14
leal (,%r10,4), %r10d
pushq %r10
pushq %rax
callq *0x10f380(%r11)
movq %r14, %r10
addq $0x10, %rsp
addl %ebx, %ebx
movq %rbx, -0x60(%rbp)
addl %r10d, %r10d
leaq 0x428(%r15), %rdx
leaq 0x1e8(%r15), %rax
leaq 0x2a8(%r15), %rcx
movl %r12d, %r14d
leaq 0x68(%r15), %rsi
cmpl $0x0, -0x48(%rbp)
cmoveq %rax, %rdx
movq %rdx, -0x48(%rbp)
cmovneq %rcx, %rsi
movq %rsi, -0x58(%rbp)
movl $0x1, %eax
movb $0x1, %r12b
movl 0x58(%r15,%rax,4), %ecx
movslq -0x30(%rbp), %rdx
leaq (%rdx,%rdx,2), %rdx
movq -0x48(%rbp), %rsi
leaq (%rsi,%rdx,4), %rsi
movq -0x58(%rbp), %rdi
leaq (%rdi,%rdx,8), %rdx
movl (%rsi,%rax,4), %esi
movl %esi, %edi
imull %r13d, %edi
addl %r14d, %edi
addl %edi, %edi
movslq %edi, %rdi
addq (%rdx,%rax,8), %rdi
movl %ecx, %edx
imull %r13d, %edx
addl %r14d, %edx
addl %edx, %edx
movslq %edx, %rdx
addq 0x40(%r15,%rax,8), %rdx
movl -0x40(%rbp), %r8d
movl -0x3c(%rbp), %r9d
pushq %r10
pushq -0x60(%rbp)
movq %r10, %rbx
movq -0x38(%rbp), %rax
callq *0x10f388(%rax)
movq %rbx, %r10
addq $0x10, %rsp
movl $0x2, %eax
testb $0x1, %r12b
movl $0x0, %r12d
jne 0x7e58
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x25b9
jmp 0x7ecf