// File: /workspace/github_c_makefile_star2_O1/akumrao[P]videoAnalyzer/core/frame.c
// Function: deblocking_filter_edgecv(x264_t*, unsigned char*, int, int*, int)
static inline void deblocking_filter_edgecv( x264_t *h, uint8_t *pix, int i_pix_stride, int bS[4], int i_QP )
{
    int i, d;
    const int i_index_a = x264_clip3( i_QP + h->sh.i_alpha_c0_offset, 0, 51 );
    const int alpha = i_alpha_table[i_index_a];
    const int beta  = i_beta_table[x264_clip3( i_QP + h->sh.i_beta_offset, 0, 51 )];

    for( i = 0; i < 4; i++ )
    {
        if( bS[i] == 0 )
        {
            pix += 2 * i_pix_stride;
            continue;
        }

        if( bS[i] < 4 )
        {
            const int tc = i_tc0_table[i_index_a][bS[i] - 1] + 1;
            /* 2px edge length (because we use same bS than the one for luma) */
            for( d = 0; d < 2; d++ )
            {
                const int p0 = pix[-1];
                const int p1 = pix[-2];
                const int q0 = pix[0];
                const int q1 = pix[1];

                if( abs( p0 - q0 ) < alpha &&
                    abs( p1 - p0 ) < beta &&
                    abs( q1 - q0 ) < beta )
                {
                    const int i_delta = x264_clip3( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );

                    pix[-1] = clip_uint8( p0 + i_delta );    /* p0' */
                    pix[0]  = clip_uint8( q0 - i_delta );    /* q0' */
                }
                pix += i_pix_stride;
            }
        }
        else
        {
            /* 2px edge length (because we use same bS than the one for luma) */
            for( d = 0; d < 2; d++ )
            {
                const int p0 = pix[-1];
                const int p1 = pix[-2];
                const int q0 = pix[0];
                const int q1 = pix[1];

                if( abs( p0 - q0 ) < alpha &&
                    abs( p1 - p0 ) < beta &&
                    abs( q1 - q0 ) < beta )
                {
                    pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2;   /* p0' */
                    pix[0]  = ( 2*q1 + q0 + p1 + 2 ) >> 2;   /* q0' */
                }
                pix += i_pix_stride;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, -0x40(%rbp)
movl 0x10db54(%rdi), %r10d
addl %r8d, %r10d
movl $0x33, %r9d
cmpl %r9d, %r10d
cmovgel %r9d, %r10d
xorl %eax, %eax
testl %r10d, %r10d
cmovlel %eax, %r10d
leaq 0x1f1c4(%rip), %r11     # 0x25420
addl 0x10db58(%rdi), %r8d
movl (%r11,%r10,4), %edi
cmpl %r9d, %r8d
cmovgel %r9d, %r8d
testl %r8d, %r8d
cmovlel %eax, %r8d
leaq 0x1f274(%rip), %r9      # 0x254f0
movl (%r9,%r8,4), %r8d
movslq %edx, %rdx
leal (%rdx,%rdx), %r9d
movslq %r9d, %rcx
movq %rcx, -0x38(%rbp)
leaq (%r10,%r10,2), %r9
leaq 0x1f327(%rip), %r10     # 0x255c0
leaq (%r10,%r9,4), %rcx
movq %rcx, -0x30(%rbp)
movq -0x40(%rbp), %rcx
movslq (%rcx,%rax,4), %r9
testq %r9, %r9
je 0x6393
cmpl $0x4, %r9d
jge 0x639c
movq -0x30(%rbp), %rcx
movl -0x4(%rcx,%r9,4), %ebx
leal 0x1(%rbx), %r14d
notl %ebx
movl $0x1, %r15d
movzbl -0x1(%rsi), %r13d
movzbl (%rsi), %r12d
movl %r13d, %r9d
subl %r12d, %r9d
movl %r9d, %r10d
negl %r10d
cmovsl %r9d, %r10d
movzbl %r10b, %r9d
cmpl %edi, %r9d
jge 0x6382
movzbl -0x2(%rsi), %r10d
movl %r10d, %r11d
subl %r13d, %r11d
movl %r11d, %r9d
negl %r9d
cmovsl %r11d, %r9d
cmpl %r8d, %r9d
jge 0x6382
movzbl 0x1(%rsi), %ecx
movl %ecx, %r9d
subl %r12d, %r9d
movl %r9d, %r11d
negl %r11d
cmovsl %r9d, %r11d
cmpl %r8d, %r11d
jge 0x6382
movl %r12d, %r9d
subl %r13d, %r9d
subl %ecx, %r10d
leal (%r10,%r9,4), %ecx
addl $0x4, %ecx
sarl $0x3, %ecx
cmpl %r14d, %ecx
movl %r14d, %r9d
cmovll %ecx, %r9d
cmpl %ebx, %ecx
cmovll %ebx, %r9d
addl %r9d, %r13d
testl %r13d, %r13d
setg %cl
negb %cl
movl $0x100, %r10d           # imm = 0x100
cmpl %r10d, %r13d
movzbl %cl, %ecx
cmovbl %r13d, %ecx
movb %cl, -0x1(%rsi)
subl %r9d, %r12d
testl %r12d, %r12d
setg %cl
negb %cl
cmpl %r10d, %r12d
movzbl %cl, %ecx
cmovbl %r12d, %ecx
movb %cl, (%rsi)
addq %rdx, %rsi
decl %r15d
je 0x62d1
jmp 0x641c
addq -0x38(%rbp), %rsi
jmp 0x641c
movl $0x1, %ebx
movzbl -0x1(%rsi), %r15d
movzbl (%rsi), %r14d
movl %r15d, %ecx
subl %r14d, %ecx
movl %ecx, %r9d
negl %r9d
cmovsl %ecx, %r9d
movzbl %r9b, %ecx
cmpl %edi, %ecx
jge 0x6415
movzbl -0x2(%rsi), %r12d
movl %r12d, %ecx
subl %r15d, %ecx
movl %ecx, %r9d
negl %r9d
cmovsl %ecx, %r9d
cmpl %r8d, %r9d
jge 0x6415
movzbl 0x1(%rsi), %r10d
movl %r10d, %ecx
subl %r14d, %ecx
movl %ecx, %r9d
negl %r9d
cmovsl %ecx, %r9d
cmpl %r8d, %r9d
jge 0x6415
leal (%r15,%r12,2), %ecx
addl %r10d, %ecx
addl $0x2, %ecx
shrl $0x2, %ecx
movb %cl, -0x1(%rsi)
addl %r12d, %r14d
leal (%r14,%r10,2), %ecx
addl $0x2, %ecx
shrl $0x2, %ecx
movb %cl, (%rsi)
addq %rdx, %rsi
decl %ebx
je 0x63a1
incq %rax
cmpq $0x4, %rax
jne 0x62a1
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq