// File: /workspace/github_c_makefile_star2_O3/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
subq $0x18, %rsp
movl %edi, %r12d
leaq 0x35da(%rip), %rdi      # 0x5138
callq 0x1120
movl 0x3543(%rip), %eax      # 0x50ac
cmpl $0x8, %eax
jb 0x1cd8
leaq 0x174b(%rip), %rdi      # 0x32c4
callq 0x1030
movl $0x0, 0x3524(%rip)      # 0x50ac
testq %rax, %rax
je 0x1c8a
movq %rax, %r14
movl %r12d, 0xc(%rsp)
movq %rax, %r15
leaq 0x31bd(%rip), %rbx      # 0x4d60
xorl %ebp, %ebp
movq (%rbx), %r13
movq %r13, %rdi
callq 0x1080
movq %rax, %r12
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x1040
testl %eax, %eax
je 0x1bd4
incq %rbp
addq $0x8, %rbx
cmpq $0x8, %rbp
jne 0x1ba5
jmp 0x1bda
movl %ebp, 0x34d2(%rip)      # 0x50ac
addq %r12, %r14
movb (%r15,%r12), %bl
testb %bl, %bl
je 0x1c0a
callq 0x1130
movq (%rax), %rax
movl 0xc(%rsp), %r12d
movsbq %bl, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x1c0f
movb 0x1(%r14), %bl
incq %r14
testb %bl, %bl
jne 0x1bf2
jmp 0x1c0f
movl 0xc(%rsp), %r12d
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x10b0
movl %eax, 0x348d(%rip)      # 0x50b4
movq (%r15), %r14
movb (%r14), %bl
testb %bl, %bl
je 0x1c4f
callq 0x1130
movq (%rax), %rax
movsbq %bl, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x1c4f
movb 0x1(%r14), %bl
incq %r14
testb %bl, %bl
jne 0x1c39
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x10b0
movl %eax, 0x3454(%rip)      # 0x50b8
movl 0x3442(%rip), %edx      # 0x50ac
movl 0x3444(%rip), %ecx      # 0x50b4
movl 0x3441(%rip), %r8d      # 0x50b8
leaq 0x168e(%rip), %rsi      # 0x330c
movl $0x4, %edi
xorl %eax, %eax
callq 0x16d6
leaq 0x1640(%rip), %rdi      # 0x32d1
callq 0x1030
movl $0x1, 0x3410(%rip)      # 0x50b0
testq %rax, %rax
je 0x1cd8
movq %rax, %r14
leaq 0x3101(%rip), %r15      # 0x4db0
xorl %ebx, %ebx
movq (%r15), %rsi
movq %r14, %rdi
callq 0x1090
testl %eax, %eax
je 0x1cd2
incq %rbx
addq $0x8, %r15
cmpq $0x5, %rbx
jne 0x1cb1
movl $0x5, %ebx
movl %ebx, 0x33d8(%rip)      # 0x50b0
leaq 0x3459(%rip), %rdi      # 0x5138
callq 0x10c0
movl 0x33c6(%rip), %eax      # 0x50b0
movl %r12d, %r14d
sarl $0x1f, %r14d
orl $0x1, %r14d
movl %r12d, %edx
negl %edx
cmovsl %r12d, %edx
testl %eax, %eax
cmovel %eax, %r14d
cmovel %r12d, %edx
movl 0x339e(%rip), %eax      # 0x50ac
decl %eax
movl %edx, %ebp
cmpl $0x6, %eax
ja 0x1d9f
leaq 0x12de(%rip), %rcx      # 0x3000
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1639(%rip), %rsi      # 0x336b
movl $0x4, %edi
movl $0x80000000, %ecx       # imm = 0x80000000
xorl %eax, %eax
callq 0x16d6
jmp 0x1dba
cmpl $0x2, %edx
movl $0x1, %ebp
cmovgel %edx, %ebp
jmp 0x1d76
xorl %ebp, %ebp
jmp 0x1d76
movl 0x3358(%rip), %eax      # 0x50b4
movl %edx, %ebp
cmpl %edx, %eax
jle 0x1d68
movl 0x334c(%rip), %ebp      # 0x50b4
cmpl 0x334a(%rip), %ebp      # 0x50b8
jle 0x1d9f
movl 0x3342(%rip), %edx      # 0x50b8
leaq 0x15ee(%rip), %rsi      # 0x336b
movl $0x4, %edi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x16d6
jmp 0x1dd7
movl 0x3321(%rip), %eax      # 0x50b4
movl %edx, %ebp
cmpl %edx, %eax
jle 0x1d9f
movl 0x3315(%rip), %ebp      # 0x50b4
leaq 0x15c5(%rip), %rsi      # 0x336b
movl $0x4, %edi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x16d6
movl %ebp, %eax
negl %eax
jno 0x1dd7
leaq 0x1570(%rip), %rsi      # 0x3331
movl $0x3, %edi
movl %r12d, %edx
xorl %eax, %eax
callq 0x16d6
movl $0x80000000, %ebp       # imm = 0x80000000
jmp 0x1e18
movl 0x32d3(%rip), %eax      # 0x50b0
cmpl $0x4, %eax
je 0x1df6
cmpl $0x3, %eax
je 0x1df2
cmpl $0x1, %eax
jne 0x1e00
imull %r14d, %ebp
jmp 0x1e00
negl %ebp
jmp 0x1e00
imull %ebp, %r14d
negl %r14d
movl %r14d, %ebp
leaq 0x154c(%rip), %rsi      # 0x3353
movl $0x3, %edi
movl %r12d, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x16d6
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x3285(%rip), %eax      # 0x50b4
movl %edx, %ebp
cmpl %edx, %eax
jl 0x1d99
jmp 0x1d9f