// File: /workspace/github_c_makefile_star2_O0/derhass[P]glx_hook/glx_hook.c
// Function: GH_dlsym_internal_dlsym
static void GH_dlsym_internal_dlsym()
{
	static const char *dlsymname = "dlsym";
	static const char *dlvsymname = "dlvsym";
	DLSYM_PROC_T orig_dlsym = NULL;
	if (GH_dlsym == NULL) {
		GH_dlsym = GH_dlsym_internal_next(dlsymname);
		orig_dlsym = GH_dlsym;
		if (GH_dlsym) {
			void *ptr;
			GH_verbose(GH_MSG_DEBUG_INTERCEPTION,"INTERNAL: (%s) = %p, ours is %p\n",dlsymname,GH_dlsym,dlsym);
			ptr = GH_dlsym_next(dlsymname);
			if (ptr != (void*)GH_dlsym) {
				if (ptr) {
					if (get_envi("GH_ALLOW_DLSYM_REDIRECTION", 1)) {
						GH_verbose(GH_MSG_DEBUG_INTERCEPTION,"INTERNAL: (%s) = %p intercepted to %p\n",dlsymname,GH_dlsym,ptr);
						GH_dlsym = ptr;
					} else {
						GH_verbose(GH_MSG_WARNING, "INTERNAL: (%s) = %p would be intercepted to %p but ignoring it\n",dlsymname,GH_dlsym,ptr);
					}
				} else {
					GH_verbose(GH_MSG_WARNING,"INTERNAL: (%s) would be intercepted to NULL, ignoring it\n",dlsymname);
				}
			}
		} else {
			GH_verbose(GH_MSG_WARNING, "failed to dynamically query '%s'\n", dlsymname);
		}
	}

	/* use the original dlsym, not a potentially redirected one */
	if (orig_dlsym && (GH_dlvsym == NULL)) {
		Dl_info info;
		memset(&info,0,sizeof(info));
		GH_dlvsym = orig_dlsym(RTLD_NEXT,dlvsymname);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq $0x0, -0x8(%rbp)
movq 0x3451(%rip), %rax      # 0x51a8
cmpq $0x0, %rax
jne 0x1e8c
movq 0x3358(%rip), %rdi      # 0x50c0
callq 0x1ee0
movq %rax, 0x3434(%rip)      # 0x51a8
movq 0x342d(%rip), %rax      # 0x51a8
movq %rax, -0x8(%rbp)
movq 0x3422(%rip), %rax      # 0x51a8
cmpq $0x0, %rax
je 0x1e70
movq 0x3329(%rip), %rdx      # 0x50c0
movq 0x340a(%rip), %rcx      # 0x51a8
movl $0x5, %edi
leaq 0x1392(%rip), %rsi      # 0x313c
movq 0x321f(%rip), %r8       # 0x4fd0
movb $0x0, %al
callq 0x16c0
movq 0x3301(%rip), %rdi      # 0x50c0
callq 0x1660
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x33d5(%rip), %rcx      # 0x51a8
cmpq %rcx, %rax
je 0x1e6e
cmpq $0x0, -0x10(%rbp)
je 0x1e52
leaq 0x1373(%rip), %rdi      # 0x315d
movl $0x1, %esi
callq 0x1f10
cmpl $0x0, %eax
je 0x1e2b
movq 0x32c0(%rip), %rdx      # 0x50c0
movq 0x33a1(%rip), %rcx      # 0x51a8
movq -0x10(%rbp), %r8
movl $0x5, %edi
leaq 0x1361(%rip), %rsi      # 0x3178
movb $0x0, %al
callq 0x16c0
movq -0x10(%rbp), %rax
movq %rax, 0x337f(%rip)      # 0x51a8
jmp 0x1e50
movq 0x328e(%rip), %rdx      # 0x50c0
movq 0x336f(%rip), %rcx      # 0x51a8
movq -0x10(%rbp), %r8
movl $0x2, %edi
leaq 0x1356(%rip), %rsi      # 0x319f
movb $0x0, %al
callq 0x16c0
jmp 0x1e6c
movq 0x3267(%rip), %rdx      # 0x50c0
movl $0x2, %edi
leaq 0x137a(%rip), %rsi      # 0x31df
movb $0x0, %al
callq 0x16c0
jmp 0x1e6e
jmp 0x1e8a
movq 0x3249(%rip), %rdx      # 0x50c0
movl $0x2, %edi
leaq 0x1396(%rip), %rsi      # 0x3219
movb $0x0, %al
callq 0x16c0
jmp 0x1e8c
cmpq $0x0, -0x8(%rbp)
je 0x1ecb
movq 0x333e(%rip), %rax      # 0x51d8
cmpq $0x0, %rax
jne 0x1ecb
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x1090
movq -0x8(%rbp), %rax
movq 0x320d(%rip), %rsi      # 0x50c8
movq $-0x1, %rdi
callq *%rax
movq %rax, 0x330d(%rip)      # 0x51d8
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)