// File: /workspace/github_c_makefile_star2_O0/akumrao[P]videoAnalyzer/core/pixel.c
// Function: pixel_satd_wxh(unsigned char*, int, unsigned char*, int, int, int)
static int pixel_satd_wxh( uint8_t *pix1, int i_pix1, uint8_t *pix2, int i_pix2, int i_width, int i_height )
{
    int16_t tmp[4][4];
    int16_t diff[4][4];
    int x, y;
    int i_satd = 0;

    for( y = 0; y < i_height; y += 4 )
    {
        for( x = 0; x < i_width; x += 4 )
        {
            int d;

            pixel_sub_4x4( diff, &pix1[x], i_pix1, &pix2[x], i_pix2 );

            for( d = 0; d < 4; d++ )
            {
                int s01, s23;
                int d01, d23;

                s01 = diff[d][0] + diff[d][1]; s23 = diff[d][2] + diff[d][3];
                d01 = diff[d][0] - diff[d][1]; d23 = diff[d][2] - diff[d][3];

                tmp[d][0] = s01 + s23;
                tmp[d][1] = s01 - s23;
                tmp[d][2] = d01 - d23;
                tmp[d][3] = d01 + d23;
            }
            for( d = 0; d < 4; d++ )
            {
                int s01, s23;
                int d01, d23;

                s01 = tmp[0][d] + tmp[1][d]; s23 = tmp[2][d] + tmp[3][d];
                d01 = tmp[0][d] - tmp[1][d]; d23 = tmp[2][d] - tmp[3][d];

                i_satd += abs( s01 + s23 ) + abs( s01 - s23 ) + abs( d01 - d23 ) + abs( d01 + d23 );
            }

        }
        pix1 += 4 * i_pix1;
        pix2 += 4 * i_pix2;
    }

    return i_satd / 2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
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 $0x0, -0x7c(%rbp)
movl $0x0, -0x78(%rbp)
movl -0x78(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0xc9f0
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0xc9ba
leaq -0x70(%rbp), %rdi
movq -0x8(%rbp), %rsi
movslq -0x74(%rbp), %rax
addq %rax, %rsi
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rcx
movslq -0x74(%rbp), %rax
addq %rax, %rcx
movl -0x1c(%rbp), %r8d
callq 0xc350
movl $0x0, -0x80(%rbp)
cmpl $0x4, -0x80(%rbp)
jge 0xc8cb
movslq -0x80(%rbp), %rax
movswl -0x70(%rbp,%rax,8), %eax
movslq -0x80(%rbp), %rcx
movswl -0x6e(%rbp,%rcx,8), %ecx
addl %ecx, %eax
movl %eax, -0x84(%rbp)
movslq -0x80(%rbp), %rax
movswl -0x6c(%rbp,%rax,8), %eax
movslq -0x80(%rbp), %rcx
movswl -0x6a(%rbp,%rcx,8), %ecx
addl %ecx, %eax
movl %eax, -0x88(%rbp)
movslq -0x80(%rbp), %rax
movswl -0x70(%rbp,%rax,8), %eax
movslq -0x80(%rbp), %rcx
movswl -0x6e(%rbp,%rcx,8), %ecx
subl %ecx, %eax
movl %eax, -0x8c(%rbp)
movslq -0x80(%rbp), %rax
movswl -0x6c(%rbp,%rax,8), %eax
movslq -0x80(%rbp), %rcx
movswl -0x6a(%rbp,%rcx,8), %ecx
subl %ecx, %eax
movl %eax, -0x90(%rbp)
movl -0x84(%rbp), %eax
addl -0x88(%rbp), %eax
movw %ax, %cx
movslq -0x80(%rbp), %rax
movw %cx, -0x50(%rbp,%rax,8)
movl -0x84(%rbp), %eax
subl -0x88(%rbp), %eax
movw %ax, %cx
movslq -0x80(%rbp), %rax
movw %cx, -0x4e(%rbp,%rax,8)
movl -0x8c(%rbp), %eax
subl -0x90(%rbp), %eax
movw %ax, %cx
movslq -0x80(%rbp), %rax
movw %cx, -0x4c(%rbp,%rax,8)
movl -0x8c(%rbp), %eax
addl -0x90(%rbp), %eax
movw %ax, %cx
movslq -0x80(%rbp), %rax
movw %cx, -0x4a(%rbp,%rax,8)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0xc7eb
movl $0x0, -0x80(%rbp)
cmpl $0x4, -0x80(%rbp)
jge 0xc9aa
movslq -0x80(%rbp), %rax
movswl -0x50(%rbp,%rax,2), %eax
movslq -0x80(%rbp), %rcx
movswl -0x48(%rbp,%rcx,2), %ecx
addl %ecx, %eax
movl %eax, -0x94(%rbp)
movslq -0x80(%rbp), %rax
movswl -0x40(%rbp,%rax,2), %eax
movslq -0x80(%rbp), %rcx
movswl -0x38(%rbp,%rcx,2), %ecx
addl %ecx, %eax
movl %eax, -0x98(%rbp)
movslq -0x80(%rbp), %rax
movswl -0x50(%rbp,%rax,2), %eax
movslq -0x80(%rbp), %rcx
movswl -0x48(%rbp,%rcx,2), %ecx
subl %ecx, %eax
movl %eax, -0x9c(%rbp)
movslq -0x80(%rbp), %rax
movswl -0x40(%rbp,%rax,2), %eax
movslq -0x80(%rbp), %rcx
movswl -0x38(%rbp,%rcx,2), %ecx
subl %ecx, %eax
movl %eax, -0xa0(%rbp)
movl -0x94(%rbp), %eax
addl -0x98(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl -0x94(%rbp), %ecx
subl -0x98(%rbp), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
addl %ecx, %eax
movl -0x9c(%rbp), %ecx
subl -0xa0(%rbp), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
addl %ecx, %eax
movl -0x9c(%rbp), %ecx
addl -0xa0(%rbp), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
addl %ecx, %eax
addl -0x7c(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0xc8d2
jmp 0xc9ac
movl -0x74(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x74(%rbp)
jmp 0xc7b2
movl -0xc(%rbp), %ecx
shll $0x2, %ecx
movq -0x8(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl -0x1c(%rbp), %ecx
shll $0x2, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x78(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x78(%rbp)
jmp 0xc79f
movl -0x7c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)