// File: /workspace/github_c_makefile_star2_O2/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 0x1477(%rip), %rax      # 0x65bc
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 0x3de3
callq 0x2320
movl %eax, %edi
callq 0x2260
movq 0x38(%rbx), %rax
movl (%rax), %ebp
cvtsi2ss %ebp, %xmm0
movl 0x4(%rax), %r15d
movss 0xe62(%rip), %xmm1      # 0x6004
mulss %xmm1, %xmm0
movaps %xmm0, 0x50(%rsp)
cvtsi2ss %r15d, %xmm0
mulss %xmm1, %xmm0
movaps %xmm0, 0x40(%rsp)
movl $0xfa00, %edi           # imm = 0xFA00
callq 0x2310
movq %rax, %rbx
movl $0x12c, %r12d           # imm = 0x12C
cmpq $0xfa00, %r14           # imm = 0xFA00
je 0x5231
callq 0x2080
cltd
idivl %ebp
cvtsi2ss %edx, %xmm0
movaps %xmm0, 0x30(%rsp)
callq 0x2080
cltd
idivl %r15d
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
cltd
idivl %r12d
cmpq $0x10, %r14
cvtsi2ss %edx, %xmm0
movss %xmm0, 0x8(%rbx,%r14)
sete 0xc(%rbx,%r14)
addq $0x10, %r14
jmp 0x51cc
movaps 0x50(%rsp), %xmm0
divss 0xdfa(%rip), %xmm0      # 0x6038
movaps %xmm0, 0x50(%rsp)
movaps 0x40(%rsp), %xmm0
divss 0xdec(%rip), %xmm0      # 0x603c
movaps %xmm0, 0x40(%rsp)
leaq 0xb0(%rsp), %r14
pushq $0xa
popq %rbp
movq %r14, %rdi
callq 0x4878
testb %al, %al
je 0x5445
movq 0xe8(%rsp), %r15
movl (%r15), %r12d
cvtsi2ss %r12d, %xmm1
movl 0x4(%r15), %r13d
cvtsi2ss %r13d, %xmm2
movss 0xb4(%rsp), %xmm3
movss 0xd6a(%rip), %xmm0      # 0x6004
mulss %xmm0, %xmm1
movaps %xmm1, 0x60(%rsp)
mulss %xmm0, %xmm2
movaps %xmm2, 0xa0(%rsp)
pushq $0xc
popq %r14
movss %xmm3, 0x2c(%rsp)
cmpq $0xfa0c, %r14           # imm = 0xFA0C
je 0x535c
cmpb $0x0, (%rbx,%r14)
movss 0xd6d(%rip), %xmm0      # 0x6040
jne 0x52dd
movss 0xd67(%rip), %xmm0      # 0x6044
mulss %xmm3, %xmm0
addss -0x4(%rbx,%r14), %xmm0
movss %xmm0, -0x4(%rbx,%r14)
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jb 0x5353
callq 0x2080
cltd
idivl %r12d
cvtsi2ss %edx, %xmm0
movaps %xmm0, 0x30(%rsp)
callq 0x2080
cltd
idivl %r13d
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,%r14)
callq 0x2080
movss 0x2c(%rsp), %xmm3
cltd
idivl %ebp
addl $0x12c, %edx            # imm = 0x12C
cvtsi2ss %edx, %xmm0
movss %xmm0, -0x4(%rbx,%r14)
addq $0x10, %r14
jmp 0x52b9
movq %r15, %rdi
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x2c76
cvtsi2ssl (%r15), %xmm1
cvtsi2ssl 0x4(%r15), %xmm2
movss 0xc88(%rip), %xmm0      # 0x6004
mulss %xmm0, %xmm1
movss %xmm1, 0x30(%rsp)
mulss %xmm0, %xmm2
movss %xmm2, 0x60(%rsp)
pushq $0x8
popq %r14
cmpq $0xfa08, %r14           # imm = 0xFA08
je 0x5430
movss (%rbx,%r14), %xmm0
movaps %xmm0, %xmm1
divss 0xc96(%rip), %xmm1      # 0x6048
movss 0xc4e(%rip), %xmm2      # 0x6008
addss %xmm2, %xmm1
maxss 0xc86(%rip), %xmm1      # 0x604c
mulss 0xc3e(%rip), %xmm1      # 0x600c
cvttss2si %xmm1, %eax
maxss %xmm2, %xmm0
movss -0x8(%rbx,%r14), %xmm1
mulss 0x50(%rsp), %xmm1
divss %xmm0, %xmm1
addss 0x30(%rsp), %xmm1
movss -0x4(%rbx,%r14), %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 0x2b6d
addq $0x10, %r14
jmp 0x5394
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
callq 0x493f
jmp 0x5260
leaq 0xb0(%rsp), %rdi
callq 0x4c17
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq