Function at 0x403730
Capabilities:
Write file on windows

Disassembly:
push rbp
push r13
push r12
push rbx
mov rbp, rsp
sub rsp, 0x158
mov rbx, rcx
mov qword [rbp + 0x30], rdx
lea rcx, [0x00482198]
mov qword [rbp + 0x38], r8
test rbx, rbx
je 0x403763
lea rax, [rbx + 0x10]
cmp qword [rbx], 0
cmovne rcx, rax
call fcn.00402830
lea rcx, [0x004821ab]
mov r12, rax
call fcn.00402830
mov rcx, r12
mov rdx, rax
call qword [sym.imp.msvcrt.dll__wfopen]
mov qword [rbp - 0x120], rax
test rax, rax
je 0x4038d8
mov rax, qword [0x004a9de0]
lea rcx, [rbp - 0x108]
mov rdx, qword [rax]
mov qword [rbp - 0x118], rdx
lea rdx, [rbp - 0x118]
mov qword [rax], rdx
mov rdx, rbp
call sub.msvcrt.dll__setjmp
cdqe
mov qword [rbp - 0x110], rax
test rax, rax
je 0x403810
mov rax, qword [0x004a9de0]
mov rcx, qword [rbp - 0x120]
mov rdx, qword [rax]
mov rdx, qword [rdx]
mov qword [rax], rdx
test rcx, rcx
je 0x403870
call sub.msvcrt.dll_fclose
cmp qword [rbp - 0x110], 0
jne 0x403870
add rsp, 0x158
pop rbx
pop r12
pop r13
pop rbp
ret
cmp qword [rbp + 0x38], 0
jle 0x4038a0
mov rbx, qword [rbp - 0x120]
mov rcx, qword [rbp + 0x30]
mov edx, 1
mov r8, qword [rbp + 0x38]
mov r9, rbx
call sub.msvcrt.dll_fwrite
mov rcx, rbx
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x403a28
mov rax, qword [0x004a9de0]
mov rcx, qword [rbp - 0x120]
mov rdx, qword [rax]
mov rdx, qword [rdx]
mov qword [rax], rdx
test rcx, rcx
jne 0x4037eb
cmp qword [rbp - 0x110], 0
je 0x4037fa
nop dword [rax]
call fcn.0040f250
cmp qword [rbp - 0x110], 0
je 0x4037fa
call fcn.0040e010
nop
add rsp, 0x158
pop rbx
pop r12
pop r13
pop rbp
ret
mov rax, qword [rbp + 0x38]
xor ecx, ecx
lea rdx, [rax - 1]
call fcn.0040d770
cmp qword [rbp + 0x38], 0
je 0x40381b
movabs r8, 0x7fffffffffffffff
mov rcx, qword [rbp + 0x38]
xor edx, edx
call fcn.0040d5c0
jmp 0x40381b
mov rcx, qword [0x004a98c0]
mov edx, 0x30
call fcn.0040c390
mov ecx, 0xd
mov r13, rax
mov rax, qword [0x004a96e0]
mov qword [r13], rax
lea rax, [0x00482180]
mov qword [r13 + 0x10], rax
test rbx, rbx
je 0x403913
mov rax, qword [rbx]
lea rcx, [rax + 0xd]
call fcn.0040c5d0
mov edx, 0x20
movabs rcx, 0x6f20746f6e6e6163
mov r12, rax
mov rax, qword [rax]
lea rax, [r12 + rax + 0x10]
mov word [rax + 0xc], dx
mov qword [rax], rcx
mov dword [rax + 8], 0x3a6e6570
mov rax, qword [r12]
lea rdx, [rax + 0xd]
mov qword [r12], rdx
test rbx, rbx
je 0x40396d
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 0x403992
mov rbx, qword [rax - 0x10]
lea r8, [rax - 0x10]
lea rdx, [rbx - 8]
mov qword [rax - 0x10], rdx
cmp rdx, 7
jbe 0x403a10
mov rax, qword [r13 + 8]
mov qword [r13 + 0x18], r12
test rax, rax
je 0x4039b5
mov rbx, qword [rax - 0x10]
lea r8, [rax - 0x10]
lea rdx, [rbx - 8]
mov qword [rax - 0x10], rdx
cmp rdx, 7
jbe 0x4039f8
mov qword [r13 + 8], 0
lea r9, str.io.nim
mov rcx, r13
lea r8, str.writeFile
mov qword [rsp + 0x20], 0x381
lea rdx, [0x00482180]
call fcn.0040d470
nop
add rsp, 0x158
pop rbx
pop r12
pop r13
pop rbp
ret
mov rcx, qword [0x004a9e20]
mov rdx, r8
add rcx, 0x18
call fcn.004079d0
jmp 0x4039b5
mov rcx, qword [0x004a9e20]
mov rdx, r8
add rcx, 0x18
call fcn.004079d0
jmp 0x403992
mov rcx, qword [rbp - 0x120]
call fcn.00402a30
nop
nop word cs:[rax + rax]
mov r8d, 1
jmp fcn.00402bc0