// File: /workspace/github_c_makefile_star2_O2/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 $0x68, %rsp
movq %rsi, 0x48(%rsp)
movq %rdi, 0x58(%rsp)
leaq 0xa0(%rsp), %rcx
movl (%rcx), %edx
movl %edx, %eax
negl %eax
cvtsi2sd %eax, %xmm0
leaq 0xb8(%rsp), %r14
movsd 0x3f3b0(%rip), %xmm1    # 0x4c120
mulsd %xmm1, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm0, %xmm0
sqrtsd %xmm0, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x28(%rsp)
movl 0x4(%rcx), %eax
movl 0x8(%rcx), %ecx
cvtsi2sd %edx, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
cvtsi2sd %eax, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
xorl %ebp, %ebp
testl %edx, %edx
cmovlel %ebp, %edx
movl %edx, 0x2c(%rsp)
testl %eax, %eax
cmovlel %ebp, %eax
movl %eax, 0x24(%rsp)
testl %ecx, %ecx
cmovlel %ebp, %ecx
movl %ecx, 0x20(%rsp)
cmpl 0x20(%rsp), %ebp
je 0xcf3c
xorl %r15d, %r15d
xorpd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
cmpl 0x24(%rsp), %r15d
je 0xcf35
movsd 0x18(%rsp), %xmm0
subsd 0x40(%rsp), %xmm0
addsd 0x3f321(%rip), %xmm0    # 0x4c120
mulsd %xmm0, %xmm0
movsd %xmm0, 0x60(%rsp)
movq 0x48(%rsp), %rax
leal (%r15,%rax), %r12d
xorl %r13d, %r13d
xorpd %xmm0, %xmm0
cmpl %r13d, 0x2c(%rsp)
je 0xcf19
movsd %xmm0, 0x38(%rsp)
movsd 0x38(%rsp), %xmm0
subsd 0x50(%rsp), %xmm0
addsd 0x3f2e2(%rip), %xmm0    # 0x4c120
mulsd %xmm0, %xmm0
addsd 0x60(%rsp), %xmm0
sqrtsd %xmm0, %xmm0
cvtsd2ss %xmm0, %xmm0
divss 0x28(%rsp), %xmm0
movss 0x3f1aa(%rip), %xmm1    # 0x4c008
subss %xmm0, %xmm1
xorps %xmm0, %xmm0
maxss %xmm1, %xmm0
movss %xmm0, 0x34(%rsp)
leaq 0xa0(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
movl %r13d, %edi
movl %r15d, %esi
movl %ebp, %edx
callq 0xb589
movss %xmm0, 0x30(%rsp)
movq 0x58(%rsp), %rax
leal (%rax,%r13), %ebx
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movl %ebx, %edi
movl %r12d, %esi
movl %ebp, %edx
callq 0xb589
movss 0x3f140(%rip), %xmm1    # 0x4c008
movss 0x34(%rsp), %xmm2
subss %xmm2, %xmm1
mulss %xmm1, %xmm0
movss 0x30(%rsp), %xmm1
mulss %xmm2, %xmm1
addss %xmm1, %xmm0
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movupd (%r14), %xmm1
movupd %xmm1, (%rsp)
movl %ebx, %edi
movl %r12d, %esi
movl %ebp, %edx
callq 0xb5fe
movsd 0x38(%rsp), %xmm0
addsd 0x3f217(%rip), %xmm0    # 0x4c128
incl %r13d
jmp 0xce19
movsd 0x18(%rsp), %xmm0
addsd 0x3f201(%rip), %xmm0    # 0x4c128
movsd %xmm0, 0x18(%rsp)
incl %r15d
jmp 0xcde0
incl %ebp
jmp 0xcdc9
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq