Function at 0x140003670
Capabilities:
Write file on windows

Disassembly:
push rbp
mov rbp, rsp
push rdi
push rsi
push rbx
sub rsp, 0x158
mov rbx, rcx
mov qword [rbp + 0x18], rdx
lea rcx, [0x1400861bb]
mov qword [rbp + 0x20], r8
test rbx, rbx
je 0x14000369f
cmp qword [rbx], 0
jne 0x140003800
call fcn.140002760
lea rcx, [0x1400861cb]
mov rsi, rax
call fcn.140002760
mov rcx, rsi
mov rdx, rax
call qword [sym.imp.msvcrt.dll__wfopen]
mov qword [rbp - 0x138], rax
test rax, rax
je 0x140003810
mov rax, qword [str._bx_f_]
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 0x140003740
mov rax, qword [str._bx_f_]
mov rcx, qword [rbp - 0x138]
mov rdx, qword [rax]
mov rdx, qword [rdx]
mov qword [rax], rdx
test rcx, rcx
je 0x1400037a0
call sub.msvcrt.dll_fclose
cmp qword [rbp - 0x128], 0
jne 0x1400037a0
add rsp, 0x158
pop rbx
pop rsi
pop rdi
pop rbp
ret
cmp qword [rbp + 0x20], 0
jle 0x1400037c8
mov rdi, qword [rbp - 0x138]
mov rcx, qword [rbp + 0x18]
mov edx, 1
mov r8, qword [rbp + 0x20]
mov r9, rdi
call sub.msvcrt.dll_fwrite
mov rcx, rdi
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x140003958
mov rax, qword [str._bx_f_]
mov rcx, qword [rbp - 0x138]
mov rdx, qword [rax]
mov rdx, qword [rdx]
mov qword [rax], rdx
test rcx, rcx
jne 0x140003723
cmp qword [rbp - 0x128], 0
je 0x140003732
nop dword [rax]
call fcn.14000e650
cmp qword [rbp - 0x128], 0
je 0x140003732
call fcn.14000dd50
nop
add rsp, 0x158
pop rbx
pop rsi
pop rdi
pop rbp
ret
mov rax, qword [rbp + 0x20]
xor ecx, ecx
lea rdx, [rax - 1]
call fcn.14000d4c0
cmp qword [rbp + 0x20], 0
je 0x14000374b
movabs r8, 0x7fffffffffffffff
mov rcx, qword [rbp + 0x20]
xor edx, edx
call fcn.14000d320
jmp 0x14000374b
lea rcx, [rbx + 0x10]
jmp 0x14000369f
mov rcx, qword [str.__f_]
mov edx, 0x30
call fcn.14000ba90
mov ecx, 0xd
mov rdi, rax
mov rax, qword [0x1400adaa0]
mov qword [rdi], rax
lea rax, [0x1400861a3]
mov qword [rdi + 0x10], rax
test rbx, rbx
je 0x14000384a
mov rax, qword [rbx]
lea rcx, [rax + 0xd]
call fcn.14000bcd0
movabs rdx, 0x6f20746f6e6e6163
movabs rcx, 0x203a6e65706f20
mov rsi, rax
mov rax, qword [rax]
lea rax, [rsi + rax + 0x10]
mov qword [rax], rdx
mov qword [rax + 6], rcx
mov rax, qword [rsi]
lea rdx, [rax + 0xd]
mov qword [rsi], rdx
test rbx, rbx
je 0x14000389f
lea rcx, [rsi + 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 [rsi], rax
add qword [rsi - 0x10], 8
mov rax, qword [rdi + 0x18]
test rax, rax
je 0x1400038c3
mov rbx, qword [rax - 0x10]
lea rcx, [rax - 0x10]
lea rdx, [rbx - 8]
mov qword [rax - 0x10], rdx
cmp rdx, 7
jbe 0x140003940
mov rax, qword [rdi + 8]
mov qword [rdi + 0x18], rsi
test rax, rax
je 0x1400038e6
mov rsi, qword [rax - 0x10]
lea rcx, [rax - 0x10]
lea rdx, [rsi - 8]
mov qword [rax - 0x10], rdx
cmp rdx, 7
jbe 0x140003928
mov qword [rdi + 8], 0
lea r9, str.io.nim
mov rcx, rdi
lea r8, str.writeFile
mov qword [rsp + 0x20], 0x381
lea rdx, [0x1400861a3]
call fcn.14000d1d0
nop
add rsp, 0x158
pop rbx
pop rsi
pop rdi
pop rbp
ret
mov rax, qword [str._L_f_]
mov rdx, rcx
lea rcx, [rax + 0x18]
call fcn.140007060
jmp 0x1400038e6
mov rax, qword [str._L_f_]
mov rdx, rcx
lea rcx, [rax + 0x18]
call fcn.140007060
jmp 0x1400038c3
mov rcx, qword [rbp - 0x138]
call fcn.140002940
nop
nop word cs:[rax + rax]
mov r8d, 1
jmp fcn.140002ac0