Function at 0x405590
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x593ba9
mov eax, dword fs:[0]
push eax
sub esp, 0x414
mov eax, dword [0x5fedec]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
mov dword [ebp - 0x410], edi
mov dword [ebp - 0x420], 0
mov dword [ebp - 0x41c], 0
mov dword [ebp - 0x418], 0
push 0xff
lea ecx, [ebp - 0x420]
mov dword [ebp - 4], 0
call fcn.00406980
lea eax, [ebp - 0x420]
push eax
call fcn.004059f0
lea eax, [ebp - 0x420]
push eax
call fcn.00402f90
add esp, 8
push str.gCheckMutex
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
push 0x3fc
mov dword [0x60447c], eax
lea eax, [ebp - 0x40c]
push 0
push eax
call fcn.00570bf0
mov eax, dword [0x604474]
add esp, 0xc
mov ebx, dword [eax]
mov dword [eax], eax
mov eax, dword [0x604474]
mov dword [eax + 4], eax
mov dword [0x604478], 0
cmp ebx, dword [0x604474]
je 0x405681
mov esi, dword [ebx]
lea ecx, [ebx + 8]
call fcn.00402810
push ebx
call fcn.0043a6c3
add esp, 4
mov ebx, esi
cmp esi, dword [0x604474]
jne 0x405664
mov ecx, dword [ebp - 0x41c]
mov eax, 0x2aaaaaab
mov ebx, dword [ebp - 0x420]
xor esi, esi
sub ecx, ebx
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
je 0x4056d1
mov edi, eax
push 0
push 0
push ebx
push 0x406090
push 0
push 0
call fcn.0057c33c
mov dword [ebp + esi*4 - 0x40c], eax
add esp, 0x18
inc esi
add ebx, 0x18
cmp esi, edi
jne 0x4056a6
mov edi, dword [ebp - 0x410]
xor ecx, ecx
xor eax, eax
cmp dword [ebp + eax*4 - 0x40c], 0
je 0x4056e8
inc eax
inc ecx
cmp eax, 0xff
jne 0x4056d5
push 0xffffffffffffffff
push 1
lea eax, [ebp - 0x40c]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
push dword [0x60447c]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push dword [0x60447c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [0x604478]
xor esi, esi
test ebx, ebx
je 0x405738
nop
push dword [ebp + esi*4 - 0x40c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [0x604478]
inc esi
cmp esi, ebx
jne 0x405720
mov ecx, dword [edi + 8]
mov eax, 0x4bda12f7
sub ecx, dword [edi]
imul ecx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, ebx
jae 0x40576c
cmp ebx, 0x12f684b
jbe 0x405764
push str.vector_T__too_long
call fcn.0056c645
push ebx
mov ecx, edi
call fcn.00406880
mov eax, dword [0x604474]
mov esi, dword [eax]
cmp esi, eax
je 0x405817
nop dword [eax + eax]
mov ecx, dword [edi + 4]
lea ebx, [esi + 8]
cmp ebx, ecx
jae 0x4057d3
mov eax, dword [edi]
cmp eax, ebx
ja 0x4057d3
sub ebx, eax
mov eax, 0x4bda12f7
imul ebx
sar edx, 6
mov ebx, edx
shr ebx, 0x1f
add ebx, edx
cmp ecx, dword [edi + 8]
jne 0x4057b1
push 1
mov ecx, edi
call fcn.00406a80
mov ecx, dword [edi + 4]
imul eax, ebx, 0xd8
mov dword [ebp - 0x410], ecx
mov dword [ebp - 0x414], ecx
add eax, dword [edi]
mov byte [ebp - 4], 1
test ecx, ecx
je 0x4057fe
push eax
jmp 0x4057f9
cmp ecx, dword [edi + 8]
jne 0x4057e1
push 1
mov ecx, edi
call fcn.00406a80
mov ecx, dword [edi + 4]
mov dword [ebp - 0x410], ecx
mov dword [ebp - 0x414], ecx
mov byte [ebp - 4], 2
test ecx, ecx
je 0x4057fe
push ebx
call fcn.00402420
add dword [edi + 4], 0xd8
mov esi, dword [esi]
mov byte [ebp - 4], 0
cmp esi, dword [0x604474]
jne 0x405780
mov ebx, dword [ebp - 0x420]
test ebx, ebx
je 0x4058aa
push dword [ebp - 0x410]
lea ecx, [ebp - 0x420]
push ecx
push dword [ebp - 0x41c]
push ebx
call fcn.00401fb0
mov ecx, dword [ebp - 0x418]
mov eax, 0x2aaaaaab
sub ecx, ebx
add esp, 0x10
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 0xaaaaaaa
jbe 0x405866
call fcn.00573111
lea eax, [eax + eax*2]
shl eax, 3
cmp eax, 0x1000
jb 0x4058a1
test bl, 0x1f
je 0x40587d
call fcn.00573111
mov eax, dword [ebx - 4]
cmp eax, ebx
jb 0x405889
call fcn.00573111
sub ebx, eax
cmp ebx, 4
jae 0x405895
call fcn.00573111
cmp ebx, 0x23
jbe 0x40589f
call fcn.00573111
mov ebx, eax
push ebx
call fcn.0043a6c3
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0056b237
mov esp, ebp
pop ebp
ret