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

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
push rdi
push r13
push r14
sub rsp, 0x40
cmp dword [0x1400975a8], 4
mov esi, 3
mov rbx, rdx
movsxd rdi, ecx
lea r13, [0x1400988c0]
lea r14d, [rsi - 1]
jne 0x1400219b7
mov eax, dword [0x14006b808]
lea r9, str.C:TMPS7FILE
lea r8, str._s_d.TRC
mov edx, 0x100
mov rcx, r13
mov dword [rsp + 0x20], eax
call fcn.1400253f4
lea r8, [0x14005a390]
lea rcx, [0x140098230]
mov rdx, r13
call fcn.14002b0f4
mov rcx, qword [0x140098230]
test rcx, rcx
jne 0x140021885
or ecx, 0xffffffff
jmp 0x1400219af
mov r8d, r14d
xor edx, edx
call fcn.14002af00
mov rcx, qword [0x140098230]
call fcn.14002ade4
test eax, eax
js 0x14002187d
cmp eax, dword [0x14006b804]
jle 0x1400219aa
mov rcx, qword [0x140098230]
call fcn.140028368
mov r11d, esi
lea r9, str.C:TMPS7FILE
sub r11d, dword [0x14006b808]
lea r8, str._s_d.TRC
mov edx, 0x100
mov rcx, r13
mov dword [0x14006b808], r11d
mov dword [rsp + 0x20], r11d
call fcn.1400253f4
lea r8, [0x14005a390]
lea rcx, [0x140098230]
mov rdx, r13
call fcn.14002b0f4
mov rcx, qword [0x140098230]
test rcx, rcx
je 0x14002187d
mov r8d, r14d
xor edx, edx
call fcn.14002af00
mov rcx, qword [0x140098230]
call fcn.14002ade4
test eax, eax
js 0x14002187d
cmp eax, dword [0x14006b804]
jle 0x1400219aa
mov rcx, qword [0x140098230]
call fcn.140028368
mov r11d, esi
lea r9, str.C:TMPS7FILE
sub r11d, dword [0x14006b808]
lea r8, str._s_d.TRC
mov edx, 0x100
mov rcx, r13
mov dword [0x14006b808], r11d
mov dword [rsp + 0x20], r11d
call fcn.1400253f4
mov rcx, r13
call fcn.14002abe8
lea r8, [0x14005a390]
lea rcx, [0x140098230]
mov rdx, r13
call fcn.14002b0f4
mov r11, qword [0x140098230]
neg r11
sbb eax, eax
and eax, r14d
dec eax
mov ecx, eax
mov dword [0x1400991d8], eax
jmp 0x1400219bd
mov ecx, 1
mov dword [0x1400991d8], ecx
jmp 0x1400219bd
mov ecx, dword [0x1400991d8]
mov edx, dword [0x1400975a8]
test edx, edx
je 0x140021afc
sub edx, 4
je 0x140021a0e
sub edx, 1
je 0x1400219f5
cmp edx, 1
jne 0x140021b37
mov rcx, rbx
mov byte [rdi + rbx], 0xa
mov byte [rdi + rbx + 1], 0
call qword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x140021b37
lea edx, [rdi + 2]
mov rcx, rbx
mov byte [rdi + rbx], 0xd
mov byte [rdi + rbx + 1], 0xa
call fcn.140020ed8
jmp 0x140021b37
cmp ecx, 1
jne 0x140021b37
lea eax, [rdi + 1]
mov byte [rdi + rbx], 0xa
mov r9, qword [0x140098230]
mov r8d, ecx
movsxd rdx, eax
mov rcx, rbx
call fcn.14002ab44
mov rcx, qword [0x140098230]
mov r8d, r14d
xor edx, edx
call fcn.14002af00
mov rcx, qword [0x140098230]
call fcn.14002ade4
test eax, eax
js 0x140021b37
cmp eax, dword [0x14006b804]
mov rcx, qword [0x140098230]
jle 0x140021af5
call fcn.140028368
sub esi, dword [0x14006b808]
lea r9, str.C:TMPS7FILE
lea r8, str._s_d.TRC
mov edx, 0x100
mov rcx, r13
mov dword [0x14006b808], esi
mov dword [rsp + 0x20], esi
call fcn.1400253f4
lea r8, [0x14005a390]
lea rcx, [0x140098230]
mov rdx, r13
call fcn.14002b0f4
mov rcx, qword [0x140098230]
test rcx, rcx
je 0x140021b37
mov r8d, r14d
xor edx, edx
call fcn.14002af00
mov rcx, qword [0x140098230]
call fcn.14002ade4
test eax, eax
js 0x140021b37
cmp eax, dword [0x14006b804]
mov rcx, qword [0x140098230]
jle 0x140021af5
call fcn.140028368
mov rcx, r13
call fcn.14002abe8
jmp 0x140021b37
call fcn.140028368
jmp 0x140021b37
and qword [rsp + 0x38], 0
mov rcx, qword [0x1400991c8]
and dword [rsp + 0x70], 0
lea rax, [rsp + 0x70]
lea r9d, [rdi + 1]
mov r8, rbx
mov qword [rsp + 0x30], rax
and dword [rsp + 0x28], 0
and qword [rsp + 0x20], 0
mov edx, r14d
mov byte [rdi + rbx], 0
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
mov rbx, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x68]
add rsp, 0x40
pop r14
pop r13
pop rdi
ret