Function at 0x140003960
Capabilities:
Write file on windows

Disassembly:
push rbp
mov rbp, rsp
push r13
push r12
push rbx
sub rsp, 0x158
mov rbx, rcx
mov qword [rbp + 0x18], rdx
lea rcx, [0x14007b29b]
mov qword [rbp + 0x20], r8
test rbx, rbx
je 0x140003993
lea rax, [rbx + 0x10]
cmp qword [rbx], 0
cmovne rcx, rax
call fcn.140002a20
lea rcx, [0x14007b2ab]
mov r12, rax
call fcn.140002a20
mov rcx, r12
mov rdx, rax
call qword [sym.imp.msvcrt.dll__wfopen]
mov qword [rbp - 0x138], rax
test rax, rax
je 0x140003b08
mov rax, qword [0x1400a2890]
lea rcx, [rbp - 0x120]
mov rdx, qword [rax]
mov qword [rbp - 0x130], rdx
lea rdx, [rbp - 0x130]
mov qword [rax], rdx
mov rdx, rbp
call sub.msvcrt.dll__setjmp
cdqe
mov qword [rbp - 0x128], rax
test rax, rax
je 0x140003a40
mov rax, qword [0x1400a2890]
mov rcx, qword [rbp - 0x138]
mov rdx, qword [rax]
mov rdx, qword [rdx]
mov qword [rax], rdx
test rcx, rcx
je 0x140003aa0
call sub.msvcrt.dll_fclose
cmp qword [rbp - 0x128], 0
jne 0x140003aa0
add rsp, 0x158
pop rbx
pop r12
pop r13
pop rbp
ret
cmp qword [rbp + 0x20], 0
jle 0x140003ad0
mov rbx, qword [rbp - 0x138]
mov rcx, qword [rbp + 0x18]
mov edx, 1
mov r8, qword [rbp + 0x20]
mov r9, rbx
call sub.msvcrt.dll_fwrite
mov rcx, rbx
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x140003c58
mov rax, qword [0x1400a2890]
mov rcx, qword [rbp - 0x138]
mov rdx, qword [rax]
mov rdx, qword [rdx]
mov qword [rax], rdx
test rcx, rcx
jne 0x140003a1b
cmp qword [rbp - 0x128], 0
je 0x140003a2a
nop dword [rax]
call fcn.14000e860
cmp qword [rbp - 0x128], 0
je 0x140003a2a
call fcn.14000e0f0
nop
add rsp, 0x158
pop rbx
pop r12
pop r13
pop rbp
ret
mov rax, qword [rbp + 0x20]
xor ecx, ecx
lea rdx, [rax - 1]
call fcn.14000d860
cmp qword [rbp + 0x20], 0
je 0x140003a4b
movabs r8, 0x7fffffffffffffff
mov rcx, qword [rbp + 0x20]
xor edx, edx
call fcn.14000d6c0
jmp 0x140003a4b
mov rcx, qword [0x1400a23e0]
mov edx, 0x30
call fcn.14000b890
mov ecx, 0xd
mov r13, rax
mov rax, qword [0x1400a2210]
mov qword [r13], rax
lea rax, [0x14007b283]
mov qword [r13 + 0x10], rax
test rbx, rbx
je 0x140003b43
mov rax, qword [rbx]
lea rcx, [rax + 0xd]
call fcn.14000ba40
movabs rdx, 0x6f20746f6e6e6163
mov r12, rax
mov rax, qword [rax]
lea rax, [r12 + rax + 0x10]
mov qword [rax], rdx
mov edx, 0x20
mov word [rax + 0xc], dx
mov dword [rax + 8], 0x3a6e6570
mov rax, qword [r12]
lea rdx, [rax + 0xd]
mov qword [r12], rdx
test rbx, rbx
je 0x140003b9d
lea rcx, [r12 + rax + 0x1d]
mov rax, qword [rbx]
lea rdx, [rbx + 0x10]
lea r8, [rax + 1]
call sub.msvcrt.dll_memcpy
mov rax, qword [rbx]
add qword [r12], rax
add qword [r12 - 0x10], 8
mov rax, qword [r13 + 0x18]
test rax, rax
je 0x140003bc2
mov rbx, qword [rax - 0x10]
lea r8, [rax - 0x10]
lea rdx, [rbx - 8]
mov qword [rax - 0x10], rdx
cmp rdx, 7
jbe 0x140003c40
mov rax, qword [r13 + 8]
mov qword [r13 + 0x18], r12
test rax, rax
je 0x140003be5
mov rbx, qword [rax - 0x10]
lea r8, [rax - 0x10]
lea rdx, [rbx - 8]
mov qword [rax - 0x10], rdx
cmp rdx, 7
jbe 0x140003c28
mov qword [r13 + 8], 0
lea r9, str.io.nim
mov rcx, r13
lea r8, str.writeFile
mov qword [rsp + 0x20], 0x381
lea rdx, [0x14007b283]
call fcn.14000d580
nop
add rsp, 0x158
pop rbx
pop r12
pop r13
pop rbp
ret
mov rax, qword [0x1400a28c0]
mov rdx, r8
lea rcx, [rax + 0x18]
call fcn.140007510
jmp 0x140003be5
mov rax, qword [0x1400a28c0]
mov rdx, r8
lea rcx, [rax + 0x18]
call fcn.140007510
jmp 0x140003bc2
mov rcx, qword [rbp - 0x138]
call fcn.140002c60
nop
nop word cs:[rax + rax]
mov r8d, 1
jmp fcn.140002df0