// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
movl %r8d, %r13d
movl %ecx, %r15d
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, -0x40(%rbp)
leaq 0x147b2(%rip), %rdi     # 0x1b1b4
leaq 0x1518f(%rip), %rsi     # 0x1bb98
leaq 0x153eb(%rip), %rdx     # 0x1bdfb
xorl %eax, %eax
callq 0x39ba
movq 0x10(%r12), %rax
movq %rax, -0x60(%rbp)
subq $0x8, %rsp
leaq -0x30(%rbp), %rax
leaq -0x2c(%rbp), %r8
leaq -0x34(%rbp), %r9
movq %r12, %rdi
movl %ebx, %esi
movl %r15d, %edx
movl %r13d, %ecx
pushq %rax
callq 0x5a03
popq %rax
popq %rcx
leaq -0x4c(%rbp), %rcx
leaq -0x48(%rbp), %r8
movq %r12, %rdi
movl %r15d, %esi
movl %r13d, %edx
callq 0x58f5
leaq -0x54(%rbp), %rdx
leaq -0x50(%rbp), %rcx
movq %r12, %rdi
movl %r15d, %esi
callq 0x5997
testl %ebx, %ebx
movl %ebx, -0x44(%rbp)
je 0x6a94
movl -0x2c(%rbp), %eax
cmpl $0x1, %ebx
jne 0x6ab9
testl %eax, %eax
js 0x6bf0
movq -0x40(%rbp), %rcx
cmpl 0x10f100(%rcx), %eax
jle 0x6ac1
jmp 0x6bf0
movl -0x2c(%rbp), %eax
testl %eax, %eax
js 0x6bf0
movq -0x40(%rbp), %rcx
cmpl 0x10f078(%rcx), %eax
jg 0x6bf0
pushq $0x68
popq %rdx
movl $0x1e8, %esi            # imm = 0x1E8
jmp 0x6acb
testl %eax, %eax
js 0x6bf0
movl $0x2a8, %edx            # imm = 0x2A8
movl $0x428, %esi            # imm = 0x428
movq -0x60(%rbp), %rbx
addq %rbx, %rsi
movl %eax, %eax
imulq $0xc, %rax, %rdi
addq %rbx, %rdx
imulq $0x18, %rax, %rax
movl 0x58(%rbx), %ecx
movl (%rdi,%rsi), %esi
movl -0x4c(%rbp), %r15d
movl -0x48(%rbp), %r12d
movl %r12d, %edi
imull %esi, %edi
addl %r15d, %edi
shll $0x2, %edi
movslq %edi, %rdi
addq (%rax,%rdx), %rdi
movl %r12d, %eax
imull %ecx, %eax
addl %r15d, %eax
shll $0x2, %eax
movslq %eax, %rdx
addq 0x40(%rbx), %rdx
movl -0x34(%rbp), %r8d
movl -0x30(%rbp), %r9d
movl -0x54(%rbp), %r14d
leal (,%r14,4), %eax
movl -0x50(%rbp), %r13d
leal (,%r13,4), %r10d
pushq %r10
pushq %rax
movq -0x40(%rbp), %rax
callq *0x10f380(%rax)
addq $0x10, %rsp
addl %r14d, %r14d
movq %r14, -0x70(%rbp)
addl %r13d, %r13d
movq %r13, -0x68(%rbp)
leaq 0x428(%rbx), %r13
leaq 0x1e8(%rbx), %rax
leaq 0x2a8(%rbx), %rcx
leaq 0x68(%rbx), %r14
cmpl $0x0, -0x44(%rbp)
cmoveq %rax, %r13
cmovneq %rcx, %r14
addq $0x4, %r13
addq $0x8, %r14
xorl %ebx, %ebx
cmpq $0x8, %rbx
je 0x6c0c
movq -0x60(%rbp), %r8
movl 0x5c(%r8,%rbx), %ecx
movslq -0x2c(%rbp), %rax
imulq $0xc, %rax, %rdx
addq %r13, %rdx
imulq $0x18, %rax, %rax
addq %r14, %rax
movl (%rbx,%rdx), %esi
movl %esi, %edx
imull %r12d, %edx
addl %r15d, %edx
addl %edx, %edx
movslq %edx, %rdi
addq (%rax,%rbx,2), %rdi
movl %ecx, %eax
imull %r12d, %eax
addl %r15d, %eax
addl %eax, %eax
movslq %eax, %rdx
addq 0x48(%r8,%rbx,2), %rdx
movl -0x34(%rbp), %r8d
movl -0x30(%rbp), %r9d
pushq -0x68(%rbp)
pushq -0x70(%rbp)
movq -0x40(%rbp), %rax
callq *0x10f388(%rax)
addq $0x10, %rsp
addq $0x4, %rbx
jmp 0x6b81
movq 0x213d9(%rip), %rax     # 0x27fd0
movq (%rax), %rcx
leaq 0x15212(%rip), %rdi     # 0x1be13
pushq $0x12
popq %rsi
pushq $0x1
popq %rdx
callq 0x21e0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq