// File: /workspace/github_c_makefile_star2_O1/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, %r15d
movl %ecx, %r14d
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, -0x50(%rbp)
leaq 0x1d408(%rip), %rdi     # 0x251b4
leaq 0x1da7d(%rip), %rsi     # 0x25830
leaq 0x1dcd9(%rip), %rdx     # 0x25a93
movl $0x0, -0x2c(%rbp)
xorl %eax, %eax
callq 0x4c22
movq 0x10(%r12), %r13
subq $0x8, %rsp
leaq -0x40(%rbp), %rax
leaq -0x3c(%rbp), %r8
leaq -0x44(%rbp), %r9
movq %r12, %rdi
movl %ebx, -0x38(%rbp)
movl %ebx, %esi
movq %r14, %rbx
movl %r14d, %edx
movl %r15d, %ecx
pushq %rax
callq 0x6ca8
addq $0x10, %rsp
movl 0x1c(%r12), %eax
cmpl $0xd, %eax
je 0x7e20
cmpl $0xf, %eax
je 0x7e1a
cmpl $0xe, %eax
movl -0x38(%rbp), %edx
jne 0x7e15
leal (%rbx,%rbx), %ecx
movl %ecx, -0x2c(%rbp)
xorl %r8d, %r8d
jmp 0x7e88
leal (%rbx,%rbx), %r8d
jmp 0x7e85
movl %ebx, %ecx
shrl $0x1f, %ecx
addl %ebx, %ecx
andl $-0x2, %ecx
movl %ebx, %r8d
movl %ecx, -0x2c(%rbp)
subl %ecx, %r8d
addl %r8d, %r8d
movslq %ebx, %rcx
movl 0x20(%r12,%rcx,4), %ecx
cmpl $0xa, %ecx
ja 0x7e85
movl $0x111, %edx            # imm = 0x111
btl %ecx, %edx
jb 0x7e66
movl $0x222, %edx            # imm = 0x222
btl %ecx, %edx
jb 0x7e81
movl $0x444, %edx            # imm = 0x444
btl %ecx, %edx
jae 0x7e85
addl %r15d, %r8d
jmp 0x7e85
movl %r15d, %ecx
shrl $0x1f, %ecx
addl %r15d, %ecx
movl %ecx, %edx
andl $-0x2, %edx
subl %edx, %r15d
addl %r15d, %r8d
sarl %ecx
addl %ecx, -0x2c(%rbp)
jmp 0x7e85
addl %r15d, -0x2c(%rbp)
movl -0x38(%rbp), %edx
cmpl $0xd, %eax
je 0x7eb1
movl $0x4, %ebx
cmpl $0xf, %eax
je 0x7ea9
cmpl $0xe, %eax
jne 0x7ea1
movl $0x2, %ebx
movl $0x4, %r10d
jmp 0x7edf
movl $0x2, %r10d
jmp 0x7edf
movslq %ebx, %rax
movl 0x20(%r12,%rax,4), %eax
movl $0x2, %r10d
movl $0x2, %ebx
cmpq $0xa, %rax
ja 0x7edf
leaq 0x1dfcf(%rip), %rcx     # 0x25ea0
movl (%rcx,%rax,4), %r10d
leaq 0x1dff0(%rip), %rcx     # 0x25ecc
movl (%rcx,%rax,4), %ebx
testl %edx, %edx
jne 0x7ef6
movl -0x3c(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpl 0x10f078(%rcx), %eax
jg 0x8056
movl -0x3c(%rbp), %eax
cmpl $0x1, %edx
jne 0x804e
testl %eax, %eax
js 0x8056
movq -0x50(%rbp), %rcx
cmpl 0x10f100(%rcx), %eax
jg 0x8056
leaq 0x428(%r13), %r15
leaq 0x1e8(%r13), %rax
leaq 0x2a8(%r13), %rcx
leaq 0x68(%r13), %r14
testl %edx, %edx
cmoveq %rax, %r15
movslq -0x3c(%rbp), %rax
cmovneq %rcx, %r14
leaq (%rax,%rax,2), %rax
movl (%r15,%rax,4), %esi
movl %esi, %ecx
movl -0x2c(%rbp), %edx
imull %edx, %ecx
addl %r8d, %ecx
shll $0x2, %ecx
movslq %ecx, %rdi
addq (%r14,%rax,8), %rdi
movl 0x58(%r13), %ecx
movl %ecx, %eax
imull %edx, %eax
addl %r8d, %eax
shll $0x2, %eax
movslq %eax, %rdx
addq 0x40(%r13), %rdx
movl %r8d, %r12d
movl -0x44(%rbp), %r8d
movl -0x40(%rbp), %r9d
leal (,%r10,4), %eax
movq %r13, -0x58(%rbp)
movq %r10, %r13
leal (,%rbx,4), %r10d
pushq %r10
pushq %rax
movq -0x50(%rbp), %rax
callq *0x10f380(%rax)
movq %r13, %r10
addq $0x10, %rsp
addl %r10d, %r10d
addl %ebx, %ebx
movq %rbx, -0x60(%rbp)
addq $0x4, %r15
movq %r15, -0x38(%rbp)
addq $0x8, %r14
movq %r14, -0x68(%rbp)
movl -0x2c(%rbp), %r15d
movq -0x58(%rbp), %r13
xorl %r14d, %r14d
movl 0x5c(%r13,%r14), %ecx
movslq -0x3c(%rbp), %rax
leaq (%rax,%rax,2), %rax
movq -0x38(%rbp), %rdx
leaq (%rdx,%rax,4), %rdx
movq -0x68(%rbp), %rsi
leaq (%rsi,%rax,8), %rax
movl (%r14,%rdx), %esi
movl %esi, %edx
imull %r15d, %edx
addl %r12d, %edx
addl %edx, %edx
movslq %edx, %rdi
addq (%rax,%r14,2), %rdi
movl %ecx, %eax
imull %r15d, %eax
addl %r12d, %eax
addl %eax, %eax
movslq %eax, %rdx
addq 0x48(%r13,%r14,2), %rdx
movl -0x44(%rbp), %r8d
movl -0x40(%rbp), %r9d
pushq -0x60(%rbp)
pushq %r10
movq %r10, %rbx
movq -0x50(%rbp), %rax
callq *0x10f388(%rax)
movq %rbx, %r10
addq $0x10, %rsp
addq $0x4, %r14
cmpq $0x4, %r14
je 0x7fce
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jns 0x7f1a
callq 0x25f2
jmp 0x803f