Function at 0x140045660
Capabilities:
Write file on windows

Disassembly:
push rbp
push rsi
push r12
push r15
lea rbp, [rsp - 0x3f]
sub rsp, 0xa8
mov rax, qword [0x1401a5020]
xor rax, rsp
mov qword [rbp + 0x1f], rax
mov r12d, 0xffff
movzx r15d, dx
mov rsi, rcx
cmp r12w, dx
jne 0x1400456a8
xor ecx, ecx
cmp dx, r12w
cmove r15w, cx
movzx eax, r15w
jmp 0x1400458e8
mov rax, qword [rcx + 0x40]
mov r8, qword [rax]
test r8, r8
je 0x1400456e5
mov rax, qword [rcx + 0x58]
movsxd r9, dword [rax]
lea rdx, [r8 + r9*2]
cmp r8, rdx
jae 0x1400456e5
lea ecx, [r9 - 1]
mov dword [rax], ecx
movzx eax, r15w
mov rdx, qword [rsi + 0x40]
mov r8, qword [rdx]
lea rcx, [r8 + 2]
mov qword [rdx], rcx
mov word [r8], r15w
jmp 0x1400458e8
cmp qword [rcx + 0x80], 0
mov qword [rsp + 0xe0], rbx
mov qword [rsp + 0xa0], rdi
mov qword [rsp + 0x98], r13
mov qword [rsp + 0x90], r14
je 0x1400458c4
mov r8, qword [rcx + 0x18]
lea rax, [rcx + 0x70]
cmp qword [r8], rax
jne 0x140045744
mov rdx, qword [rcx + 0x90]
mov rcx, qword [rcx + 0x88]
mov qword [r8], rcx
sub rdx, rcx
mov rax, qword [rsi + 0x38]
sar rdx, 1
mov qword [rax], rcx
mov rax, qword [rsi + 0x50]
mov dword [rax], edx
mov r10, qword [rsi + 0x68]
mov qword [rbp - 0x11], r10
test r10, r10
jne 0x140045774
movzx ecx, r15w
mov rdx, qword [rsi + 0x80]
call fcn.1400b5e78
cmp ax, r12w
je 0x1400458c4
movzx r12d, r15w
jmp 0x1400458c4
mov word [rbp - 0x29], r15w
lea rcx, vtable.std::codecvt_wchar_t__char__struct__Mbstatet_.0
mov rax, qword [r10]
mov r11, qword [rax + 0x38]
cmp rax, rcx
jne 0x140045902
lea rax, [rbp - 0x29]
lea rdi, [rbp - 1]
mov qword [rbp - 0x21], rax
mov qword [rbp - 0x19], rdi
lea rcx, [rbp - 0x29]
nop dword [rax]
nop dword [rax + rax]
lea rdx, [rbp + 0x1f]
cmp rdi, rdx
je 0x140045866
movzx edx, word [rcx]
lea rax, [rbp + 0x1f]
sub rax, rdi
lea r9, [r10 + 0x10]
lea r8, [rsi + 0x74]
cmp rax, 5
jl 0x1400457ee
mov rcx, rdi
call fcn.1400f95e0
test eax, eax
js 0x1400458c4
movsxd rdi, eax
add rdi, qword [rbp - 0x19]
jmp 0x14004582c
mov rbx, qword [rsi + 0x74]
lea rcx, [rbp - 9]
call fcn.1400f95e0
test eax, eax
js 0x1400458c4
mov rdi, qword [rbp - 0x19]
movsxd r14, eax
lea rax, [rbp + 0x1f]
sub rax, rdi
cmp rax, r14
jl 0x14004585e
mov r8, r14
lea rdx, [rbp - 9]
mov rcx, rdi
call fcn.140081290
mov rdi, qword [rbp - 0x19]
add rdi, r14
mov rax, qword [rbp - 0x21]
lea rdx, [rbp - 0x27]
mov r10, qword [rbp - 0x11]
add rax, 2
mov qword [rbp - 0x21], rax
mov rcx, rax
mov qword [rbp - 0x19], rdi
cmp rax, rdx
jne 0x1400457b0
xor ecx, ecx
lea rdx, [rbp - 0x27]
cmp rax, rdx
setne cl
jmp 0x140045872
mov rax, qword [rbp - 0x21]
mov qword [rsi + 0x74], rbx
xor ecx, ecx
lea rdx, [rbp - 0x27]
cmp rax, rdx
setne cl
test ecx, ecx
js 0x1400458c4
cmp ecx, 1
jle 0x140045889
cmp ecx, 3
jne 0x1400458c4
movzx ecx, word [rbp - 0x29]
jmp 0x140045755
lea rcx, [rbp - 1]
sub rdi, rcx
je 0x1400458b3
mov r9, qword [rsi + 0x80]
lea rcx, [rbp - 1]
mov r8, rdi
mov edx, 1
call fcn.1400ac560
cmp rdi, rax
jne 0x1400458c4
mov rax, qword [rbp - 0x21]
lea rcx, [rbp - 0x29]
mov byte [rsi + 0x72], 1
cmp rax, rcx
movzx eax, r15w
jne 0x1400458c8
movzx eax, r12w
mov r13, qword [rsp + 0x98]
mov rdi, qword [rsp + 0xa0]
mov rbx, qword [rsp + 0xe0]
mov r14, qword [rsp + 0x90]
mov rcx, qword [rbp + 0x1f]
xor rcx, rsp
call fcn.140050f90
add rsp, 0xa8
pop r15
pop r12
pop rsi
pop rbp
ret
lea rax, [rbp - 0x19]
mov rcx, r10
mov qword [rsp + 0x38], rax
lea r9, [rbp - 0x27]
lea rax, [rbp + 0x1f]
mov qword [rsp + 0x30], rax
lea r8, [rbp - 0x29]
lea rax, [rbp - 1]
mov qword [rsp + 0x28], rax
lea rdx, [rsi + 0x74]
lea rax, [rbp - 0x21]
mov qword [rsp + 0x20], rax
call r11
mov rdi, qword [rbp - 0x19]
mov ecx, eax
mov rax, qword [rbp - 0x21]
jmp 0x140045872