// File: /workspace/github_c_makefile_star2_O1/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 %esi, %ebx
leaq 0xd0(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x20(%rsp)
negl %eax
cvtsi2sd %eax, %xmm0
movl %edi, %r14d
movsd 0x3bfbb(%rip), %xmm1    # 0x53120
mulsd %xmm1, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm0, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x17181
sqrtsd %xmm0, %xmm0
jmp 0x17186
callq 0x3470
leaq 0xd0(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x30(%rsp)
testl %eax, %eax
jle 0x173e2
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x34(%rsp)
leaq 0xe8(%rsp), %rcx
leaq 0xd0(%rsp), %rax
movl 0x4(%rax), %eax
xorps %xmm1, %xmm1
cvtsi2sdl 0x20(%rsp), %xmm1
movsd 0x3bf55(%rip), %xmm0    # 0x53120
mulsd %xmm0, %xmm1
movsd %xmm1, 0x88(%rsp)
movq %rax, 0x40(%rsp)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x68(%rsp)
movslq (%rcx), %rax
movslq 0x4(%rcx), %rdx
movl 0x8(%rcx), %esi
movl %esi, 0x38(%rsp)
movslq %r14d, %rsi
movslq %ebx, %rdi
leaq (,%rsi,4), %r8
addq 0x10(%rcx), %r8
movq %r8, 0x58(%rsp)
movq %rdi, %rcx
movq %rdi, 0x60(%rsp)
imull %eax, %ecx
movl %ecx, 0x1c(%rsp)
movq %rdx, 0x78(%rsp)
movl %edx, %ecx
movq %rax, 0x48(%rsp)
imull %eax, %ecx
movl %ecx, 0x2c(%rsp)
movq %rsi, %rbp
movl %esi, %eax
movq %rax, 0x80(%rsp)
xorl %ebx, %ebx
cmpl $0x0, 0x40(%rsp)
jle 0x173ce
movl 0x1c(%rsp), %eax
movl %eax, 0x18(%rsp)
xorl %r14d, %r14d
cmpl $0x0, 0x20(%rsp)
jle 0x173b4
movslq 0x18(%rsp), %rax
movq 0x58(%rsp), %rcx
leaq (%rcx,%rax,4), %rax
movq %rax, 0x70(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
subsd 0x68(%rsp), %xmm0
addsd 0x3be92(%rip), %xmm0    # 0x53120
mulsd %xmm0, %xmm0
movsd %xmm0, 0x90(%rsp)
movq 0x60(%rsp), %rax
leaq (%r14,%rax), %r15
xorl %r12d, %r12d
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
subsd 0x88(%rsp), %xmm0
addsd 0x3be60(%rip), %xmm0    # 0x53120
mulsd %xmm0, %xmm0
addsd 0x90(%rsp), %xmm0
ucomisd 0x3e19b(%rip), %xmm0    # 0x55470
jb 0x172dd
sqrtsd %xmm0, %xmm0
jmp 0x172e2
callq 0x3470
movsd %xmm0, 0x50(%rsp)
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 0x15476
movss %xmm0, 0x3c(%rsp)
leaq (%r12,%rbp), %r13
movq 0x80(%rsp), %rax
leal (%rax,%r12), %edi
leaq 0xe8(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
movl %r15d, %esi
movl %ebx, %edx
callq 0x15476
movl %r13d, %eax
orl %r15d, %eax
js 0x173a6
cmpq 0x48(%rsp), %r13
jge 0x173a6
cmpq 0x78(%rsp), %r15
jge 0x173a6
cmpl %ebx, 0x38(%rsp)
jle 0x173a6
xorps %xmm1, %xmm1
cvtsd2ss 0x50(%rsp), %xmm1
divss 0x34(%rsp), %xmm1
movss 0x3bc90(%rip), %xmm3    # 0x53008
movaps %xmm3, %xmm2
subss %xmm1, %xmm2
xorps %xmm1, %xmm1
maxss %xmm2, %xmm1
movaps %xmm3, %xmm2
subss %xmm1, %xmm2
mulss %xmm2, %xmm0
mulss 0x3c(%rsp), %xmm1
addss %xmm0, %xmm1
movq 0x70(%rsp), %rax
movss %xmm1, (%rax,%r12,4)
incq %r12
cmpq %r12, 0x20(%rsp)
jne 0x172a7
incq %r14
movl 0x18(%rsp), %eax
addl 0x48(%rsp), %eax
movl %eax, 0x18(%rsp)
cmpq 0x40(%rsp), %r14
jne 0x1725a
incl %ebx
movl 0x2c(%rsp), %eax
addl %eax, 0x1c(%rsp)
cmpl 0x30(%rsp), %ebx
jne 0x17244
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq