// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: rotate_image
image rotate_image(image im, float rad)
{
    int x, y, c;
    float cx = im.w/2.;
    float cy = im.h/2.;
    image rot = make_image(im.w, im.h, im.c);
    for(c = 0; c < im.c; ++c){
        for(y = 0; y < im.h; ++y){
            for(x = 0; x < im.w; ++x){
                float rx = cos(rad)*(x-cx) - sin(rad)*(y-cy) + cx;
                float ry = sin(rad)*(x-cx) + cos(rad)*(y-cy) + 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 $0xa8, %rsp
movss %xmm0, 0x28(%rsp)
movq %rdi, %rbx
movl 0xe0(%rsp), %r12d
movslq 0xe4(%rsp), %rax
movslq 0xe8(%rsp), %r14
movq $0x0, 0x10(%rdi)
movl %eax, 0x4(%rdi)
movl %r12d, (%rdi)
movl %r14d, 0x8(%rdi)
movq %rax, 0x40(%rsp)
imull %r12d, %eax
imull %r14d, %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3260
movq %rbx, 0x78(%rsp)
movq %rax, 0x88(%rsp)
movq %rax, 0x10(%rbx)
movq %r14, 0x80(%rsp)
testq %r14, %r14
setg 0x26(%rsp)
jle 0x189e9
leaq 0xe0(%rsp), %rbx
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
movsd 0x3a92f(%rip), %xmm1    # 0x53120
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm2
movq 0x40(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
testl %eax, %eax
setg 0x27(%rsp)
xorps %xmm1, %xmm1
cvtss2sd 0x28(%rsp), %xmm1
movsd %xmm1, 0x28(%rsp)
movss %xmm2, 0x64(%rsp)
xorps %xmm1, %xmm1
cvtss2sd %xmm2, %xmm1
movsd %xmm1, 0x98(%rsp)
movss %xmm0, 0x60(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x90(%rsp)
imull %r12d, %eax
movl %eax, 0x5c(%rsp)
movq $0x0, 0x38(%rsp)
xorl %r15d, %r15d
cmpl $0x0, 0x40(%rsp)
jle 0x189bf
movq 0x38(%rsp), %rax
movl %eax, 0x34(%rsp)
movq $0x0, 0x48(%rsp)
movb 0x27(%rsp), %r13b
testl %r12d, %r12d
jle 0x18998
movl 0x34(%rsp), %eax
movq 0x88(%rsp), %rcx
leaq (%rcx,%rax,4), %r14
xorps %xmm0, %xmm0
cvtsi2ssl 0x48(%rsp), %xmm0
subss 0x60(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x68(%rsp)
andb 0x26(%rsp), %r13b
xorl %ebp, %ebp
movsd 0x28(%rsp), %xmm0
callq 0x31f0
xorps %xmm1, %xmm1
cvtsi2ss %ebp, %xmm1
movsd %xmm0, 0x50(%rsp)
subss 0x64(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movsd %xmm0, 0x70(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x33e0
mulsd 0x68(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
mulsd 0x70(%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x98(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x50(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x33e0
movsd %xmm0, 0xa0(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x31f0
mulsd 0x68(%rsp), %xmm0
movsd 0xa0(%rsp), %xmm1
mulsd 0x70(%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0x90(%rsp), %xmm1
cvtsd2ss %xmm1, %xmm1
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movss 0x50(%rsp), %xmm0
movl %r15d, %edi
callq 0x17fc2
testb $0x1, %r13b
je 0x1898c
movss %xmm0, (%r14,%rbp,4)
incq %rbp
cmpq %rbp, %r12
jne 0x188bb
movq 0x48(%rsp), %rdx
incq %rdx
movq 0x40(%rsp), %rax
cmpq %rax, %rdx
setl %r13b
addl %r12d, 0x34(%rsp)
movq %rdx, 0x48(%rsp)
cmpq %rax, %rdx
jne 0x18882
incq %r15
movq 0x80(%rsp), %rax
cmpq %rax, %r15
setb 0x26(%rsp)
movq 0x38(%rsp), %rcx
addl 0x5c(%rsp), %ecx
movq %rcx, 0x38(%rsp)
cmpq %rax, %r15
jne 0x18860
movq 0x78(%rsp), %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq