// File: /workspace/github_c_makefile_star2_O0/Nealsbo[P]C-Software-Renderer/src/application.c
// Function: Application_Run
void Application_Run() {
	printf( "Application Run: Start\n");
    SDL_Event e;

    SetupScene( Scene );
    mainRenderer = Renderer_Init( Scene, RENDER_STATE_LIT, RENDER_TYPE_SOFTWARE );
    
    float frames_slice = 0.0f;
    float delta = 0.0f;
    
    unsigned int frames_slice_count = 0;
    clock_t curr_time, last_time;
    last_time = clock();
    
	printf( "Application Run: Loop\n");
    while ( !quit ) {
        curr_time = clock();
        delta = (float)( curr_time - last_time )/CLOCKS_PER_SEC;
        frames_slice += delta;
        elapsed_time += delta;
        frames_slice_count++;
        
        IH_ProcessInput( e, mainRenderer );
        UpdateScene( mainRenderer, delta );
        Renderer_DrawWorld( mainRenderer, gScreenSurface );
        SDL_UpdateWindowSurface( gWindow );
        
        printf("%f\n", elapsed_time);
        if(frames_slice > 1.0f){
            printf("FPS: %u\n", (unsigned int)(1.0f / frames_slice * (float)frames_slice_count));
            frames_slice = 0.0f;
            frames_slice_count = 0;
        }

        if( quit ) {
            break;
        }
        last_time = curr_time;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
leaq 0xcc9d(%rip), %rdi      # 0xe0ef
movb $0x0, %al
callq 0x1040
callq 0x18d0
movq 0x11d63(%rip), %rdi     # 0x131c8
movl $0x1, %esi
xorl %edx, %edx
callq 0xbc60
movq %rax, 0x11d58(%rip)     # 0x131d0
xorps %xmm0, %xmm0
movss %xmm0, -0x3c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
callq 0x10e0
movq %rax, -0x58(%rbp)
leaq 0xcc68(%rip), %rdi      # 0xe107
movb $0x0, %al
callq 0x1040
cmpl $0x0, 0x11cfb(%rip)     # 0x131a8
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x14bb
jmp 0x15f2
callq 0x10e0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
subq -0x58(%rbp), %rax
cvtsi2ss %rax, %xmm0
movss 0xcb2f(%rip), %xmm1     # 0xe008
divss %xmm1, %xmm0
movss %xmm0, -0x40(%rbp)
movss -0x40(%rbp), %xmm0
addss -0x3c(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
movss -0x40(%rbp), %xmm0
addss 0x11cae(%rip), %xmm0    # 0x131ac
movss %xmm0, 0x11ca6(%rip)    # 0x131ac
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movq 0x11cba(%rip), %rdi     # 0x131d0
movq -0x8(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x30(%rax)
movups -0x38(%rbp), %xmm0
movups -0x28(%rbp), %xmm1
movups -0x18(%rbp), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x1600
movq 0x11c8c(%rip), %rdi     # 0x131d0
movss -0x40(%rbp), %xmm0
callq 0x16d0
movq 0x11c7b(%rip), %rdi     # 0x131d0
movq 0x11c64(%rip), %rsi     # 0x131c0
callq 0xc890
movq 0x11c50(%rip), %rdi     # 0x131b8
callq 0x1180
movss 0x11c37(%rip), %xmm0    # 0x131ac
cvtss2sd %xmm0, %xmm0
leaq 0xcc26(%rip), %rdi      # 0xe1a6
movb $0x1, %al
callq 0x1040
movss -0x3c(%rbp), %xmm0
movss 0xca70(%rip), %xmm1     # 0xe004
ucomiss %xmm1, %xmm0
jbe 0x15da
movss -0x3c(%rbp), %xmm1
movss 0xca5e(%rip), %xmm0     # 0xe004
divss %xmm1, %xmm0
movl -0x44(%rbp), %eax
cvtsi2ss %rax, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %rax
movl %eax, %esi
leaq 0xcb5a(%rip), %rdi      # 0xe11e
movb $0x0, %al
callq 0x1040
xorps %xmm0, %xmm0
movss %xmm0, -0x3c(%rbp)
movl $0x0, -0x44(%rbp)
cmpl $0x0, 0x11bc7(%rip)     # 0x131a8
je 0x15e5
jmp 0x15f2
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x14a6
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax,%rax)