Function at 0x40c040
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x45de8b
mov eax, dword fs:[0]
push eax
sub esp, 0x40
push ebx
push esi
push edi
mov eax, dword [0x474cb0]
xor eax, esp
push eax
lea eax, [esp + 0x50]
mov dword fs:[0], eax
lea esi, [esp + 0x2c]
call fcn.00413390
mov dword [esp + 0x58], 0
mov edi, dword [ebp + 8]
mov eax, dword [edi + 0xc]
push eax
push 0x469be0
mov ebx, esi
call fcn.00413420
mov esi, dword [edi + 0x24]
mov ecx, 0x469bf4
call fcn.004133b0
push 0xec
call fcn.00446372
mov esi, eax
add esp, 4
mov dword [esp + 0x20], esi
mov byte [esp + 0x58], 1
test esi, esi
je 0x40c0ed
sub esp, 0x10
mov ecx, esp
mov dword [esp + 0x2c], esp
push ecx
mov edx, ebx
push edx
call fcn.00413630
mov byte [esp + 0x68], 2
mov eax, dword [edi + 0x14c]
push 0
push edi
push eax
push esi
mov byte [esp + 0x78], 1
call fcn.00413760
mov ebx, eax
mov dword [esp + 0x10], ebx
jmp 0x40c0f9
mov dword [esp + 0x10], 0
mov ebx, dword [esp + 0x10]
mov byte [esp + 0x58], 0
mov edi, ebx
mov dword [esp + 0x14], ebx
call fcn.00414680
mov esi, dword [ebp + 8]
mov ecx, 0xd
mov dword [ebx + 0x14], ecx
mov byte [ebx + 0x58], 0
mov eax, 0x2710
mov dword [ebx + 0x24], eax
mov dword [ebx + 0x28], eax
mov dword [esi + 4], ecx
add esi, 0x164
cmp dword [esi + 0x78], 0
mov dword [esp + 0x1c], esi
jne 0x40c13e
lea esi, [ecx - 0xf]
jmp 0x40c256
cmp dword [ebx + 0x10], 0
je 0x40c14e
mov esi, 0xfffffffd
jmp 0x40c256
cmp dword [esi + 0x60], 0
lea edi, [esi + 0x60]
mov dword [esp + 0x20], edi
jne 0x40c165
mov esi, 0xfffffffc
jmp 0x40c256
push ebx
push esi
call fcn.00410f50
test eax, eax
je 0x40c17a
mov esi, 0xfffffffb
jmp 0x40c256
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
inc dword [esi + 4]
mov eax, dword [esi + 4]
mov dword [ebx + 0x10], eax
mov eax, dword [esi + 0x1c]
mov edx, dword [eax + 4]
lea edi, [esi + 8]
lea ecx, [esp + 0x14]
push ecx
push edx
push eax
mov dword [esp + 0x34], eax
call fcn.00411e70
mov ecx, edi
mov dword [esp + 0x14], eax
call fcn.00411f20
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x28]
mov dword [ecx + 4], eax
mov ecx, dword [eax + 4]
mov dword [ecx], eax
cmp dword [esi + 0x20], 0x64
jbe 0x40c204
mov eax, dword [edi + 0x14]
mov edx, dword [eax]
mov eax, dword [edi]
lea esi, [esp + 0x14]
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], eax
call fcn.00411ac0
mov ecx, dword [eax]
test ecx, ecx
je 0x40c1ea
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
mov eax, dword [edi + 0x14]
mov eax, dword [eax]
mov ecx, dword [edi]
push eax
push ecx
lea ebx, [esp + 0x2c]
call fcn.00411940
mov esi, dword [esp + 0x1c]
mov ebx, dword [esp + 0x10]
mov ecx, dword [esp + 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [ebx]
mov eax, dword [edx + 0xc]
push 0
mov ecx, ebx
call eax
mov ecx, dword [esi + 0x78]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
cmp dword [esi + 0x80], 0xffffffff
jne 0x40c253
push 0
push 0
push esi
push 0x410a50
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [esi + 0x80], eax
cmp eax, 0xffffffff
jne 0x40c253
mov esi, 0xfffffff7
jmp 0x40c256
mov esi, dword [esi + 4]
mov dword [esp + 0x58], 0xffffffff
lea eax, [esp + 0x2c]
call fcn.004133a0
mov eax, esi
mov ecx, dword [esp + 0x50]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4