// File: /workspace/github_c_makefile_star2_O1/akumrao[P]videoAnalyzer/core/frame.c
// Function: x264_frame_expand_border(x264_frame_t*)
void x264_frame_expand_border( x264_frame_t *frame )
{
    int w;
    int i, y;
    for( i = 0; i < frame->i_plane; i++ )
    {
#define PPIXEL(x, y) ( frame->plane[i] + (x) +(y)*frame->i_stride[i] )
        w = ( i == 0 ) ? 32 : 16;

        for( y = 0; y < w; y++ )
        {
            /* upper band */
            memcpy( PPIXEL(0,-y-1), PPIXEL(0,0), frame->i_stride[i] - 2 * w);
            /* up left corner */
            memset( PPIXEL(-w,-y-1 ), PPIXEL(0,0)[0], w );
            /* up right corner */
            memset( PPIXEL(frame->i_stride[i] - 2*w,-y-1), PPIXEL( frame->i_stride[i]-1-2*w,0)[0], w );

            /* lower band */
            memcpy( PPIXEL(0, frame->i_lines[i]+y), PPIXEL(0,frame->i_lines[i]-1), frame->i_stride[i] - 2 * w );
            /* low left corner */
            memset( PPIXEL(-w, frame->i_lines[i]+y), PPIXEL(0,frame->i_lines[i]-1)[0], w);
            /* low right corner */
            memset( PPIXEL(frame->i_stride[i]-2*w, frame->i_lines[i]+y), PPIXEL(frame->i_stride[i]-1-2*w,frame->i_lines[i]-1)[0], w);

        }
        for( y = 0; y < frame->i_lines[i]; y++ )
        {
            /* left band */
            memset( PPIXEL( -w, y ), PPIXEL( 0, y )[0], w );
            /* right band */
            memset( PPIXEL( frame->i_stride[i]-2*w, y ), PPIXEL( frame->i_stride[i] - 1-2*w, y )[0], w );
        }
#undef PPIXEL
    }
}

// Assembly:
cmpl $0x0, 0x20(%rdi)
jle 0x5480
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorl %r15d, %r15d
xorl %r14d, %r14d
xorl %eax, %eax
testq %r15, %r15
sete %r14b
setne %al
shll $0x4, %eax
orq $-0x20, %rax
movq %rax, -0x38(%rbp)
shll $0x4, %r14d
leal 0x20(,%r14,2), %eax
addl $0x10, %r14d
movl %eax, -0x2c(%rbp)
notl %eax
movq %rax, -0x48(%rbp)
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %r13d, %r13d
movq %r14, -0x40(%rbp)
movq 0x48(%rbx,%r15,8), %rsi
movl 0x24(%rbx,%r15,4), %eax
movl %eax, %ecx
imull %r12d, %ecx
movslq %ecx, %rdi
addq %rsi, %rdi
movl -0x2c(%rbp), %r14d
subl %r14d, %eax
movslq %eax, %rdx
callq 0x20a0
movq 0x48(%rbx,%r15,8), %rax
movq -0x38(%rbp), %rcx
addq %rax, %rcx
movslq 0x24(%rbx,%r15,4), %rdi
movslq %r12d, %r12
imulq %r12, %rdi
addq %rcx, %rdi
movzbl (%rax), %esi
movq -0x40(%rbp), %rdx
callq 0x2070
movq 0x48(%rbx,%r15,8), %rax
movl 0x24(%rbx,%r15,4), %ecx
movl %ecx, %edx
subl %r14d, %edx
movslq %edx, %rdx
addq %rax, %rdx
movl %ecx, %esi
imull %r12d, %esi
movslq %esi, %rdi
addq %rdx, %rdi
addl -0x48(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %esi
movq -0x40(%rbp), %rdx
callq 0x2070
movq 0x48(%rbx,%r15,8), %rax
movl 0x24(%rbx,%r15,4), %ecx
movl 0x34(%rbx,%r15,4), %edx
leal (%rdx,%r13), %esi
imull %ecx, %esi
movslq %esi, %rdi
addq %rax, %rdi
decl %edx
imull %ecx, %edx
movslq %edx, %rsi
addq %rax, %rsi
subl %r14d, %ecx
movslq %ecx, %rdx
callq 0x20a0
movq 0x48(%rbx,%r15,8), %rax
movq -0x38(%rbp), %rcx
addq %rax, %rcx
movq -0x40(%rbp), %r14
movl 0x24(%rbx,%r15,4), %edx
movl 0x34(%rbx,%r15,4), %esi
leal (%rsi,%r13), %edi
imull %edx, %edi
movslq %edi, %rdi
addq %rcx, %rdi
decl %esi
imull %edx, %esi
movslq %esi, %rcx
movzbl (%rax,%rcx), %esi
movq %r14, %rdx
callq 0x2070
movq 0x48(%rbx,%r15,8), %rax
movl 0x24(%rbx,%r15,4), %edx
movl 0x34(%rbx,%r15,4), %ecx
leal (%rcx,%r13), %esi
imull %edx, %esi
movq -0x48(%rbp), %rdi
leal (%rdx,%rdi), %r8d
decl %ecx
imull %edx, %ecx
subl -0x2c(%rbp), %edx
movslq %edx, %rdx
addq %rax, %rdx
movslq %esi, %rdi
addq %rdx, %rdi
movslq %r8d, %rdx
addq %rax, %rdx
movslq %ecx, %rax
movzbl (%rax,%rdx), %esi
movq %r14, %rdx
callq 0x2070
incl %r13d
decl %r12d
cmpl %r13d, %r14d
jne 0x52a1
cmpl $0x0, 0x34(%rbx,%r15,4)
jle 0x5462
leal (%r14,%r14), %r13d
movl %r13d, -0x2c(%rbp)
notl %r13d
xorl %r12d, %r12d
movq 0x48(%rbx,%r15,8), %rax
movslq 0x24(%rbx,%r15,4), %rcx
movslq %r12d, %r12
imulq %r12, %rcx
movq -0x38(%rbp), %rdx
leaq (%rax,%rdx), %rdi
addq %rcx, %rdi
movzbl (%rax,%rcx), %esi
movq %r14, %rdx
callq 0x2070
movq 0x48(%rbx,%r15,8), %rax
movl 0x24(%rbx,%r15,4), %ecx
movl %ecx, %edx
subl -0x2c(%rbp), %edx
movslq %edx, %rdi
addq %rax, %rdi
movl %ecx, %edx
imull %r12d, %edx
movslq %edx, %rdx
addq %rdx, %rdi
addl %r13d, %ecx
movslq %ecx, %rcx
addq %rax, %rcx
movzbl (%rdx,%rcx), %esi
movq %r14, %rdx
callq 0x2070
incl %r12d
cmpl 0x34(%rbx,%r15,4), %r12d
jl 0x53fa
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0x5261
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq