// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/game.c
// Function: init
Error init(){
	if(SDL_Init(SDL_INIT_EVERYTHING) == -1){
		errMsg("Could not initialize SDL");
		return INIT_FAILURE;
	}

	SDL_GL_SetAttribute(SDL_GL_RED_SIZE, BITS_PER_PIXEL);
	SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, BITS_PER_PIXEL);
	SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, BITS_PER_PIXEL);
	SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, BITS_PER_PIXEL);
	SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, STENCIL_BUFFER_SIZE);
	SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, GL_TRUE);
	SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, DEPTH_BUFFER_SIZE);
	SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
	SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, MAJOR_GL_VERSION);
	SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, MINOR_GL_VERSION);
	screen = SDL_CreateWindow(WINDOW_TITLE,
			SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
			WINDOW_WIDTH, WINDOW_HEIGHT,
			SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL);

	context = SDL_GL_CreateContext(screen);

	if(ogl_LoadFunctions() == ogl_LOAD_FAILED){
		errMsg("Failed to initalize OpenGL functions");
		return INIT_FAILURE;
	}

	initGL();
	initData();

	return NO_ERROR;
}

// Assembly:
pushq %rbx
movl $0xf231, %edi           # imm = 0xF231
callq 0x10e0
cmpl $-0x1, %eax
je 0x1d87
xorl %edi, %edi
movl $0x8, %esi
callq 0x11d0
movl $0x1, %ebx
movl $0x1, %edi
movl $0x8, %esi
callq 0x11d0
movl $0x2, %edi
movl $0x8, %esi
callq 0x11d0
movl $0x3, %edi
movl $0x8, %esi
callq 0x11d0
movl $0x7, %edi
movl $0x8, %esi
callq 0x11d0
movl $0x5, %edi
movl $0x1, %esi
callq 0x11d0
movl $0x6, %edi
movl $0x18, %esi
callq 0x11d0
movl $0x15, %edi
movl $0x1, %esi
callq 0x11d0
movl $0x11, %edi
movl $0x3, %esi
callq 0x11d0
movl $0x12, %edi
movl $0x3, %esi
callq 0x11d0
leaq 0x4462(%rip), %rdi      # 0x60d8
movl $0x2fff0000, %esi       # imm = 0x2FFF0000
movl $0x2fff0000, %edx       # imm = 0x2FFF0000
movl $0x320, %ecx            # imm = 0x320
movl $0x258, %r8d            # imm = 0x258
movl $0x6, %r9d
callq 0x1050
movq %rax, 0x84cb(%rip)      # 0xa168
movq %rax, %rdi
callq 0x1070
movq %rax, 0x84c4(%rip)      # 0xa170
xorl %eax, %eax
callq 0x20cc
testl %eax, %eax
je 0x1dad
leaq 0x854e(%rip), %rbx      # 0xa210
movl $0xbe2, %edi            # imm = 0xBE2
callq *(%rbx)
leaq 0x84e0(%rip), %rax      # 0xa1b0
movl $0x302, %edi            # imm = 0x302
movl $0x303, %esi            # imm = 0x303
callq *(%rax)
movl $0xb71, %edi            # imm = 0xB71
callq *(%rbx)
leaq 0x84fe(%rip), %rax      # 0xa1e8
movl $0x203, %edi            # imm = 0x203
callq *(%rax)
leaq 0x84c8(%rip), %rax      # 0xa1c0
movss 0x435c(%rip), %xmm3     # 0x605c
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq *(%rax)
leaq 0x8466(%rip), %rdi      # 0xa178
leaq 0x43fe(%rip), %rsi      # 0x6117
leaq 0x4404(%rip), %rdx      # 0x6124
callq 0x4538
leaq 0x4405(%rip), %rdi      # 0x6131
callq 0x4c64
movq %rax, 0x8470(%rip)      # 0xa1a8
leaq 0x43ff(%rip), %rsi      # 0x613e
movq %rax, %rdi
xorl %edx, %edx
callq 0x4df6
movq %rax, %rdi
callq 0x4eb8
movq %rax, 0x8448(%rip)      # 0xa1a0
movq 0x8449(%rip), %rdi      # 0xa1a8
leaq 0x43e8(%rip), %rsi      # 0x614e
xorl %edx, %edx
callq 0x4df6
movq 0x842c(%rip), %rsi      # 0xa1a0
movq %rax, %rdi
callq 0x12fc
movq %rax, 0x8415(%rip)      # 0xa198
xorl %ebx, %ebx
jmp 0x1dcc
movq 0x83da(%rip), %rcx      # 0xa168
leaq 0x4323(%rip), %rsi      # 0x60b8
leaq 0x4323(%rip), %rdx      # 0x60bf
movl $0x10, %edi
callq 0x10b0
movl $0x1, %ebx
jmp 0x1dcc
movq 0x83b4(%rip), %rcx      # 0xa168
leaq 0x42fd(%rip), %rsi      # 0x60b8
leaq 0x4321(%rip), %rdx      # 0x60e3
movl $0x10, %edi
callq 0x10b0
movl %ebx, %eax
popq %rbx
retq