// File: /workspace/github_c_makefile_star2_O0/akumrao[P]videoAnalyzer/core/predict.c
// Function: predict_16x16_p(unsigned char*, int)
static void predict_16x16_p( uint8_t *src, int i_stride )
{
    int x, y, i;
    int a, b, c;
    int H = 0;
    int V = 0;
    int i00;

    /* calcule H and V */
    for( i = 0; i <= 7; i++ )
    {
        H += ( i + 1 ) * ( src[ 8 + i - i_stride ] - src[6 -i -i_stride] );
        V += ( i + 1 ) * ( src[-1 + (8+i)*i_stride] - src[-1 + (6-i)*i_stride] );
    }

    a = 16 * ( src[-1 + 15*i_stride] + src[15 - i_stride] );
    b = ( 5 * H + 32 ) >> 6;
    c = ( 5 * V + 32 ) >> 6;

    i00 = a - b * 7 - c * 7 + 16;

    for( y = 0; y < 16; y++ )
    {
        for( x = 0; x < 16; x++ )
        {
            int pix;

            pix = (i00+b*x)>>5;

            src[x] = X264_CLIP3( pix, 0, 255 );
        }
        src += i_stride;
        i00 += c;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x7, -0x18(%rbp)
jg 0xcd8c
movl -0x18(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
movl -0x18(%rbp), %edx
addl $0x8, %edx
subl -0xc(%rbp), %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
movq -0x8(%rbp), %rdx
movl $0x6, %esi
subl -0x18(%rbp), %esi
subl -0xc(%rbp), %esi
movslq %esi, %rsi
movzbl (%rdx,%rsi), %edx
subl %edx, %ecx
imull %ecx, %eax
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
movl -0x18(%rbp), %edx
addl $0x8, %edx
imull -0xc(%rbp), %edx
addl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
movq -0x8(%rbp), %rdx
movl $0x6, %esi
subl -0x18(%rbp), %esi
imull -0xc(%rbp), %esi
addl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movslq %esi, %rsi
movzbl (%rdx,%rsi), %edx
subl %edx, %ecx
imull %ecx, %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xccf0
movq -0x8(%rbp), %rax
imull $0xf, -0xc(%rbp), %ecx
addl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movq -0x8(%rbp), %rcx
movl $0xf, %edx
subl -0xc(%rbp), %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
shll $0x4, %eax
movl %eax, -0x1c(%rbp)
imull $0x5, -0x28(%rbp), %eax
addl $0x20, %eax
sarl $0x6, %eax
movl %eax, -0x20(%rbp)
imull $0x5, -0x2c(%rbp), %eax
addl $0x20, %eax
sarl $0x6, %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
imull $0x7, -0x20(%rbp), %ecx
subl %ecx, %eax
imull $0x7, -0x24(%rbp), %ecx
subl %ecx, %eax
addl $0x10, %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x10, -0x14(%rbp)
jge 0xce8a
movl $0x0, -0x10(%rbp)
cmpl $0x10, -0x10(%rbp)
jge 0xce62
movl -0x30(%rbp), %eax
movl -0x20(%rbp), %ecx
imull -0x10(%rbp), %ecx
addl %ecx, %eax
sarl $0x5, %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0xce28
xorl %eax, %eax
movl %eax, -0x38(%rbp)
jmp 0xce47
cmpl $0xff, -0x34(%rbp)
jle 0xce3b
movl $0xff, %eax
movl %eax, -0x3c(%rbp)
jmp 0xce41
movl -0x34(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xce03
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl -0x24(%rbp), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xcdf2
popq %rbp
retq
nopl (%rax)