// File: /workspace/github_c_makefile_star2_O0/Nealsbo[P]C-Software-Renderer/src/application.c
// Function: SetupScene
static void SetupScene() {
	printf( "Scene Setup: Start\n" );
    obj_model_t *testModel0 = Model_LoadOBJ( loadedObjectName );
    //obj_model_t *testModel0 = Model_CreateBasePlane( "Plane01" );
    Model_SetPosition( testModel0, vec3_create( 0.0f, 0.0f, -2.0f ) );
    Model_SetRotation( testModel0, vec3_create( 0.0f, 3.14f + to_radians( 180.0f ), 0.0f ) );
    /*
    obj_model_t *testModel1 = Model_CreateBasePlane( "Plane01" );
    Model_SetRotation( testModel1, vec3_create( to_radians( -90.0f ), to_radians( 180.0f ), 0.0f ) );
    Model_SetPosition( testModel1, vec3_create( 0.0f, -2.0f, 0.0f ) );
    Model_SetScale( testModel1, vec3_create( 5.0f, 5.0f, 5.0f ) );
    */
    camera_t *Cam = Camera_Init(vec3_create( 0.0f, 0.0f, 2.0f ),          // Position
                                vec3_create( 0.0f, 1.0f, 0.0f ),          // Up vector
                                -90.0f,                                 // Yaw
                                0.0f,                                   // Pitch
                                60.0f,                                  // FOV - broken
                                (float)WINDOW_WIDTH/WINDOW_HEIGHT,      // Aspect
                                0.5f,                                   // Near plane
                                100.0f,                                 // Far plane
                                5.0f);                                  // Speed
    
    Scene = Scene_Init( Cam );
    Scene_SetDirectLight( Scene, vec3_create( 0.0f, 3.0f, 5.0f ), vec3_create( 1.0f, 0.5f, 0.0f ) );
    Scene_SetAmbientLight( Scene, vec3_create( 0.0f, 0.5f, 1.0f ) );
    Scene_AddObject( Scene, testModel0 );
    //Scene_AddObject( Scene, testModel1 );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
leaq 0xc85f(%rip), %rdi      # 0xe141
xorl %eax, %eax
callq 0x1040
movq 0x11868(%rip), %rdi     # 0x13158
callq 0x9a80
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1a0(%rbp)
xorps %xmm1, %xmm1
movss %xmm1, -0x174(%rbp)
movss 0xc6f9(%rip), %xmm2     # 0xe010
movaps %xmm1, %xmm0
callq 0x4270
movq -0x1a0(%rbp), %rdi
movss %xmm1, -0x20(%rbp)
movlpd %xmm0, -0x28(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x10(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
callq 0xa450
movq -0x8(%rbp), %rax
movq %rax, -0x198(%rbp)
movss 0xc6a6(%rip), %xmm0     # 0xe014
callq 0x80c0
movss -0x174(%rbp), %xmm2
movaps %xmm0, %xmm1
movss 0xc692(%rip), %xmm0     # 0xe018
addss %xmm0, %xmm1
movaps %xmm2, %xmm0
callq 0x4270
movq -0x198(%rbp), %rdi
movss %xmm1, -0x50(%rbp)
movlpd %xmm0, -0x58(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x40(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x48(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movss -0x60(%rbp), %xmm1
callq 0xa490
movss -0x174(%rbp), %xmm1
movss 0xc63e(%rip), %xmm2     # 0xe01c
movaps %xmm1, %xmm0
callq 0x4270
movss -0x174(%rbp), %xmm2
movss %xmm1, -0x88(%rbp)
movlpd %xmm0, -0x90(%rbp)
movl -0x88(%rbp), %eax
movl %eax, -0x78(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x80(%rbp)
movss 0xc5ea(%rip), %xmm1     # 0xe004
movss %xmm1, -0x16c(%rbp)
movaps %xmm2, %xmm0
callq 0x4270
movss -0x174(%rbp), %xmm5
movss %xmm1, -0xa8(%rbp)
movlpd %xmm0, -0xb0(%rbp)
movl -0xa8(%rbp), %eax
movl %eax, -0x98(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0xb8(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0xc0(%rbp)
movsd -0xc0(%rbp), %xmm0
movss -0xb8(%rbp), %xmm1
movl -0x98(%rbp), %eax
movl %eax, -0xc8(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movsd -0xd0(%rbp), %xmm2
movss -0xc8(%rbp), %xmm3
movq %rsp, %rax
movl $0x40a00000, 0x10(%rax) # imm = 0x40A00000
movl $0x42c80000, 0x8(%rax)  # imm = 0x42C80000
movl $0x3f000000, (%rax)     # imm = 0x3F000000
movss 0xc557(%rip), %xmm4     # 0xe020
movss 0xc553(%rip), %xmm6     # 0xe024
movss 0xc54f(%rip), %xmm7     # 0xe028
callq 0x1cd0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0xc980
movss -0x174(%rbp), %xmm0
movq %rax, 0x116ce(%rip)     # 0x131c8
movq 0x116c7(%rip), %rax     # 0x131c8
movq %rax, -0x180(%rbp)
movss 0xc51c(%rip), %xmm1     # 0xe02c
movss 0xc518(%rip), %xmm2     # 0xe030
callq 0x4270
movss -0x174(%rbp), %xmm2
movaps %xmm0, %xmm3
movss -0x16c(%rbp), %xmm0
movaps %xmm3, -0x190(%rbp)
movaps %xmm1, %xmm3
movaps -0x190(%rbp), %xmm1
movss %xmm3, -0xe8(%rbp)
movlpd %xmm1, -0xf0(%rbp)
movl -0xe8(%rbp), %eax
movl %eax, -0xd8(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movss 0xc4c1(%rip), %xmm1     # 0xe034
movss %xmm1, -0x170(%rbp)
callq 0x4270
movq -0x180(%rbp), %rdi
movss %xmm1, -0x108(%rbp)
movlpd %xmm0, -0x110(%rbp)
movl -0x108(%rbp), %eax
movl %eax, -0xf8(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0x100(%rbp)
movl -0xd8(%rbp), %eax
movl %eax, -0x118(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0x120(%rbp)
movsd -0x120(%rbp), %xmm0
movss -0x118(%rbp), %xmm1
movl -0xf8(%rbp), %eax
movl %eax, -0x128(%rbp)
movq -0x100(%rbp), %rax
movq %rax, -0x130(%rbp)
movsd -0x130(%rbp), %xmm2
movss -0x128(%rbp), %xmm3
callq 0xcb70
movss -0x174(%rbp), %xmm0
movss -0x170(%rbp), %xmm1
movss -0x16c(%rbp), %xmm2
movq 0x1159f(%rip), %rax     # 0x131c8
movq %rax, -0x168(%rbp)
callq 0x4270
movq -0x168(%rbp), %rdi
movss %xmm1, -0x148(%rbp)
movlpd %xmm0, -0x150(%rbp)
movl -0x148(%rbp), %eax
movl %eax, -0x138(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0x140(%rbp)
movl -0x138(%rbp), %eax
movl %eax, -0x158(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0x160(%rbp)
movsd -0x160(%rbp), %xmm0
movss -0x158(%rbp), %xmm1
callq 0xcbd0
movq 0x1152c(%rip), %rdi     # 0x131c8
movq -0x8(%rbp), %rsi
callq 0xcb10
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
nop