Function at 0x408c80
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4f83d1
mov eax, dword fs:[0]
push eax
sub esp, 0x58
mov eax, dword [0x55a3d0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
or eax, 0xffffffff
mov dword [ebp - 0x58], edi
mov dword [edi], eax
xor ebx, ebx
mov dword [ebp - 4], ebx
mov dword [edi + 4], eax
mov dword [edi + 8], eax
push 0x10
mov byte [ebp - 4], 2
call fcn.004b5bb8
mov esi, eax
add esp, 4
mov dword [ebp - 0x54], esi
mov byte [ebp - 4], 3
cmp esi, ebx
je 0x408d31
push 0x34
mov dword [esi + 8], ebx
call fcn.004b5bb8
add esp, 4
cmp eax, ebx
je 0x408d0d
mov dword [esi + 4], eax
mov dword [eax], eax
mov eax, dword [esi + 4]
mov dword [eax + 4], eax
mov eax, dword [esi + 4]
mov dword [eax + 8], eax
mov eax, dword [esi + 4]
mov byte [eax + 0x30], 1
mov ecx, dword [esi + 4]
mov byte [ecx + 0x31], 1
mov dword [ebp - 0x50], esi
jmp 0x408d34
lea edx, [ebp - 0x50]
push edx
lea ecx, [ebp - 0x64]
mov dword [ebp - 0x50], ebx
call fcn.004b59ab
push 0x52daf4
lea eax, [ebp - 0x64]
push eax
mov dword [ebp - 0x64], vtable.std::bad_alloc.0
call fcn.004b9b55
mov dword [ebp - 0x50], ebx
mov eax, dword [ebp - 0x50]
shr eax, 2
mov dword [ebp - 0x54], eax
mov eax, 0xf
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x38], ebx
mov byte [ebp - 0x48], 0
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x1c], ebx
mov byte [ebp - 0x2c], 0
lea esi, [ebp - 0x48]
mov byte [ebp - 4], 5
call fcn.00408b00
push 0x13
push str.bipc_gmap_sem_lock_
lea ecx, [ebp - 0x2c]
call fcn.00411d00
push 0xffffffffffffffff
push ebx
mov ecx, esi
push ecx
lea ecx, [ebp - 0x2c]
call fcn.0040e400
cmp dword [ebp - 0x18], 0x10
mov eax, dword [ebp - 0x2c]
jae 0x408d8b
lea eax, [ebp - 0x2c]
cmp dword [edi], 0xffffffff
jne 0x408da3
push eax
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
cmp eax, 0xffffffff
mov dword [edi], eax
setne bl
jmp 0x408da5
xor bl, bl
push 0x14
push str.bipc_gmap_sem_count_
lea ecx, [ebp - 0x2c]
call fcn.00411d00
push 0xffffffffffffffff
push 0
lea edx, [ebp - 0x48]
push edx
lea ecx, [ebp - 0x2c]
call fcn.0040e400
push edi
mov dword [ebp - 0x60], edi
call fcn.00409fd0
mov byte [ebp - 0x5c], 1
mov byte [ebp - 4], 6
mov esi, dword [sym.imp.KERNEL32.dll_CreateSemaphoreA]
test bl, bl
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
je 0x408e17
cmp dword [ebp - 0x18], 0x10
mov eax, dword [ebp - 0x2c]
jae 0x408df1
lea eax, [ebp - 0x2c]
cmp dword [edi + 8], 0xffffffff
jne 0x408e17
push eax
push closesocket
push 0
push 0
call esi
mov dword [edi + 8], eax
call ebx
cmp dword [edi + 8], 0xffffffff
mov byte [ebp - 0x49], 1
setne al
test al, al
jne 0x408e1b
mov byte [ebp - 0x49], 0
push 0x12
push str.bipc_gmap_sem_map_
lea ecx, [ebp - 0x2c]
call fcn.00411d00
push 0xffffffffffffffff
push 0
lea eax, [ebp - 0x48]
push eax
lea ecx, [ebp - 0x2c]
call fcn.0040e400
cmp byte [ebp - 0x49], 0
je 0x408e75
cmp dword [ebp - 0x18], 0x10
mov eax, dword [ebp - 0x2c]
jae 0x408e4c
lea eax, [ebp - 0x2c]
cmp dword [edi + 4], 0xffffffff
jne 0x408e75
mov ecx, dword [ebp - 0x54]
push eax
push ecx
push 0
push 0
call esi
mov dword [edi + 4], eax
call ebx
cmp eax, 0xb7
setne cl
cmp dword [edi + 4], 0xffffffff
setne al
test al, al
jne 0x408e8a
push 0x52dabc
lea edx, [ebp - 0x54]
push edx
mov dword [ebp - 0x54], 0
call fcn.004b9b55
test cl, cl
jne 0x408e9b
mov eax, dword [ebp - 0x50]
test eax, eax
je 0x408e9b
push eax
call fcn.004099b0
mov ecx, dword [edi + 8]
lea eax, [ebp - 0x58]
push eax
push 1
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
lea eax, [ebp - 0x60]
call fcn.0040a050
mov esi, 0x10
cmp dword [ebp - 0x18], esi
jb 0x408ec9
mov edx, dword [ebp - 0x2c]
push edx
call fcn.004b5907
add esp, 4
mov dword [ebp - 0x18], 0xf
mov dword [ebp - 0x1c], 0
mov byte [ebp - 0x2c], 0
cmp dword [ebp - 0x34], esi
jb 0x408eec
mov eax, dword [ebp - 0x48]
push eax
call fcn.004b5907
add esp, 4
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004b58f8
mov esp, ebp
pop ebp
ret