// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: glXSwapBuffers
extern void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
{
#ifdef GH_CONTEXT_TRACKING
	gl_context_t *glc=(gl_context_t*)pthread_getspecific(ctx_current);

	if (glc) {
		frametimes_before_swap(&glc->frametimes);
		if (glc->swapbuffer_omission.swapbuffers > 0) {
			int do_swap;
			if (glc->swapbuffer_omission.latency_mode > 0) {
				latency_before_swap(&glc->latency);
			}
			do_swap = swapbuffer_omission_do_swap(&glc->swapbuffer_omission);
			if (do_swap) {
				if (glc->swapbuffer_omission.latency_mode < 1) {
					latency_before_swap(&glc->latency);
					GH_glXSwapBuffers(dpy, drawable);
					latency_after_swap(&glc->latency);
				} else {
					GH_glXSwapBuffers(dpy, drawable);
				}
			} else {
				swapbuffer_omission_swap_skipped(&glc->swapbuffer_omission);
			}
			if (glc->swapbuffer_omission.latency_mode > 0) {
				latency_after_swap(&glc->latency);
			}
			swapbuffer_omission_swap_finished(&glc->swapbuffer_omission, do_swap);
		} else {
			latency_before_swap(&glc->latency);
			GH_glXSwapBuffers(dpy, drawable);
			latency_after_swap(&glc->latency);
		}
		frametimes_after_swap(&glc->frametimes);
		if (glc->swap_sleep_usecs) {
			usleep(glc->swap_sleep_usecs);
		}
	} else {
		GH_verbose(GH_MSG_WARNING,"SwapBuffers called without a context\n");
		GH_GET_PTR_GL(glXSwapBuffers);
		GH_glXSwapBuffers(dpy, drawable);
	}
#else /* GH_CONTEXT_TRACKING */
	GH_GET_PTR_GL(glXSwapBuffers);
	GH_glXSwapBuffers(dpy, drawable);
#endif /* GH_CONTEXT_TRACKING */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl 0x881a(%rip), %edi      # 0xd2b0
callq 0x2070
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4bdd
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x4c40
movq -0x18(%rbp), %rax
cmpl $0x0, 0x98(%rax)
jle 0x4b87
movq -0x18(%rbp), %rax
cmpl $0x0, 0xa0(%rax)
jle 0x4ae2
movq -0x18(%rbp), %rdi
addq $0x68, %rdi
callq 0x4cc0
movq -0x18(%rbp), %rdi
addq $0x98, %rdi
callq 0x4d90
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x4b48
movq -0x18(%rbp), %rax
cmpl $0x1, 0xa0(%rax)
jge 0x4b35
movq -0x18(%rbp), %rdi
addq $0x68, %rdi
callq 0x4cc0
movq 0x87cc(%rip), %rax      # 0xd2e8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
movq -0x18(%rbp), %rdi
addq $0x68, %rdi
callq 0x50b0
jmp 0x4b46
movq 0x87ac(%rip), %rax      # 0xd2e8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
jmp 0x4b58
movq -0x18(%rbp), %rdi
addq $0x98, %rdi
callq 0x5170
movq -0x18(%rbp), %rax
cmpl $0x0, 0xa0(%rax)
jle 0x4b72
movq -0x18(%rbp), %rdi
addq $0x68, %rdi
callq 0x50b0
movq -0x18(%rbp), %rdi
addq $0x98, %rdi
movl -0x1c(%rbp), %esi
callq 0x51c0
jmp 0x4bb2
movq -0x18(%rbp), %rdi
addq $0x68, %rdi
callq 0x4cc0
movq 0x874d(%rip), %rax      # 0xd2e8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
movq -0x18(%rbp), %rdi
addq $0x68, %rdi
callq 0x50b0
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x5230
movq -0x18(%rbp), %rax
cmpl $0x0, 0x810(%rax)
je 0x4bdb
movq -0x18(%rbp), %rax
movl 0x810(%rax), %edi
callq 0x21d0
jmp 0x4c39
movl $0x2, %edi
leaq 0x4746(%rip), %rsi      # 0x932f
movb $0x0, %al
callq 0x3020
leaq 0x8621(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x86e5(%rip), %rax      # 0xd2e8
cmpq $0x0, %rax
jne 0x4c1c
leaq 0x4745(%rip), %rdi      # 0x9355
callq 0x3640
movq %rax, 0x86cc(%rip)      # 0xd2e8
leaq 0x85f5(%rip), %rdi      # 0xd218
callq 0x2130
movq 0x86b9(%rip), %rax      # 0xd2e8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
addq $0x20, %rsp
popq %rbp
retq
nop