// File: /workspace/github_c_makefile_star2_O1/akumrao[P]videoAnalyzer/core/frame.c
// Function: deblocking_filter_edgech(x264_t*, unsigned char*, int, int*, int)
static inline void deblocking_filter_edgech( 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 )];

    int i_pix_next  = i_pix_stride;

    for( i = 0; i < 4; i++ )
    {
        if( bS[i] == 0 )
        {
            pix += 2;
            continue;
        }
        if( bS[i] < 4 )
        {
            int tc = i_tc0_table[i_index_a][bS[i] - 1] + 1;
            /* 2px edge length (see deblocking_filter_edgecv) */
            for( d = 0; d < 2; d++ )
            {
                const int p0 = pix[-1*i_pix_next];
                const int p1 = pix[-2*i_pix_next];
                const int q0 = pix[0];
                const int q1 = pix[1*i_pix_next];

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

                    pix[-i_pix_next] = clip_uint8( p0 + i_delta );    /* p0' */
                    pix[0]           = clip_uint8( q0 - i_delta );    /* q0' */
                }
                pix++;
            }
        }
        else
        {
            /* 2px edge length (see deblocking_filter_edgecv) */
            for( d = 0; d < 2; d++ )
            {
                const int p0 = pix[-1*i_pix_next];
                const int p1 = pix[-2*i_pix_next];
                const int q0 = pix[0];
                const int q1 = pix[1*i_pix_next];

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, -0x58(%rbp)
movl 0x10db54(%rdi), %r9d
addl %r8d, %r9d
movl $0x33, %ecx
cmpl %ecx, %r9d
cmovgel %ecx, %r9d
xorl %eax, %eax
testl %r9d, %r9d
cmovlel %eax, %r9d
leaq 0x1efb5(%rip), %r10     # 0x25420
addl 0x10db58(%rdi), %r8d
movl (%r10,%r9,4), %edi
cmpl %ecx, %r8d
cmovgel %ecx, %r8d
testl %r8d, %r8d
cmovlel %eax, %r8d
leaq 0x1f065(%rip), %rcx     # 0x254f0
movl (%rcx,%r8,4), %r8d
leal (%rdx,%rdx), %ecx
movslq %edx, %r10
movq %r10, -0x48(%rbp)
negl %edx
movslq %edx, %rdx
movq %rdx, -0x40(%rbp)
negl %ecx
movslq %ecx, %rcx
movq %rcx, -0x38(%rbp)
leaq (%r9,%r9,2), %rcx
leaq 0x1f10a(%rip), %rdx     # 0x255c0
leaq (%rdx,%rcx,4), %rcx
movq %rcx, -0x50(%rbp)
movq -0x58(%rbp), %rcx
movslq (%rcx,%rax,4), %rcx
testq %rcx, %rcx
je 0x65ca
cmpl $0x4, %ecx
jge 0x65d3
movq -0x50(%rbp), %rdx
movl -0x4(%rdx,%rcx,4), %r14d
leal 0x1(%r14), %ecx
movl %ecx, -0x2c(%rbp)
notl %r14d
movq -0x40(%rbp), %rcx
leaq (%rsi,%rcx), %r12
movq -0x38(%rbp), %rcx
leaq (%rsi,%rcx), %r13
movq -0x48(%rbp), %rcx
addq %rsi, %rcx
movq %rcx, -0x60(%rbp)
xorl %r11d, %r11d
movzbl (%r12,%r11), %r10d
movzbl (%rsi,%r11), %edx
movl %r10d, %ecx
subl %edx, %ecx
movl %ecx, %ebx
negl %ebx
cmovsl %ecx, %ebx
movzbl %bl, %ecx
cmpl %edi, %ecx
jge 0x65b8
movzbl (%r13,%r11), %ebx
movl %ebx, %r15d
subl %r10d, %r15d
movl %r15d, %ecx
negl %ecx
cmovsl %r15d, %ecx
cmpl %r8d, %ecx
jge 0x65b8
movq -0x60(%rbp), %rcx
movzbl (%rcx,%r11), %r9d
movl %r9d, %ecx
subl %edx, %ecx
movl %ecx, %r15d
negl %r15d
cmovsl %ecx, %r15d
cmpl %r8d, %r15d
jge 0x65b8
movl %edx, %ecx
subl %r10d, %ecx
subl %r9d, %ebx
leal (%rbx,%rcx,4), %ecx
addl $0x4, %ecx
sarl $0x3, %ecx
movl -0x2c(%rbp), %r9d
cmpl %r9d, %ecx
cmovll %ecx, %r9d
cmpl %r14d, %ecx
cmovll %r14d, %r9d
addl %r9d, %r10d
testl %r10d, %r10d
setg %cl
negb %cl
movl $0x100, %ebx            # imm = 0x100
cmpl %ebx, %r10d
movzbl %cl, %ecx
cmovbl %r10d, %ecx
movb %cl, (%r12,%r11)
subl %r9d, %edx
testl %edx, %edx
setg %cl
negb %cl
cmpl %ebx, %edx
movzbl %cl, %ecx
cmovbl %edx, %ecx
movb %cl, (%rsi,%r11)
incq %r11
cmpl $0x1, %r11d
je 0x6509
jmp 0x6666
addq $0x2, %rsi
jmp 0x6669
movq -0x40(%rbp), %rcx
leaq (%rsi,%rcx), %rdx
movq -0x38(%rbp), %rcx
leaq (%rsi,%rcx), %r9
movq -0x48(%rbp), %rcx
leaq (%rsi,%rcx), %r14
xorl %r11d, %r11d
movzbl (%rdx,%r11), %r15d
movzbl (%rsi,%r11), %r10d
movl %r15d, %ecx
subl %r10d, %ecx
movl %ecx, %ebx
negl %ebx
cmovsl %ecx, %ebx
movzbl %bl, %ecx
cmpl %edi, %ecx
jge 0x665d
movzbl (%r9,%r11), %r12d
movl %r12d, %ecx
subl %r15d, %ecx
movl %ecx, %ebx
negl %ebx
cmovsl %ecx, %ebx
cmpl %r8d, %ebx
jge 0x665d
movzbl (%r14,%r11), %ebx
movl %ebx, %ecx
subl %r10d, %ecx
movl %ecx, %r13d
negl %r13d
cmovsl %ecx, %r13d
cmpl %r8d, %r13d
jge 0x665d
leal (%r15,%r12,2), %ecx
addl %ebx, %ecx
addl $0x2, %ecx
shrl $0x2, %ecx
movb %cl, (%rdx,%r11)
addl %r12d, %r10d
leal (%r10,%rbx,2), %ecx
addl $0x2, %ecx
shrl $0x2, %ecx
movb %cl, (%rsi,%r11)
incq %r11
cmpl $0x1, %r11d
je 0x65ee
addq %r11, %rsi
incq %rax
cmpq $0x4, %rax
jne 0x64be
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)