// File: /workspace/github_c_makefile_star2_O2/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 $0xd8, %rsp
movabsq $0x1e000000280, %rax    # imm = 0x1E000000280
movq %rax, 0x38(%rsp)
movl $0x1, 0x48(%rsp)
xorl %eax, %eax
movb %al, 0x4c(%rsp)
movl $0x1010101, 0x4d(%rsp)  # imm = 0x1010101
movb %al, 0x54(%rsp)
movl $0x40, 0x58(%rsp)
leaq 0x1499(%rip), %rax      # 0x65ac
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x38(%rsp), %xmm0
movups 0x48(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x70(%rsp), %rdi
callq 0x3dc3
leaq 0x147c(%rip), %rdi      # 0x65c2
callq 0x2911
testq %rax, %rax
je 0x52eb
movq %rax, %rbx
leaq 0x70(%rsp), %r14
movq %r14, %rdi
callq 0x4858
testb %al, %al
je 0x52d5
movss 0x78(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
movss 0xe84(%rip), %xmm1      # 0x6004
mulss %xmm1, %xmm0
callq 0x21d0
addss %xmm0, %xmm0
addss 0xe6f(%rip), %xmm0      # 0x6004
movss %xmm0, 0x34(%rsp)
movq 0xa8(%rsp), %r15
movq %r15, %rdi
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x2c56
movslq (%r15), %rbp
movl 0x4(%r15), %r13d
movl (%rbx), %r12d
movl 0x4(%rbx), %r14d
movss 0x28(%rsp), %xmm0
callq 0x21d0
movaps %xmm0, 0x60(%rsp)
movss 0x28(%rsp), %xmm0
callq 0x2180
movaps 0x60(%rsp), %xmm7
movss 0x34(%rsp), %xmm6
cmpl $0x1, %r14d
movl %r14d, %esi
movl $0x0, %eax
adcl %eax, %esi
testl %ebp, %ebp
movl $0x0, %edi
cmovgl %ebp, %edi
movaps %xmm7, %xmm1
testl %r13d, %r13d
cmovlel %eax, %r13d
movq %r13, 0x28(%rsp)
xorps 0xe5e(%rip), %xmm1      # 0x6070
shlq $0x2, %rbp
xorl %r8d, %r8d
xorl %r9d, %r9d
cmpq 0x28(%rsp), %r9
je 0x52c3
cvtsi2ss %r9d, %xmm2
movaps %xmm1, %xmm3
mulss %xmm2, %xmm3
mulss %xmm0, %xmm2
xorl %r10d, %r10d
cmpq %r10, %rdi
je 0x52b8
cvtsi2ss %r10d, %xmm4
movaps %xmm4, %xmm5
mulss %xmm0, %xmm5
addss %xmm3, %xmm5
mulss %xmm6, %xmm5
mulss %xmm7, %xmm4
addss %xmm2, %xmm4
mulss %xmm6, %xmm4
cvttss2si %xmm5, %r11d
cvttss2si %xmm4, %eax
cltd
idivl %r14d
movl %edx, %ecx
testl %edx, %edx
movl $0x0, %edx
cmovgl %ecx, %edx
movl %ecx, %eax
sarl $0x1f, %eax
movl %ecx, %r13d
shrl $0x1f, %r13d
subl %ecx, %eax
addl %edx, %eax
xorl %edx, %edx
divl %esi
addl %r13d, %eax
imull %r14d, %eax
movzbl %r11b, %edx
addl %ecx, %eax
imull %r12d, %eax
addl %edx, %eax
movq 0x10(%rbx), %rcx
cltq
movl (%rcx,%rax,4), %eax
movq 0x10(%r15), %rcx
addq %r8, %rcx
movl %eax, (%rcx,%r10,4)
incq %r10
jmp 0x523a
incq %r9
addq %rbp, %r8
jmp 0x521c
leaq 0x70(%rsp), %r14
movq %r14, %rdi
callq 0x491f
jmp 0x515c
movq %rbx, %rdi
callq 0x3bb8
leaq 0x70(%rsp), %rdi
callq 0x4bf7
xorl %eax, %eax
jmp 0x52ee
pushq $-0x1
popq %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq