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

    scg_app_t app;
    scg_app_init(&app, config);

    scg_image_t *image = scg_image_new_from_bmp("assets/ball.bmp");
    if (image == NULL) {
        return -1;
    }

    while (scg_app_process_events(&app)) {
        draw(app.draw_target, image);

        scg_app_present(&app);
    }

    scg_image_free(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, 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 0x107e(%rip), %rax      # 0x659c
movq %rax, 0x60(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x58(%rsp), %xmm0
movups 0x68(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x80(%rsp), %rdi
callq 0x3e81
leaq 0x105b(%rip), %rdi      # 0x65af
callq 0x2925
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x572f
leaq 0x80(%rsp), %rdi
callq 0x49dc
testb %al, %al
je 0x5708
movq 0x28(%rsp), %rax
movl (%rax), %ecx
movl 0x4(%rax), %eax
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
movq %rdx, 0x40(%rsp)
movq %rcx, 0x50(%rsp)
addl $0x20, %ecx
movq %rcx, 0x38(%rsp)
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
negl %ecx
movl %ecx, 0x30(%rsp)
addl $0x10, %eax
movq %rax, 0x48(%rsp)
movq 0xb8(%rsp), %rbp
movl (%rbp), %ecx
movl 0x4(%rbp), %eax
movl %eax, %esi
imull %ecx, %esi
testl %esi, %esi
jle 0x55e6
movq 0x10(%rbp), %rdx
movl %esi, %esi
xorl %edi, %edi
movl $0xff008080, (%rdx,%rdi,4) # imm = 0xFF008080
incq %rdi
cmpq %rdi, %rsi
jne 0x55d7
movl %ecx, %r13d
shrl $0x1f, %r13d
addl %ecx, %r13d
sarl %r13d
movl %r13d, %r12d
movq 0x40(%rsp), %rdx
subl %edx, %r12d
movq 0x38(%rsp), %rcx
addl %r12d, %ecx
movl %ecx, 0x34(%rsp)
movl %r12d, %ecx
subl 0x50(%rsp), %ecx
movl %eax, %r15d
shrl $0x1f, %r15d
addl %eax, %r15d
sarl %r15d
addl 0x30(%rsp), %r15d
addl %ecx, %edx
addl $-0x20, %edx
movl %ecx, %ebx
addl $-0x20, %ebx
movq 0x48(%rsp), %rax
leal (%rax,%r15), %r14d
movq %rbp, %rdi
leaq 0x1b72(%rip), %rsi      # 0x71b2
movl %r14d, %ecx
movl $0x1, %r8d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x3977
movq %rbp, %rdi
leaq 0x1b59(%rip), %rsi      # 0x71b7
movl %r13d, %edx
movl %r14d, %ecx
movl $0x1, %r8d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x3977
addl 0x38(%rsp), %r13d
movq %rbp, %rdi
leaq 0x1b39(%rip), %rsi      # 0x71bd
movl %r13d, %edx
movl %r14d, %ecx
movl $0x1, %r8d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x3977
movl $0x0, 0x18(%rbp)
movq %rbp, %rdi
movq 0x28(%rsp), %r14
movq %r14, %rsi
movl %ebx, %edx
movl %r15d, %ecx
callq 0x2cb0
movl $0x2, 0x18(%rbp)
movq %rbp, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x2cb0
movl $0x1, 0x18(%rbp)
movq %rbp, %rdi
movq %r14, %rsi
movl 0x34(%rsp), %edx
movl %r15d, %ecx
callq 0x2cb0
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
callq 0x4b28
movq %rbx, %rdi
callq 0x49dc
testb %al, %al
jne 0x55b8
movq 0x28(%rsp), %rbx
movq 0x10(%rbx), %rdi
callq 0x2290
movq %rbx, %rdi
callq 0x2290
leaq 0x80(%rsp), %rdi
callq 0x4ff7
xorl %eax, %eax
jmp 0x5734
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq