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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x4c
mov edi, ecx
call fcn.00562f95
mov eax, dword [eax]
mov dword [ebp - 0x3c], eax
call fcn.00562f95
xor esi, esi
mov dword [eax], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x38], eax
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [edi + 0x3c]
test al, 0x10
mov dword [ebp - 0x10], edi
je 0x40ad06
mov eax, dword [edi + 0x24]
mov ebx, dword [edi + 0x38]
cmp ebx, eax
jae 0x40a9db
mov dword [edi + 0x38], eax
mov ebx, eax
mov esi, dword [edi + 0x20]
sub ebx, esi
js 0x40acc1
cmp ebx, 0x7ffffff8
jae 0x40acd0
cmp ebx, 0xa
ja 0x40ac55
lea eax, [ebp - 0x20]
mov byte [eax + 0xb], bl
lea edi, [eax + ebx]
cmp eax, esi
ja 0x40aa10
cmp edi, esi
ja 0x40acba
test ebx, ebx
je 0x40aa1f
push ebx
push esi
push eax
call fcn.00567460
add esp, 0xc
mov eax, dword [ebp - 0x10]
lea esi, [eax + 8]
mov byte [edi], 0
movsx eax, byte [ebp - 0x15]
test eax, eax
jns 0x40aa33
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x30], eax
jns 0x40aa43
push dword [ebp - 0x20]
call fcn.00562f60
add esp, 4
mov eax, dword [esi]
mov eax, dword [eax + 4]
mov ebx, dword [esi + eax + 0x1c]
cmp ebx, 0x648d98
jne 0x40acd8
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x54], 0x649444
mov eax, dword [0x649444]
cmp eax, 0xffffffff
jne 0x40ad80
mov eax, dword [0x649448]
lea edx, [eax - 1]
mov ecx, dword [ebx + 8]
mov esi, dword [ebx + 0xc]
sub esi, ecx
sar esi, 2
cmp esi, edx
jbe 0x40acb5
mov edi, dword [ecx + eax*4 - 4]
test edi, edi
je 0x40acb5
mov eax, dword [edi]
mov esi, dword [eax + 0x1c]
mov ecx, esi
call dword [0x63e19c]
mov ecx, edi
push 0xa
call esi
cmp ebx, 0x648d98
jne 0x40ad54
movsx eax, al
mov esi, dword [ebp - 0x34]
mov ecx, esi
push eax
call fcn.0040b010
mov ecx, esi
call fcn.0040aec0
xor eax, eax
dec eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov ecx, dword [ebp - 0x10]
mov eax, dword [ecx + 0x3c]
test al, 0x10
je 0x40ad21
mov eax, dword [ecx + 0x24]
mov ebx, dword [ecx + 0x38]
cmp ebx, eax
jae 0x40aaf4
mov dword [ecx + 0x38], eax
mov ebx, eax
mov esi, dword [ecx + 0x20]
sub ebx, esi
js 0x40acc1
cmp ebx, 0x7ffffff8
jae 0x40ace1
cmp ebx, 0xa
ja 0x40ac32
lea eax, [ebp - 0x2c]
mov byte [eax + 0xb], bl
lea edi, [eax + ebx]
cmp eax, esi
ja 0x40ab29
cmp edi, esi
ja 0x40acba
test ebx, ebx
je 0x40ab38
push ebx
push esi
push eax
call fcn.00567460
add esp, 0xc
mov byte [edi], 0
lea eax, [ebp - 0x20]
lea ebx, [ebp - 0x2c]
lea esi, [ebp - 0x54]
mov ecx, esi
push eax
push 0xffffffffffffffff
mov edi, dword [ebp - 0x10]
push dword [edi + 0x90]
push ebx
call fcn.00542950
mov eax, dword [edi + 0x94]
mov ecx, dword [edi + 0x98]
mov dword [ebp - 0x48], ecx
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x40], 0x57
mov al, byte [0x6494a3]
test al, al
jne 0x40ada5
cmp byte [ebp - 0x49], 0
jns 0x40ab8f
push dword [ebp - 0x54]
call fcn.00562f60
add esp, 4
cmp dword [edi + 4], 3
je 0x40add5
mov eax, dword [0x6460b4]
test al, 2
jne 0x40ace9
test al, 4
jne 0x40abb7
test eax, 0xfffffffa
jne 0x40abf8
cmp dword [edi + 4], 2
jl 0x40abf8
lea esi, [ebp - 0x2c]
movsx ebx, byte [esi + 0xb]
test ebx, ebx
cmovs ebx, dword [esi + 4]
cmovs esi, dword [esi]
test ebx, ebx
je 0x40abf8
xor edi, edi
mov eax, ebx
sub eax, edi
lea ecx, [esi + edi]
push eax
push ecx
push 2
call fcn.00564986
add esp, 0xc
test eax, eax
setns cl
add edi, eax
cmp edi, ebx
setb al
test cl, al
jne 0x40abcd
mov eax, dword [0x6460b4]
mov edi, dword [ebp - 0x10]
test al, 1
jne 0x40ac78
cmp dword [edi + 4], 3
je 0x40ad3e
cmp byte [ebp - 0x21], 0
jns 0x40ac17
push dword [ebp - 0x2c]
call fcn.00562f60
add esp, 4
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.00562f95
mov ecx, dword [ebp - 0x3c]
mov dword [eax], ecx
add esp, 0x4c
pop esi
pop edi
pop ebx
pop ebp
ret
mov edi, ebx
or edi, 7
inc edi
push edi
call fcn.00562f65
add esp, 4
mov dword [ebp - 0x2c], eax
or edi, 0x80000000
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x28], ebx
jmp 0x40ab1a
mov edi, ebx
or edi, 7
inc edi
push edi
call fcn.00562f65
add esp, 4
mov dword [ebp - 0x20], eax
or edi, 0x80000000
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x1c], ebx
jmp 0x40aa01
call fcn.0040c560
test al, al
je 0x40abfc
lea eax, [ebp - 0x2c]
movsx ecx, byte [eax + 0xb]
test ecx, ecx
cmovs ecx, dword [eax + 4]
mov dword [ebp - 0x20], 0xffffffff
cmovs eax, dword [eax]
push 0
lea edx, [ebp - 0x20]
push edx
push ecx
push eax
push dword [0x64a794]
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x40abfc
call fcn.00590170
push str....._third_partylibc_srcinclude__stringchar_traits.h:145:_assertion__std::__is_pointer_in_range___s1____s1____n____s2__failed:_char_traits::copy:_source_and_destination_ranges_overlap_n
jmp 0x40acc6
push str....._third_partylibc_srcinclude_string_view:330:_assertion____end_____begin____0_failed:_std::string_view::string_view_iterator__sentinel__received_invalid_range_n
push 0x622e92
call fcn.00590170
lea ecx, [ebp - 0x20]
call fcn.00593a00
lock inc dword [ebx + 4]
jmp 0x40aa58
lea ecx, [ebp - 0x2c]
call fcn.00593a00
cmp byte [ebp - 0x21], 0
jns 0x40acf2
mov ebx, dword [ebp - 0x2c]
push ebx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [0x6460b4]
mov edi, dword [ebp - 0x10]
jmp 0x40aba6
mov ebx, 0
test al, 8
je 0x40a9fb
mov eax, dword [ebp - 0x10]
mov esi, dword [eax + 0x14]
mov ebx, dword [eax + 0x1c]
jmp 0x40a9de
xor esi, esi
mov ebx, 0
test al, 8
je 0x40ab14
mov eax, dword [ebp - 0x10]
mov esi, dword [eax + 0x14]
mov ebx, dword [eax + 0x1c]
jmp 0x40aaf7
lea eax, [ebp - 0x2c]
mov ecx, edi
mov edx, dword [ebp - 0x30]
push eax
call fcn.005b9c70
add esp, 4
jmp 0x40ac06
xor ecx, ecx
dec ecx
lock xadd dword [ebx + 4], ecx
test ecx, ecx
jne 0x40aab6
mov ecx, dword [ebx]
mov esi, dword [ecx + 4]
mov byte [ebp - 0x11], al
mov ecx, esi
call dword [0x63e19c]
mov ecx, ebx
call esi
mov al, byte [ebp - 0x11]
jmp 0x40aab6
lea eax, [ebp - 0x54]
lea ecx, [ebp - 0x20]
mov dword [ecx], eax
lea eax, [ebp - 0x2c]
mov dword [eax], ecx
push 0x4f1540
push eax
push 0x649444
call fcn.0040a4e0
add esp, 0xc
jmp 0x40aa70
movzx ecx, al
lea eax, [ebp - 0x44]
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x48]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], esi
lea eax, [ebp - 0x58]
mov dword [eax], str.LogMessage
lea edx, [ebp - 0x40]
lea esi, [ebp - 0x20]
push esi
push eax
call fcn.005b9ef0
add esp, 8
jmp 0x40ab7e
cmp byte [0x64a7b8], 0
jne 0x40ab99
mov byte [0x64a7b8], 1
mov eax, dword [0x64a7c0]
mov ecx, dword [0x64784c]
mov edx, dword fs:[0x2c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x40ae76
mov ecx, dword [ebp - 0x10]
lea esi, [ebp - 0x20]
push esi
call fcn.005b9bc0
movsx eax, byte [ebp - 0x15]
mov ecx, esi
test eax, eax
jns 0x40ae22
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x20]
test eax, eax
js 0x40ae62
sete dl
test ecx, ecx
setne dh
or dh, dl
je 0x40ae6c
push eax
push ecx
push dword [0x64a7bc]
call fcn.00406f40
add esp, 0xc
cmp byte [ebp - 0x15], 0
jns 0x40ae53
push dword [ebp - 0x20]
call fcn.00562f60
add esp, 4
mov byte [0x64a7b8], 0
mov edi, dword [ebp - 0x10]
jmp 0x40ab99
push str....._third_partylibc_srcinclude_string_view:318:_assertion___len___static_cast_size_type__numeric_limits_difference_type_::max____failed:_string_view::string_view__CharT___size_t_:_length_does_not_fit_in_difference_type_n
jmp 0x40acc6
push str....._third_partylibc_srcinclude_string_view:320:_assertion___len__0____s___nullptr_failed:_string_view::string_view__CharT___size_t_:_received_nullptr_n
jmp 0x40acc6
push 0x64a7c0
call fcn.00562fa8
add esp, 4
cmp dword [0x64a7c0], 0xffffffff
jne 0x40ae06
push 0x400
push str.LOG_FATAL
call fcn.0040b000
add esp, 8
mov dword [0x64a7bc], eax
push 0x64a7c0
call fcn.00562ff7
add esp, 4
jmp 0x40ae06