// File: /workspace/github_c_makefile_star2_O3/derhass[P]glx_hook/glx_hook.c
// Function: create_ctx
static gl_context_t *
create_ctx(GLXContext ctx, unsigned int num)
{
	gl_context_t *glc;

	glc=malloc(sizeof(*glc));
	if (glc) {
		glc->ctx=ctx;
		glc->draw=None;
		glc->read=None;
		glc->inject_swapinterval=GH_SWAP_DONT_SET;
		glc->flags=GH_GL_NEVER_CURRENT;
		glc->num=num;
		glc->original_debug_callback=(GLDEBUGPROC)NULL;
		glc->original_debug_callback_AMD=(GLDEBUGPROCAMD)NULL;
		glc->original_debug_callback_user_ptr=NULL;
		glc->original_debug_callback_AMD_user_ptr=NULL;

		glc->swap_sleep_usecs=0;
		frametimes_init(&glc->frametimes, GH_FRAMETIME_NONE, 0, 0, 0, num);
		latency_init(&glc->latency, GH_LATENCY_NOP, 0, 1000000, 0, 0);
		swapbuffer_omission_init(&glc->swapbuffer_omission);
	}
	return glc;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x838, %edi            # imm = 0x838
callq 0x2130
movq %rax, %rbx
testq %rax, %rax
je 0x6374
movq %r14, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movabsq $-0x7ffffffffffffffe, %rax # imm = 0x8000000000000002
movq %rax, 0x18(%rbx)
movl %ebp, 0x20(%rbx)
movl $0x0, 0x810(%rbx)
leaq 0x68(%rbx), %rdi
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x3c(%rbx)
movups %xmm0, 0x50(%rbx)
xorl %r14d, %r14d
movq %r14, 0x60(%rbx)
movups %xmm0, 0x818(%rbx)
movups %xmm0, 0x828(%rbx)
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
xorl %edx, %edx
movl $0xf4240, %ecx          # imm = 0xF4240
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x637c
leaq 0x1e3e(%rip), %rdi      # 0x801e
xorl %esi, %esi
callq 0x5e3e
movl %eax, %ebp
leaq 0x1e40(%rip), %rdi      # 0x8030
xorl %esi, %esi
callq 0x5e3e
movl %eax, 0x98(%rbx)
movq %r14, 0xb8(%rbx)
testl %ebp, %ebp
jle 0x6222
movl $0x1, 0x98(%rbx)
movl %ebp, %eax
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
movq %rax, 0xb8(%rbx)
leaq 0x1e16(%rip), %rdi      # 0x803f
xorl %esi, %esi
callq 0x5e3e
movl %eax, 0xa0(%rbx)
leaq 0x1e1b(%rip), %rdi      # 0x8058
movl $0x1, %esi
callq 0x5e3e
movl %eax, 0xa4(%rbx)
leaq 0x1e1b(%rip), %rdi      # 0x806f
movl $0x3, %esi
callq 0x5e3e
movl %eax, 0xa8(%rbx)
leaq 0x1e1d(%rip), %rdi      # 0x8088
movl $0x1, %esi
callq 0x5e3e
movl %eax, %ebp
movl %eax, 0xac(%rbx)
leaq 0x1e19(%rip), %rdi      # 0x809d
movl $0x4, %esi
callq 0x5e3e
movl %eax, 0xb0(%rbx)
testl %ebp, %ebp
jg 0x62a7
movl $0x1, 0xac(%rbx)
movl $0x1, %ebp
cmpl %ebp, %eax
jge 0x62b1
movl %ebp, 0xb0(%rbx)
xorl %eax, %eax
movl %eax, 0x9c(%rbx)
movl %eax, 0x800(%rbx)
leaq 0x1dec(%rip), %rdi      # 0x80b2
movl $0x6, %esi
callq 0x6688
movl %eax, %ebp
movl %eax, 0x804(%rbx)
leaq 0x1df0(%rip), %rdi      # 0x80cf
movl $0x4, %esi
callq 0x6688
movl %eax, 0x808(%rbx)
movl $0x10, %ecx
cmpl $0x10, %ebp
ja 0x6303
movl $0x2, %ecx
cmpl $0x1, %ebp
ja 0x630b
movl %ecx, 0x804(%rbx)
movl %ecx, %ebp
cmpl %ebp, %eax
jae 0x631a
testl %eax, %eax
jne 0x6322
movl $0x1, %ebp
jmp 0x631c
decl %ebp
movl %ebp, 0x808(%rbx)
leaq 0x4c0(%rbx), %rax
movq %rbx, %rcx
addq $0x7c0, %rcx            # imm = 0x7C0
movl $0x38, %edx
xorps %xmm0, %xmm0
movups %xmm0, -0x14(%rbx,%rdx,4)
movups %xmm0, -0x20(%rbx,%rdx,4)
movups %xmm0, (%rbx,%rdx,4)
movups %xmm0, 0xc(%rbx,%rdx,4)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movl $0x1, (%rcx)
addq $0x10, %rdx
addq $0x4, %rcx
addq $0x30, %rax
cmpq $0x138, %rdx            # imm = 0x138
jne 0x633b
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq