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

    for( i = 0; i < 4; i++ )
    {
        H += ( i + 1 ) * ( src[4+i - i_stride] - src[2 - i -i_stride] );
        V += ( i + 1 ) * ( src[-1 +(i+4)*i_stride] - src[-1+(2-i)*i_stride] );
    }

    a = 16 * ( src[-1+7*i_stride] + src[7 - i_stride] );
    b = ( 17 * H + 16 ) >> 5;
    c = ( 17 * V + 16 ) >> 5;
    i00 = a -3*b -3*c + 16;

    for( y = 0; y < 8; y++ )
    {
        for( x = 0; x < 8; 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, -0x10(%rbp)
cmpl $0x4, -0x10(%rbp)
jge 0xd3ec
movl -0x10(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
movl -0x10(%rbp), %edx
addl $0x4, %edx
subl -0xc(%rbp), %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
movq -0x8(%rbp), %rdx
movl $0x2, %esi
subl -0x10(%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 -0x10(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
movl -0x10(%rbp), %edx
addl $0x4, %edx
imull -0xc(%rbp), %edx
addl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
movq -0x8(%rbp), %rdx
movl $0x2, %esi
subl -0x10(%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 -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xd350
movq -0x8(%rbp), %rax
imull $0x7, -0xc(%rbp), %ecx
addl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movq -0x8(%rbp), %rcx
movl $0x7, %edx
subl -0xc(%rbp), %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
shll $0x4, %eax
movl %eax, -0x1c(%rbp)
imull $0x11, -0x28(%rbp), %eax
addl $0x10, %eax
sarl $0x5, %eax
movl %eax, -0x20(%rbp)
imull $0x11, -0x2c(%rbp), %eax
addl $0x10, %eax
sarl $0x5, %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
imull $0x3, -0x20(%rbp), %ecx
subl %ecx, %eax
imull $0x3, -0x24(%rbp), %ecx
subl %ecx, %eax
addl $0x10, %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x8, -0x18(%rbp)
jge 0xd4ea
movl $0x0, -0x14(%rbp)
cmpl $0x8, -0x14(%rbp)
jge 0xd4c2
movl -0x30(%rbp), %eax
movl -0x20(%rbp), %ecx
imull -0x14(%rbp), %ecx
addl %ecx, %eax
sarl $0x5, %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0xd488
xorl %eax, %eax
movl %eax, -0x38(%rbp)
jmp 0xd4a7
cmpl $0xff, -0x34(%rbp)
jle 0xd49b
movl $0xff, %eax
movl %eax, -0x3c(%rbp)
jmp 0xd4a1
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 -0x14(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xd463
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 -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xd452
popq %rbp
retq
nopl (%rax)