Function at 0x436fb0
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
mov dword [ebp - 8], esi
mov dword [ebp - 4], edi
mov esi, dword [ebp + 8]
cmp dword [ebp + 0xc], 5
jne 0x437011
cmp dword [0x5108e0], 0
je 0x43728f
push 0x5108d8
call fcn.0042b660
add esp, 4
mov edx, dword [0x5108e0]
xor eax, eax
cmp dword [edx + eax*4], 0xffffffff
jne 0x437241
inc eax
cmp eax, 0x10
jl 0x436fe7
mov dword [0x5108d8], 0
mov eax, 0x226
mov dword [esi], 0xffff7fff
jmp 0x437237
push 0x5108d8
call fcn.0042b660
add esp, 4
cmp dword [0x5108dc], 0
je 0x437059
mov eax, dword [0x5093a0]
cmp eax, 0xffff8000
mov dword [esi], eax
jle 0x437040
dec eax
mov dword [0x5093a0], eax
jmp 0x43722b
mov dword [0x5093a0], 0xffffff7f
mov dword [0x5108dc], 0
jmp 0x43722b
mov edi, dword [0x5093a0]
cmp edi, 0xffffc000
jge 0x437076
mov dword [0x5093a0], 0xffffff7f
mov edi, 0xffffff7f
mov dword [ebp - 0xc], ebx
push edi
call fcn.0043f4c0
add esp, 4
test eax, eax
je 0x43721b
cmp edi, 0xfffffffa
lea ecx, [edi + 5]
jg 0x437094
mov ecx, edi
mov eax, 0xfb93e673
mul ecx
shr edx, 9
imul ebx, edx, 0x209
sub ecx, ebx
mov edx, dword [0x509380]
cmp edx, 2
lea eax, [ecx + 0x69]
mov dword [ebp - 0x10], eax
jge 0x4370f2
lea ebx, [ecx*4 + 0x1a4]
lea ecx, [ebx*8]
sub ecx, ebx
mov ebx, dword [ecx + 0x50c464]
test ebx, ebx
jne 0x43719a
mov dword [ecx + 0x50c464], 1
mov ecx, eax
shl ecx, 5
lea ebx, [eax*4]
sub ecx, ebx
jmp 0x43719a
lea eax, [ecx*4 + 0x1a4]
lea edx, [eax*8]
sub edx, eax
lea ecx, [edx + 0x50c464]
push ecx
call fcn.0042b660
add esp, 4
test eax, eax
jne 0x437183
mov edx, dword [ebp - 0x10]
mov ecx, edx
shl ecx, 5
lea eax, [edx*4]
sub ecx, eax
cmp dword [ecx + 0x50c460], 0
je 0x43732e
mov ecx, edx
lea eax, [edx*4]
shl ecx, 5
sub ecx, eax
mov dword [ecx + 0x50c464], 0
push 0xffffffffffffffff
lea eax, [edx*4]
shl edx, 5
sub edx, eax
push dword [edx + 0x50c460]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [ebp - 0x10]
lea eax, [edx*4]
shl edx, 5
sub edx, eax
lea ecx, [edx + 0x50c464]
push ecx
call fcn.0042b660
add esp, 4
mov eax, dword [ebp - 0x10]
mov ecx, eax
shl ecx, 5
mov edx, dword [0x509380]
lea ebx, [eax*4]
sub ecx, ebx
cmp edx, 1
je 0x437303
mov ebx, dword [ecx + 0x50c478]
test ebx, ebx
je 0x4371bc
cmp edi, dword [ebx + 0x100]
jbe 0x4371bc
mov ebx, dword [ebx + 0x28]
test ebx, ebx
jne 0x4371ad
cmp edx, 1
je 0x4372e1
lea ecx, [eax*4]
shl eax, 5
sub eax, ecx
cmp edx, 2
jge 0x4371e2
mov dword [eax + 0x50c464], 0
jmp 0x437207
mov edx, dword [ebp - 0x10]
mov dword [eax + 0x50c464], 0
lea eax, [edx*4]
shl edx, 5
sub edx, eax
push dword [edx + 0x50c460]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
test ebx, ebx
je 0x4372d0
cmp edi, dword [ebx + 0x100]
jne 0x4372d0
dec edi
cmp edi, 0xffff8000
jg 0x437079
mov ebx, dword [ebp - 0xc]
mov dword [0x5108d8], 0
xor eax, eax
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
mov esp, ebp
pop ebp
ret
mov edx, dword [edx + eax*4]
xor ecx, ecx
mov edi, edx
shl edi, cl
test edi, 0x80000000
je 0x43725d
inc ecx
cmp ecx, 0x20
jl 0x437246
jmp 0x436ff7
mov edi, eax
neg ecx
shl edi, 5
neg edi
lea edi, [edi + ecx - 1]
mov dword [esi], edi
add ecx, 0x1f
mov esi, 1
shl esi, cl
mov ecx, dword [0x5108e0]
or edx, esi
mov dword [ecx + eax*4], edx
xor eax, eax
mov dword [0x5108d8], 0
jmp 0x437237
push 0x5108e0
push 0
push 0x40
call fcn.0042a770
add esp, 0xc
test eax, eax
je 0x4372b5
mov esi, dword [ebp - 8]
mov dword [0x5108d8], 0
mov esp, ebp
pop ebp
ret
mov eax, dword [0x5108e0]
mov dword [eax], 0
mov eax, dword [0x5108e0]
mov dword [eax], 0xf8000000
jmp 0x436fd2
mov ebx, dword [ebp - 0xc]
mov dword [esi], edi
dec edi
mov dword [0x5093a0], edi
jmp 0x43722b
push dword [ecx + 0x50c474]
push dword [ecx + 0x50c470]
call fcn.0042b640
add esp, 8
mov eax, dword [ebp - 0x10]
mov edx, dword [0x509380]
jmp 0x4371c5
lea eax, [ecx + 0x50c470]
push eax
call fcn.0042b610
add esp, 4
mov eax, dword [ebp - 0x10]
mov ecx, eax
shl ecx, 5
mov edx, dword [0x509380]
lea ebx, [eax*4]
sub ecx, ebx
jmp 0x4371a3
xor eax, eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov edx, dword [ebp - 0x10]
mov ebx, edx
shl ebx, 5
lea ecx, [edx*4]
sub ebx, ecx
mov dword [ebx + 0x50c460], eax
mov dword [ebx + 0x50c464], 0
jmp 0x43714b