// File: /workspace/github_c_makefile_star2_O3/adelciotto[P]scg/examples/rotozoom.c
// Function: main
int main(int arcg, char *argv[]) {
    scg_config_t config = scg_config_new_default();
    config.video.title = "SCG Example: Rotozoom";

    scg_app_t app;
    scg_app_init(&app, config);

    scg_image_t *src_image = scg_image_new_from_bmp("assets/2ndreal.bmp");
    if (src_image == NULL) {
        return -1;
    }

    while (scg_app_process_events(&app)) {
        float32_t scale = 0.5f + sinf(app.elapsed_time * 0.5f) * 2.0f;
        float32_t angle = app.elapsed_time;
        draw(app.draw_target, src_image, angle, scale);

        scg_app_present(&app);
    }

    scg_image_free(src_image);
    scg_app_free(&app);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movabsq $0x1e000000280, %rax    # imm = 0x1E000000280
movq %rax, 0x58(%rsp)
movl $0x1, 0x68(%rsp)
xorl %eax, %eax
movb %al, 0x6c(%rsp)
movl $0x1010101, 0x6d(%rsp)  # imm = 0x1010101
movb %al, 0x74(%rsp)
movl $0x40, 0x78(%rsp)
leaq 0x1067(%rip), %rax      # 0x65dc
movq %rax, 0x60(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x58(%rsp), %xmm0
movdqu 0x68(%rsp), %xmm1
movdqu %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x90(%rsp), %rdi
callq 0x3f6d
leaq 0x1045(%rip), %rdi      # 0x65f2
callq 0x2925
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x5898
leaq 0x90(%rsp), %rdi
callq 0x4a46
testb %al, %al
je 0x5871
movq 0x40(%rsp), %rax
movl 0x4(%rax), %ebp
cmpl $0x1, %ebp
movl %ebp, %r15d
adcl $0x0, %r15d
movl (%rax), %r12d
movss 0x98(%rsp), %xmm0
movss %xmm0, 0x38(%rsp)
mulss 0xa03(%rip), %xmm0      # 0x6004
callq 0x21d0
movss %xmm0, 0x4c(%rsp)
movq 0xc8(%rsp), %rdi
movl (%rdi), %ecx
movl 0x4(%rdi), %ebx
movl %ebx, %eax
movl %ecx, 0x34(%rsp)
imull %ecx, %eax
testl %eax, %eax
jle 0x572e
movq 0x10(%rdi), %rcx
movl %eax, %edx
addl $0x3, %eax
andl $-0x4, %eax
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0xa35(%rip), %xmm6      # 0x6080
pxor %xmm6, %xmm0
xorl %edx, %edx
movdqa 0xa17(%rip), %xmm1      # 0x6070
movdqa 0x9ff(%rip), %xmm2      # 0x6060
pcmpeqd %xmm7, %xmm7
movdqa 0xa22(%rip), %xmm8      # 0x6090
movdqa %xmm1, %xmm3
pxor %xmm6, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm0, %xmm4
pcmpeqd %xmm0, %xmm3
pshufd $0xf5, %xmm3, %xmm5     # xmm5 = xmm3[1,1,3,3]
pand %xmm4, %xmm5
pshufd $0xf5, %xmm4, %xmm3     # xmm3 = xmm4[1,1,3,3]
por %xmm5, %xmm3
movd %xmm3, %esi
notl %esi
testb $0x1, %sil
je 0x56a7
movl $0xff000000, (%rcx,%rdx,4) # imm = 0xFF000000
pxor %xmm7, %xmm3
pextrw $0x4, %xmm3, %esi
testb $0x1, %sil
je 0x56be
movl $0xff000000, 0x4(%rcx,%rdx,4) # imm = 0xFF000000
movdqa %xmm2, %xmm3
pxor %xmm6, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm0, %xmm4
pcmpeqd %xmm0, %xmm3
pshufd $0xf5, %xmm3, %xmm5     # xmm5 = xmm3[1,1,3,3]
pand %xmm4, %xmm5
pshufd $0xf5, %xmm4, %xmm3     # xmm3 = xmm4[1,1,3,3]
por %xmm5, %xmm3
pxor %xmm7, %xmm3
pextrw $0x0, %xmm3, %esi
testb $0x1, %sil
je 0x56fb
movl $0xff000000, 0x8(%rcx,%rdx,4) # imm = 0xFF000000
pextrw $0x4, %xmm3, %esi
testb $0x1, %sil
je 0x570e
movl $0xff000000, 0xc(%rcx,%rdx,4) # imm = 0xFF000000
addq $0x4, %rdx
paddq %xmm8, %xmm1
paddq %xmm8, %xmm2
cmpq %rdx, %rax
jne 0x566e
movl (%rdi), %eax
movl %eax, 0x34(%rsp)
movl 0x4(%rdi), %ebx
movq %rdi, 0x50(%rsp)
movss 0x38(%rsp), %xmm0
callq 0x21d0
movaps %xmm0, 0x80(%rsp)
movss 0x38(%rsp), %xmm0
callq 0x2180
movaps 0x80(%rsp), %xmm7
testl %ebx, %ebx
movaps 0x91e(%rip), %xmm2      # 0x6080
movss 0x4c(%rsp), %xmm6
jle 0x5851
addss %xmm6, %xmm6
addss 0x88a(%rip), %xmm6      # 0x6004
movaps %xmm7, %xmm1
xorps %xmm2, %xmm1
movl 0x34(%rsp), %esi
movl %ebx, %eax
movq %rax, 0x38(%rsp)
leaq (,%rsi,4), %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
cmpl $0x0, 0x34(%rsp)
jle 0x5840
xorps %xmm2, %xmm2
cvtsi2ss %r10d, %xmm2
movaps %xmm1, %xmm3
mulss %xmm2, %xmm3
mulss %xmm0, %xmm2
movq 0x40(%rsp), %rax
movq 0x10(%rax), %r11
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rbx
addq %r9, %rbx
xorl %r13d, %r13d
xorps %xmm4, %xmm4
cvtsi2ss %r13d, %xmm4
movaps %xmm4, %xmm5
mulss %xmm0, %xmm5
addss %xmm3, %xmm5
mulss %xmm6, %xmm5
mulss %xmm7, %xmm4
addss %xmm2, %xmm4
cvttss2si %xmm5, %r14d
mulss %xmm6, %xmm4
cvttss2si %xmm4, %eax
cltd
idivl %ebp
movl %edx, %ecx
testl %edx, %edx
movl $0x0, %edx
cmovgl %ecx, %edx
movl %ecx, %eax
sarl $0x1f, %eax
movl %ecx, %edi
shrl $0x1f, %edi
subl %ecx, %eax
addl %edx, %eax
xorl %edx, %edx
divl %r15d
addl %edi, %eax
imull %ebp, %eax
movzbl %r14b, %edx
addl %ecx, %eax
imull %r12d, %eax
addl %edx, %eax
cltq
movl (%r11,%rax,4), %eax
movl %eax, (%rbx,%r13,4)
incq %r13
cmpq %r13, %rsi
jne 0x57cf
incq %r10
addq %r8, %r9
cmpq 0x38(%rsp), %r10
jne 0x5799
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
callq 0x4b6f
movq %rbx, %rdi
callq 0x4a46
testb %al, %al
jne 0x55ea
movq 0x40(%rsp), %rbx
movq 0x10(%rbx), %rdi
callq 0x2290
movq %rbx, %rdi
callq 0x2290
leaq 0x90(%rsp), %rdi
callq 0x5042
xorl %eax, %eax
jmp 0x589d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq