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

    scg_app_t app;
    scg_app_init(&app, config);

    srand(scg_get_performance_counter());

    starfield_t starfield;
    init(&starfield, &app, STARFIELD_NUM_STARS, STARFIELD_NUM_LAYERS,
         STARFIELD_SCROLL_SPEED);

    while (scg_app_process_events(&app)) {
        update(&starfield, &app);

        draw(app.draw_target, &starfield);

        scg_app_present(&app);
    }

    scg_app_free(&app);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movabsq $0x1e000000280, %rax    # imm = 0x1E000000280
movq %rax, 0x38(%rsp)
movl $0x1, 0x48(%rsp)
xorl %r14d, %r14d
movb %r14b, 0x4c(%rsp)
movl $0x1010101, 0x4d(%rsp)  # imm = 0x1010101
movb %r14b, 0x54(%rsp)
movl $0x40, 0x58(%rsp)
leaq 0x1044(%rip), %rax      # 0x65dc
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 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x3f8d
callq 0x2320
movl %eax, %edi
callq 0x2260
movq 0x38(%rbx), %rax
movl (%rax), %ebp
movl 0x4(%rax), %r15d
movl $0x4e20, %edi           # imm = 0x4E20
callq 0x2310
movq %rax, %rbx
movw $0x1, %r12w
xorl %r13d, %r13d
callq 0x2080
cltd
idivl %ebp
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movss %xmm0, (%rbx,%r13)
callq 0x2080
cltd
idivl %r15d
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movss %xmm0, 0x4(%rbx,%r13)
movl $0xa, %ecx
cmpq $0x14, %r13
sete %al
je 0x5647
movzwl %r14w, %ecx
imull $0xcccd, %ecx, %ecx     # imm = 0xCCCD
shrl $0x12, %ecx
andl $-0x2, %ecx
leal (%rcx,%rcx,4), %ecx
movl %r12d, %edx
subl %ecx, %edx
movzwl %dx, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movl %ecx, 0x8(%rbx,%r13)
divss 0x9b9(%rip), %xmm0      # 0x6014
movss %xmm0, 0xc(%rbx,%r13)
movb %al, 0x10(%rbx,%r13)
addq $0x14, %r13
incl %r12d
incl %r14d
cmpq $0x4e20, %r13           # imm = 0x4E20
jne 0x55f2
leaq 0x60(%rsp), %rdi
callq 0x4a66
testb %al, %al
je 0x58d9
movdqa 0x9e8(%rip), %xmm6      # 0x6080
pcmpeqd %xmm7, %xmm7
leaq 0x60(%rsp), %r14
movss 0x64(%rsp), %xmm1
movq 0x98(%rsp), %r15
movl (%r15), %ebp
movl 0x4(%r15), %eax
incl %eax
xorps %xmm2, %xmm2
cvtsi2ss %eax, %xmm2
movl $0x10, %r12d
movss %xmm1, 0x34(%rsp)
movss %xmm2, 0x30(%rsp)
cmpb $0x0, (%rbx,%r12)
movss 0x95a(%rip), %xmm0      # 0x6038
jne 0x56ef
movss -0x4(%rbx,%r12), %xmm0
mulss 0x94d(%rip), %xmm0      # 0x603c
mulss %xmm1, %xmm0
addss -0xc(%rbx,%r12), %xmm0
movss %xmm0, -0xc(%rbx,%r12)
ucomiss %xmm2, %xmm0
jbe 0x573d
callq 0x2080
movss 0x30(%rsp), %xmm2
movss 0x34(%rsp), %xmm1
pcmpeqd %xmm7, %xmm7
movdqa 0x95d(%rip), %xmm6      # 0x6080
cltd
idivl %ebp
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movss %xmm0, -0x10(%rbx,%r12)
movl $0xc0800000, -0xc(%rbx,%r12) # imm = 0xC0800000
addq $0x14, %r12
cmpq $0x4e30, %r12           # imm = 0x4E30
jne 0x56d1
movl $0x2, 0x18(%r15)
movl 0x4(%r15), %eax
imull (%r15), %eax
testl %eax, %eax
jle 0x584e
movq 0x10(%r15), %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 0x8e7(%rip), %xmm1      # 0x6070
movdqa 0x8cf(%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, %esi
notl %esi
testb $0x1, %sil
je 0x57ca
movl $0xff000000, (%rcx,%rdx,4) # imm = 0xFF000000
pxor %xmm7, %xmm3
pextrw $0x4, %xmm3, %esi
testb $0x1, %sil
je 0x57e1
movl $0xff000000, 0x4(%rcx,%rdx,4) # imm = 0xFF000000
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 0x581e
movl $0xff000000, 0x8(%rcx,%rdx,4) # imm = 0xFF000000
pextrw $0x4, %xmm3, %esi
testb $0x1, %sil
je 0x5831
movl $0xff000000, 0xc(%rcx,%rdx,4) # imm = 0xFF000000
addq $0x4, %rdx
movdqa 0x853(%rip), %xmm3      # 0x6090
paddq %xmm3, %xmm1
paddq %xmm3, %xmm2
cmpq %rdx, %rax
jne 0x5791
movl $0x10, %r12d
movss -0x4(%rbx,%r12), %xmm0
mulss 0x7a9(%rip), %xmm0      # 0x600c
cvttss2si %xmm0, %r9d
cvttss2si -0x10(%rbx,%r12), %esi
cvttss2si -0xc(%rbx,%r12), %edx
shll $0x18, %r9d
orl $0xffffff, %r9d         # imm = 0xFFFFFF
cmpb $0x1, (%rbx,%r12)
jne 0x589d
movq %r15, %rdi
movl $0x1, %ecx
movl $0x2, %r8d
callq 0x3604
jmp 0x58a8
movq %r15, %rdi
movl %r9d, %ecx
callq 0x2b88
addq $0x14, %r12
cmpq $0x4e30, %r12           # imm = 0x4E30
jne 0x5854
movq %r14, %rdi
callq 0x4b8f
movq %r14, %rdi
callq 0x4a66
testb %al, %al
movdqa 0x7b1(%rip), %xmm6      # 0x6080
pcmpeqd %xmm7, %xmm7
jne 0x56a1
leaq 0x60(%rsp), %rdi
callq 0x5062
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq