Function at 0x40f5a0
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
mov dword [ebp - 8], 1
movzx eax, byte [ebp + 0xc]
test eax, eax
jne 0x40f5d5
imul ecx, dword [ebp + 8], 0x24
cmp dword [ecx + 0x478b10], 0xffffffff
je 0x40f5d5
imul edx, dword [ebp + 8], 0x24
mov eax, dword [edx + 0x478b10]
push eax
call fcn.0041d380
add esp, 4
imul ecx, dword [ebp + 8], 0x24
cmp dword [ecx + 0x478b24], 0
je 0x40f601
imul edx, dword [ebp + 8], 0x24
mov eax, dword [edx + 0x478b24]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
imul ecx, dword [ebp + 8], 0x24
mov dword [ecx + 0x478b24], 0
imul edx, dword [ebp + 8], 0x24
cmp dword [edx + 0x478b14], 0xffffffff
je 0x40f62d
imul eax, dword [ebp + 8], 0x24
mov ecx, dword [eax + 0x478b14]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
imul edx, dword [ebp + 8], 0x24
mov dword [edx + 0x478b14], 0xffffffff
imul eax, dword [ebp + 8], 0x24
cmp dword [eax + 0x478b18], 0xffffffff
je 0x40f659
imul ecx, dword [ebp + 8], 0x24
mov edx, dword [ecx + 0x478b18]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
imul eax, dword [ebp + 8], 0x24
mov dword [eax + 0x478b18], 0xffffffff
imul ecx, dword [ebp + 8], 0x24
cmp dword [ecx + 0x478b1c], 0xffffffff
je 0x40f685
imul edx, dword [ebp + 8], 0x24
mov eax, dword [edx + 0x478b1c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
imul ecx, dword [ebp + 8], 0x24
mov dword [ecx + 0x478b1c], 0xffffffff
imul edx, dword [ebp + 8], 0x24
cmp dword [edx + 0x478b20], 0xffffffff
je 0x40f6b1
imul eax, dword [ebp + 8], 0x24
mov ecx, dword [eax + 0x478b20]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
imul edx, dword [ebp + 8], 0x24
mov dword [edx + 0x478b20], 0xffffffff
movzx eax, byte [ebp + 0xc]
test eax, eax
jne 0x40f700
movzx ecx, byte [ebp + 0x10]
test ecx, ecx
jne 0x40f700
imul edx, dword [ebp + 8], 0x24
cmp dword [edx + 0x478b28], 0
je 0x40f700
push 0
imul eax, dword [ebp + 8], 0x24
mov ecx, dword [eax + 0x478b28]
push ecx
call dword [sym.imp.KERNEL32.dll_TerminateThread]
imul edx, dword [ebp + 8], 0x24
mov eax, dword [edx + 0x478b28]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
imul ecx, dword [ebp + 8], 0x24
mov dword [ecx + 0x478b28], 0
movzx edx, byte [ebp + 0xc]
test edx, edx
jne 0x40f728
imul eax, dword [ebp + 8], 0x24
cmp dword [eax + 0x478b10], 0xffffffff
je 0x40f728
imul ecx, dword [ebp + 8], 0x24
mov edx, dword [ecx + 0x478b10]
push edx
call fcn.00407fe0
add esp, 4
imul eax, dword [ebp + 8], 0x24
mov dword [eax + 0x478b2c], 0
imul ecx, dword [ebp + 8], 0x24
mov dword [ecx + 0x478b30], 1
mov edx, dword [ebp + 8]
push edx
call fcn.0040fde0
add esp, 4
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x40f7b6
movzx eax, byte [ebp + 0xc]
test eax, eax
je 0x40f7b6
movzx ecx, byte [ebp + 0x10]
test ecx, ecx
jne 0x40f7b6
mov dword [ebp - 0xc], 0
mov dword [ebp - 4], 0
lea edx, [ebp - 0xc]
push edx
push 0xe
push 0x434f20
mov eax, dword [ebp + 8]
push eax
call fcn.0040fe10
add esp, 0x10
mov dword [ebp - 4], eax
push 0x10
lea ecx, [ebp - 0xc]
push ecx
lea edx, [ebp - 4]
push edx
call fcn.0040fea0
add esp, 0xc
mov eax, dword [ebp - 4]
push eax
call fcn.0040fd00
add esp, 4
mov dword [ebp - 4], 0
cmp dword [ebp - 8], 0
jne 0x40f7c5
mov dword [ebp - 0x10], 1
jmp 0x40f7cc
mov dword [ebp - 0x10], 0
mov eax, dword [ebp - 0x10]
mov esp, ebp
pop ebp
ret