// File: /workspace/github_c_makefile_star2_O1/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 $0xd8, %rsp
movabsq $0x1e000000280, %rax    # imm = 0x1E000000280
movq %rax, 0x48(%rsp)
movl $0x1, 0x58(%rsp)
xorl %r14d, %r14d
movb %r14b, 0x5c(%rsp)
movl $0x1010101, 0x5d(%rsp)  # imm = 0x1010101
movb %r14b, 0x64(%rsp)
movl $0x40, 0x68(%rsp)
leaq 0x106b(%rip), %rax      # 0x65ac
movq %rax, 0x50(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x48(%rsp), %xmm0
movups 0x58(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x3ea1
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 0xa6f(%rip), %xmm0      # 0x6004
mulss %xmm0, %xmm1
movss %xmm1, 0x38(%rsp)
xorps %xmm1, %xmm1
cvtsi2ss %r15d, %xmm1
mulss %xmm0, %xmm1
movss %xmm1, 0x34(%rsp)
movl $0xfa00, %edi           # imm = 0xFA00
callq 0x2310
movq %rax, %rbx
callq 0x2080
cltd
idivl %ebp
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
subss 0x38(%rsp), %xmm0
movss %xmm0, (%rbx,%r14)
callq 0x2080
cltd
idivl %r15d
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movss 0x34(%rsp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0x4(%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 0x55be
leaq 0x70(%rsp), %rdi
callq 0x49fc
testb %al, %al
je 0x5892
movss 0x38(%rsp), %xmm0
divss 0x9d2(%rip), %xmm0      # 0x6038
movss %xmm0, 0x38(%rsp)
movss 0x34(%rsp), %xmm0
divss 0x9c2(%rip), %xmm0      # 0x603c
movss %xmm0, 0x34(%rsp)
xorps %xmm1, %xmm1
leaq 0x70(%rsp), %r14
movq 0xa8(%rsp), %r15
movl (%r15), %ebp
cvtsi2ss %ebp, %xmm5
movl 0x4(%r15), %r12d
cvtsi2ss %r12d, %xmm6
movss 0x74(%rsp), %xmm7
movss 0x956(%rip), %xmm0      # 0x6004
mulss %xmm0, %xmm5
movss %xmm5, 0x40(%rsp)
mulss %xmm0, %xmm6
movss %xmm6, 0x3c(%rsp)
movl $0xc, %r13d
movss %xmm7, 0x44(%rsp)
cmpb $0x0, (%rbx,%r13)
movss 0x965(%rip), %xmm0      # 0x6040
jne 0x56e5
movss 0x95f(%rip), %xmm0      # 0x6044
mulss %xmm7, %xmm0
addss -0x4(%rbx,%r13), %xmm0
movss %xmm0, -0x4(%rbx,%r13)
ucomiss %xmm0, %xmm1
jb 0x5779
callq 0x2080
cltd
idivl %ebp
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
subss 0x40(%rsp), %xmm0
movss %xmm0, -0xc(%rbx,%r13)
callq 0x2080
cltd
idivl %r12d
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movss 0x3c(%rsp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, -0x8(%rbx,%r13)
callq 0x2080
movss 0x44(%rsp), %xmm7
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 0x56ce
movl 0x4(%r15), %ecx
imull (%r15), %ecx
testl %ecx, %ecx
jle 0x57ad
movq 0x10(%r15), %rax
movl %ecx, %ecx
xorl %edx, %edx
movl $0xff000000, (%rax,%rdx,4) # imm = 0xFF000000
incq %rdx
cmpq %rdx, %rcx
jne 0x579e
xorps %xmm1, %xmm1
cvtsi2ssl (%r15), %xmm1
xorps %xmm2, %xmm2
cvtsi2ssl 0x4(%r15), %xmm2
movss 0x83e(%rip), %xmm0      # 0x6004
mulss %xmm0, %xmm1
movss %xmm1, 0x40(%rsp)
mulss %xmm0, %xmm2
movss %xmm2, 0x3c(%rsp)
movl $0x8, %r12d
movss (%rbx,%r12), %xmm0
movaps %xmm0, %xmm1
divss 0x857(%rip), %xmm1      # 0x6048
movss 0x80f(%rip), %xmm2      # 0x6008
addss %xmm2, %xmm1
maxss 0x847(%rip), %xmm1      # 0x604c
mulss 0x7ff(%rip), %xmm1      # 0x600c
cvttss2si %xmm1, %eax
maxss %xmm2, %xmm0
movss -0x8(%rbx,%r12), %xmm1
mulss 0x38(%rsp), %xmm1
divss %xmm0, %xmm1
addss 0x40(%rsp), %xmm1
movss -0x4(%rbx,%r12), %xmm2
mulss 0x34(%rsp), %xmm2
divss %xmm0, %xmm2
movss 0x3c(%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 0x57e0
movq %r14, %rdi
callq 0x4b48
movq %r14, %rdi
callq 0x49fc
testb %al, %al
xorps %xmm1, %xmm1
jne 0x5688
leaq 0x70(%rsp), %rdi
callq 0x5017
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq