// File: /workspace/github_c_makefile_star2_O2/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 $0x98, %rsp
movss %xmm4, 0x30(%rsp)
movss %xmm3, 0x28(%rsp)
movss %xmm2, 0x20(%rsp)
movl %edx, %r15d
movl %esi, %ebp
movss %xmm1, 0x48(%rsp)
movss %xmm0, 0x18(%rsp)
movq %rdi, %r14
leaq 0xd0(%rsp), %rbx
cvtsi2sdl (%rbx), %xmm0
movsd 0x3e406(%rip), %xmm1    # 0x4c120
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x50(%rsp)
cvtsi2sdl 0x4(%rbx), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x38(%rsp)
movl 0x8(%rbx), %r13d
movl %r13d, %ecx
callq 0xb45a
cvtss2sd 0x18(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
cvtsi2sd %ebp, %xmm0
movsd 0x3e3c1(%rip), %xmm3    # 0x4c120
mulsd %xmm3, %xmm0
movsd %xmm0, 0x90(%rsp)
movss 0x48(%rsp), %xmm1
cvtss2sd %xmm1, %xmm0
movsd %xmm0, 0x60(%rsp)
movss 0x30(%rsp), %xmm2
cvtss2sd %xmm2, %xmm0
movsd %xmm0, 0x88(%rsp)
movss 0x20(%rsp), %xmm0
divss %xmm1, %xmm0
mulss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x80(%rsp)
cvtsi2sd %r15d, %xmm0
mulsd %xmm3, %xmm0
movsd %xmm0, 0x70(%rsp)
movss 0x28(%rsp), %xmm0
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x68(%rsp)
cvtss2sd 0x50(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
xorl %r12d, %r12d
testl %ebp, %ebp
cmovlel %r12d, %ebp
cvtss2sd 0x38(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
testl %r15d, %r15d
cmovlel %r12d, %r15d
movl %r15d, 0x5c(%rsp)
testl %r13d, %r13d
cmovlel %r12d, %r13d
movl %r13d, 0x58(%rsp)
cmpl 0x58(%rsp), %r12d
je 0xdf84
xorl %r13d, %r13d
xorps %xmm0, %xmm0
movsd %xmm0, 0x40(%rsp)
cmpl 0x5c(%rsp), %r13d
je 0xdf7c
movsd 0x40(%rsp), %xmm0
subsd 0x70(%rsp), %xmm0
divsd 0x60(%rsp), %xmm0
addsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
xorl %r15d, %r15d
xorpd %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
cmpl %r15d, %ebp
je 0xdf60
movsd 0x18(%rsp), %xmm0
callq 0x31e0
movsd %xmm0, 0x20(%rsp)
movsd 0x28(%rsp), %xmm0
subsd 0x90(%rsp), %xmm0
divsd 0x60(%rsp), %xmm0
mulsd 0x88(%rsp), %xmm0
addsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x33d0
mulsd 0x30(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
mulsd 0x38(%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x48(%rsp), %xmm1
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x20(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x33d0
movsd %xmm0, 0x50(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x31e0
mulsd 0x30(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
mulsd 0x38(%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0x78(%rsp), %xmm1
cvtsd2ss %xmm1, %xmm1
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movss 0x20(%rsp), %xmm0
movl %r12d, %edi
callq 0xd971
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm1
movups %xmm1, (%rsp)
movl %r15d, %edi
movl %r13d, %esi
movl %r12d, %edx
callq 0xb5fe
movsd 0x28(%rsp), %xmm0
addsd 0x3e1d6(%rip), %xmm0    # 0x4c128
movsd %xmm0, 0x28(%rsp)
incl %r15d
jmp 0xde53
movsd 0x40(%rsp), %xmm0
addsd 0x3e1ba(%rip), %xmm0    # 0x4c128
movsd %xmm0, 0x40(%rsp)
incl %r13d
jmp 0xde1d
incl %r12d
jmp 0xde06
movq %r14, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq