// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: rotate_crop_image
image rotate_crop_image(image im, float rad, float s, int w, int h, float dx, float dy, float aspect)
{
    int x, y, c;
    float cx = im.w/2.;
    float cy = im.h/2.;
    image rot = make_image(w, h, im.c);
    for(c = 0; c < im.c; ++c){
        for(y = 0; y < h; ++y){
            for(x = 0; x < w; ++x){
                float rx = cos(rad)*((x - w/2.)/s*aspect + dx/s*aspect) - sin(rad)*((y - h/2.)/s + dy/s) + cx;
                float ry = sin(rad)*((x - w/2.)/s*aspect + dx/s*aspect) + cos(rad)*((y - h/2.)/s + dy/s) + cy;
                float val = bilinear_interpolate(im, rx, ry, c);
                set_pixel(rot, x, y, c, val);
            }
        }
    }
    return rot;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movss %xmm4, 0x30(%rsp)
movss %xmm3, 0x48(%rsp)
movss %xmm2, 0x60(%rsp)
movl %esi, %r15d
movss %xmm1, 0x40(%rsp)
movss %xmm0, 0x28(%rsp)
movq %rdi, %r14
movl 0x110(%rsp), %ebx
movl 0x114(%rsp), %ebp
movslq 0x118(%rsp), %r12
movq $0x0, 0x10(%rdi)
movl %edx, 0x4(%rdi)
movl %esi, (%rdi)
movl %r12d, 0x8(%rdi)
movl %edx, 0x38(%rsp)
movl %edx, %eax
imull %esi, %eax
movl %eax, 0x68(%rsp)
imull %r12d, %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3260
movq %r14, 0x78(%rsp)
movq %rax, 0x98(%rsp)
movq %rax, 0x10(%r14)
movq %r12, 0x80(%rsp)
testq %r12, %r12
setg 0x26(%rsp)
jle 0x1873d
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd 0x3ac98(%rip), %xmm1    # 0x53120
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
xorps %xmm2, %xmm2
cvtsi2sd %ebx, %xmm2
mulsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
leaq 0x110(%rsp), %rbx
movl 0x38(%rsp), %eax
testl %eax, %eax
setg 0x27(%rsp)
xorps %xmm3, %xmm3
cvtss2sd 0x28(%rsp), %xmm3
movsd %xmm3, 0x28(%rsp)
xorps %xmm3, %xmm3
cvtsi2sd %r15d, %xmm3
mulsd %xmm1, %xmm3
movsd %xmm3, 0xd0(%rsp)
movss 0x40(%rsp), %xmm4
xorps %xmm3, %xmm3
cvtss2sd %xmm4, %xmm3
movsd %xmm3, 0x70(%rsp)
movss 0x30(%rsp), %xmm5
xorps %xmm3, %xmm3
cvtss2sd %xmm5, %xmm3
movsd %xmm3, 0xc8(%rsp)
movss 0x60(%rsp), %xmm3
divss %xmm4, %xmm3
mulss %xmm5, %xmm3
cvtss2sd %xmm3, %xmm3
movsd %xmm3, 0xc0(%rsp)
xorps %xmm3, %xmm3
cvtsi2sd %eax, %xmm3
mulsd %xmm1, %xmm3
movsd %xmm3, 0x90(%rsp)
movss 0x48(%rsp), %xmm1
divss %xmm4, %xmm1
cvtss2sd %xmm1, %xmm1
movsd %xmm1, 0x88(%rsp)
xorps %xmm1, %xmm1
cvtss2sd %xmm2, %xmm1
movsd %xmm1, 0xb8(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xb0(%rsp)
movslq %eax, %rcx
movq %rcx, 0xa8(%rsp)
movl %eax, %eax
movq %rax, 0xa0(%rsp)
movl %r15d, %r14d
movq $0x0, 0x50(%rsp)
xorl %r12d, %r12d
movl %r15d, 0x6c(%rsp)
cmpl $0x0, 0x38(%rsp)
jle 0x18713
movq 0x50(%rsp), %rax
movl %eax, 0x3c(%rsp)
movq $0x0, 0x58(%rsp)
movb 0x27(%rsp), %bpl
testl %r15d, %r15d
jle 0x186e2
movl 0x3c(%rsp), %eax
movq 0x98(%rsp), %rcx
leaq (%rcx,%rax,4), %r13
xorps %xmm0, %xmm0
cvtsi2sdl 0x58(%rsp), %xmm0
subsd 0x90(%rsp), %xmm0
divsd 0x70(%rsp), %xmm0
addsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
andb 0x26(%rsp), %bpl
xorl %r15d, %r15d
movsd 0x28(%rsp), %xmm0
callq 0x31f0
movsd %xmm0, 0x30(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
subsd 0xd0(%rsp), %xmm0
divsd 0x70(%rsp), %xmm0
mulsd 0xc8(%rsp), %xmm0
addsd 0xc0(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x33e0
mulsd 0x40(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
mulsd 0x48(%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0xb8(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x30(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x33e0
movsd %xmm0, 0x60(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x31f0
mulsd 0x40(%rsp), %xmm0
movsd 0x60(%rsp), %xmm1
mulsd 0x48(%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0xb0(%rsp), %xmm1
cvtsd2ss %xmm1, %xmm1
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movss 0x30(%rsp), %xmm0
movl %r12d, %edi
callq 0x17fc2
testb $0x1, %bpl
je 0x186d6
movss %xmm0, (%r13,%r15,4)
incq %r15
cmpq %r15, %r14
jne 0x185f5
movq 0x58(%rsp), %rcx
incq %rcx
cmpq 0xa8(%rsp), %rcx
setl %bpl
movl 0x6c(%rsp), %r15d
addl %r15d, 0x3c(%rsp)
movq %rcx, 0x58(%rsp)
cmpq 0xa0(%rsp), %rcx
jne 0x185ad
incq %r12
movq 0x80(%rsp), %rax
cmpq %rax, %r12
setb 0x26(%rsp)
movq 0x50(%rsp), %rcx
addl 0x68(%rsp), %ecx
movq %rcx, 0x50(%rsp)
cmpq %rax, %r12
jne 0x1858b
movq 0x78(%rsp), %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq