// File: /workspace/github_c_makefile_star2_O2/derhass[P]glx_hook/glx_hook.c
// Function: GH_swap_interval
static int GH_swap_interval(int interval)
{
	static pthread_mutex_t mutex=PTHREAD_MUTEX_INITIALIZER;
	static volatile GH_config cfg={GH_SWAP_MODES_COUNT, GH_SWAP_TEAR_KEEP, {0,1}};

	pthread_mutex_lock(&mutex);
	if (cfg.swap_mode >= GH_SWAP_MODES_COUNT) {
		GH_swap_mode_from_str(&cfg, getenv("GH_SWAP_MODE"));
		GH_swap_tear_from_str(&cfg, getenv("GH_SWAP_TEAR"));
	}
	pthread_mutex_unlock(&mutex);
	return GH_swap_interval_base(&cfg, interval);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x2655(%rip), %rdi      # 0x4138
callq 0x1120
movl 0x25be(%rip), %eax      # 0x40ac
cmpl $0x8, %eax
jb 0x1c3f
leaq 0x7c6(%rip), %rdi       # 0x22c4
callq 0x1030
movl $0x0, 0x259f(%rip)      # 0x40ac
testq %rax, %rax
je 0x1bec
movq %rax, %r14
leaq 0x2240(%rip), %rbp      # 0x3d60
xorl %r13d, %r13d
xorl %r15d, %r15d
cmpq $0x8, %r13
je 0x1b5d
movq (%rbp), %r12
movq %r12, %rdi
callq 0x1080
movq %rax, %r15
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x1040
testl %eax, %eax
je 0x1b56
incq %r13
addq $0x8, %rbp
jmp 0x1b26
movl %r13d, 0x254f(%rip)     # 0x40ac
addq %r15, %r14
movsbq (%r14), %r15
testq %r15, %r15
je 0x1b7e
callq 0x1130
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r15,2)
jne 0x1b7e
incq %r14
jmp 0x1b60
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x10b0
movl %eax, 0x2520(%rip)      # 0x40b4
movq (%r15), %r14
movsbq (%r14), %r15
testq %r15, %r15
je 0x1bb5
callq 0x1130
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r15,2)
jne 0x1bb5
incq %r14
jmp 0x1b97
movq %rsp, %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x10b0
movl %eax, 0x24f0(%rip)      # 0x40b8
movl 0x24de(%rip), %edx      # 0x40ac
movl 0x24e0(%rip), %ecx      # 0x40b4
movl 0x24dd(%rip), %r8d      # 0x40b8
leaq 0x72a(%rip), %rsi       # 0x230c
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x1677
leaq 0x6de(%rip), %rdi       # 0x22d1
callq 0x1030
movl $0x1, 0x24ae(%rip)      # 0x40b0
testq %rax, %rax
je 0x1c3f
movq %rax, %r14
leaq 0x219f(%rip), %r12      # 0x3db0
xorl %r15d, %r15d
pushq $0x5
popq %rbp
cmpq $0x5, %r15
je 0x1c39
movq (%r12), %rsi
movq %r14, %rdi
callq 0x1090
testl %eax, %eax
je 0x1c36
incq %r15
addq $0x8, %r12
jmp 0x1c17
movl %r15d, %ebp
movl %ebp, 0x2471(%rip)      # 0x40b0
leaq 0x24f2(%rip), %rdi      # 0x4138
callq 0x10c0
movl 0x245f(%rip), %eax      # 0x40b0
movl %ebx, %r15d
sarl $0x1f, %r15d
orl $0x1, %r15d
movl %ebx, %edx
negl %edx
cmovsl %ebx, %edx
testl %eax, %eax
cmovel %eax, %r15d
cmovel %ebx, %edx
movl 0x243a(%rip), %eax      # 0x40ac
decl %eax
cmpl $0x6, %eax
ja 0x1cdd
leaq 0x380(%rip), %rcx       # 0x2000
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x80000000, %ebp       # imm = 0x80000000
jmp 0x1cdf
cmpl $0x2, %edx
pushq $0x1
popq %rbp
cmovgel %edx, %ebp
jmp 0x1cdf
xorl %ebp, %ebp
jmp 0x1cdf
movl 0x240f(%rip), %eax      # 0x40b4
movl %edx, %ebp
cmpl %edx, %eax
jle 0x1cb1
movl 0x2403(%rip), %ebp      # 0x40b4
cmpl 0x2401(%rip), %ebp      # 0x40b8
jle 0x1cdf
movl 0x23f9(%rip), %edx      # 0x40b8
jmp 0x1cdf
movl 0x23ed(%rip), %eax      # 0x40b4
cmpl %edx, %eax
jle 0x1cdd
movl 0x23e3(%rip), %ebp      # 0x40b4
jmp 0x1cdf
movl 0x23db(%rip), %eax      # 0x40b4
cmpl %edx, %eax
jl 0x1ccb
movl %edx, %ebp
leaq 0x685(%rip), %rsi       # 0x236b
pushq $0x4
popq %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1677
movl %ebp, %r14d
negl %r14d
jno 0x1d15
leaq 0x630(%rip), %rsi       # 0x2331
pushq $0x3
popq %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1677
movl $0x80000000, %r14d      # imm = 0x80000000
jmp 0x1d53
movl 0x2395(%rip), %eax      # 0x40b0
cmpl $0x4, %eax
je 0x1d33
cmpl $0x3, %eax
je 0x1d3d
cmpl $0x1, %eax
jne 0x1d2e
imull %r15d, %ebp
movl %ebp, %r14d
jmp 0x1d3d
imull %ebp, %r15d
negl %r15d
movl %r15d, %r14d
leaq 0x60f(%rip), %rsi       # 0x2353
pushq $0x3
popq %rdi
movl %ebx, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x1677
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq