// File: /workspace/github_c_makefile_star2_O1/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 0x3610(%rip), %rdi      # 0x5138
callq 0x1120
movl 0x3579(%rip), %eax      # 0x50ac
cmpl $0x8, %eax
jb 0x1cb3
leaq 0x1781(%rip), %rdi      # 0x32c4
callq 0x1030
movl $0x0, 0x355a(%rip)      # 0x50ac
testq %rax, %rax
je 0x1c5c
movq %rax, %r14
movl %r12d, 0xc(%rsp)
movq %rax, %r15
leaq 0x31f3(%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 0x1ba1
incq %rbp
addq $0x8, %rbx
cmpq $0x8, %rbp
jne 0x1b6f
movl $0x8, %ebp
cmpl $0x7, %ebp
ja 0x1bac
movl %ebp, 0x3500(%rip)      # 0x50ac
addq %r12, %r14
movb (%r15,%r12), %bl
testb %bl, %bl
je 0x1bdc
callq 0x1130
movq (%rax), %rax
movl 0xc(%rsp), %r12d
movsbq %bl, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x1be1
movb 0x1(%r14), %bl
incq %r14
testb %bl, %bl
jne 0x1bc4
jmp 0x1be1
movl 0xc(%rsp), %r12d
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x10b0
movl %eax, 0x34bb(%rip)      # 0x50b4
movq (%r15), %r14
movb (%r14), %bl
testb %bl, %bl
je 0x1c21
callq 0x1130
movq (%rax), %rax
movsbq %bl, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x1c21
movb 0x1(%r14), %bl
incq %r14
testb %bl, %bl
jne 0x1c0b
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x10b0
movl %eax, 0x3482(%rip)      # 0x50b8
movl 0x3470(%rip), %edx      # 0x50ac
movl 0x3472(%rip), %ecx      # 0x50b4
movl 0x346f(%rip), %r8d      # 0x50b8
leaq 0x16bc(%rip), %rsi      # 0x330c
movl $0x4, %edi
xorl %eax, %eax
callq 0x16b2
leaq 0x166e(%rip), %rdi      # 0x32d1
callq 0x1030
movl $0x1, 0x343e(%rip)      # 0x50b0
testq %rax, %rax
je 0x1cb3
movq %rax, %r14
leaq 0x312f(%rip), %rbx      # 0x4db0
xorl %r15d, %r15d
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x1090
testl %eax, %eax
je 0x1ca6
incq %r15
addq $0x8, %rbx
cmpq $0x5, %r15
jne 0x1c84
movl $0x5, %r15d
cmpl $0x7, %r15d
ja 0x1cb3
movl %r15d, 0x33fd(%rip)     # 0x50b0
leaq 0x347e(%rip), %rdi      # 0x5138
callq 0x10c0
movl 0x33eb(%rip), %eax      # 0x50b0
movl %r12d, %r15d
sarl $0x1f, %r15d
orl $0x1, %r15d
movl %r12d, %edx
negl %edx
cmovsl %r12d, %edx
testl %eax, %eax
cmovel %eax, %r15d
cmovel %r12d, %edx
movl 0x33c3(%rip), %eax      # 0x50ac
decl %eax
cmpl $0x6, %eax
ja 0x1d56
leaq 0x1309(%rip), %rcx      # 0x3000
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x80000000, %ebp       # imm = 0x80000000
jmp 0x1d58
cmpl $0x2, %edx
movl $0x1, %ebp
cmovgel %edx, %ebp
jmp 0x1d58
xorl %ebp, %ebp
jmp 0x1d58
movl 0x3396(%rip), %eax      # 0x50b4
movl %edx, %ebp
cmpl %edx, %eax
jle 0x1d2a
movl 0x338a(%rip), %ebp      # 0x50b4
cmpl 0x3388(%rip), %ebp      # 0x50b8
jle 0x1d58
movl 0x3380(%rip), %edx      # 0x50b8
jmp 0x1d58
movl 0x3374(%rip), %eax      # 0x50b4
cmpl %edx, %eax
jle 0x1d56
movl 0x336a(%rip), %ebp      # 0x50b4
jmp 0x1d58
movl 0x3362(%rip), %eax      # 0x50b4
cmpl %edx, %eax
jl 0x1d44
movl %edx, %ebp
leaq 0x160c(%rip), %rsi      # 0x336b
movl $0x4, %edi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x16b2
movl %ebp, %r14d
negl %r14d
jno 0x1d93
leaq 0x15b5(%rip), %rsi      # 0x3331
movl $0x3, %edi
movl %r12d, %edx
xorl %eax, %eax
callq 0x16b2
movl $0x80000000, %r14d      # imm = 0x80000000
jmp 0x1dd4
movl 0x3317(%rip), %eax      # 0x50b0
cmpl $0x4, %eax
je 0x1db1
cmpl $0x3, %eax
je 0x1dbb
cmpl $0x1, %eax
jne 0x1dac
imull %r15d, %ebp
movl %ebp, %r14d
jmp 0x1dbb
imull %ebp, %r15d
negl %r15d
movl %r15d, %r14d
leaq 0x1591(%rip), %rsi      # 0x3353
movl $0x3, %edi
movl %r12d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x16b2
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq