Function at 0x409840
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x40
mov edi, ecx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x1c], esp
mov dword [ebp - 0x10], 0xffffffff
lea eax, [ebp - 0x18]
mov dword [ebp - 0x14], 0x40d1d0
mov ecx, dword fs:[0]
mov dword [ebp - 0x18], ecx
mov dword fs:[0], eax
sub esp, 0x10
movaps xmm0, xmmword [0x42a7e0]
movups xmmword [esp], xmm0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov esi, eax
mov dword [ebx + 4], eax
test eax, eax
jne 0x4098ab
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x20], eax
mov eax, dword [ebx]
mov ecx, ebx
push 1
call dword [eax]
mov eax, dword [ebp - 0x20]
test eax, eax
jne 0x40996b
sub esp, 0x10
movaps xmm0, xmmword [0x42a7e0]
movups xmmword [esp], xmm0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [edi + 8], eax
mov dword [ebx + 8], eax
cmp dword [edi + 8], 0
jne 0x4098e7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x20], eax
mov eax, dword [ebx]
mov ecx, ebx
push 1
call dword [eax]
mov eax, dword [ebp - 0x20]
test eax, eax
jne 0x4099ce
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x4c], 0
lea ecx, [ebp - 0x4c]
push ecx
push 0
push ebx
push 0x409b00
push eax
push 0
call fcn.00416c92
add esp, 0x18
mov dword [edi + 4], eax
test eax, eax
jne 0x409944
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x20], eax
mov eax, dword [ebx]
mov ecx, ebx
push 1
call dword [eax]
test esi, esi
je 0x40992b
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [edi + 8]
test eax, eax
je 0x409939
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x20]
test eax, eax
jne 0x409a31
test esi, esi
je 0x409958
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x18]
mov dword fs:[0], eax
add esp, 0x40
pop esi
pop edi
pop ebx
pop ebp
ret 8
lea ecx, [ebp - 0x48]
push str.thread.entry_event
push section..data
push eax
call fcn.004017e0
mov dword [ebp - 0x34], vtable.std::exception.0
lea eax, [ebp - 0x30]
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x30], 0
lea ecx, [ebp - 0x44]
push eax
push ecx
call fcn.0040fbcc
add esp, 8
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x38]
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x34], vtable.std::system_error.0
mov dword [ebp - 0x10], 0
lea eax, [ebp - 0x34]
push 0x433384
push eax
call fcn.0040f600
add esp, 8
lea ecx, [ebp - 0x48]
push str.thread.exit_event
push section..data
push eax
call fcn.004017e0
mov dword [ebp - 0x34], vtable.std::exception.0
lea eax, [ebp - 0x30]
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x30], 0
lea ecx, [ebp - 0x44]
push eax
push ecx
call fcn.0040fbcc
add esp, 8
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x38]
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x34], vtable.std::system_error.0
mov dword [ebp - 0x10], 1
lea eax, [ebp - 0x34]
push 0x433384
push eax
call fcn.0040f600
add esp, 8
lea ecx, [ebp - 0x48]
push str.thread
push section..data
push eax
call fcn.004017e0
mov dword [ebp - 0x34], vtable.std::exception.0
lea eax, [ebp - 0x30]
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x30], 0
lea ecx, [ebp - 0x44]
push eax
push ecx
call fcn.0040fbcc
add esp, 8
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x38]
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x34], vtable.std::system_error.0
mov dword [ebp - 0x10], 2
lea eax, [ebp - 0x34]
push 0x433384
push eax
call fcn.0040f600
add esp, 8
nop word cs:[eax + eax]
push ebp
sub esp, 0x18
add ebp, 0xc
mov dword [ebp - 0x48], vtable.std::exception.0
lea eax, [ebp - 0x44]
push eax
call fcn.0040fc2f
add esp, 0x1c
pop ebp
ret