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

    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, app.elapsed_time);

        scg_app_present(&app);
    }

    scg_image_free(image);
    scg_app_free(&app);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xb8, %rsp
movabsq $0x1e000000280, %rax    # imm = 0x1E000000280
movq %rax, 0x28(%rsp)
movl $0x1, 0x38(%rsp)
xorl %eax, %eax
movb %al, 0x3c(%rsp)
movl $0x1010101, 0x3d(%rsp)  # imm = 0x1010101
movb %al, 0x44(%rsp)
movl $0x40, 0x48(%rsp)
leaq 0x106b(%rip), %rax      # 0x65dc
movq %rax, 0x30(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x20(%rsp)
movdqu 0x28(%rsp), %xmm0
movdqu 0x38(%rsp), %xmm1
movdqu %xmm1, 0x10(%rsp)
movdqu %xmm0, (%rsp)
leaq 0x50(%rsp), %rdi
callq 0x3f6d
leaq 0x104b(%rip), %rdi      # 0x65f3
callq 0x2925
testq %rax, %rax
je 0x5770
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x4a46
testb %al, %al
je 0x5751
movl (%rbx), %ebp
movl 0x4(%rbx), %r15d
movdqa 0xaa7(%rip), %xmm6      # 0x6080
movdqa 0xaae(%rip), %xmm8      # 0x6090
leaq 0x50(%rsp), %r14
movq 0x88(%rsp), %rdi
movl (%rdi), %ecx
movl 0x4(%rdi), %esi
movl %esi, %eax
imull %ecx, %eax
testl %eax, %eax
jle 0x56f0
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]
pxor %xmm6, %xmm0
xorl %edx, %edx
movdqa 0xa48(%rip), %xmm1      # 0x6070
movdqa 0xa30(%rip), %xmm2      # 0x6060
pcmpeqd %xmm7, %xmm7
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 0x566d
movl $0xff008080, (%rcx,%rdx,4) # imm = 0xFF008080
pxor %xmm7, %xmm3
pextrw $0x4, %xmm3, %esi
testb $0x1, %sil
je 0x5684
movl $0xff008080, 0x4(%rcx,%rdx,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, %esi
testb $0x1, %sil
je 0x56c1
movl $0xff008080, 0x8(%rcx,%rdx,4) # imm = 0xFF008080
pextrw $0x4, %xmm3, %esi
testb $0x1, %sil
je 0x56d4
movl $0xff008080, 0xc(%rcx,%rdx,4) # imm = 0xFF008080
addq $0x4, %rdx
paddq %xmm8, %xmm1
paddq %xmm8, %xmm2
cmpq %rdx, %rax
jne 0x5634
movl (%rdi), %ecx
movl 0x4(%rdi), %esi
movd 0x58(%rsp), %xmm0
movl $0x2, 0x18(%rdi)
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
subl %r15d, %edx
movl %esi, %ecx
shrl $0x1f, %ecx
addl %esi, %ecx
sarl %ecx
subl %ebp, %ecx
movq %rbx, %rsi
movd 0x919(%rip), %xmm1      # 0x6038
movdqa %xmm1, %xmm2
callq 0x30ad
movq %r14, %rdi
callq 0x4b6f
movq %r14, %rdi
callq 0x4a46
movdqa 0x94f(%rip), %xmm8      # 0x6090
movdqa 0x937(%rip), %xmm6      # 0x6080
testb %al, %al
jne 0x55e7
movq 0x10(%rbx), %rdi
callq 0x2290
movq %rbx, %rdi
callq 0x2290
leaq 0x50(%rsp), %rdi
callq 0x5042
xorl %eax, %eax
jmp 0x5775
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xb8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq