// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
movl $0xf231, %edi           # imm = 0xF231
callq 0x10e0
cmpl $-0x1, %eax
je 0x734e
pushq $0x8
popq %r14
xorl %edi, %edi
movl %r14d, %esi
callq 0x11d0
pushq $0x1
popq %rbx
movl %ebx, %edi
movl %r14d, %esi
callq 0x11d0
pushq $0x2
popq %rdi
movl %r14d, %esi
callq 0x11d0
pushq $0x3
popq %rbp
movl %ebp, %edi
movl %r14d, %esi
callq 0x11d0
pushq $0x7
popq %rdi
movl %r14d, %esi
callq 0x11d0
pushq $0x5
popq %rdi
movl %ebx, %esi
callq 0x11d0
pushq $0x6
popq %r14
pushq $0x18
popq %rsi
movl %r14d, %edi
callq 0x11d0
pushq $0x15
popq %rdi
movl %ebx, %esi
callq 0x11d0
pushq $0x11
popq %rdi
movl %ebp, %esi
callq 0x11d0
pushq $0x12
popq %rdi
movl %ebp, %esi
callq 0x11d0
leaq 0x2798(%rip), %rdi      # 0x99d8
movl $0x2fff0000, %esi       # imm = 0x2FFF0000
movl $0x2fff0000, %edx       # imm = 0x2FFF0000
movl $0x320, %ecx            # imm = 0x320
movl $0x258, %r8d            # imm = 0x258
movl %r14d, %r9d
callq 0x1050
movq %rax, 0x59c4(%rip)      # 0xcc28
movq %rax, %rdi
callq 0x1070
movq %rax, 0x59bd(%rip)      # 0xcc30
xorl %eax, %eax
callq 0x12ec
testl %eax, %eax
je 0x735f
leaq 0x4f3f(%rip), %rbx      # 0xc1c8
movl $0xbe2, %edi            # imm = 0xBE2
callq *(%rbx)
leaq 0x4ed1(%rip), %rax      # 0xc168
movl $0x302, %edi            # imm = 0x302
movl $0x303, %esi            # imm = 0x303
callq *(%rax)
movl $0xb71, %edi            # imm = 0xB71
callq *(%rbx)
leaq 0x4eef(%rip), %rax      # 0xc1a0
movl $0x203, %edi            # imm = 0x203
callq *(%rax)
leaq 0x4eb9(%rip), %rax      # 0xc178
movss 0x25b1(%rip), %xmm3     # 0x9878
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq *(%rax)
leaq 0x595f(%rip), %rdi      # 0xcc38
leaq 0x2737(%rip), %rsi      # 0x9a17
leaq 0x273d(%rip), %rdx      # 0x9a24
callq 0x5b18
leaq 0x273e(%rip), %rdi      # 0x9a31
callq 0x620c
movq %rax, 0x5969(%rip)      # 0xcc68
leaq 0x2738(%rip), %rsi      # 0x9a3e
movq %rax, %rdi
xorl %edx, %edx
callq 0x637d
movq %rax, %rdi
callq 0x643c
movq %rax, 0x5941(%rip)      # 0xcc60
movq 0x5942(%rip), %rdi      # 0xcc68
leaq 0x2721(%rip), %rsi      # 0x9a4e
xorl %edx, %edx
callq 0x637d
movq 0x5925(%rip), %rsi      # 0xcc60
movq %rax, %rdi
callq 0x6934
movq %rax, 0x590e(%rip)      # 0xcc58
xorl %ebx, %ebx
jmp 0x736b
leaq 0x266a(%rip), %rdi      # 0x99bf
callq 0x7194
pushq $0x1
popq %rbx
jmp 0x736b
leaq 0x267d(%rip), %rdi      # 0x99e3
callq 0x7194
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq