// File: /workspace/github_c_makefile_star2_O3/akumrao[P]videoAnalyzer/core/mc.c
// Function: mc_hc(unsigned char*, int, unsigned char*, int, int, int)
static inline void mc_hc( uint8_t *src, int i_src_stride, uint8_t *dst, int i_dst_stride, int i_width, int i_height )
{
    uint8_t *out;
    uint8_t *pix;
    int x, y;

    for( x = 0; x < i_width; x++ )
    {
        int tap[6];

        pix = &src[x];
        out = &dst[x];

        tap[0] = x264_tapfilter1( &pix[-2*i_src_stride] );
        tap[1] = x264_tapfilter1( &pix[-1*i_src_stride] );
        tap[2] = x264_tapfilter1( &pix[ 0*i_src_stride] );
        tap[3] = x264_tapfilter1( &pix[ 1*i_src_stride] );
        tap[4] = x264_tapfilter1( &pix[ 2*i_src_stride] );

        for( y = 0; y < i_height; y++ )
        {
            tap[5] = x264_tapfilter1( &pix[ 3*i_src_stride] );

            *out = x264_mc_clip1( ( tap[0] - 5*tap[1] + 20 * tap[2] + 20 * tap[3] -5*tap[4] + tap[5] + 512 ) >> 10 );

            /* Next line */
            pix += i_src_stride;
            out += i_dst_stride;
            tap[0] = tap[1];
            tap[1] = tap[2];
            tap[2] = tap[3];
            tap[3] = tap[4];
            tap[4] = tap[5];
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %r9d, -0x2c(%rbp)
movq %rdx, -0x60(%rbp)
movq %rdi, -0x40(%rbp)
testl %r8d, %r8d
jle 0x9535
movslq %esi, %rax
leaq (%rax,%rax), %rdx
negq %rdx
movq %rdx, -0x58(%rbp)
movq %rax, %rdx
negq %rdx
movq %rdx, -0x50(%rbp)
leal (%rax,%rax,2), %edx
movslq %edx, %rdx
movslq %ecx, %rcx
movl %r8d, %esi
movq %rsi, -0x68(%rbp)
addq -0x40(%rbp), %rdx
movq %rdx, -0x48(%rbp)
movq $0x0, -0x38(%rbp)
leaq 0x1eaa0(%rip), %rbx     # 0x27df0
cmpl $0x0, -0x2c(%rbp)
jle 0x951c
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %r11
leaq (%rdi,%r11), %rdx
movzbl 0x1(%rdx,%rax,2), %esi
movzbl (%rdx,%rax,2), %r8d
addl %esi, %r8d
leal (%r8,%r8,4), %esi
movzbl -0x2(%rdx,%rax,2), %r8d
leal (%r8,%rsi,4), %r8d
movzbl 0x3(%rdx,%rax,2), %esi
addl %r8d, %esi
movzbl 0x2(%rdx,%rax,2), %r8d
movzbl -0x1(%rdx,%rax,2), %r9d
addl %r8d, %r9d
leal (%r9,%r9,4), %r8d
subl %r8d, %esi
movzbl 0x1(%rax,%rdx), %r8d
movzbl (%rax,%rdx), %r9d
addl %r8d, %r9d
leal (%r9,%r9,4), %r8d
movzbl -0x2(%rax,%rdx), %r9d
leal (%r9,%r8,4), %r9d
movzbl 0x3(%rax,%rdx), %r8d
addl %r9d, %r8d
movzbl 0x2(%rax,%rdx), %r9d
movzbl -0x1(%rax,%rdx), %r10d
addl %r9d, %r10d
leal (%r10,%r10,4), %r9d
subl %r9d, %r8d
movzbl 0x1(%rdi,%r11), %r9d
movzbl (%rdi,%r11), %r10d
addl %r9d, %r10d
leal (%r10,%r10,4), %r9d
movzbl -0x2(%rdi,%r11), %r10d
leal (%r10,%r9,4), %r9d
movzbl 0x3(%rdi,%r11), %r15d
addl %r9d, %r15d
movzbl 0x2(%rdi,%r11), %r9d
movzbl -0x1(%rdi,%r11), %r10d
addl %r9d, %r10d
leal (%r10,%r10,4), %r9d
subl %r9d, %r15d
movq -0x50(%rbp), %rdi
movzbl 0x1(%rdi,%rdx), %r9d
movzbl (%rdi,%rdx), %r10d
addl %r9d, %r10d
leal (%r10,%r10,4), %r9d
movzbl -0x2(%rdi,%rdx), %r10d
leal (%r10,%r9,4), %r9d
movzbl 0x3(%rdi,%rdx), %r12d
addl %r9d, %r12d
movzbl 0x2(%rdi,%rdx), %r9d
movzbl -0x1(%rdi,%rdx), %r10d
addl %r9d, %r10d
leal (%r10,%r10,4), %r9d
subl %r9d, %r12d
movq -0x58(%rbp), %rdi
movzbl 0x1(%rdi,%rdx), %r9d
movzbl (%rdi,%rdx), %r10d
addl %r9d, %r10d
leal (%r10,%r10,4), %r9d
movzbl -0x2(%rdi,%rdx), %r10d
leal (%r10,%r9,4), %r9d
movzbl 0x3(%rdi,%rdx), %r13d
addl %r9d, %r13d
movzbl 0x2(%rdi,%rdx), %r9d
movzbl -0x1(%rdi,%rdx), %edx
addl %r9d, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %r13d
movq -0x60(%rbp), %rdx
addq %r11, %rdx
movq -0x48(%rbp), %r11
movl -0x2c(%rbp), %r9d
movzbl -0x1(%r11), %r10d
movzbl (%r11), %edi
movzbl 0x1(%r11), %r14d
addl %edi, %r14d
movzbl 0x2(%r11), %edi
addl %r10d, %edi
movzbl -0x2(%r11), %r10d
leal (%r14,%r14,4), %r14d
leal (%r10,%r14,4), %r10d
movzbl 0x3(%r11), %r14d
addl %r14d, %r10d
leal (%rdi,%rdi,4), %edi
subl %edi, %r10d
leal (%r15,%r8), %edi
leal (%rdi,%rdi,4), %edi
leal (%r13,%rdi,4), %edi
leal (%r12,%rsi), %r14d
leal (%r14,%r14,4), %r14d
subl %r14d, %edi
addl %r10d, %edi
addl $0x200, %edi            # imm = 0x200
sarl $0xa, %edi
movslq %edi, %rdi
movb 0x50(%rdi,%rbx), %dil
movb %dil, (%rdx)
movl %r12d, %r13d
movl %r15d, %r12d
movl %r8d, %r15d
movl %esi, %r8d
addq %rcx, %rdx
addq %rax, %r11
movl %r10d, %esi
decl %r9d
jne 0x94a0
movq -0x38(%rbp), %rsi
incq %rsi
incq -0x48(%rbp)
movq %rsi, -0x38(%rbp)
cmpq -0x68(%rbp), %rsi
jne 0x9350
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq