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

Disassembly:
push ebp
push esp
pop ebp
mov eax, 0x302c
call fcn.0040acb0
push edi
mov byte [ebp - 0x3008], 0
mov ecx, 0x3ff
xor eax, eax
lea edi, [ebp - 0x3007]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov byte [ebp - 0x2008], 0
mov ecx, 0x3ff
xor eax, eax
lea edi, [ebp - 0x2007]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov byte [ebp - 0x1000], 0
mov ecx, 0x3ff
sub eax, eax
lea edi, [ebp - 0xfff]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp + 0x1c]
mov dword [ebp - 0x1004], eax
cmp dword [ebp + 8], 0
jl 0x406f1e
cmp dword [ebp + 8], 3
jl 0x406f26
or eax, 0xffffffff
jmp 0x40723b
cmp dword [ebp + 8], 2
jne 0x406fd0
push 0x427a98
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
or eax, eax
jle 0x406fd0
cmp dword [0x4386b4], 0
jne 0x406f8e
push str.user32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 0x300c], eax
cmp dword [ebp - 0x300c], 0
je 0x406f86
push str.wsprintfA
mov ecx, dword [ebp - 0x300c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x4386b4], eax
cmp dword [0x4386b4], 0
jne 0x406f8e
or eax, 0xffffffff
jmp 0x40723b
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 - 0x2008]
push ecx
call dword [0x4386b4]
add esp, 0x10
lea edx, [ebp - 0x2008]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x427a98
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
call fcn.00406da0
or eax, 0xffffffff
jmp 0x40723b
cmp dword [ebp + 0x18], 0
je 0x40700d
mov eax, dword [ebp - 0x1004]
push eax
mov ecx, dword [ebp + 0x18]
push ecx
push 0xfed
lea edx, [ebp - 0x1000]
push edx
call fcn.0040abb0
add esp, 0x10
or eax, eax
jge 0x40700d
push str._CrtDbgReport:_String_too_long_or_IO_Error
lea eax, [ebp - 0x1000]
push eax
call fcn.00406820
add esp, 8
cmp dword [ebp + 8], 2
jne 0x407045
cmp dword [ebp + 0x18], 0
je 0x407025
mov dword [ebp - 0x3028], str.Assertion_failed:
jmp 0x40702f
mov dword [ebp - 0x3028], str.Assertion_failed_
mov ecx, dword [ebp - 0x3028]
push ecx
lea edx, [ebp - 0x3008]
push edx
call fcn.00406820
add esp, 8
lea eax, [ebp - 0x1000]
push eax
lea ecx, [ebp - 0x3008]
push ecx
call fcn.00406830
add esp, 8
cmp dword [ebp + 8], 2
jne 0x40709a
mov edx, dword [ebp + 8]
mov eax, dword [edx*4 + 0x427a9c]
and eax, 1
test eax, eax
je 0x407086
push 0x4257f0
lea ecx, [ebp - 0x3008]
push ecx
call fcn.00406830
add esp, 8
push 0x4257ec
lea edx, [ebp - 0x3008]
push edx
call fcn.00406830
add esp, 8
cmp dword [ebp + 0xc], 0
je 0x4070e2
lea eax, [ebp - 0x3008]
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 - 0x2008]
push eax
call fcn.0040aab0
add esp, 0x18
or eax, eax
jge 0x4070e0
push str._CrtDbgReport:_String_too_long_or_IO_Error
lea ecx, [ebp - 0x2008]
push ecx
call fcn.00406820
add esp, 8
jmp 0x4070f8
lea edx, [ebp - 0x3008]
push edx
lea eax, [ebp - 0x2008]
push eax
call fcn.00406820
add esp, 8
cmp dword [0x439fac], 0
je 0x40713c
lea ecx, [ebp - 0x1008]
push ecx
lea edx, [ebp - 0x2008]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [0x439fac]
add esp, 0xc
test eax, eax
je 0x40713c
cmp dword [ebp + 8], 2
jne 0x407131
push 0x427a98
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov eax, dword [ebp - 0x1008]
jmp 0x40723b
mov ecx, dword [ebp + 8]
mov edx, dword [ecx*4 + 0x427a9c]
and edx, 1
test edx, edx
je 0x40718b
mov eax, dword [ebp + 8]
cmp dword [eax*4 + 0x427aa8], 0xffffffff
je 0x40718b
push 0
lea ecx, [ebp - 0x3010]
push ecx
lea edx, [ebp - 0x2008]
push edx
call fcn.00406330
add esp, 4
push eax
lea eax, [ebp - 0x2008]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx*4 + 0x427aa8]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp + 8]
mov ecx, dword [eax*4 + 0x427a9c]
and ecx, 2
test ecx, ecx
je 0x4071a9
lea edx, [ebp - 0x2008]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [ebp + 8]
mov ecx, dword [eax*4 + 0x427a9c]
and ecx, 4
or ecx, ecx
je 0x407228
cmp dword [ebp + 0x10], 0
je 0x4071dd
push 0xa
lea edx, [ebp - 0x3024]
push edx
mov eax, dword [ebp + 0x10]
push eax
call fcn.0040a7c0
add esp, 0xc
mov dword [ebp - 0x302c], eax
jmp 0x4071e7
mov dword [ebp - 0x302c], 0
lea ecx, [ebp - 0x1000]
push ecx
mov edx, dword [ebp + 0x14]
push edx
mov eax, dword [ebp - 0x302c]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.00407240
add esp, 0x14
mov dword [ebp - 0x1008], eax
cmp dword [ebp + 8], 2
jne 0x407220
push 0x427a98
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov eax, dword [ebp - 0x1008]
jmp 0x40723b
cmp dword [ebp + 8], 2
jne 0x407239
push 0x427a98
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
xor eax, eax
pop edi
push ebp
pop esp
pop ebp
ret