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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x3038
call fcn.00415af0
mov eax, dword [0x45fae4]
mov dword [ebp - 0xc], eax
push edi
mov byte [ebp - 0x2010], 0
mov ecx, 0x3ff
xor eax, eax
lea edi, [ebp - 0x200f]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov byte [ebp - 0x1010], 0
mov ecx, 0x3ff
xor eax, eax
lea edi, [ebp - 0x100f]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov byte [ebp - 0x3010], 0
mov ecx, 0x3ff
xor eax, eax
lea edi, [ebp - 0x300f]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp + 0x1c]
mov dword [ebp - 4], eax
cmp dword [ebp + 8], 0
jl 0x40f843
cmp dword [ebp + 8], 3
jl 0x40f84b
or eax, 0xffffffff
jmp 0x40fbb2
cmp dword [ebp + 8], 2
jne 0x40f8f5
push 0x45fae8
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
test eax, eax
jle 0x40f8f5
cmp dword [0x46b0d4], 0
jne 0x40f8b3
push str.user32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 0x3014], eax
cmp dword [ebp - 0x3014], 0
je 0x40f8ab
push str.wsprintfA
mov ecx, dword [ebp - 0x3014]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x46b0d4], eax
cmp dword [0x46b0d4], 0
jne 0x40f8b3
or eax, 0xffffffff
jmp 0x40fbb2
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp + 0xc]
push eax
push str.Second_Chance_Assertion_Failed:_File__s__Line__d_n
lea ecx, [ebp - 0x1010]
push ecx
call dword [0x46b0d4]
add esp, 0x10
lea edx, [ebp - 0x1010]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x45fae8
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
call fcn.0040f4e0
or eax, 0xffffffff
jmp 0x40fbb2
cmp dword [ebp + 0x18], 0
je 0x40f92f
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp + 0x18]
push ecx
push 0xfeb
lea edx, [ebp - 0x3010]
push edx
call fcn.00415b30
add esp, 0x10
test eax, eax
jge 0x40f92f
push str._CrtDbgReport:_String_too_long_or_IO_Error
lea eax, [ebp - 0x3010]
push eax
call fcn.004189c0
add esp, 8
cmp dword [ebp + 8], 2
jne 0x40f967
cmp dword [ebp + 0x18], 0
je 0x40f947
mov dword [ebp - 0x3034], str.Assertion_failed:
jmp 0x40f951
mov dword [ebp - 0x3034], str.Assertion_failed_
mov ecx, dword [ebp - 0x3034]
push ecx
lea edx, [ebp - 0x2010]
push edx
call fcn.004189c0
add esp, 8
lea eax, [ebp - 0x3010]
push eax
lea ecx, [ebp - 0x2010]
push ecx
call fcn.004189d0
add esp, 8
cmp dword [ebp + 8], 2
jne 0x40f9ba
mov edx, dword [ebp + 8]
mov eax, dword [edx*4 + 0x45faec]
and eax, 1
je 0x40f9a6
push 0x42b6b4
lea ecx, [ebp - 0x2010]
push ecx
call fcn.004189d0
add esp, 8
push 0x42b6b0
lea edx, [ebp - 0x2010]
push edx
call fcn.004189d0
add esp, 8
cmp dword [ebp + 0xc], 0
je 0x40fa02
lea eax, [ebp - 0x2010]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
push str._s__d__:__s
push 0x1000
lea eax, [ebp - 0x1010]
push eax
call fcn.00415a00
add esp, 0x18
test eax, eax
jge 0x40fa00
push str._CrtDbgReport:_String_too_long_or_IO_Error
lea ecx, [ebp - 0x1010]
push ecx
call fcn.004189c0
add esp, 8
jmp 0x40fa18
lea edx, [ebp - 0x2010]
push edx
lea eax, [ebp - 0x1010]
push eax
call fcn.004189c0
add esp, 8
cmp dword [0x46c804], 0
je 0x40fa81
mov ecx, dword [0x46c804]
mov dword [ebp - 0x3018], ecx
jmp 0x40fa3e
mov edx, dword [ebp - 0x3018]
mov eax, dword [edx + 4]
mov dword [ebp - 0x3018], eax
cmp dword [ebp - 0x3018], 0
je 0x40fa81
lea ecx, [ebp - 8]
push ecx
lea edx, [ebp - 0x1010]
push edx
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x3018]
call dword [ecx + 0xc]
add esp, 0xc
test eax, eax
je 0x40fa7f
cmp dword [ebp + 8], 2
jne 0x40fa77
push 0x45fae8
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov eax, dword [ebp - 8]
jmp 0x40fbb2
jmp 0x40fa2f
cmp dword [0x46c800], 0
je 0x40fabf
lea edx, [ebp - 8]
push edx
lea eax, [ebp - 0x1010]
push eax
mov ecx, dword [ebp + 8]
push ecx
call dword [0x46c800]
add esp, 0xc
test eax, eax
je 0x40fabf
cmp dword [ebp + 8], 2
jne 0x40fab7
push 0x45fae8
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov eax, dword [ebp - 8]
jmp 0x40fbb2
mov edx, dword [ebp + 8]
mov eax, dword [edx*4 + 0x45faec]
and eax, 1
je 0x40fb0c
mov ecx, dword [ebp + 8]
cmp dword [ecx*4 + 0x45faf8], 0xffffffff
je 0x40fb0c
push 0
lea edx, [ebp - 0x301c]
push edx
lea eax, [ebp - 0x1010]
push eax
call fcn.0040cc30
add esp, 4
push eax
lea ecx, [ebp - 0x1010]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx*4 + 0x45faf8]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx*4 + 0x45faec]
and edx, 2
je 0x40fb28
lea eax, [ebp - 0x1010]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx*4 + 0x45faec]
and edx, 4
je 0x40fb9f
cmp dword [ebp + 0x10], 0
je 0x40fb5a
push 0xa
lea eax, [ebp - 0x3030]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.004186d0
add esp, 0xc
mov dword [ebp - 0x3038], eax
jmp 0x40fb64
mov dword [ebp - 0x3038], 0
lea edx, [ebp - 0x3010]
push edx
mov eax, dword [ebp + 0x14]
push eax
mov ecx, dword [ebp - 0x3038]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.0040fbc0
add esp, 0x14
mov dword [ebp - 8], eax
cmp dword [ebp + 8], 2
jne 0x40fb9a
push 0x45fae8
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov eax, dword [ebp - 8]
jmp 0x40fbb2
cmp dword [ebp + 8], 2
jne 0x40fbb0
push 0x45fae8
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
xor eax, eax
mov ecx, dword [ebp - 0xc]
call fcn.0040f460
pop edi
mov esp, ebp
pop ebp
ret