// File: /workspace/github_c_makefile_star2_O0/akumrao[P]videoAnalyzer/core/mc.c
// Function: motion_compensation_chroma(unsigned char*, int, unsigned char*, int, int, int, int, int)
static void motion_compensation_chroma( uint8_t *src, int i_src_stride,
                                        uint8_t *dst, int i_dst_stride,
                                        int mvx, int mvy,
                                        int i_width, int i_height )
{
    uint8_t *srcp;
    int x, y;

    const int d8x = mvx&0x07;
    const int d8y = mvy&0x07;

    const int cA = (8-d8x)*(8-d8y);
    const int cB = d8x    *(8-d8y);
    const int cC = (8-d8x)*d8y;
    const int cD = d8x    *d8y;

    src  += (mvy >> 3) * i_src_stride + (mvx >> 3);
    srcp = &src[i_src_stride];

    for( y = 0; y < i_height; y++ )
    {
        for( x = 0; x < i_width; x++ )
        {
            dst[x] = ( cA*src[x]  + cB*src[x+1] +
                       cC*srcp[x] + cD*srcp[x+1] + 32 ) >> 6;
        }
        dst  += i_dst_stride;

        src   = srcp;
        srcp += i_src_stride;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movl -0x20(%rbp), %eax
andl $0x7, %eax
movl %eax, -0x3c(%rbp)
movl -0x24(%rbp), %eax
andl $0x7, %eax
movl %eax, -0x40(%rbp)
movl $0x8, %eax
subl -0x3c(%rbp), %eax
movl $0x8, %ecx
subl -0x40(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x44(%rbp)
movl -0x3c(%rbp), %eax
movl $0x8, %ecx
subl -0x40(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x48(%rbp)
movl $0x8, %eax
subl -0x3c(%rbp), %eax
imull -0x40(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x3c(%rbp), %eax
imull -0x40(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x24(%rbp), %ecx
sarl $0x3, %ecx
imull -0xc(%rbp), %ecx
movl -0x20(%rbp), %eax
sarl $0x3, %eax
addl %eax, %ecx
movq -0x8(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl 0x18(%rbp), %eax
jge 0xad31
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl 0x10(%rbp), %eax
jge 0xacf9
movl -0x44(%rbp), %eax
movq -0x8(%rbp), %rcx
movslq -0x34(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
imull %ecx, %eax
movl -0x48(%rbp), %ecx
movq -0x8(%rbp), %rdx
movl -0x34(%rbp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movzbl (%rdx,%rsi), %edx
imull %edx, %ecx
addl %ecx, %eax
movl -0x4c(%rbp), %ecx
movq -0x30(%rbp), %rdx
movslq -0x34(%rbp), %rsi
movzbl (%rdx,%rsi), %edx
imull %edx, %ecx
addl %ecx, %eax
movl -0x50(%rbp), %ecx
movq -0x30(%rbp), %rdx
movl -0x34(%rbp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movzbl (%rdx,%rsi), %edx
imull %edx, %ecx
addl %ecx, %eax
addl $0x20, %eax
sarl $0x6, %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xac7b
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movl -0xc(%rbp), %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xac68
popq %rbp
retq
nopw %cs:(%rax,%rax)