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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1004a8a0
push 0x1002d1b8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push ecx
mov eax, 0x3020
call fcn.10031380
push ebx
push esi
push edi
xor ebx, ebx
mov byte [ebp - 0x2038], bl
mov edx, 0x3ff
mov ecx, edx
xor eax, eax
lea edi, [ebp - 0x2037]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov byte [ebp - 0x1038], bl
mov ecx, edx
xor eax, eax
lea edi, [ebp - 0x1037]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov byte [ebp - 0x3038], bl
mov ecx, edx
xor eax, eax
lea edi, [ebp - 0x3037]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
cmp dword [ebp + 8], ebx
jl 0x100320bd
cmp dword [ebp + 8], 3
jge 0x100320bd
cmp dword [ebp + 8], 2
jne 0x100320cf
mov esi, 0x10050a38
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
test eax, eax
jle 0x100320cf
mov eax, dword [0x1007165c]
cmp eax, ebx
jne 0x1003208c
push str.user32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
cmp eax, ebx
je 0x100320bd
push str.wsprintfA
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x1007165c], eax
cmp eax, ebx
je 0x100320bd
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push str.Second_Chance_Assertion_Failed:_File__s__Line__d_n
lea ecx, [ebp - 0x1038]
push ecx
call eax
add esp, 0x10
lea eax, [ebp - 0x1038]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
call dword [sym.imp.KERNEL32.dll_DebugBreak]
or eax, 0xffffffff
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
leave
ret
cmp dword [ebp + 0x18], ebx
je 0x10032106
lea eax, [ebp + 0x1c]
push eax
push dword [ebp + 0x18]
push 0xfeb
lea eax, [ebp - 0x3038]
push eax
call fcn.10038fce
add esp, 0x10
test eax, eax
jge 0x10032106
push 0xa
pop ecx
mov esi, str._CrtDbgReport:_String_too_long_or_IO_Error
lea edi, [ebp - 0x3038]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
cmp dword [ebp + 8], 2
jne 0x1003212b
cmp dword [ebp + 0x18], ebx
mov edx, str.Assertion_failed:
jne 0x1003211b
mov edx, str.Assertion_failed_
lea ecx, [ebp - 0x2038]
mov al, byte [edx]
mov byte [ecx], al
inc edx
inc ecx
cmp al, bl
jne 0x10032121
lea eax, [ebp - 0x3038]
mov edx, eax
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x10032133
sub eax, edx
lea edi, [ebp - 0x2038]
dec edi
mov cl, byte [edi + 1]
inc edi
cmp cl, bl
jne 0x10032143
mov ecx, eax
mov esi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp dword [ebp + 8], 2
jne 0x10032196
test byte [0x10050a44], 1
je 0x10032180
lea edi, [ebp - 0x2038]
dec edi
mov al, byte [edi + 1]
inc edi
cmp al, bl
jne 0x10032171
mov esi, 0x1004a7fc
movsw word es:[edi], word [esi]
lea edi, [ebp - 0x2038]
dec edi
mov al, byte [edi + 1]
inc edi
cmp al, bl
jne 0x10032187
mov esi, 0x1004a7f8
movsw word es:[edi], word [esi]
cmp dword [ebp + 0xc], ebx
je 0x100321da
lea eax, [ebp - 0x2038]
push eax
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push str._s__d__:__s
push 0x1000
lea eax, [ebp - 0x1038]
push eax
call fcn.10038f33
add esp, 0x18
test eax, eax
jge 0x100321ef
push 0xa
pop ecx
mov esi, str._CrtDbgReport:_String_too_long_or_IO_Error
lea edi, [ebp - 0x1038]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
jmp 0x100321ef
xor eax, eax
mov cl, byte [ebp + eax - 0x2038]
mov byte [ebp + eax - 0x1038], cl
inc eax
cmp cl, bl
jne 0x100321dc
cmp dword [0x10092054], ebx
je 0x1003225d
push 0xf
call fcn.10033984
pop ecx
mov dword [ebp - 4], ebx
mov esi, dword [0x10092054]
mov dword [ebp - 0x20], esi
cmp esi, ebx
je 0x10032254
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x1038]
push eax
push dword [ebp + 8]
call dword [esi + 0xc]
add esp, 0xc
test eax, eax
je 0x1003224f
cmp dword [ebp + 8], 2
jne 0x10032238
push 0x10050a38
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov esi, dword [ebp - 0x1c]
push 0xffffffffffffffff
lea eax, [ebp - 0x10]
push eax
call fcn.1002d0f3
pop ecx
pop ecx
mov eax, esi
jmp 0x100320c0
mov esi, dword [esi + 4]
jmp 0x10032208
or dword [ebp - 4], 0xffffffff
call fcn.100322fa
mov eax, dword [0x10092044]
cmp eax, ebx
je 0x10032281
lea ecx, [ebp - 0x1c]
push ecx
lea ecx, [ebp - 0x1038]
push ecx
push dword [ebp + 8]
call eax
add esp, 0xc
test eax, eax
jne 0x10032321
mov esi, dword [ebp + 8]
shl esi, 2
test byte [esi + 0x10050a3c], 1
je 0x100322c1
mov edx, dword [esi + 0x10050a48]
cmp edx, 0xffffffff
je 0x100322c1
lea eax, [ebp - 0x1038]
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x100322a4
sub eax, edi
push ebx
lea ecx, [ebp - 0x24]
push ecx
push eax
lea eax, [ebp - 0x1038]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test byte [esi + 0x10050a3c], 2
je 0x100322d7
lea eax, [ebp - 0x1038]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
test byte [esi + 0x10050a3c], 4
je 0x1003233a
cmp dword [ebp + 0x10], ebx
je 0x10032303
push 0xa
lea eax, [ebp - 0x38]
push eax
push dword [ebp + 0x10]
call fcn.10038e09
add esp, 0xc
jmp 0x10032305
xor eax, eax
lea ecx, [ebp - 0x3038]
push ecx
push dword [ebp + 0x14]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.10032352
add esp, 0x14
mov dword [ebp - 0x1c], eax
cmp dword [ebp + 8], 2
jne 0x10032332
push 0x10050a38
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov eax, dword [ebp - 0x1c]
jmp 0x100320c0
cmp dword [ebp + 8], 2
jne 0x1003234b
push 0x10050a38
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
xor eax, eax
jmp 0x100320c0