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

    scg_app_t app;
    scg_app_init(&app, config);

    srand(scg_get_performance_counter());

    starfield_t starfield;
    init(&starfield, &app, STARFIELD_NUM_STARS, STARFIELD_MAX_DISTANCE,
         STARFIELD_WORLD_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 $0x118, %rsp            # imm = 0x118
movabsq $0x1e000000280, %rax    # imm = 0x1E000000280
movq %rax, 0x78(%rsp)
movl $0x1, 0x88(%rsp)
xorl %r14d, %r14d
movb %r14b, 0x8c(%rsp)
movl $0x1010101, 0x8d(%rsp) # imm = 0x1010101
movb %r14b, 0x94(%rsp)
movl $0x40, 0x98(%rsp)
leaq 0x1045(%rip), %rax      # 0x65ec
movq %rax, 0x80(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x78(%rsp), %xmm0
movups 0x88(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0x3f8d
callq 0x2320
movl %eax, %edi
callq 0x2260
movq 0x38(%rbx), %rax
movl (%rax), %ebp
xorps %xmm1, %xmm1
cvtsi2ss %ebp, %xmm1
movl 0x4(%rax), %r15d
movss 0x9fd(%rip), %xmm0      # 0x6004
mulss %xmm0, %xmm1
movaps %xmm1, 0x50(%rsp)
xorps %xmm1, %xmm1
cvtsi2ss %r15d, %xmm1
mulss %xmm0, %xmm1
movaps %xmm1, 0x40(%rsp)
movl $0xfa00, %edi           # imm = 0xFA00
callq 0x2310
movq %rax, %rbx
callq 0x2080
cltd
idivl %ebp
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movaps %xmm0, 0x30(%rsp)
callq 0x2080
cltd
idivl %r15d
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movaps 0x30(%rsp), %xmm2
unpcklps 0x40(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
movaps 0x50(%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
subps %xmm1, %xmm2
movlps %xmm2, (%rbx,%r14)
callq 0x2080
cltq
imulq $0x1b4e81b5, %rax, %rcx # imm = 0x1B4E81B5
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x12c, %ecx, %ecx      # imm = 0x12C
subl %ecx, %eax
cmpq $0x10, %r14
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x8(%rbx,%r14)
sete 0xc(%rbx,%r14)
addq $0x10, %r14
cmpq $0xfa00, %r14           # imm = 0xFA00
jne 0x562e
leaq 0xb0(%rsp), %rdi
callq 0x4a66
testb %al, %al
je 0x5a27
movaps 0x50(%rsp), %xmm0
divss 0x95e(%rip), %xmm0      # 0x6038
movaps %xmm0, 0x50(%rsp)
movaps 0x40(%rsp), %xmm0
divss 0x950(%rip), %xmm0      # 0x603c
movaps %xmm0, 0x40(%rsp)
xorps %xmm1, %xmm1
movdqa 0x994(%rip), %xmm7      # 0x6090
pcmpeqd %xmm8, %xmm8
leaq 0xb0(%rsp), %r14
movq 0xe8(%rsp), %r15
movl (%r15), %ebp
xorps %xmm2, %xmm2
cvtsi2ss %ebp, %xmm2
movl 0x4(%r15), %r12d
xorps %xmm3, %xmm3
cvtsi2ss %r12d, %xmm3
movss 0xb4(%rsp), %xmm4
movss 0x8cc(%rip), %xmm0      # 0x6004
mulss %xmm0, %xmm2
movaps %xmm2, 0x60(%rsp)
mulss %xmm0, %xmm3
movaps %xmm3, 0xa0(%rsp)
movl $0xc, %r13d
movss %xmm4, 0x2c(%rsp)
cmpb $0x0, (%rbx,%r13)
movss 0x8da(%rip), %xmm0      # 0x6040
jne 0x5770
movss 0x8d4(%rip), %xmm0      # 0x6044
mulss %xmm4, %xmm0
addss -0x4(%rbx,%r13), %xmm0
movss %xmm0, -0x4(%rbx,%r13)
ucomiss %xmm0, %xmm1
jb 0x581a
callq 0x2080
cltd
idivl %ebp
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movaps %xmm0, 0x30(%rsp)
callq 0x2080
cltd
idivl %r12d
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movaps 0x30(%rsp), %xmm2
unpcklps 0xa0(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
movaps 0x60(%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
subps %xmm1, %xmm2
movlps %xmm2, -0xc(%rbx,%r13)
callq 0x2080
movss 0x2c(%rsp), %xmm4
pcmpeqd %xmm8, %xmm8
movdqa 0x8ab(%rip), %xmm7      # 0x6090
xorps %xmm1, %xmm1
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
negl %ecx
addl %ecx, %eax
addl $0x12c, %eax            # imm = 0x12C
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x4(%rbx,%r13)
addq $0x10, %r13
cmpq $0xfa0c, %r13           # imm = 0xFA0C
jne 0x5759
movl (%r15), %edx
movl 0x4(%r15), %ecx
movl %ecx, %eax
imull %edx, %eax
testl %eax, %eax
jle 0x5938
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]
xorl %edx, %edx
movdqa 0x81e(%rip), %xmm1      # 0x6080
movdqa 0x806(%rip), %xmm2      # 0x6070
movdqa %xmm0, %xmm3
pxor %xmm7, %xmm3
movdqa %xmm1, %xmm4
pxor %xmm7, %xmm4
movdqa %xmm4, %xmm5
pcmpgtd %xmm3, %xmm5
pcmpeqd %xmm3, %xmm4
pshufd $0xf5, %xmm4, %xmm6     # xmm6 = xmm4[1,1,3,3]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm4     # xmm4 = xmm5[1,1,3,3]
por %xmm6, %xmm4
movd %xmm4, %esi
notl %esi
testb $0x1, %sil
je 0x58ab
movl $0xff000000, (%rcx,%rdx,4) # imm = 0xFF000000
pxor %xmm8, %xmm4
pextrw $0x4, %xmm4, %esi
testb $0x1, %sil
je 0x58c3
movl $0xff000000, 0x4(%rcx,%rdx,4) # imm = 0xFF000000
movdqa %xmm2, %xmm4
pxor %xmm7, %xmm4
movdqa %xmm4, %xmm5
pcmpgtd %xmm3, %xmm5
pcmpeqd %xmm3, %xmm4
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pand %xmm5, %xmm4
pshufd $0xf5, %xmm5, %xmm3     # xmm3 = xmm5[1,1,3,3]
por %xmm4, %xmm3
pxor %xmm8, %xmm3
pextrw $0x0, %xmm3, %esi
testb $0x1, %sil
je 0x5901
movl $0xff000000, 0x8(%rcx,%rdx,4) # imm = 0xFF000000
pextrw $0x4, %xmm3, %esi
testb $0x1, %sil
je 0x5914
movl $0xff000000, 0xc(%rcx,%rdx,4) # imm = 0xFF000000
addq $0x4, %rdx
movdqa 0x780(%rip), %xmm3      # 0x60a0
paddq %xmm3, %xmm1
paddq %xmm3, %xmm2
cmpq %rdx, %rax
jne 0x586a
movl (%r15), %edx
movl 0x4(%r15), %ecx
xorps %xmm1, %xmm1
cvtsi2ss %edx, %xmm1
xorps %xmm2, %xmm2
cvtsi2ss %ecx, %xmm2
movss 0x6b6(%rip), %xmm0      # 0x6004
mulss %xmm0, %xmm1
movss %xmm1, 0x30(%rsp)
mulss %xmm0, %xmm2
movss %xmm2, 0x60(%rsp)
movl $0x8, %r12d
movss (%rbx,%r12), %xmm0
movaps %xmm0, %xmm1
divss 0x6cf(%rip), %xmm1      # 0x6048
movss 0x687(%rip), %xmm2      # 0x6008
addss %xmm2, %xmm1
maxss 0x6bf(%rip), %xmm1      # 0x604c
mulss 0x677(%rip), %xmm1      # 0x600c
cvttss2si %xmm1, %eax
maxss %xmm2, %xmm0
movss -0x8(%rbx,%r12), %xmm1
mulss 0x50(%rsp), %xmm1
divss %xmm0, %xmm1
addss 0x30(%rsp), %xmm1
movss -0x4(%rbx,%r12), %xmm2
mulss 0x40(%rsp), %xmm2
divss %xmm0, %xmm2
movss 0x60(%rsp), %xmm0
subss %xmm2, %xmm0
cvttss2si %xmm1, %esi
cvttss2si %xmm0, %edx
movzbl %al, %eax
imull $0x10101, %eax, %ecx    # imm = 0x10101
orl $0xff000000, %ecx       # imm = 0xFF000000
movq %r15, %rdi
callq 0x2b88
addq $0x10, %r12
cmpq $0xfa08, %r12           # imm = 0xFA08
jne 0x5968
movq %r14, %rdi
callq 0x4b8f
movq %r14, %rdi
callq 0x4a66
testb %al, %al
xorps %xmm1, %xmm1
movdqa 0x674(%rip), %xmm7      # 0x6090
pcmpeqd %xmm8, %xmm8
jne 0x5709
leaq 0xb0(%rsp), %rdi
callq 0x5062
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq