// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: ghost_image
void ghost_image(image source, image dest, int dx, int dy)
{
    int x,y,k;
    float max_dist = sqrt((-source.w/2. + .5)*(-source.w/2. + .5));
    for(k = 0; k < source.c; ++k){
        for(y = 0; y < source.h; ++y){
            for(x = 0; x < source.w; ++x){
                float dist = sqrt((x - source.w/2. + .5)*(x - source.w/2. + .5) + (y - source.h/2. + .5)*(y - source.h/2. + .5));
                float alpha = (1 - dist/max_dist);
                if(alpha < 0) alpha = 0;
                float v1 = get_pixel(source, x,y,k);
                float v2 = get_pixel(dest, dx+x,dy+y,k);
                float val = alpha*v1 + (1-alpha)*v2;
                set_pixel(dest, dx+x, dy+y, k, val);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl 0xd8(%rsp), %eax
movl %eax, 0x30(%rsp)
testl %eax, %eax
jle 0x17c72
leaq 0xe8(%rsp), %rcx
leaq 0xd0(%rsp), %rdx
movl (%rdx), %r8d
movl %r8d, %eax
negl %eax
cvtsi2sd %eax, %xmm0
movsd 0x3d6fd(%rip), %xmm1    # 0x55148
mulsd %xmm1, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm0, %xmm0
sqrtsd %xmm0, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x34(%rsp)
movq %r8, 0x50(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r8d, %xmm0
movl 0x4(%rdx), %eax
mulsd %xmm1, %xmm0
movsd %xmm0, 0x70(%rsp)
movq %rax, 0x40(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movslq (%rcx), %rax
movslq 0x4(%rcx), %rdx
movl 0x8(%rcx), %r8d
movl %r8d, 0x38(%rsp)
movslq %edi, %rdi
leaq (,%rdi,4), %r8
addq 0x10(%rcx), %r8
movq %r8, 0x60(%rsp)
movslq %esi, %rsi
movq %rsi, %rcx
movq %rsi, 0x58(%rsp)
imull %eax, %ecx
movl %ecx, 0x28(%rsp)
movq %rdx, 0x88(%rsp)
movl %edx, %ecx
movq %rax, 0x48(%rsp)
imull %eax, %ecx
movl %ecx, 0x2c(%rsp)
movq %rdi, 0x90(%rsp)
movl %edi, %r13d
xorl %ebx, %ebx
cmpl $0x0, 0x40(%rsp)
jle 0x17c5e
movl 0x28(%rsp), %eax
movl %eax, 0x24(%rsp)
xorl %r14d, %r14d
cmpl $0x0, 0x50(%rsp)
jle 0x17c44
movslq 0x24(%rsp), %rax
movq 0x60(%rsp), %rcx
leaq (%rcx,%rax,4), %rax
movq %rax, 0x80(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
subsd 0x68(%rsp), %xmm0
addsd 0x3d60d(%rip), %xmm0    # 0x55148
mulsd %xmm0, %xmm0
movsd %xmm0, 0x78(%rsp)
movq 0x58(%rsp), %rax
leaq (%r14,%rax), %r15
xorl %r12d, %r12d
leaq 0xd0(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
movl %r12d, %edi
movl %r14d, %esi
movl %ebx, %edx
callq 0x15f12
movss %xmm0, 0x3c(%rsp)
leal (%r12,%r13), %ebp
leaq 0xe8(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
movl %ebp, %edi
movl %r15d, %esi
movl %ebx, %edx
callq 0x15f12
orl %r15d, %ebp
js 0x17c36
movq 0x90(%rsp), %rax
addq %r12, %rax
cmpq 0x48(%rsp), %rax
jge 0x17c36
cmpq 0x88(%rsp), %r15
jge 0x17c36
cmpl %ebx, 0x38(%rsp)
jle 0x17c36
xorps %xmm1, %xmm1
cvtsi2sd %r12d, %xmm1
subsd 0x70(%rsp), %xmm1
addsd 0x3d563(%rip), %xmm1    # 0x55148
mulsd %xmm1, %xmm1
addsd 0x78(%rsp), %xmm1
sqrtsd %xmm1, %xmm1
cvtsd2ss %xmm1, %xmm1
divss 0x34(%rsp), %xmm1
movss 0x3d403(%rip), %xmm3    # 0x55008
movaps %xmm3, %xmm2
subss %xmm1, %xmm2
xorps %xmm1, %xmm1
maxss %xmm2, %xmm1
movaps %xmm3, %xmm2
subss %xmm1, %xmm2
mulss %xmm0, %xmm2
mulss 0x3c(%rsp), %xmm1
addss %xmm2, %xmm1
movq 0x80(%rsp), %rax
movss %xmm1, (%rax,%r12,4)
incq %r12
cmpq %r12, 0x50(%rsp)
jne 0x17b51
incq %r14
movl 0x24(%rsp), %eax
addl 0x48(%rsp), %eax
movl %eax, 0x24(%rsp)
cmpq 0x40(%rsp), %r14
jne 0x17b04
incl %ebx
movl 0x2c(%rsp), %eax
addl %eax, 0x28(%rsp)
cmpl 0x30(%rsp), %ebx
jne 0x17aee
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq