Function at 0x14004e5b0
Capabilities:
Check mutex on windows

Disassembly:
mov rax, rsp
push rbp
push rdi
push r12
push r14
push r15
lea rbp, [rax - 0x5f]
sub rsp, 0x90
mov qword [rbp - 0x39], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov rax, qword [0x1400c7008]
xor rax, rsp
mov qword [rbp + 0x2f], rax
mov rbx, rcx
mov qword [rbp - 0x31], rcx
xor r12d, r12d
mov qword [rcx], r12
mov qword [rcx + 8], 0xffffffffffffffff
mov qword [rcx + 0x10], 0xffffffffffffffff
lea ecx, [r12 + 0x20]
call fcn.140063248
mov rsi, rax
mov qword [rbp - 9], rax
add rax, 8
xor ecx, ecx
mov qword [rax], rcx
mov qword [rax + 8], rcx
mov qword [rax + 0x10], rcx
and qword [rax], 1
mov qword [rax + 8], rax
mov qword [rax + 0x10], rax
and qword [rax], 0xfffffffffffffffe
mov qword [rsi], r12
mov r15d, esi
shr r15d, 2
mov r14, rsi
shr r14, 0x20
bts r14d, 0x1e
mov qword [rbp + 0x1f], r12
mov qword [rbp + 0x27], r12
xor r8d, r8d
xor edx, edx
lea rcx, [rbp + 0xf]
call fcn.14000e930
nop
mov qword [rbp - 0x19], r12
mov qword [rbp - 0x11], r12
xor r8d, r8d
xor edx, edx
lea rcx, [rbp - 0x29]
call fcn.14000e930
nop
lea rcx, [rbp + 0xf]
call fcn.14004e480
lea r8d, [r12 + 0x13]
lea rdx, str.bipc_gmap_sem_lock_
lea rcx, [rbp - 0x29]
call fcn.14000ea50
or r9, 0xffffffffffffffff
xor r8d, r8d
lea rdx, [rbp + 0xf]
lea rcx, [rbp - 0x29]
call fcn.14000edf0
lea r8, [rbp - 0x29]
cmp qword [rbp - 0x11], 0x10
cmovae r8, qword [rbp - 0x29]
cmp qword [rbx], r12
jne 0x14004e6d2
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexA]
mov qword [rbx], rax
test rax, rax
setne dil
jmp 0x14004e6d5
xor dil, dil
mov r8d, shutdown
lea rdx, str.bipc_gmap_sem_count_
lea rcx, [rbp - 0x29]
call fcn.14000ea50
or r9, 0xffffffffffffffff
xor r8d, r8d
lea rdx, [rbp + 0xf]
lea rcx, [rbp - 0x29]
call fcn.14000edf0
xor eax, eax
mov qword [rbp + 7], rax
mov qword [rbp - 1], rbx
mov rcx, qword [rbx]
call fcn.14004fca0
mov byte [rbp + 7], 1
test dil, dil
je 0x14004e75a
lea r9, [rbp - 0x29]
cmp qword [rbp - 0x11], 0x10
cmovae r9, qword [rbp - 0x29]
cmp qword [rbx + 0x10], 0xffffffffffffffff
jne 0x14004e75a
xor edx, edx
xor ecx, ecx
mov r8d, 0x7fffffff
call qword [sym.imp.KERNEL32.dll_CreateSemaphoreA]
mov qword [rbx + 0x10], rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp qword [rbx + 0x10], 0xffffffffffffffff
setne al
test al, al
je 0x14004e75a
mov dil, 1
jmp 0x14004e75d
xor dil, dil
mov r8d, reloc.WS2_32.dll_select
lea rdx, str.bipc_gmap_sem_map_
lea rcx, [rbp - 0x29]
call fcn.14000ea50
or r9, 0xffffffffffffffff
xor r8d, r8d
lea rdx, [rbp + 0xf]
lea rcx, [rbp - 0x29]
call fcn.14000edf0
test dil, dil
je 0x14004e81e
lea r9, [rbp - 0x29]
cmp qword [rbp - 0x11], 0x10
cmovae r9, qword [rbp - 0x29]
cmp qword [rbx + 8], 0xffffffffffffffff
jne 0x14004e81e
mov r8d, r14d
mov edx, r15d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateSemaphoreA]
mov qword [rbx + 8], rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
setne cl
cmp qword [rbx + 8], 0xffffffffffffffff
setne al
test al, al
je 0x14004e81e
test cl, cl
jne 0x14004e7dd
mov rcx, rsi
call fcn.14004f590
lea r8, [rbp - 9]
mov edx, 1
mov rcx, qword [rbx + 0x10]
call qword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
nop
lea rcx, [rbp - 1]
call fcn.14004fd60
nop
xor r8d, r8d
mov dl, 1
lea rcx, [rbp - 0x29]
call fcn.14000e930
nop
xor r8d, r8d
mov dl, 1
lea rcx, [rbp + 0xf]
call fcn.14000e930
nop
mov rax, rbx
jmp 0x14004e83b
mov rcx, rsi
call fcn.14004f590
mov dword [rbp - 9], r12d
lea rdx, [0x1400b84d8]
lea rcx, [rbp - 9]
call sub.VCRUNTIME140.dll__CxxThrowException
nop
mov rcx, qword [rbp + 0x2f]
xor rcx, rsp
call fcn.140062f80
lea r11, [rsp + 0x90]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret