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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x444
mov eax, dword [0x4a02f0]
xor eax, esp
mov dword [esp + 0x440], eax
push ebx
push esi
mov ebx, ecx
push edi
lea edi, [ebx + 8]
push 0xa
mov ecx, edi
call fcn.0040b740
mov eax, dword [edi]
mov eax, dword [eax + 4]
xor esi, esi
test byte [eax + edi + 0xc], 6
jne 0x40ae70
mov eax, dword [eax + edi + 0x38]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x34]
call eax
cmp eax, 0xffffffff
jne 0x40ae70
mov esi, 4
mov ecx, dword [edi]
mov ecx, dword [ecx + 4]
add ecx, edi
test esi, esi
je 0x40ae91
mov eax, dword [ecx + 0xc]
or eax, esi
cmp dword [ecx + 0x38], 0
jne 0x40ae89
or eax, 4
push 0
push eax
call fcn.00401080
lea edx, [esp + 0x10]
lea ecx, [ebx + 0xc]
push edx
call fcn.00409a10
mov eax, dword [0x56e354]
test eax, eax
je 0x40aee2
mov edx, dword [ebx + 0xa0]
lea ecx, [esp + 0x10]
push ecx
mov ecx, dword [ebx + 0xa8]
push edx
mov edx, dword [ebx + 0xa4]
push ecx
mov ecx, dword [ebx]
push edx
push ecx
call eax
add esp, 0x14
test al, al
je 0x40aee2
cmp dword [esp + 0x24], 0x10
jb 0x40b0d4
mov edx, dword [esp + 0x10]
push edx
jmp 0x40b0cc
mov eax, dword [0x4a2e94]
mov esi, 0x10
cmp eax, 2
je 0x40aefd
cmp eax, 3
je 0x40aefd
cmp dword [ebx], 2
jl 0x40af48
jmp 0x40af12
mov eax, dword [esp + 0x10]
cmp dword [esp + 0x24], esi
jae 0x40af0b
lea eax, [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [esp + 0x10]
cmp dword [esp + 0x24], esi
jae 0x40af20
lea eax, [esp + 0x10]
push eax
push 0x49b6a8
call fcn.00470631
add eax, 0x40
push eax
call fcn.004703fb
add esp, 0xc
call fcn.00470631
add eax, 0x40
push eax
call fcn.004723f8
add esp, 4
push 0
xor edx, edx
call fcn.0040a3c0
mov eax, dword [0x4a2e94]
add esp, 4
test eax, eax
je 0x40aff8
cmp eax, 2
je 0x40aff8
cmp dword [0x56e360], 0
jne 0x40af83
mov eax, dword [0x56e364]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x40af90
mov ecx, dword [0x56e35c]
push ecx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
call fcn.0040a540
test al, al
je 0x40afd3
mov edx, dword [0x56e344]
push 2
push 0
push 0
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esp + 0x10]
cmp dword [esp + 0x24], esi
jae 0x40afba
lea eax, [esp + 0x10]
mov edx, dword [esp + 0x20]
push 0
lea ecx, [esp + 0x10]
push ecx
push edx
push eax
mov eax, dword [0x56e344]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [0x56e360], 0
jne 0x40afeb
mov ecx, dword [0x56e364]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x40aff8
mov edx, dword [0x56e35c]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebx]
cmp eax, 4
jne 0x40b078
mov ecx, dword [esp + 0x20]
mov eax, 0x400
cmp ecx, eax
jae 0x40b00e
mov eax, ecx
mov ecx, dword [esp + 0x10]
cmp dword [esp + 0x24], esi
jae 0x40b01c
lea ecx, [esp + 0x10]
push eax
push ecx
lea eax, [esp + 0x50]
push eax
call fcn.0046d7f0
lea ecx, [esp + 0x54]
add esp, 0xc
push ecx
call fcn.00413c60
add esp, 4
call dword [sym.imp.KERNEL32.dll_IsDebuggerPresent]
test eax, eax
je 0x40b047
call fcn.0040a060
cmp dword [0x56e34c], 0
je 0x40b042
lea edx, [esp + 0x2c]
push edx
lea ecx, [ebx + 0xc]
call fcn.00409a10
lea eax, [esp + 0x2c]
push eax
call dword [0x56e34c]
add esp, 4
cmp dword [esp + 0x40], esi
jb 0x40b0c1
mov ecx, dword [esp + 0x2c]
push ecx
jmp 0x40b0b9
cmp eax, 3
jne 0x40b0c1
cmp dword [0x56e350], 0
lea edx, [esp + 0x2c]
lea ecx, [ebx + 0xc]
push edx
je 0x40b0a0
call fcn.00409a10
lea eax, [esp + 0x2c]
push eax
call dword [0x56e350]
jmp 0x40b068
call fcn.00409a10
lea ecx, [esp + 0x2c]
call fcn.0040ac10
cmp dword [esp + 0x40], esi
jb 0x40b0c1
mov eax, dword [esp + 0x2c]
push eax
call fcn.0046d64b
add esp, 4
cmp dword [esp + 0x24], esi
jb 0x40b0d4
mov ecx, dword [esp + 0x10]
push ecx
call fcn.0046d64b
add esp, 4
mov edx, dword [ebx + 0xac]
push edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [edi]
mov ecx, dword [eax + 4]
lea esi, [edi + 0x50]
mov dword [ecx + esi - 0x50], 0x49b574
lea ecx, [esi - 0x4c]
call fcn.00406d30
mov edx, dword [esi - 0x50]
mov eax, dword [edx + 4]
mov dword [eax + esi - 0x50], 0x49a234
push esi
mov dword [esi], vtable.std::ios_base.0
call fcn.0048d39f
mov ecx, dword [esp + 0x450]
add esp, 4
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0046e0cd
mov esp, ebp
pop ebp
ret