Function at 0x1400227e0
Capabilities:
Write file on windows

Disassembly:
push r13
push r14
push r15
sub rsp, 0x80
mov r13d, edx
mov r8, qword [0x140050bc0]
mov r14, rcx
xor r8, rsp
mov qword [rsp + 0x78], r8
cmp r13d, 0xffffffff
jne 0x140022837
mov rcx, qword [rsp + 0x78]
mov qword [rsp + 0x78], 0
xor rcx, rsp
cmp rcx, qword [0x140050bc0]
jne 0x140022832
xor eax, eax
add rsp, 0x80
pop r15
pop r14
pop r13
ret
call fcn.140039fc0
mov rdx, qword [r14 + 0x40]
mov rdx, qword [rdx]
test rdx, rdx
je 0x140022859
mov r9, qword [r14 + 0x58]
mov r8d, dword [r9]
movsxd rcx, r8d
add rcx, rdx
cmp rdx, rcx
jb 0x140022a7a
cmp qword [r14 + 0x80], 0
jne 0x140022890
mov rcx, qword [rsp + 0x78]
mov qword [rsp + 0x78], 0
xor rcx, rsp
cmp rcx, qword [0x140050bc0]
jne 0x140022832
mov eax, 0xffffffff
add rsp, 0x80
pop r15
pop r14
pop r13
ret
mov rcx, qword [r14 + 0x18]
lea rdx, [r14 + 0x70]
cmp rdx, qword [rcx]
je 0x140022a53
mov rcx, qword [r14 + 0x68]
test rcx, rcx
je 0x140022a18
mov r8, rsp
lea r11, [rsp + 0x40]
mov byte [r11 + 0x10], r13b
lea r15, [rsp + 0x51]
mov r10, qword [rcx]
lea rdx, [r14 + 0x74]
lea r9, [rsp + 0x51]
mov qword [r8 + 0x20], r11
lea r11, [rsp + 0x71]
mov qword [r8 + 0x30], r11
lea r11, [rsp + 0x48]
mov qword [r8 + 0x28], r15
mov qword [r8 + 0x38], r11
lea r8, [rsp + 0x50]
call qword [r10 + 0x38]
cmp eax, 1
ja 0x14002299a
mov r15, qword [rsp + 0x48]
lea rdx, [rsp + 0x51]
sub r15, rdx
je 0x140022925
mov r9, qword [r14 + 0x80]
lea rcx, [rsp + 0x51]
mov edx, 1
mov r8, r15
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
cmp r15, rax
jne 0x140022969
mov byte [r14 + 0x71], 1
lea rdx, [rsp + 0x50]
mov ecx, 0xffffffff
cmp rdx, qword [rdx - 0x10]
cmove r13d, ecx
mov rcx, qword [rdx + 0x28]
mov qword [rdx + 0x28], 0
xor rcx, rsp
cmp rcx, qword [0x140050bc0]
jne 0x140022832
mov eax, r13d
add rsp, 0x80
pop r15
pop r14
pop r13
ret
mov rcx, qword [rsp + 0x78]
mov qword [rsp + 0x78], 0
xor rcx, rsp
cmp rcx, qword [0x140050bc0]
jne 0x140022832
mov eax, 0xffffffff
add rsp, 0x80
pop r15
pop r14
pop r13
ret
cmp eax, 3
jne 0x1400229e7
mov rdx, qword [r14 + 0x80]
movsx ecx, byte [rsp + 0x50]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputc]
cmp eax, 0xffffffff
mov rcx, qword [rsp + 0x78]
mov qword [rsp + 0x78], 0
cmove r13d, eax
xor rcx, rsp
cmp rcx, qword [0x140050bc0]
jne 0x140022832
mov eax, r13d
add rsp, 0x80
pop r15
pop r14
pop r13
ret
mov rcx, qword [rsp + 0x78]
mov qword [rsp + 0x78], 0
xor rcx, rsp
cmp rcx, qword [0x140050bc0]
jne 0x140022832
mov eax, 0xffffffff
add rsp, 0x80
pop r15
pop r14
pop r13
ret
movsx rcx, r13b
mov rdx, qword [r14 + 0x80]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputc]
cmp eax, 0xffffffff
mov rcx, qword [rsp + 0x78]
mov qword [rsp + 0x78], 0
cmove r13d, eax
xor rcx, rsp
cmp rcx, qword [0x140050bc0]
jne 0x140022832
jmp 0x140022958
mov rdx, qword [r14 + 0x88]
mov r8, qword [r14 + 0x90]
mov qword [rcx], rdx
sub r8, rdx
mov rcx, qword [r14 + 0x38]
mov qword [rcx], rdx
mov r9, qword [r14 + 0x50]
mov dword [r9], r8d
jmp 0x1400228a1
dec r8d
mov dword [r9], r8d
mov rcx, qword [r14 + 0x40]
mov r8, qword [rcx]
lea rdx, [r8 + 1]
mov qword [rcx], rdx
mov byte [r8], r13b
mov rcx, qword [rsp + 0x78]
mov qword [rsp + 0x78], 0
xor rcx, rsp
cmp rcx, qword [0x140050bc0]
jne 0x140022832
jmp 0x140022958