Function at 0x140018270
Capabilities:
Check mutex on windows

Disassembly:
mov qword [rsp + 0x10], rdx
push rbp
push rbx
push rsi
push rdi
push r12
push r14
push r15
mov rbp, rsp
sub rsp, 0x70
mov qword [rbp - 0x20], 0xfffffffffffffffe
mov esi, r8d
mov r15, rdx
mov rbx, rcx
mov dword [rbp - 0x50], 0
mov qword [rcx], 0
mov dword [rcx + 8], 1
mov r9d, 0x2f
lea r8d, [r9 + 0x2d]
lea rdx, [rbp - 0x38]
mov rcx, r15
call fcn.14014e5d0
nop
mov rcx, qword [r15]
mov rdx, qword [rax]
mov qword [r15], rdx
mov qword [rax], rcx
mov rcx, qword [rbp - 0x38]
add rcx, 0xfffffffffffffff0
lea r12, [0x1402be068]
mov edi, 0xffffffff
cmp rcx, r12
je 0x1400182f8
mov eax, edi
lock xadd dword [rcx], eax
test eax, eax
jne 0x1400182f8
call fcn.14010a370
nop
lea rax, str.Global_
mov qword [rbp - 0x30], rax
lea rdx, [rbp - 0x30]
lea rcx, [rbp + 0x40]
call fcn.14001b960
nop
mov rdx, r15
lea rcx, [rbp + 0x40]
call fcn.14014ff80
mov rcx, qword [rax]
mov qword [rbp + 0x58], rcx
add rcx, 0xfffffffffffffff0
cmp rcx, r12
je 0x140018336
mov eax, 1
lock xadd dword [rcx], eax
mov dword [rbp - 0x50], 1
mov rcx, qword [rbp + 0x40]
add rcx, 0xfffffffffffffff0
cmp rcx, r12
je 0x140018359
mov eax, edi
lock xadd dword [rcx], eax
test eax, eax
jne 0x140018359
call fcn.14010a370
lea rdx, [rbp + 0x58]
lea rcx, [rbp - 0x18]
call fcn.140018b20
mov r8, qword [rax]
mov edx, 1
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov qword [rbx], rax
mov eax, 1
and eax, 0xfffffffe
mov dword [rbp - 0x50], eax
mov rcx, qword [rbp + 0x58]
add rcx, 0xfffffffffffffff0
cmp rcx, r12
je 0x1400183a0
mov eax, edi
lock xadd dword [rcx], eax
test eax, eax
jne 0x1400183a0
call fcn.14010a370
cmp qword [rbx], 0
jne 0x140018458
lea rax, str.Local_
mov qword [rbp - 0x28], rax
lea rdx, [rbp - 0x28]
lea rcx, [rbp - 0x48]
call fcn.14001b960
nop
mov rdx, r15
lea rcx, [rbp - 0x48]
call fcn.14014ff80
mov rcx, qword [rax]
mov qword [rbp - 0x40], rcx
add rcx, 0xfffffffffffffff0
cmp rcx, r12
je 0x1400183e8
mov eax, 1
lock xadd dword [rcx], eax
mov r14d, 2
mov dword [rbp - 0x50], r14d
mov rcx, qword [rbp - 0x48]
add rcx, 0xfffffffffffffff0
cmp rcx, r12
je 0x14001840e
mov eax, edi
lock xadd dword [rcx], eax
test eax, eax
jne 0x14001840e
call fcn.14010a370
lea rdx, [rbp - 0x40]
lea rcx, [rbp - 0x10]
call fcn.140018b20
mov r8, qword [rax]
mov edx, 1
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov qword [rbx], rax
and r14d, 0xfffffffd
mov dword [rbp - 0x50], r14d
mov rcx, qword [rbp - 0x40]
add rcx, 0xfffffffffffffff0
cmp rcx, r12
je 0x140018452
mov eax, edi
lock xadd dword [rcx], eax
test eax, eax
jne 0x140018452
call fcn.14010a370
cmp qword [rbx], 0
je 0x1400184ab
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x1400184ab
mov rcx, qword [rbx]
test esi, esi
jne 0x140018489
test rcx, rcx
je 0x1400184ab
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov rcx, qword [rbx]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbx], 0
jmp 0x1400184ab
mov eax, 0xffffffff
test esi, esi
cmovs esi, eax
mov edx, esi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, 0xffffff7f
je 0x1400184ab
mov rcx, rbx
call fcn.1400184e0
nop
mov rcx, qword [r15]
sub rcx, 0x10
cmp rcx, r12
je 0x1400184c4
lock xadd dword [rcx], edi
test edi, edi
jne 0x1400184c4
call fcn.14010a370
mov rax, rbx
add rsp, 0x70
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret