// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: context_creation_opts_init
static void context_creation_opts_init(gl_context_creation_opts_t *opts)
{
	opts->force_profile_on = 0;
	opts->force_profile_off = 0;
	opts->force_flags_on = 0;
	opts->force_flags_off = 0;
	opts->force_no_error = -1;

	if (get_envi("GH_FORCE_GL_CONTEXT_PROFILE_CORE", 0)) {
		opts->force_profile_on = GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
		opts->force_profile_off = GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
	}

	int value = get_envi("GH_FORCE_GL_CONTEXT_PROFILE_COMPAT", 0);
	if (value == 1) {
		opts->force_profile_on = GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
		opts->force_profile_off = GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
	} else if (value == 2) {
		opts->flags |= GH_GLCTX_COMPAT_IF_LEGACY;
	}
	if (get_envi("GH_FORCE_GL_CONTEXT_FLAGS_NO_FORWARD_COMPAT", 0)) {
		opts->force_flags_on &= ~GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
		opts->force_flags_off |= GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
	}
	if (get_envi("GH_FORCE_GL_CONTEXT_FLAGS_NO_DEBUG", 0)) {
		opts->force_flags_on &= ~GLX_CONTEXT_DEBUG_BIT_ARB;
		opts->force_flags_off |= GLX_CONTEXT_DEBUG_BIT_ARB;
	}
	if (get_envi("GH_FORCE_GL_CONTEXT_FLAGS_FORWARD_COMPAT", 0)) {
		opts->force_flags_on |= GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
		opts->force_flags_off &= ~GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
	}
	if (get_envi("GH_FORCE_GL_CONTEXT_FLAGS_DEBUG", 0)) {
		opts->force_flags_on |= GLX_CONTEXT_DEBUG_BIT_ARB;
		opts->force_flags_off &= ~GLX_CONTEXT_DEBUG_BIT_ARB;
	}
	if (get_envi("GH_FORCE_GL_CONTEXT_FLAGS_NO_ERROR", 0)) {
		opts->force_no_error = GL_TRUE;
	}
	if (get_envi("GH_FORCE_GL_CONTEXT_FLAGS_ERROR", 0)) {
		opts->force_no_error = GL_FALSE;
	}

	opts->force_version[0] = get_envi("GH_FORCE_GL_VERSION_MAJOR", opts->force_version[0]);
	opts->force_version[1] = get_envi("GH_FORCE_GL_VERSION_MINOR", opts->force_version[1]);

	opts->force_version_min[0] = get_envi("GH_FORCE_MIN_GL_VERSION_MAJOR", opts->force_version_min[0]);
	opts->force_version_min[1] = get_envi("GH_FORCE_MIN_GL_VERSION_MINOR", opts->force_version_min[1]);

	opts->force_version_max[0] = get_envi("GH_FORCE_MAX_GL_VERSION_MAJOR", opts->force_version_max[0]);
	opts->force_version_max[1] = get_envi("GH_FORCE_MAX_GL_VERSION_MINOR", opts->force_version_max[1]);
	
	opts->force_flags_on = get_envi("GH_FORCE_GL_CONTEXT_FLAGS_ON", opts->force_flags_on);
	opts->force_flags_off = get_envi("GH_FORCE_GL_CONTEXT_FLAGS_OFF", opts->force_flags_off);

	opts->force_profile_on = get_envi("GH_FORCE_GL_CONTEXT_PROFILE_MASK_ON", opts->force_profile_on);
	opts->force_profile_off = get_envi("GH_FORCE_GL_CONTEXT_PROFILE_MASK_OFF", opts->force_profile_off);

	GH_verbose(GH_MSG_DEBUG, "got GL override options: force version %d.%d, min %d.%d, max %d.%d, flags +0x%x -0x%x, profile flags: +0x%x -0x%x, no error: %d\n",
		opts->force_version[0],opts->force_version[1],
		opts->force_version_min[0], opts->force_version_min[1],
		opts->force_version_max[0], opts->force_version_max[1],
		(unsigned)opts->force_flags_on, (unsigned)opts->force_flags_off,
		(unsigned)opts->force_profile_on, (unsigned)opts->force_profile_off,
		opts->force_no_error);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl $0x0, 0x4c(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x50(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x44(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x48(%rax)
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x54(%rax) # imm = 0xFFFFFFFF
leaq 0x3def(%rip), %rdi      # 0x9640
xorl %esi, %esi
callq 0x5480
cmpl $0x0, %eax
je 0x5873
movq -0x28(%rbp), %rax
movl $0x1, 0x4c(%rax)
movq -0x28(%rbp), %rax
movl $0x2, 0x50(%rax)
leaq 0x3de7(%rip), %rdi      # 0x9661
xorl %esi, %esi
callq 0x5480
movl %eax, -0x2c(%rbp)
cmpl $0x1, -0x2c(%rbp)
jne 0x58a2
movq -0x28(%rbp), %rax
movl $0x2, 0x4c(%rax)
movq -0x28(%rbp), %rax
movl $0x1, 0x50(%rax)
jmp 0x58b7
cmpl $0x2, -0x2c(%rbp)
jne 0x58b5
movq -0x28(%rbp), %rax
movl 0x28(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x28(%rax)
jmp 0x58b7
leaq 0x3dc6(%rip), %rdi      # 0x9684
xorl %esi, %esi
callq 0x5480
cmpl $0x0, %eax
je 0x58e4
movq -0x28(%rbp), %rax
movl 0x44(%rax), %ecx
andl $-0x3, %ecx
movl %ecx, 0x44(%rax)
movq -0x28(%rbp), %rax
movl 0x48(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x48(%rax)
leaq 0x3dc5(%rip), %rdi      # 0x96b0
xorl %esi, %esi
callq 0x5480
cmpl $0x0, %eax
je 0x5911
movq -0x28(%rbp), %rax
movl 0x44(%rax), %ecx
andl $-0x2, %ecx
movl %ecx, 0x44(%rax)
movq -0x28(%rbp), %rax
movl 0x48(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x48(%rax)
leaq 0x3dbb(%rip), %rdi      # 0x96d3
xorl %esi, %esi
callq 0x5480
cmpl $0x0, %eax
je 0x593e
movq -0x28(%rbp), %rax
movl 0x44(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x44(%rax)
movq -0x28(%rbp), %rax
movl 0x48(%rax), %ecx
andl $-0x3, %ecx
movl %ecx, 0x48(%rax)
leaq 0x3db7(%rip), %rdi      # 0x96fc
xorl %esi, %esi
callq 0x5480
cmpl $0x0, %eax
je 0x596b
movq -0x28(%rbp), %rax
movl 0x44(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x44(%rax)
movq -0x28(%rbp), %rax
movl 0x48(%rax), %ecx
andl $-0x2, %ecx
movl %ecx, 0x48(%rax)
leaq 0x3daa(%rip), %rdi      # 0x971c
xorl %esi, %esi
callq 0x5480
cmpl $0x0, %eax
je 0x5989
movq -0x28(%rbp), %rax
movl $0x1, 0x54(%rax)
leaq 0x3daf(%rip), %rdi      # 0x973f
xorl %esi, %esi
callq 0x5480
cmpl $0x0, %eax
je 0x59a7
movq -0x28(%rbp), %rax
movl $0x0, 0x54(%rax)
movq -0x28(%rbp), %rax
movl 0x2c(%rax), %esi
leaq 0x3daa(%rip), %rdi      # 0x975f
callq 0x5480
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x28(%rbp), %rax
movl 0x30(%rax), %esi
leaq 0x3da8(%rip), %rdi      # 0x9779
callq 0x5480
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x28(%rbp), %rax
movl 0x34(%rax), %esi
leaq 0x3da6(%rip), %rdi      # 0x9793
callq 0x5480
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x28(%rbp), %rax
movl 0x38(%rax), %esi
leaq 0x3da8(%rip), %rdi      # 0x97b1
callq 0x5480
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x28(%rbp), %rax
movl 0x3c(%rax), %esi
leaq 0x3daa(%rip), %rdi      # 0x97cf
callq 0x5480
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x3c(%rax)
movq -0x28(%rbp), %rax
movl 0x40(%rax), %esi
leaq 0x3dac(%rip), %rdi      # 0x97ed
callq 0x5480
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x28(%rbp), %rax
movl 0x44(%rax), %esi
leaq 0x3dae(%rip), %rdi      # 0x980b
callq 0x5480
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0x28(%rbp), %rax
movl 0x48(%rax), %esi
leaq 0x3daf(%rip), %rdi      # 0x9828
callq 0x5480
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x28(%rbp), %rax
movl 0x4c(%rax), %esi
leaq 0x3db1(%rip), %rdi      # 0x9846
callq 0x5480
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4c(%rax)
movq -0x28(%rbp), %rax
movl 0x50(%rax), %esi
leaq 0x3db9(%rip), %rdi      # 0x986a
callq 0x5480
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x50(%rax)
movq -0x28(%rbp), %rax
movl 0x2c(%rax), %edx
movq -0x28(%rbp), %rax
movl 0x30(%rax), %ecx
movq -0x28(%rbp), %rax
movl 0x34(%rax), %r8d
movq -0x28(%rbp), %rax
movl 0x38(%rax), %r9d
movq -0x28(%rbp), %rax
movl 0x3c(%rax), %r12d
movq -0x28(%rbp), %rax
movl 0x40(%rax), %r15d
movq -0x28(%rbp), %rax
movl 0x44(%rax), %r14d
movq -0x28(%rbp), %rax
movl 0x48(%rax), %ebx
movq -0x28(%rbp), %rax
movl 0x4c(%rax), %r11d
movq -0x28(%rbp), %rax
movl 0x50(%rax), %r10d
movq -0x28(%rbp), %rax
movl 0x54(%rax), %eax
movl $0x4, %edi
leaq 0x3d70(%rip), %rsi      # 0x988f
movl %r12d, (%rsp)
movl %r15d, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movl %r11d, 0x20(%rsp)
movl %r10d, 0x28(%rsp)
movl %eax, 0x30(%rsp)
movb $0x0, %al
callq 0x3020
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)