Function at 0x40cc70
Capabilities:
Print debug messages
Write file on windows

Disassembly:
sub esp, 0x40
mov eax, dword [0x4fa5ac]
xor eax, esp
mov dword [esp + 0x3c], eax
push ebx
push esi
mov esi, ecx
push edi
lea edi, [esi + 4]
push 0xa
mov ecx, edi
call fcn.0040c920
mov ecx, edi
call fcn.004309f0
lea eax, [esp + 0x2c]
lea ebx, [esi + 8]
push eax
mov ecx, ebx
call fcn.0040a280
mov eax, dword [0x4fc788]
test eax, eax
je 0x40cce9
mov edx, dword [esi + 0x84]
lea ecx, [esp + 0x2c]
push ecx
mov ecx, dword [esi + 0x8c]
push edx
mov edx, dword [esi + 0x88]
push ecx
mov ecx, dword [esi]
push edx
push ecx
call eax
add esp, 0x14
test al, al
je 0x40cce9
cmp dword [esp + 0x44], 0x10
jb 0x40ce8d
mov edx, dword [esp + 0x30]
push edx
jmp 0x40ce85
mov eax, dword [0x4fa028]
push ebp
mov ebp, 0x10
cmp eax, 2
je 0x40cd05
cmp eax, 3
je 0x40cd05
cmp dword [esi], 2
jl 0x40cd4d
jmp 0x40cd1a
mov eax, dword [esp + 0x34]
cmp dword [esp + 0x48], ebp
jae 0x40cd13
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [esp + 0x34]
cmp dword [esp + 0x48], ebp
jae 0x40cd28
lea eax, [esp + 0x34]
push eax
push 0x4a69dc
call fcn.0043b2a6
add eax, 0x40
push eax
call fcn.0043b18a
call fcn.0043b2a6
add eax, 0x40
push eax
call fcn.0043b12e
add esp, 0x10
push 0
push 0
call fcn.0040a960
mov eax, dword [0x4fa028]
add esp, 8
test eax, eax
je 0x40cdf9
cmp eax, 2
je 0x40cdf9
cmp dword [0x4fc794], 0
jne 0x40cd88
mov eax, dword [0x4fc798]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x40cd93
mov ecx, dword [0x4fc790]
call fcn.00414390
call fcn.0040ab10
test al, al
je 0x40cdd7
mov ecx, dword [0x4fc778]
push 2
push 0
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esp + 0x34]
cmp dword [esp + 0x48], ebp
jae 0x40cdbd
lea eax, [esp + 0x34]
mov ecx, dword [esp + 0x44]
push 0
lea edx, [esp + 0x30]
push edx
mov edx, dword [0x4fc778]
push ecx
push eax
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [0x4fc794], 0
jne 0x40cdee
mov eax, dword [0x4fc798]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x40cdf9
mov ecx, dword [0x4fc790]
call fcn.004143a0
mov eax, dword [esi]
cmp eax, 4
jne 0x40ce32
call fcn.00414730
test al, al
je 0x40ce10
call fcn.00414740
jmp 0x40ce79
cmp dword [0x4fc780], 0
je 0x40ce09
lea ecx, [esp + 0x10]
push ecx
mov ecx, ebx
call fcn.0040a280
lea edx, [esp + 0x10]
push edx
call dword [0x4fc780]
jmp 0x40ce6d
cmp eax, 3
jne 0x40ce79
cmp dword [0x4fc784], 0
mov ecx, ebx
je 0x40ce59
lea eax, [esp + 0x10]
push eax
call fcn.0040a280
lea ecx, [esp + 0x10]
push ecx
call dword [0x4fc784]
jmp 0x40ce6d
lea edx, [esp + 0x10]
push edx
call fcn.0040a280
lea eax, [esp + 0x10]
push eax
call fcn.0040a110
add esp, 4
lea ecx, [esp + 0x10]
call fcn.004018f0
cmp dword [esp + 0x48], ebp
pop ebp
jb 0x40ce8d
mov ecx, dword [esp + 0x30]
push ecx
call fcn.004390ba
add esp, 4
mov edx, dword [esi + 0x90]
push edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [edi]
mov ecx, dword [eax + 4]
lea esi, [edi + 0x4c]
mov dword [ecx + esi - 0x4c], 0x4a68e0
lea edi, [esi - 0x48]
mov ecx, edi
mov dword [edi], 0x4a6874
call fcn.0042e200
mov ecx, edi
call fcn.004090c0
mov edx, dword [edi - 4]
mov eax, dword [edx + 4]
mov dword [eax + edi - 4], 0x4bbfdc
push esi
mov dword [esi], vtable.std::ios_base.0
call fcn.00438aad
mov ecx, dword [esp + 0x4c]
add esp, 4
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00439589
add esp, 0x40
ret