Function at 0x140051590
Capabilities:
Write file on windows

Disassembly:
push r13
push r14
push r15
sub rsp, 0x80
mov r13d, edx
mov r8, qword [0x1400b8bc0]
mov r14, rcx
xor r8, rsp
mov qword [rsp + 0x78], r8
cmp r13d, 0xffffffff
jne 0x1400515e7
mov rcx, qword [rsp + 0x78]
mov qword [rsp + 0x78], 0
xor rcx, rsp
cmp rcx, qword [0x1400b8bc0]
jne 0x1400515e2
xor eax, eax
add rsp, 0x80
pop r15
pop r14
pop r13
ret
call fcn.140097240
mov rdx, qword [r14 + 0x40]
mov rdx, qword [rdx]
test rdx, rdx
je 0x140051609
mov r9, qword [r14 + 0x58]
mov r8d, dword [r9]
movsxd rcx, r8d
add rcx, rdx
cmp rdx, rcx
jb 0x14005182a
cmp qword [r14 + 0x80], 0
jne 0x140051640
mov rcx, qword [rsp + 0x78]
mov qword [rsp + 0x78], 0
xor rcx, rsp
cmp rcx, qword [0x1400b8bc0]
jne 0x1400515e2
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 0x140051803
mov rcx, qword [r14 + 0x68]
test rcx, rcx
je 0x1400517c8
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 0x14005174a
mov r15, qword [rsp + 0x48]
lea rdx, [rsp + 0x51]
sub r15, rdx
je 0x1400516d5
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 0x140051719
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 [0x1400b8bc0]
jne 0x1400515e2
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 [0x1400b8bc0]
jne 0x1400515e2
mov eax, 0xffffffff
add rsp, 0x80
pop r15
pop r14
pop r13
ret
cmp eax, 3
jne 0x140051797
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 [0x1400b8bc0]
jne 0x1400515e2
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 [0x1400b8bc0]
jne 0x1400515e2
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 [0x1400b8bc0]
jne 0x1400515e2
jmp 0x140051708
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 0x140051651
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 [0x1400b8bc0]
jne 0x1400515e2
jmp 0x140051708