// File: /workspace/github_c_makefile_star2_O1/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 $0xe8, %rsp
movabsq $0x1e000000280, %rax    # imm = 0x1E000000280
movq %rax, 0x48(%rsp)
movl $0x1, 0x58(%rsp)
xorl %eax, %eax
movb %al, 0x5c(%rsp)
movl $0x1010101, 0x5d(%rsp)  # imm = 0x1010101
movb %al, 0x64(%rsp)
movl $0x40, 0x68(%rsp)
leaq 0x107e(%rip), %rax      # 0x659c
movq %rax, 0x50(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x48(%rsp), %xmm0
movups 0x58(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x80(%rsp), %rdi
callq 0x3e81
leaq 0x105e(%rip), %rdi      # 0x65b2
callq 0x2925
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x5740
leaq 0x80(%rsp), %rdi
callq 0x49dc
testb %al, %al
je 0x5719
movq 0x30(%rsp), %rax
movl 0x4(%rax), %ebp
cmpl $0x1, %ebp
movl %ebp, %r15d
adcl $0x0, %r15d
movl (%rax), %r12d
movss 0x88(%rsp), %xmm0
movss %xmm0, 0x2c(%rsp)
mulss 0xa5c(%rip), %xmm0      # 0x6004
callq 0x21d0
movss %xmm0, 0x44(%rsp)
movq 0xb8(%rsp), %rax
movl 0x4(%rax), %ecx
movq %rax, 0x38(%rsp)
imull (%rax), %ecx
testl %ecx, %ecx
jle 0x55e6
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movl %ecx, %ecx
xorl %edx, %edx
movl $0xff000000, (%rax,%rdx,4) # imm = 0xFF000000
incq %rdx
cmpq %rdx, %rcx
jne 0x55d7
movq 0x38(%rsp), %rax
movl (%rax), %r14d
movslq 0x4(%rax), %rbx
movss 0x2c(%rsp), %xmm0
callq 0x21d0
movaps %xmm0, 0x70(%rsp)
movss 0x2c(%rsp), %xmm0
callq 0x2180
movaps 0x70(%rsp), %xmm7
testq %rbx, %rbx
movss 0x44(%rsp), %xmm6
jle 0x56f9
addss %xmm6, %xmm6
addss 0x9d7(%rip), %xmm6      # 0x6004
movaps %xmm7, %xmm1
xorps 0xa29(%rip), %xmm1      # 0x6060
leaq (,%r14,4), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
testl %r14d, %r14d
jle 0x56ea
xorps %xmm2, %xmm2
cvtsi2ss %r8d, %xmm2
movaps %xmm1, %xmm3
mulss %xmm2, %xmm3
mulss %xmm0, %xmm2
movq 0x30(%rsp), %rax
movq 0x10(%rax), %r9
movq 0x38(%rsp), %rax
movq 0x10(%rax), %r10
addq %rdi, %r10
xorl %r11d, %r11d
xorps %xmm4, %xmm4
cvtsi2ss %r11d, %xmm4
movaps %xmm4, %xmm5
mulss %xmm7, %xmm5
addss %xmm2, %xmm5
mulss %xmm6, %xmm5
cvttss2si %xmm5, %eax
cltd
idivl %ebp
movl %edx, %ecx
movl %edx, %eax
sarl $0x1f, %eax
movl %edx, %r13d
shrl $0x1f, %r13d
testl %edx, %edx
movl $0x0, %edx
cmovgl %ecx, %edx
subl %ecx, %eax
addl %edx, %eax
xorl %edx, %edx
divl %r15d
addl %r13d, %eax
imull %ebp, %eax
mulss %xmm0, %xmm4
addss %xmm3, %xmm4
mulss %xmm6, %xmm4
cvttss2si %xmm4, %edx
movzbl %dl, %edx
addl %ecx, %eax
imull %r12d, %eax
addl %edx, %eax
cltq
movl (%r9,%rax,4), %eax
movl %eax, (%r10,%r11,4)
incq %r11
cmpq %r11, %r14
jne 0x5678
incq %r8
addq %rsi, %rdi
cmpq %rbx, %r8
jne 0x5644
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
callq 0x4b28
movq %rbx, %rdi
callq 0x49dc
testb %al, %al
jne 0x5591
movq 0x30(%rsp), %rbx
movq 0x10(%rbx), %rdi
callq 0x2290
movq %rbx, %rdi
callq 0x2290
leaq 0x80(%rsp), %rdi
callq 0x4ff7
xorl %eax, %eax
jmp 0x5745
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq