// File: /workspace/github_c_makefile_star2_O3/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 0x1dbf
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 0x642a(%rip), %rdi      # 0x80d8
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, 0xa493(%rip)      # 0xc168
movq %rax, %rdi
callq 0x1070
movq %rax, 0xa48c(%rip)      # 0xc170
xorl %eax, %eax
callq 0x20dc
testl %eax, %eax
je 0x1de5
leaq 0xa516(%rip), %rbx      # 0xc210
movl $0xbe2, %edi            # imm = 0xBE2
callq *(%rbx)
leaq 0xa4a8(%rip), %rax      # 0xc1b0
movl $0x302, %edi            # imm = 0x302
movl $0x303, %esi            # imm = 0x303
callq *(%rax)
movl $0xb71, %edi            # imm = 0xB71
callq *(%rbx)
leaq 0xa4c6(%rip), %rax      # 0xc1e8
movl $0x203, %edi            # imm = 0x203
callq *(%rax)
leaq 0xa490(%rip), %rax      # 0xc1c0
movss 0x6324(%rip), %xmm3     # 0x805c
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq *(%rax)
leaq 0xa42e(%rip), %rdi      # 0xc178
leaq 0x63c6(%rip), %rsi      # 0x8117
leaq 0x63cc(%rip), %rdx      # 0x8124
callq 0x6944
leaq 0x63cd(%rip), %rdi      # 0x8131
callq 0x700c
movq %rax, 0xa438(%rip)      # 0xc1a8
leaq 0x63c7(%rip), %rsi      # 0x813e
movq %rax, %rdi
xorl %edx, %edx
callq 0x717d
movq %rax, %rdi
callq 0x7240
movq %rax, 0xa410(%rip)      # 0xc1a0
movq 0xa411(%rip), %rdi      # 0xc1a8
leaq 0x63b0(%rip), %rsi      # 0x814e
xorl %edx, %edx
callq 0x717d
movq 0xa3f4(%rip), %rsi      # 0xc1a0
movq %rax, %rdi
callq 0x12ec
movq %rax, 0xa3dd(%rip)      # 0xc198
xorl %ebx, %ebx
jmp 0x1e04
movq 0xa3a2(%rip), %rcx      # 0xc168
leaq 0x62eb(%rip), %rsi      # 0x80b8
leaq 0x62eb(%rip), %rdx      # 0x80bf
movl $0x10, %edi
callq 0x10b0
movl $0x1, %ebx
jmp 0x1e04
movq 0xa37c(%rip), %rcx      # 0xc168
leaq 0x62c5(%rip), %rsi      # 0x80b8
leaq 0x62e9(%rip), %rdx      # 0x80e3
movl $0x10, %edi
callq 0x10b0
movl %ebx, %eax
popq %rbx
retq