LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/dpw[P]skinny-mutex/test.c
// Function: test_cond_timedwait
static void test_cond_timedwait(skinny_mutex_t *mutex)
{
	pthread_cond_t cond;
	struct timespec t;

	assert(!pthread_cond_init(&cond, NULL));

	assert(!clock_gettime(CLOCK_REALTIME, &t));

	t.tv_nsec += 1000000;
	if (t.tv_nsec > 1000000000) {
		t.tv_nsec -= 1000000000;
		t.tv_sec++;
	}

	assert(!skinny_mutex_lock(mutex));
	assert(skinny_mutex_cond_timedwait(&cond, mutex, &t) == ETIMEDOUT);
	assert(!skinny_mutex_unlock(mutex));

	assert(!pthread_cond_destroy(&cond));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x10f0
cmpl $0x0, %eax
jne 0x2690
jmp 0x26af
leaq 0x2487(%rip), %rdi      # 0x4b1e
leaq 0x1ab8(%rip), %rsi      # 0x4156
movl $0xbf, %edx
leaq 0x2494(%rip), %rcx      # 0x4b3e
callq 0x10b0
xorl %edi, %edi
leaq -0x48(%rbp), %rsi
callq 0x1050
cmpl $0x0, %eax
jne 0x26c1
jmp 0x26e0
leaq 0x24a1(%rip), %rdi      # 0x4b69
leaq 0x1a87(%rip), %rsi      # 0x4156
movl $0xc1, %edx
leaq 0x2463(%rip), %rcx      # 0x4b3e
callq 0x10b0
movq -0x40(%rbp), %rax
addq $0xf4240, %rax          # imm = 0xF4240
movq %rax, -0x40(%rbp)
cmpq $0x3b9aca00, -0x40(%rbp) # imm = 0x3B9ACA00
jle 0x2712
movq -0x40(%rbp), %rax
subq $0x3b9aca00, %rax       # imm = 0x3B9ACA00
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2990
cmpl $0x0, %eax
jne 0x2722
jmp 0x2741
leaq 0x1e8d(%rip), %rdi      # 0x45b6
leaq 0x1a26(%rip), %rsi      # 0x4156
movl $0xc9, %edx
leaq 0x2402(%rip), %rcx      # 0x4b3e
callq 0x10b0
movq -0x8(%rbp), %rsi
leaq -0x38(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x1a70
cmpl $0x6e, %eax
jne 0x2759
jmp 0x2778
leaq 0x242c(%rip), %rdi      # 0x4b8c
leaq 0x19ef(%rip), %rsi      # 0x4156
movl $0xca, %edx
leaq 0x23cb(%rip), %rcx      # 0x4b3e
callq 0x10b0
movq -0x8(%rbp), %rdi
callq 0x29e0
cmpl $0x0, %eax
jne 0x2788
jmp 0x27a7
leaq 0x1e69(%rip), %rdi      # 0x45f8
leaq 0x19c0(%rip), %rsi      # 0x4156
movl $0xcb, %edx
leaq 0x239c(%rip), %rcx      # 0x4b3e
callq 0x10b0
leaq -0x38(%rbp), %rdi
callq 0x1150
cmpl $0x0, %eax
jne 0x27b7
jmp 0x27d6
leaq 0x2409(%rip), %rdi      # 0x4bc7
leaq 0x1991(%rip), %rsi      # 0x4156
movl $0xcd, %edx
leaq 0x236d(%rip), %rcx      # 0x4b3e
callq 0x10b0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/dpw[P]skinny-mutex/test.c
// Function: test_cond_wait_cancellation
static void test_cond_wait_cancellation(skinny_mutex_t *mutex)
{
	struct test_cond_wait tcw;
	pthread_t thread;
	void *retval;

	tcw.mutex = mutex;
	assert(!pthread_cond_init(&tcw.cond, NULL));
	tcw.flag = 0;

	assert(!pthread_create(&thread, NULL, test_cond_wait_thread, &tcw));

	delay();
	assert(!pthread_cancel(thread));
	assert(!pthread_join(thread, &retval));
	assert(retval == PTHREAD_CANCELED);

	assert(!pthread_cond_destroy(&tcw.cond));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x10f0
cmpl $0x0, %eax
jne 0x280c
jmp 0x282b
leaq 0x218c(%rip), %rdi      # 0x499f
leaq 0x193c(%rip), %rsi      # 0x4156
movl $0xd7, %edx
leaq 0x23be(%rip), %rcx      # 0x4be4
callq 0x10b0
movl $0x0, -0x10(%rbp)
leaq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xb1f(%rip), %rdx       # 0x3360
leaq -0x48(%rbp), %rcx
callq 0x1130
cmpl $0x0, %eax
jne 0x2851
jmp 0x2870
leaq 0x2191(%rip), %rdi      # 0x49e9
leaq 0x18f7(%rip), %rsi      # 0x4156
movl $0xda, %edx
leaq 0x2379(%rip), %rcx      # 0x4be4
callq 0x10b0
callq 0x30c0
movq -0x50(%rbp), %rdi
callq 0x1190
cmpl $0x0, %eax
jne 0x2885
jmp 0x28a4
leaq 0x1f1a(%rip), %rdi      # 0x47a6
leaq 0x18c3(%rip), %rsi      # 0x4156
movl $0xdd, %edx
leaq 0x2345(%rip), %rcx      # 0x4be4
callq 0x10b0
movq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x1170
cmpl $0x0, %eax
jne 0x28b8
jmp 0x28d7
leaq 0x1eff(%rip), %rdi      # 0x47be
leaq 0x1890(%rip), %rsi      # 0x4156
movl $0xde, %edx
leaq 0x2312(%rip), %rcx      # 0x4be4
callq 0x10b0
movq $-0x1, %rax
cmpq %rax, -0x58(%rbp)
jne 0x28e6
jmp 0x2905
leaq 0x1c35(%rip), %rdi      # 0x4522
leaq 0x1862(%rip), %rsi      # 0x4156
movl $0xdf, %edx
leaq 0x22e4(%rip), %rcx      # 0x4be4
callq 0x10b0
leaq -0x48(%rbp), %rdi
addq $0x8, %rdi
callq 0x1150
cmpl $0x0, %eax
jne 0x2919
jmp 0x2938
leaq 0x2125(%rip), %rdi      # 0x4a45
leaq 0x182f(%rip), %rsi      # 0x4156
movl $0xe1, %edx
leaq 0x22b1(%rip), %rcx      # 0x4be4
callq 0x10b0
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/dpw[P]skinny-mutex/test.c
// Function: do_test_hammer
static void do_test_hammer(void (*f)(skinny_mutex_t *m))
{
	skinny_mutex_t mutex;
	pthread_t threads[10];
	int i;

	assert(!skinny_mutex_init(&mutex));

	for (i = 0; i < 10; i++)
		assert(!pthread_create(&threads[i], NULL,
				       do_test_hammer_thread, &mutex));

	delay();
	f(&mutex);

	for (i = 0; i < 10; i++) {
		void *retval;
		assert(!pthread_cancel(threads[i]));
		assert(!pthread_join(threads[i], &retval));
		assert(retval == PTHREAD_CANCELED);
	}

	assert(!skinny_mutex_destroy(&mutex));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x2f20
cmpl $0x0, %eax
jne 0x2d9c
jmp 0x2dbb
leaq 0x1420(%rip), %rdi      # 0x41c3
leaq 0x13ac(%rip), %rsi      # 0x4156
movl $0x13d, %edx            # imm = 0x13D
leaq 0x16bb(%rip), %rcx      # 0x4471
callq 0x10b0
movl $0x0, -0x64(%rbp)
cmpl $0xa, -0x64(%rbp)
jge 0x2e1e
movslq -0x64(%rbp), %rax
leaq -0x60(%rbp), %rdi
shlq $0x3, %rax
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x25e(%rip), %rdx       # 0x3040
leaq -0x10(%rbp), %rcx
callq 0x1130
cmpl $0x0, %eax
jne 0x2df2
jmp 0x2e11
leaq 0x16a8(%rip), %rdi      # 0x44a1
leaq 0x1356(%rip), %rsi      # 0x4156
movl $0x141, %edx            # imm = 0x141
leaq 0x1665(%rip), %rcx      # 0x4471
callq 0x10b0
jmp 0x2e13
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x2dc2
callq 0x30c0
leaq -0x10(%rbp), %rdi
callq *-0x8(%rbp)
movl $0x0, -0x64(%rbp)
cmpl $0xa, -0x64(%rbp)
jge 0x2ee5
movslq -0x64(%rbp), %rax
movq -0x60(%rbp,%rax,8), %rdi
callq 0x1190
cmpl $0x0, %eax
jne 0x2e50
jmp 0x2e6f
leaq 0x168c(%rip), %rdi      # 0x44e3
leaq 0x12f8(%rip), %rsi      # 0x4156
movl $0x148, %edx            # imm = 0x148
leaq 0x1607(%rip), %rcx      # 0x4471
callq 0x10b0
movslq -0x64(%rbp), %rax
movq -0x60(%rbp,%rax,8), %rdi
leaq -0x70(%rbp), %rsi
callq 0x1170
cmpl $0x0, %eax
jne 0x2e88
jmp 0x2ea7
leaq 0x1670(%rip), %rdi      # 0x44ff
leaq 0x12c0(%rip), %rsi      # 0x4156
movl $0x149, %edx            # imm = 0x149
leaq 0x15cf(%rip), %rcx      # 0x4471
callq 0x10b0
movq $-0x1, %rax
cmpq %rax, -0x70(%rbp)
jne 0x2eb6
jmp 0x2ed5
leaq 0x1665(%rip), %rdi      # 0x4522
leaq 0x1292(%rip), %rsi      # 0x4156
movl $0x14a, %edx            # imm = 0x14A
leaq 0x15a1(%rip), %rcx      # 0x4471
callq 0x10b0
jmp 0x2ed7
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x2e31
leaq -0x10(%rbp), %rdi
callq 0x2a30
cmpl $0x0, %eax
jne 0x2ef5
jmp 0x2f14
leaq 0x1312(%rip), %rdi      # 0x420e
leaq 0x1253(%rip), %rsi      # 0x4156
movl $0x14d, %edx            # imm = 0x14D
leaq 0x1562(%rip), %rcx      # 0x4471
callq 0x10b0
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dpw[P]skinny-mutex/test.c
// Function: do_test_cond_thread
static void *do_test_cond_thread(void *v_dt)
{
	struct do_test_cond *dt = v_dt;

	assert(!skinny_mutex_lock(&dt->mutex));
	dt->phase = 1;
	assert(!pthread_cond_signal(&dt->cond));

	do {
		assert(!skinny_mutex_cond_wait(&dt->cond, &dt->mutex));
	} while (dt->phase != 2);

	assert(!skinny_mutex_unlock(&dt->mutex));

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2990
cmpl $0x0, %eax
jne 0x2f64
jmp 0x2f83
leaq 0x1455(%rip), %rdi      # 0x43c0
leaq 0x11e4(%rip), %rsi      # 0x4156
movl $0xfc, %edx
leaq 0x1461(%rip), %rcx      # 0x43df
callq 0x10b0
movq -0x10(%rbp), %rax
movl $0x1, 0x38(%rax)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x10c0
cmpl $0x0, %eax
jne 0x2fa2
jmp 0x2fc1
leaq 0x1458(%rip), %rdi      # 0x4401
leaq 0x11a6(%rip), %rsi      # 0x4156
movl $0xfe, %edx
leaq 0x1423(%rip), %rcx      # 0x43df
callq 0x10b0
jmp 0x2fc3
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
callq 0x1c10
cmpl $0x0, %eax
jne 0x2fdb
jmp 0x2ffa
leaq 0x143f(%rip), %rdi      # 0x4421
leaq 0x116d(%rip), %rsi      # 0x4156
movl $0x101, %edx            # imm = 0x101
leaq 0x13ea(%rip), %rcx      # 0x43df
callq 0x10b0
jmp 0x2ffc
movq -0x10(%rbp), %rax
cmpl $0x2, 0x38(%rax)
jne 0x2fc3
movq -0x10(%rbp), %rdi
callq 0x29e0
cmpl $0x0, %eax
jne 0x3016
jmp 0x3035
leaq 0x1433(%rip), %rdi      # 0x4450
leaq 0x1132(%rip), %rsi      # 0x4156
movl $0x104, %edx            # imm = 0x104
leaq 0x13af(%rip), %rcx      # 0x43df
callq 0x10b0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/dpw[P]skinny-mutex/test.c
// Function: do_test_hammer_thread
static void *do_test_hammer_thread(void *v_m)
{
	skinny_mutex_t *m = v_m;

	for (;;) {
		assert(!skinny_mutex_lock(m));
		assert(!skinny_mutex_unlock(m));
		pthread_testcancel();
	}

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2990
cmpl $0x0, %eax
jne 0x3064
jmp 0x3083
leaq 0x14d2(%rip), %rdi      # 0x453d
leaq 0x10e4(%rip), %rsi      # 0x4156
movl $0x12d, %edx            # imm = 0x12D
leaq 0x14d5(%rip), %rcx      # 0x4553
callq 0x10b0
movq -0x10(%rbp), %rdi
callq 0x29e0
cmpl $0x0, %eax
jne 0x3093
jmp 0x30b2
leaq 0x14dd(%rip), %rdi      # 0x4577
leaq 0x10b5(%rip), %rsi      # 0x4156
movl $0x12e, %edx            # imm = 0x12E
leaq 0x14a6(%rip), %rcx      # 0x4553
callq 0x10b0
callq 0x10e0
jmp 0x3054
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/dpw[P]skinny-mutex/test.c
// Function: bump
static void *bump(void *v_tc)
{
	struct test_contention *tc = v_tc;

	assert(!skinny_mutex_lock(tc->mutex));
	assert(!tc->held);
	tc->held = 1;
	delay();
	tc->held = 0;
	tc->count++;
	assert(!skinny_mutex_unlock(tc->mutex));

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2990
cmpl $0x0, %eax
jne 0x3147
jmp 0x3166
leaq 0x158f(%rip), %rdi      # 0x46dd
leaq 0x1001(%rip), %rsi      # 0x4156
movl $0x2a, %edx
leaq 0x159a(%rip), %rcx      # 0x46fb
callq 0x10b0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x3172
jmp 0x3191
leaq 0x1595(%rip), %rdi      # 0x470e
leaq 0xfd6(%rip), %rsi       # 0x4156
movl $0x2b, %edx
leaq 0x156f(%rip), %rcx      # 0x46fb
callq 0x10b0
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
callq 0x30c0
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x29e0
cmpl $0x0, %eax
jne 0x31cc
jmp 0x31eb
leaq 0x1545(%rip), %rdi      # 0x4718
leaq 0xf7c(%rip), %rsi       # 0x4156
movl $0x30, %edx
leaq 0x1515(%rip), %rcx      # 0x46fb
callq 0x10b0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dpw[P]skinny-mutex/test.c
// Function: lock_cancellation_thread
static void *lock_cancellation_thread(void *v_mutex)
{
	skinny_mutex_t *mutex = v_mutex;
 	assert(!skinny_mutex_lock(mutex));
	assert(!skinny_mutex_unlock(mutex));
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2990
cmpl $0x0, %eax
jne 0x3224
jmp 0x3243
leaq 0x138b(%rip), %rdi      # 0x45b6
leaq 0xf24(%rip), %rsi       # 0x4156
movl $0x52, %edx
leaq 0x15a7(%rip), %rcx      # 0x47e5
callq 0x10b0
movq -0x10(%rbp), %rdi
callq 0x29e0
cmpl $0x0, %eax
jne 0x3253
jmp 0x3272
leaq 0x139e(%rip), %rdi      # 0x45f8
leaq 0xef5(%rip), %rsi       # 0x4156
movl $0x53, %edx
leaq 0x1578(%rip), %rcx      # 0x47e5
callq 0x10b0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dpw[P]skinny-mutex/test.c
// Function: trylock_contender_thread
static void *trylock_contender_thread(void *v_mutex)
{
	skinny_mutex_t *mutex = v_mutex;
	assert(!skinny_mutex_lock(mutex));
	delay();
	delay();
	assert(!skinny_mutex_unlock(mutex));
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2990
cmpl $0x0, %eax
jne 0x32f4
jmp 0x3313
leaq 0x12bb(%rip), %rdi      # 0x45b6
leaq 0xe54(%rip), %rsi       # 0x4156
movl $0x71, %edx
leaq 0x166a(%rip), %rcx      # 0x4978
callq 0x10b0
callq 0x30c0
callq 0x30c0
movq -0x10(%rbp), %rdi
callq 0x29e0
cmpl $0x0, %eax
jne 0x332d
jmp 0x334c
leaq 0x12c4(%rip), %rdi      # 0x45f8
leaq 0xe1b(%rip), %rsi       # 0x4156
movl $0x74, %edx
leaq 0x1631(%rip), %rcx      # 0x4978
callq 0x10b0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dpw[P]skinny-mutex/test.c
// Function: test_cond_wait_thread
static void *test_cond_wait_thread(void *v_tcw)
{
	struct test_cond_wait *tcw = v_tcw;

	assert(!skinny_mutex_lock(tcw->mutex));
	pthread_cleanup_push(test_cond_wait_cleanup, tcw);

	while (!tcw->flag)
		assert(!skinny_mutex_cond_wait(&tcw->cond, tcw->mutex));

	pthread_cleanup_pop(1);
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2990
cmpl $0x0, %eax
jne 0x338a
jmp 0x33a9
leaq 0x16d5(%rip), %rdi      # 0x4a66
leaq 0xdbe(%rip), %rsi       # 0x4156
movl $0x9a, %edx
leaq 0x16e1(%rip), %rcx      # 0x4a85
callq 0x10b0
jmp 0x33ab
leaq 0xce(%rip), %rax        # 0x3480
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
callq 0x1180
movl %eax, -0x94(%rbp)
movslq -0x94(%rbp), %rax
cmpq $0x0, %rax
je 0x33fb
movq -0x88(%rbp), %rax
movq -0x90(%rbp), %rdi
callq *%rax
leaq -0x80(%rbp), %rdi
callq 0x1120
leaq -0x80(%rbp), %rdi
callq 0x1160
jmp 0x3406
movq -0x10(%rbp), %rax
cmpl $0x0, 0x38(%rax)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3419
jmp 0x3455
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x1c10
cmpl $0x0, %eax
jne 0x3434
jmp 0x3453
leaq 0x166e(%rip), %rdi      # 0x4aa9
leaq 0xd14(%rip), %rsi       # 0x4156
movl $0x9e, %edx
leaq 0x1637(%rip), %rcx      # 0x4a85
callq 0x10b0
jmp 0x3406
jmp 0x3457
jmp 0x3459
jmp 0x345b
leaq -0x80(%rbp), %rdi
callq 0x1090
movq -0x88(%rbp), %rax
movq -0x90(%rbp), %rdi
callq *%rax
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: glXCreateNewContext
extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct )
{
	GLXContext ctx;

	ctx = override_create_context(dpy, NULL, &config, shareList, direct, NULL);
	if (ctx == NULL) {
		GH_GET_PTR_GL(glXCreateNewContext);
		ctx=GH_glXCreateNewContext(dpy, config, renderType, shareList, direct);
	}
	create_context(ctx);
	return ctx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
xorl %eax, %eax
movl %eax, %r9d
leaq -0x10(%rbp), %rdx
movq %r9, %rsi
callq 0x33f0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x3a0b
leaq 0x985e(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x989a(%rip), %rax      # 0xd260
cmpq $0x0, %rax
jne 0x39df
leaq 0x574b(%rip), %rdi      # 0x911e
callq 0x3640
movq %rax, 0x9881(%rip)      # 0xd260
leaq 0x9832(%rip), %rdi      # 0xd218
callq 0x2130
movq 0x986e(%rip), %rax      # 0xd260
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
callq *%rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x3760
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: glXCreateContextAttribsARB
extern GLXContext glXCreateContextAttribsARB (Display * dpy, GLXFBConfig config, GLXContext shareList, Bool direct, const int *attr)
{
	GLXContext ctx;

	ctx = override_create_context(dpy, NULL, &config, shareList, direct, attr);
	if (ctx == NULL) {
		GH_GET_PTR_GL(glXCreateContextAttribsARB);
		ctx=GH_glXCreateContextAttribsARB(dpy, config, shareList, direct, attr);
	}
	create_context(ctx);
	return ctx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %r8d
movq -0x28(%rbp), %r9
xorl %eax, %eax
movl %eax, %esi
leaq -0x10(%rbp), %rdx
callq 0x33f0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x3abb
leaq 0x97ae(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x97f2(%rip), %rax      # 0xd268
cmpq $0x0, %rax
jne 0x3a8f
leaq 0x56af(%rip), %rdi      # 0x9132
callq 0x3640
movq %rax, 0x97d9(%rip)      # 0xd268
leaq 0x9782(%rip), %rdi      # 0xd218
callq 0x2130
movq 0x97c6(%rip), %rax      # 0xd268
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movq -0x28(%rbp), %r8
callq *%rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x3760
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: glXImportContextEXT
extern GLXContext glXImportContextEXT (Display *dpy, GLXContextID id)
{
	GLXContext ctx;

	GH_GET_PTR_GL(glXImportContextEXT);
	ctx=GH_glXImportContextEXT(dpy, id);
	create_context(ctx);
	return ctx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x9731(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x977d(%rip), %rax      # 0xd270
cmpq $0x0, %rax
jne 0x3b0c
leaq 0x564d(%rip), %rdi      # 0x914d
callq 0x3640
movq %rax, 0x9764(%rip)      # 0xd270
leaq 0x9705(%rip), %rdi      # 0xd218
callq 0x2130
movq 0x9751(%rip), %rax      # 0xd270
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3760
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: glXCreateContextWithConfigSGIX
extern GLXContext glXCreateContextWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, int renderType, GLXContext shareList, Bool direct)
{
	GLXContext ctx;

	/* TODO: override_create_context for this case */
	GH_GET_PTR_GL(glXCreateContextWithConfigSGIX);
	ctx=GH_glXCreateContextWithConfigSGIX(dpy, config, renderType, shareList, direct);
	create_context(ctx);
	return ctx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
leaq 0x96b6(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x970a(%rip), %rax      # 0xd278
cmpq $0x0, %rax
jne 0x3b87
leaq 0x55e6(%rip), %rdi      # 0x9161
callq 0x3640
movq %rax, 0x96f1(%rip)      # 0xd278
leaq 0x968a(%rip), %rdi      # 0xd218
callq 0x2130
movq 0x96de(%rip), %rax      # 0xd278
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
callq *%rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x3760
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: glDebugMessageCallback
extern void glDebugMessageCallback(GLDEBUGPROC proc, const GLvoid *user_ptr)
{
	GH_GET_PTR_GL(glDebugMessageCallback);
	if (GH_glDebugMessageCallback) {
		gl_context_t *glc=(gl_context_t*)pthread_getspecific(ctx_current);
		if (glc) {
			glc->original_debug_callback = proc;
			glc->original_debug_callback_user_ptr = user_ptr;

			if (glc->flags & GH_GL_INTERCEPT_DEBUG) {
				GH_verbose(GH_MSG_INFO, "injecting debug output [core]!\n");
				proc = GH_debug_callback;
				user_ptr = glc;
			}
		} else {
			GH_verbose(GH_MSG_WARNING, "debug message callback without current context!\n");
		}
		GH_glDebugMessageCallback(proc, user_ptr);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x8ef1(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x8f75(%rip), %rax      # 0xd2a8
cmpq $0x0, %rax
jne 0x434c
leaq 0x4e64(%rip), %rdi      # 0x91a4
callq 0x3640
movq %rax, 0x8f5c(%rip)      # 0xd2a8
leaq 0x8ec5(%rip), %rdi      # 0xd218
callq 0x2130
movq 0x8f49(%rip), %rax      # 0xd2a8
cmpq $0x0, %rax
je 0x43f8
movl 0x8f41(%rip), %edi      # 0xd2b0
callq 0x2070
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x43d4
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x818(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x828(%rax)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x43d2
movl $0x3, %edi
leaq 0x4e03(%rip), %rsi      # 0x91bb
movb $0x0, %al
callq 0x3020
leaq 0x3a(%rip), %rax        # 0x4400
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x43e7
movl $0x2, %edi
leaq 0x4dfb(%rip), %rsi      # 0x91db
movb $0x0, %al
callq 0x3020
movq 0x8eba(%rip), %rax      # 0xd2a8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: GH_debug_callback
static void APIENTRY
GH_debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity,
		  GLsizei length, const GLchar *message, const GLvoid* userParam)
{
	const gl_context_t *glc=(const gl_context_t*)userParam;
	if (glc) {
		GH_verbose(GH_MSG_INFO, "GLDEBUG: %s %s %s [0x%x]: %s\n",
					translateDebugSourceEnum(source),
					translateDebugTypeEnum(type),
					translateDebugSeverityEnum(severity),
					id, message);
		if (glc->original_debug_callback) {
			glc->original_debug_callback(source, type, id, severity,
						     length, message, glc->original_debug_callback_user_ptr);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq 0x10(%rbp), %rax
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl %r8d, -0x14(%rbp)
movq %r9, -0x20(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x44bd
movl -0x4(%rbp), %edi
callq 0x80d0
movq %rax, -0x38(%rbp)
movl -0x8(%rbp), %edi
callq 0x8160
movq %rax, -0x30(%rbp)
movl -0x10(%rbp), %edi
callq 0x81f0
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq %rax, %r8
movl -0xc(%rbp), %r9d
movq -0x20(%rbp), %rax
movl $0x3, %edi
leaq 0x5f3c(%rip), %rsi      # 0xa3ae
movq %rax, (%rsp)
movb $0x0, %al
callq 0x3020
movq -0x28(%rbp), %rax
cmpq $0x0, 0x818(%rax)
je 0x44bb
movq -0x28(%rbp), %rax
movq 0x818(%rax), %rax
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movl -0xc(%rbp), %edx
movl -0x10(%rbp), %ecx
movl -0x14(%rbp), %r8d
movq -0x20(%rbp), %r9
movq -0x28(%rbp), %r10
movq 0x828(%r10), %r10
movq %r10, (%rsp)
callq *%rax
jmp 0x44bd
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: glDebugMessageCallbackARB
extern void glDebugMessageCallbackARB(GLDEBUGPROC proc, const GLvoid *user_ptr)
{
	GH_GET_PTR_GL(glDebugMessageCallbackARB);
	if (GH_glDebugMessageCallbackARB) {
		gl_context_t *glc=(gl_context_t*)pthread_getspecific(ctx_current);
		if (glc) {
			glc->original_debug_callback = proc;
			glc->original_debug_callback_user_ptr = user_ptr;

			if (glc->flags & GH_GL_INTERCEPT_DEBUG) {
				GH_verbose(GH_MSG_INFO, "injecting debug output [ARB]!\n");
				proc = GH_debug_callback;
				user_ptr = glc;
			}
		} else {
			GH_verbose(GH_MSG_WARNING, "debug message callback without current context!\n");
		}
		GH_glDebugMessageCallbackARB(proc, user_ptr);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x8d31(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x8dc5(%rip), %rax      # 0xd2b8
cmpq $0x0, %rax
jne 0x450c
leaq 0x4d0c(%rip), %rdi      # 0x920c
callq 0x3640
movq %rax, 0x8dac(%rip)      # 0xd2b8
leaq 0x8d05(%rip), %rdi      # 0xd218
callq 0x2130
movq 0x8d99(%rip), %rax      # 0xd2b8
cmpq $0x0, %rax
je 0x45b8
movl 0x8d81(%rip), %edi      # 0xd2b0
callq 0x2070
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4594
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x818(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x828(%rax)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x4592
movl $0x3, %edi
leaq 0x4cae(%rip), %rsi      # 0x9226
movb $0x0, %al
callq 0x3020
leaq -0x186(%rip), %rax      # 0x4400
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x45a7
movl $0x2, %edi
leaq 0x4c3b(%rip), %rsi      # 0x91db
movb $0x0, %al
callq 0x3020
movq 0x8d0a(%rip), %rax      # 0xd2b8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: glDebugMessageCallbackKHR
extern void glDebugMessageCallbackKHR(GLDEBUGPROC proc, const GLvoid *user_ptr)
{
	GH_GET_PTR_GL(glDebugMessageCallbackKHR);
	if (GH_glDebugMessageCallbackKHR) {
		gl_context_t *glc=(gl_context_t*)pthread_getspecific(ctx_current);
		if (glc) {
			glc->original_debug_callback = proc;
			glc->original_debug_callback_user_ptr = user_ptr;

			if (glc->flags & GH_GL_INTERCEPT_DEBUG) {
				GH_verbose(GH_MSG_INFO, "injecting debug output [KHR]!\n");
				proc = GH_debug_callback;
				user_ptr = glc;
			}
		} else {
			GH_verbose(GH_MSG_WARNING, "debug message callback without current context!\n");
		}
		GH_glDebugMessageCallbackKHR(proc, user_ptr);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x8c41(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x8cdd(%rip), %rax      # 0xd2c0
cmpq $0x0, %rax
jne 0x45fc
leaq 0x4c55(%rip), %rdi      # 0x9245
callq 0x3640
movq %rax, 0x8cc4(%rip)      # 0xd2c0
leaq 0x8c15(%rip), %rdi      # 0xd218
callq 0x2130
movq 0x8cb1(%rip), %rax      # 0xd2c0
cmpq $0x0, %rax
je 0x46a8
movl 0x8c91(%rip), %edi      # 0xd2b0
callq 0x2070
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4684
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x818(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x828(%rax)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x4682
movl $0x3, %edi
leaq 0x4bf7(%rip), %rsi      # 0x925f
movb $0x0, %al
callq 0x3020
leaq -0x276(%rip), %rax      # 0x4400
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x4697
movl $0x2, %edi
leaq 0x4b4b(%rip), %rsi      # 0x91db
movb $0x0, %al
callq 0x3020
movq 0x8c22(%rip), %rax      # 0xd2c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: glDebugMessageCallbackAMD
extern void glDebugMessageCallbackAMD(GLDEBUGPROCAMD proc, GLvoid *user_ptr)
{
	GH_GET_PTR_GL(glDebugMessageCallbackAMD);
	if (GH_glDebugMessageCallbackAMD) {
		gl_context_t *glc=(gl_context_t*)pthread_getspecific(ctx_current);
		if (glc) {
			glc->original_debug_callback_AMD = proc;
			glc->original_debug_callback_AMD_user_ptr = user_ptr;

			if (glc->flags & GH_GL_INTERCEPT_DEBUG) {
				GH_verbose(GH_MSG_INFO, "injecting debug output [AMD]!\n");
				proc = GH_debug_callback_AMD;
				user_ptr = glc;
			}
		} else {
			GH_verbose(GH_MSG_WARNING, "debug message callback without current context!\n");
		}
		GH_glDebugMessageCallbackAMD(proc, user_ptr);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x8b51(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x8bf5(%rip), %rax      # 0xd2c8
cmpq $0x0, %rax
jne 0x46ec
leaq 0x4b9e(%rip), %rdi      # 0x927e
callq 0x3640
movq %rax, 0x8bdc(%rip)      # 0xd2c8
leaq 0x8b25(%rip), %rdi      # 0xd218
callq 0x2130
movq 0x8bc9(%rip), %rax      # 0xd2c8
cmpq $0x0, %rax
je 0x4798
movl 0x8ba1(%rip), %edi      # 0xd2b0
callq 0x2070
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4774
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x820(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x830(%rax)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x4772
movl $0x3, %edi
leaq 0x4b40(%rip), %rsi      # 0x9298
movb $0x0, %al
callq 0x3020
leaq 0x3a(%rip), %rax        # 0x47a0
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x4787
movl $0x2, %edi
leaq 0x4a5b(%rip), %rsi      # 0x91db
movb $0x0, %al
callq 0x3020
movq 0x8b3a(%rip), %rax      # 0xd2c8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: GH_debug_callback_AMD
static void APIENTRY
GH_debug_callback_AMD(GLuint id, GLenum category, GLenum severity,
		  GLsizei length, const GLchar *message, GLvoid* userParam)
{
	const gl_context_t *glc=(const gl_context_t*)userParam;

	if (glc) {
		GH_verbose(GH_MSG_INFO, "GLDEBUG[AMD]: %s %s %s [0x%x]: %s\n",
					translateDebugCategoryEnum(category),
					translateDebugSeverityEnum(severity),
					id, message);
		if (glc->original_debug_callback_AMD) {
			glc->original_debug_callback_AMD(id, category, severity,
							 length, message,
							 glc->original_debug_callback_AMD_user_ptr);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movq %r8, -0x18(%rbp)
movq %r9, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x4839
movl -0x8(%rbp), %edi
callq 0x8270
movq %rax, -0x30(%rbp)
movl -0xc(%rbp), %edi
callq 0x81f0
movq -0x30(%rbp), %rdx
movq %rax, %rcx
movl -0x4(%rbp), %r8d
movq -0x18(%rbp), %r9
movl $0x3, %edi
leaq 0x5c96(%rip), %rsi      # 0xa490
movb $0x0, %al
callq 0x3020
movq -0x28(%rbp), %rax
cmpq $0x0, 0x820(%rax)
je 0x4837
movq -0x28(%rbp), %rax
movq 0x820(%rax), %rax
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movl -0xc(%rbp), %edx
movl -0x10(%rbp), %ecx
movq -0x18(%rbp), %r8
movq -0x28(%rbp), %r9
movq 0x830(%r9), %r9
callq *%rax
jmp 0x4839
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: frametimes_before_swap
static void
frametimes_before_swap(GH_frametimes *ft)
{
	unsigned int ts_idx;
	unsigned int rs_idx;

	if (ft->mode == GH_FRAMETIME_NONE)
		return;
	ts_idx=ft->cur_pos * ft->num_timestamps + GH_FRAMETIME_BEFORE_SWAPBUFFERS;
	rs_idx=ft->cur_result * ft->num_timestamps + GH_FRAMETIME_BEFORE_SWAPBUFFERS;
	timestamp_set(&ft->timestamp[ts_idx], &ft->frametime[rs_idx], ft->mode);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x4c57
jmp 0x4cb0
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
movq -0x8(%rbp), %rcx
imull 0x8(%rcx), %eax
addl $0x0, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
movq -0x8(%rbp), %rcx
imull 0x8(%rcx), %eax
addl $0x0, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0xc(%rbp), %eax
shlq $0x5, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movl -0x10(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rsi
movq -0x8(%rbp), %rax
movl (%rax), %edx
callq 0x7cb0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: latency_before_swap
static void
latency_before_swap(GH_latency *lat)
{
	GLsync sync;

	switch(lat->latency) {
		case GH_LATENCY_NOP:
		case GH_LATENCY_FINISH_AFTER:
			(void)lat;
			break;
		case GH_LATENCY_FINISH_BEFORE:
			GH_glFinish();
			break;
		default:
			if ( (sync=lat->sync_object[lat->cur_pos]) ) {
				if (lat->flags & GH_LATENCY_FLAG_MANUAL_WAIT) {
					/* check for the fence in a loop */
					while(GH_glClientWaitSync(sync, GL_SYNC_FLUSH_COMMANDS_BIT, lat->gl_wait_interval) == GL_TIMEOUT_EXPIRED) {
						if (lat->self_wait_interval) {
							usleep(lat->self_wait_interval);
						}
					}
				} else {
					/* just wait for the fence */
					GH_glClientWaitSync(sync, GL_SYNC_FLUSH_COMMANDS_BIT, lat->gl_wait_timeout);
					/* NOTE: we do not care about the result */
				}
			}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
addl $0x2, %eax
subl $0x2, %eax
jb 0x4ce8
jmp 0x4cdf
movl -0x14(%rbp), %eax
testl %eax, %eax
je 0x4ced
jmp 0x4cfb
jmp 0x4d82
movq 0x8674(%rip), %rax      # 0xd368
callq *%rax
jmp 0x4d82
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x4d80
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4d64
jmp 0x4d29
movq 0x8678(%rip), %rax      # 0xd3a8
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq 0x20(%rcx), %rdx
movl $0x1, %esi
callq *%rax
cmpl $0x911b, %eax           # imm = 0x911B
jne 0x4d62
movq -0x8(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x4d60
movq -0x8(%rbp), %rax
movl 0x28(%rax), %edi
callq 0x21d0
jmp 0x4d29
jmp 0x4d7e
movq 0x863d(%rip), %rax      # 0xd3a8
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rdx
movl $0x1, %esi
callq *%rax
jmp 0x4d80
jmp 0x4d82
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: latency_after_swap
static void
latency_after_swap(GH_latency *lat)
{
	switch(lat->latency) {
		case GH_LATENCY_NOP:
		case GH_LATENCY_FINISH_BEFORE:
			(void)lat;
			break;
		case GH_LATENCY_FINISH_AFTER:
			GH_glFinish();
			break;
		default:
			if ( (lat->sync_object[lat->cur_pos]) ) {
				GH_glDeleteSync(lat->sync_object[lat->cur_pos]);
			}
			lat->sync_object[lat->cur_pos]=GH_glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
			if (++lat->cur_pos == (unsigned)lat->latency) {
				lat->cur_pos=0;
			}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xc(%rbp)
subl $-0x2, %eax
je 0x50df
jmp 0x50cc
movl -0xc(%rbp), %eax
subl $-0x1, %eax
je 0x50e4
jmp 0x50d6
movl -0xc(%rbp), %eax
testl %eax, %eax
jne 0x50ef
jmp 0x50df
jmp 0x5166
movq 0x827d(%rip), %rax      # 0xd368
callq *%rax
jmp 0x5166
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0x5121
movq 0x8294(%rip), %rax      # 0xd3a0
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq -0x8(%rbp), %rdx
movl 0x10(%rdx), %edx
movq (%rcx,%rdx,8), %rdi
callq *%rax
movl $0x9117, %edi           # imm = 0x9117
xorl %esi, %esi
callq *0x826a(%rip)           # 0xd398
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x10(%rcx)
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x5164
movq -0x8(%rbp), %rax
movl $0x0, 0x10(%rax)
jmp 0x5166
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: swapbuffer_omission_swap_skipped
static void
swapbuffer_omission_swap_skipped(GH_swapbuffer_omission_t *swo)
{
	switch (swo->flush_mode) {
		case 1:
			GH_glFlush();
			break;
		case 2:
			GH_glFinish();
			break;
		default:
			(void)0; /* nop */
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0xc(%rbp)
subl $0x1, %eax
je 0x5197
jmp 0x518d
movl -0xc(%rbp), %eax
subl $0x2, %eax
je 0x51a2
jmp 0x51ad
movq 0x81c2(%rip), %rax      # 0xd360
callq *%rax
jmp 0x51af
movq 0x81bf(%rip), %rax      # 0xd368
callq *%rax
jmp 0x51af
jmp 0x51af
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: swapbuffer_omission_swap_finished
static void
swapbuffer_omission_swap_finished(GH_swapbuffer_omission_t *swo, int did_swap)
{
	if (did_swap) {
		swo->swapbuffer_cnt = 0;
	}
	if (swo->min_swap_time > 0) {
		timestamp_set(&swo->prev_frame_ts[swo->cur_pos][0],&swo->prev_frames[swo->cur_pos][0], GH_FRAMETIME_CPU_GPU);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x51e0
movq -0x8(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jbe 0x522a
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
movq -0x8(%rbp), %rax
movl 0x768(%rax), %eax
shlq $0x6, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x428, %rsi            # imm = 0x428
movq -0x8(%rbp), %rax
movl 0x768(%rax), %eax
imulq $0x30, %rax, %rax
addq %rax, %rsi
movl $0x2, %edx
callq 0x7cb0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: frametimes_after_swap
static void
frametimes_after_swap(GH_frametimes *ft)
{
	unsigned int ts_idx;
	unsigned int rs_idx;

	if (ft->mode == GH_FRAMETIME_NONE)
		return;
	ts_idx=ft->cur_pos * ft->num_timestamps + GH_FRAMETIME_AFTER_SWAPBUFFERS;
	rs_idx=ft->cur_result * ft->num_timestamps + GH_FRAMETIME_AFTER_SWAPBUFFERS;
	timestamp_set(&ft->timestamp[ts_idx], &ft->frametime[rs_idx], ft->mode);
	frametimes_finish_frame(ft);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x5247
jmp 0x52a9
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
movq -0x8(%rbp), %rcx
imull 0x8(%rcx), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
movq -0x8(%rbp), %rcx
imull 0x8(%rcx), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0xc(%rbp), %eax
shlq $0x5, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movl -0x10(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rsi
movq -0x8(%rbp), %rax
movl (%rax), %edx
callq 0x7cb0
movq -0x8(%rbp), %rdi
callq 0x8790
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: need_creation_override
static int need_creation_override(const gl_context_creation_opts_t *opts)
{
	if (opts->force_version[0] >= 0 || opts->force_version[1] >= 0) {
		return 1;
	}
	if (opts->force_version_min[0] >= 0 || opts->force_version_min[1] >= 0) {
		return 1;
	}
	if (opts->force_version_max[0] >= 0 || opts->force_version_max[1] >= 0) {
		return 1;
	}
	if (opts->force_flags_on || opts->force_flags_off) {
		return 2;
	}
	if (opts->force_profile_on || opts->force_profile_off) {
		return 3;
	}
	if (opts->force_no_error >= 0) {
		return 4;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
jge 0x5b7c
movq -0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jl 0x5b88
movl $0x1, -0x4(%rbp)
jmp 0x5c16
movq -0x10(%rbp), %rax
cmpl $0x0, 0x34(%rax)
jge 0x5b9c
movq -0x10(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jl 0x5ba5
movl $0x1, -0x4(%rbp)
jmp 0x5c16
movq -0x10(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
jge 0x5bb9
movq -0x10(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jl 0x5bc2
movl $0x1, -0x4(%rbp)
jmp 0x5c16
movq -0x10(%rbp), %rax
cmpl $0x0, 0x44(%rax)
jne 0x5bd6
movq -0x10(%rbp), %rax
cmpl $0x0, 0x48(%rax)
je 0x5bdf
movl $0x2, -0x4(%rbp)
jmp 0x5c16
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4c(%rax)
jne 0x5bf3
movq -0x10(%rbp), %rax
cmpl $0x0, 0x50(%rax)
je 0x5bfc
movl $0x3, -0x4(%rbp)
jmp 0x5c16
movq -0x10(%rbp), %rax
cmpl $0x0, 0x54(%rax)
jl 0x5c0f
movl $0x4, -0x4(%rbp)
jmp 0x5c16
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: GH_get_gl_proc
static void *
GH_get_gl_proc(const char *name)
{
	static void *proc;

	/* try glXGetProcAddressARB first */
	GH_GET_PTR(glXGetProcAddressARB);
	if (GH_glXGetProcAddressARB && (proc=GH_glXGetProcAddressARB(name)) )
		return proc;

	/* try glXGetProcAddress as second chance */
	GH_GET_PTR(glXGetProcAddress);
	if (GH_glXGetProcAddress && (proc=GH_glXGetProcAddress(name)) )
		return proc;

	/* try dlsym as last resort */
	return GH_dlsym_gl(name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
leaq 0x6cf5(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x6d21(%rip), %rax      # 0xd250
cmpq $0x0, %rax
jne 0x6548
leaq 0x2b9b(%rip), %rdi      # 0x90d7
callq 0x2fc0
movq %rax, 0x6d08(%rip)      # 0xd250
leaq 0x6cc9(%rip), %rdi      # 0xd218
callq 0x2130
movq 0x6cf5(%rip), %rax      # 0xd250
cmpq $0x0, %rax
je 0x6588
movq 0x6ce8(%rip), %rax      # 0xd250
movq -0x10(%rbp), %rdi
callq *%rax
movq %rax, 0x6dab(%rip)      # 0xd320
cmpq $0x0, %rax
je 0x6588
movq 0x6d9e(%rip), %rax      # 0xd320
movq %rax, -0x8(%rbp)
jmp 0x6601
leaq 0x6c89(%rip), %rdi      # 0xd218
callq 0x21a0
movq 0x6cad(%rip), %rax      # 0xd248
cmpq $0x0, %rax
jne 0x65b4
leaq 0x2aff(%rip), %rdi      # 0x90a7
callq 0x2fc0
movq %rax, 0x6c94(%rip)      # 0xd248
leaq 0x6c5d(%rip), %rdi      # 0xd218
callq 0x2130
movq 0x6c81(%rip), %rax      # 0xd248
cmpq $0x0, %rax
je 0x65f4
movq 0x6c74(%rip), %rax      # 0xd248
movq -0x10(%rbp), %rdi
callq *%rax
movq %rax, 0x6d3f(%rip)      # 0xd320
cmpq $0x0, %rax
je 0x65f4
movq 0x6d32(%rip), %rax      # 0xd320
movq %rax, -0x8(%rbp)
jmp 0x6601
movq -0x10(%rbp), %rdi
callq 0x3640
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x838, %edi            # imm = 0x838
callq 0x2140
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x6752
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movl $0x80000000, 0x1c(%rax) # imm = 0x80000000
movq -0x18(%rbp), %rax
movl $0x2, 0x18(%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x818(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x820(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x828(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x830(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x810(%rax)
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
movl -0xc(%rbp), %r9d
xorl %r8d, %r8d
movl %r8d, %esi
movl %r8d, %edx
movl %r8d, %ecx
callq 0x6820
movq -0x18(%rbp), %rdi
addq $0x68, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
xorl %r9d, %r9d
movl $0xf4240, %ecx          # imm = 0xF4240
movl %r9d, %edx
movl %r9d, %r8d
callq 0x6ab0
movq -0x18(%rbp), %rdi
addq $0x98, %rdi
callq 0x6ca0
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: read_config
static void
read_config(gl_context_t *glc)
{
	glc->inject_swapinterval=get_envi("GH_INJECT_SWAPINTERVAL", GH_SWAP_DONT_SET);
	if (get_envi("GH_GL_DEBUG_OUTPUT",0)) {
		glc->flags |= GH_GL_INTERCEPT_DEBUG;
	}
	if (get_envi("GH_GL_INJECT_DEBUG_OUTPUT",0)) {
		glc->flags |= GH_GL_INJECT_DEBUG;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x3989(%rip), %rdi      # 0xa0fc
movl $0x80000000, %esi       # imm = 0x80000000
callq 0x5480
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1c(%rax)
leaq 0x3986(%rip), %rdi      # 0xa113
xorl %esi, %esi
callq 0x5480
cmpl $0x0, %eax
je 0x67a6
movq -0x8(%rbp), %rax
movl 0x18(%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0x18(%rax)
leaq 0x3979(%rip), %rdi      # 0xa126
xorl %esi, %esi
callq 0x5480
cmpl $0x0, %eax
je 0x67c6
movq -0x8(%rbp), %rax
movl 0x18(%rax), %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: add_ctx
static void
add_ctx(gl_context_t *glc)
{
	pthread_mutex_lock(&ctx_mutex);
	glc->next=ctx_list;
	ctx_list=glc;
	pthread_mutex_unlock(&ctx_mutex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x6b4d(%rip), %rdi      # 0xd330
callq 0x21a0
movq 0x6bc1(%rip), %rcx      # 0xd3b0
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq %rax, 0x6bae(%rip)      # 0xd3b0
leaq 0x6b27(%rip), %rdi      # 0xd330
callq 0x2130
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: timestamp_init
static void
timestamp_init(GH_timestamp *ts)
{
	ts->query_object=0;
	ts->timestamp_gl=0;
	ts->timestamp_cpu.tv_sec=0;
	ts->timestamp_cpu.tv_nsec=0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
popq %rbp
retq
nopl (%rax,%rax)