Function at 0x14006408a
Capabilities:
Check mutex on windows

Disassembly:
push rbx
push rbp
sub rsp, 0x48
mov rbp, rcx
cmp rdx, 5
jne 0x140064022
mov rax, qword [0x1400ec5a0]
test rax, rax
je 0x1400642c3
lea rcx, [0x1400ec5a8]
mov ebx, 0x226
call fcn.14007a450
mov rax, qword [0x1400ec5a0]
xor edx, edx
cmp dword [rax + rdx*4], 0xffffffff
jne 0x14006426c
inc rdx
cmp rdx, 0x10
jl 0x140063ff9
mov dword [0x1400ec5a8], 0
mov dword [rbp], 0xffff7fff
jmp 0x140064263
lea rcx, [0x1400ec5a8]
call fcn.14007a450
cmp dword [0x1400ec5ac], 0
je 0x14006406d
mov eax, dword [0x1400cc588]
cmp eax, 0xffff8000
mov dword [rbp], eax
jle 0x140064054
dec eax
mov dword [0x1400cc588], eax
jmp 0x140064257
mov dword [0x1400cc588], 0xffffff7f
mov dword [0x1400ec5ac], 0
jmp 0x140064257
mov ebx, dword [0x1400cc588]
cmp ebx, 0xffffc000
jge 0x14006408a
mov dword [0x1400cc588], 0xffffff7f
mov ebx, 0xffffff7f
mov qword [rsp + 0x30], rsi
mov ecx, ebx
call fcn.140065570
test eax, eax
je 0x140064244
cmp ebx, 0xfffffffa
lea ecx, [rbx + 5]
cmovle ecx, ebx
mov eax, 0xfb93e673
mul ecx
shr edx, 9
imul esi, edx, 0x209
sub ecx, esi
add ecx, 0x69
mov edx, dword [0x1400ce448]
cmp edx, 2
mov dword [rsp + 0x38], ecx
movsxd rax, ecx
jge 0x140064105
lea r8, [rax + rax*2]
lea rax, [0x140000000]
shl r8, 4
mov esi, dword [rax + r8 + 0xe5048]
test esi, esi
jne 0x1400641a4
lea rax, [0x140000000]
mov dword [rax + r8 + 0xe5048], 1
jmp 0x1400641a4
lea rsi, [0x1400e5040]
lea rax, [rax + rax*2]
shl rax, 4
lea rcx, [rsi + rax + 8]
call fcn.14007a450
test eax, eax
jne 0x14006419a
movsxd rdx, dword [rsp + 0x38]
lea rax, [0x140000000]
lea rcx, [rdx + rdx*2]
shl rcx, 4
mov r8, qword [rax + rcx + 0xe5040]
test r8, r8
je 0x140064394
lea rax, [0x140000000]
lea rcx, [rdx + rdx*2]
shl rcx, 4
mov dword [rax + rcx + 0xe5048], 0
lea rax, [0x140000000]
lea r8, [rdx + rdx*2]
shl r8, 4
mov edx, 0xffffffff
mov rcx, qword [rax + r8 + 0xe5040]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
movsxd rax, dword [rsp + 0x38]
lea rdx, [rax + rax*2]
shl rdx, 4
lea rcx, [rsi + rdx + 8]
call fcn.14007a450
mov edx, dword [0x1400ce448]
mov ecx, dword [rsp + 0x38]
cmp edx, 1
je 0x140064369
movsxd rcx, ecx
lea rsi, [0x140000000]
lea rax, [rcx + rcx*2]
shl rax, 4
mov rsi, qword [rsi + rax + 0xe5068]
test rsi, rsi
je 0x1400641dd
cmp ebx, dword [rsi + 0x1b0]
jbe 0x1400641dd
mov rsi, qword [rsi + 0x48]
test rsi, rsi
jne 0x1400641cc
cmp edx, 1
je 0x140064326
cmp edx, 2
jge 0x1400641ff
lea rdx, [0x140000000]
mov dword [rdx + rax + 0xe5048], 0
jmp 0x14006422f
lea rdx, [0x140000000]
mov r8, rdx
mov dword [rdx + rax + 0xe5048], 0
movsxd rax, dword [rsp + 0x38]
lea r9, [rax + rax*2]
shl r9, 4
mov rcx, qword [r8 + r9 + 0xe5040]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
test rsi, rsi
je 0x140064311
cmp ebx, dword [rsi + 0x1b0]
jne 0x140064311
dec ebx
cmp ebx, 0xffff8000
jg 0x14006408f
mov rsi, qword [rsp + 0x30]
mov dword [0x1400ec5a8], 0
xor ebx, ebx
mov eax, ebx
add rsp, 0x48
pop rbp
pop rbx
ret
mov eax, dword [rax + rdx*4]
xor ecx, ecx
mov r8d, eax
shl r8d, cl
test r8d, 0x80000000
je 0x14006428c
inc ecx
cmp ecx, 0x20
jl 0x140064271
jmp 0x14006400c
mov ebx, edx
neg ecx
shl ebx, 5
neg ebx
lea r8d, [rcx + rbx - 1]
mov dword [rbp], r8d
add ecx, 0x1f
mov ebp, 1
mov r9, qword [0x1400ec5a0]
shl ebp, cl
xor ebx, ebx
or eax, ebp
mov dword [r9 + rdx*4], eax
mov dword [0x1400ec5a8], 0
jmp 0x140064263
mov ecx, 0x40
xor edx, edx
lea r8, [0x1400ec5a0]
call fcn.140071900
test eax, eax
je 0x1400642eb
mov dword [0x1400ec5a8], 0
add rsp, 0x48
pop rbp
pop rbx
ret
mov rdx, qword [0x1400ec5a0]
movabs rax, 0
mov qword [rdx], rax
mov rax, qword [0x1400ec5a0]
mov dword [rax], 0xf8000000
jmp 0x140063fdf
mov rsi, qword [rsp + 0x30]
mov dword [rbp], ebx
dec ebx
mov dword [0x1400cc588], ebx
jmp 0x140064257
lea rdx, [0x140000000]
lea rcx, [rsp + 0x20]
mov r9, rdx
mov r8, qword [rdx + rax + 0xe5058]
mov rax, qword [r9 + rax + 0xe5060]
mov qword [rcx], r8
mov qword [rcx + 8], rax
call fcn.14007a420
movsxd rax, dword [rsp + 0x38]
mov edx, dword [0x1400ce448]
lea rax, [rax + rax*2]
shl rax, 4
jmp 0x1400641e6
movsxd rcx, ecx
lea rax, [0x1400e5040]
lea rdx, [rcx + rcx*2]
shl rdx, 4
lea rcx, [rax + rdx + 0x18]
call fcn.14007a3e0
mov edx, dword [0x1400ce448]
mov ecx, dword [rsp + 0x38]
jmp 0x1400641ad
xor ecx, ecx
xor edx, edx
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_CreateMutexA]
movsxd rdx, dword [rsp + 0x38]
lea rcx, [0x140000000]
lea r8, [rdx + rdx*2]
shl r8, 4
mov qword [rcx + r8 + 0xe5040], rax
mov rax, rcx
mov dword [rax + r8 + 0xe5048], 0
jmp 0x140064161