// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: create_context
static void
create_context(GLXContext ctx)
{
	gl_context_t *glc;
	unsigned int ctx_num;

	GH_verbose(GH_MSG_DEBUG, "created ctx %p\n",ctx);

	pthread_mutex_lock(&ctx_mutex);
	ctx_num=ctx_counter++;
	if (!ctx_num) {
		pthread_key_create(&ctx_current, NULL);
		pthread_setspecific(ctx_current, NULL);
		/* query the function pointers for the standard functions
		 * which might be often called ... */
		GH_GET_PTR_GL(glXSwapBuffers);
		GH_GET_PTR_GL(glXMakeCurrent);
		GH_GET_PTR_GL(glXMakeContextCurrent);
		GH_GET_PTR_GL(glXMakeCurrentReadSGI);
		GH_GET_PTR_GL(glFlush);
		GH_GET_PTR_GL(glFinish);
	}
	pthread_mutex_unlock(&ctx_mutex);
	
	glc=create_ctx(ctx, ctx_num);
	if (glc) {
		read_config(glc);
		/* add to our list */
		add_ctx(glc);
	} else {
		GH_verbose(GH_MSG_ERROR, "out of memory\n");
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdx
movl $0x4, %edi
leaq 0x657d(%rip), %rsi      # 0x9cf9
movb $0x0, %al
callq 0x3020
leaq 0x9ba6(%rip), %rdi      # 0xd330
callq 0x21a0
movl 0x9bc3(%rip), %eax      # 0xd358
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x9bb8(%rip)      # 0xd358
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x391c
leaq 0x9afc(%rip), %rdi      # 0xd2b0
xorl %eax, %eax
movl %eax, %esi
callq 0x20c0
movl 0x9aed(%rip), %edi      # 0xd2b0
xorl %eax, %eax
movl %eax, %esi
callq 0x21b0
leaq 0x9a45(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x9b09(%rip), %rax      # 0xd2e8
cmpq $0x0, %rax
jne 0x37f8
leaq 0x5b69(%rip), %rdi      # 0x9355
callq 0x3640
movq %rax, 0x9af0(%rip)      # 0xd2e8
leaq 0x9a19(%rip), %rdi      # 0xd218
callq 0x2130
leaq 0x9a0d(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x9a79(%rip), %rax      # 0xd290
cmpq $0x0, %rax
jne 0x3830
leaq 0x64e5(%rip), %rdi      # 0x9d09
callq 0x3640
movq %rax, 0x9a60(%rip)      # 0xd290
leaq 0x99e1(%rip), %rdi      # 0xd218
callq 0x2130
leaq 0x99d5(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x9a49(%rip), %rax      # 0xd298
cmpq $0x0, %rax
jne 0x3868
leaq 0x64bc(%rip), %rdi      # 0x9d18
callq 0x3640
movq %rax, 0x9a30(%rip)      # 0xd298
leaq 0x99a9(%rip), %rdi      # 0xd218
callq 0x2130
leaq 0x999d(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x9a19(%rip), %rax      # 0xd2a0
cmpq $0x0, %rax
jne 0x38a0
leaq 0x649a(%rip), %rdi      # 0x9d2e
callq 0x3640
movq %rax, 0x9a00(%rip)      # 0xd2a0
leaq 0x9971(%rip), %rdi      # 0xd218
callq 0x2130
leaq 0x9965(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x9aa1(%rip), %rax      # 0xd360
cmpq $0x0, %rax
jne 0x38d8
leaq 0x6478(%rip), %rdi      # 0x9d44
callq 0x3640
movq %rax, 0x9a88(%rip)      # 0xd360
leaq 0x9939(%rip), %rdi      # 0xd218
callq 0x2130
leaq 0x992d(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x9a71(%rip), %rax      # 0xd368
cmpq $0x0, %rax
jne 0x3910
leaq 0x6448(%rip), %rdi      # 0x9d4c
callq 0x3640
movq %rax, 0x9a58(%rip)      # 0xd368
leaq 0x9901(%rip), %rdi      # 0xd218
callq 0x2130
leaq 0x9a0d(%rip), %rdi      # 0xd330
callq 0x2130
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x6650
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x3953
movq -0x10(%rbp), %rdi
callq 0x6760
movq -0x10(%rbp), %rdi
callq 0x67d0
jmp 0x3966
movl $0x1, %edi
leaq 0x6229(%rip), %rsi      # 0x9b88
movb $0x0, %al
callq 0x3020
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)