// File: /workspace/github_c_makefile_star2_O3/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 0x1067(%rip), %rax      # 0x65dc
movq %rax, 0x60(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x20(%rsp)
movdqu 0x58(%rsp), %xmm0
movdqu 0x68(%rsp), %xmm1
movdqu %xmm1, 0x10(%rsp)
movdqu %xmm0, (%rsp)
leaq 0x80(%rsp), %rdi
callq 0x3f6d
leaq 0x1040(%rip), %rdi      # 0x65ef
callq 0x2925
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x588c
leaq 0x80(%rsp), %rdi
callq 0x4a46
testb %al, %al
je 0x5865
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)
movdqa 0xa65(%rip), %xmm6      # 0x6080
pcmpeqd %xmm7, %xmm7
movdqa 0xa68(%rip), %xmm8      # 0x6090
movq 0xb8(%rsp), %rbp
movl (%rbp), %ecx
movl 0x4(%rbp), %eax
movl %eax, %edx
imull %ecx, %edx
testl %edx, %edx
jle 0x572e
movq 0x10(%rbp), %rsi
movl %edx, %edi
addl $0x3, %edx
andl $-0x4, %edx
decq %rdi
movq %rdi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
pxor %xmm6, %xmm0
xorl %edi, %edi
movdqa 0xa06(%rip), %xmm1      # 0x6070
movdqa 0x9ee(%rip), %xmm2      # 0x6060
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, %r8d
notl %r8d
testb $0x1, %r8b
je 0x56ad
movl $0xff008080, (%rsi,%rdi,4) # imm = 0xFF008080
pxor %xmm7, %xmm3
pextrw $0x4, %xmm3, %r8d
testb $0x1, %r8b
je 0x56c5
movl $0xff008080, 0x4(%rsi,%rdi,4) # imm = 0xFF008080
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, %r8d
testb $0x1, %r8b
je 0x5703
movl $0xff008080, 0x8(%rsi,%rdi,4) # imm = 0xFF008080
pextrw $0x4, %xmm3, %r8d
testb $0x1, %r8b
je 0x5717
movl $0xff008080, 0xc(%rsi,%rdi,4) # imm = 0xFF008080
addq $0x4, %rdi
paddq %xmm8, %xmm1
paddq %xmm8, %xmm2
cmpq %rdi, %rdx
jne 0x5672
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 0x1a6a(%rip), %rsi      # 0x71f2
movl %r14d, %ecx
movl $0x1, %r8d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x3a63
movq %rbp, %rdi
leaq 0x1a51(%rip), %rsi      # 0x71f7
movl %r13d, %edx
movl %r14d, %ecx
movl $0x1, %r8d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x3a63
addl 0x38(%rsp), %r13d
movq %rbp, %rdi
leaq 0x1a31(%rip), %rsi      # 0x71fd
movl %r13d, %edx
movl %r14d, %ecx
movl $0x1, %r8d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x3a63
movl $0x0, 0x18(%rbp)
movq %rbp, %rdi
movq 0x28(%rsp), %r14
movq %r14, %rsi
movl %ebx, %edx
movl %r15d, %ecx
callq 0x2d74
movl $0x2, 0x18(%rbp)
movq %rbp, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x2d74
movl $0x1, 0x18(%rbp)
movq %rbp, %rdi
movq %r14, %rsi
movl 0x34(%rsp), %edx
movl %r15d, %ecx
callq 0x2d74
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
callq 0x4b6f
movq %rbx, %rdi
callq 0x4a46
movdqa 0x83f(%rip), %xmm8      # 0x6090
pcmpeqd %xmm7, %xmm7
movdqa 0x823(%rip), %xmm6      # 0x6080
testb %al, %al
jne 0x5628
movq 0x28(%rsp), %rbx
movq 0x10(%rbx), %rdi
callq 0x2290
movq %rbx, %rdi
callq 0x2290
leaq 0x80(%rsp), %rdi
callq 0x5042
xorl %eax, %eax
jmp 0x5891
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq