Function at 0x140021f30
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x7e8]
sub rsp, 0x8e8
mov rax, qword [0x140106438]
xor rax, rsp
mov qword [rbp + 0x7d0], rax
xor r15d, r15d
mov qword [rsp + 0x58], r9
lea rax, [0x1400e0718]
mov qword [rsp + 0x38], rcx
mov qword [rbp - 0x70], rax
xorps xmm0, xmm0
lea rax, str.w__ccsUTF_8
mov qword [rsp + 0x50], r15
mov qword [rbp - 0x68], rax
xorps xmm1, xmm1
lea rax, str.w__ccsUTF_16LE
mov word [rsp + 0x24], r15w
mov qword [rbp - 0x60], rax
mov rbx, r8
xor eax, eax
mov qword [rsp + 0x28], r15
mov qword [rbp - 0x38], rax
mov rdi, rdx
mov qword [rbp - 0x78], rax
mov rsi, rcx
mov r13d, r15d
mov r12d, r15d
mov r14d, r15d
movups xmmword [rbp - 0x58], xmm0
movups xmmword [rbp - 0x48], xmm0
movups xmmword [rsp + 0x68], xmm1
movups xmmword [rsp + 0x78], xmm1
test rcx, rcx
je 0x140022531
test rdx, rdx
je 0x140022531
test rbx, rbx
je 0x140022531
test r9, r9
je 0x140022531
cmp byte [rcx], al
je 0x140022531
cmp byte [rdx], al
je 0x140022531
cmp byte [r8], al
je 0x140022531
mov rax, rbx
sub r9, rbx
movzx r8d, byte [rax]
movzx ecx, byte [rax + r9]
sub r8d, ecx
jne 0x140022027
inc rax
test ecx, ecx
jne 0x140022012
test r8d, r8d
je 0x140022531
mov rcx, rsi
call fcn.140003550
mov qword [rsp + 0x48], rax
test rax, rax
jne 0x140022056
mov rdx, rsi
lea rcx, str.Could_not_convert__s_to_UTF_16
call fcn.140041aa0
jmp 0x1400224fe
mov rcx, rdi
call fcn.140003550
mov r13, rax
test rax, rax
jne 0x14002207a
mov rdx, rdi
lea rcx, str.Could_not_convert__s_to_UTF_16
call fcn.140041aa0
jmp 0x1400224fe
mov rcx, rbx
call fcn.140003550
mov r14, rax
test rax, rax
jne 0x14002209e
mov rdx, rbx
lea rcx, str.Could_not_convert__s_to_UTF_16
call fcn.140041aa0
jmp 0x1400224fe
mov rbx, qword [rsp + 0x58]
mov rcx, rbx
call fcn.140003550
mov qword [rsp + 0x50], rax
test rax, rax
je 0x14002208a
mov rbx, qword [rsp + 0x48]
lea rdx, str.r__ccsUNICODE
mov rcx, rbx
call fcn.14009b834
mov qword [rsp + 0x60], rax
mov rsi, rax
test rax, rax
jne 0x1400220ec
mov rdx, qword [rsp + 0x38]
lea rcx, str.Could_not_open_file__s_n
call fcn.140041aa0
jmp 0x1400224fe
mov edx, 2
lea rcx, [rsp + 0x24]
mov r9, rsi
lea r8d, [rdx - 1]
call fcn.1400a6f3c
cmp rax, 1
je 0x140022132
mov rcx, rsi
call fcn.1400a6aa0
test eax, eax
jne 0x140022125
mov rdx, qword [rsp + 0x38]
lea rcx, str.Could_not_read_file__s_n
call fcn.140041aa0
mov rcx, rsi
call fcn.14009b928
jmp 0x1400224fe
movzx eax, word [rsp + 0x24]
cmp eax, 0xbbef
je 0x14002214e
cmp eax, 0xfeff
mov edi, 2
cmovne edi, r15d
jmp 0x140022153
mov edi, 1
xor r8d, r8d
mov dword [rsp + 0x30], edi
xor edx, edx
mov rcx, rsi
call fcn.1400a5ff0
mov rcx, 0xffffffffffffffff
nop dword [rax + rax]
inc rcx
cmp word [rbx + rcx*2], r12w
jne 0x140022170
add rcx, 2
mov edx, 2
call fcn.1400966e0
mov qword [rsp + 0x40], rax
mov r12, rax
test rax, rax
jne 0x1400221ae
lea rcx, str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.140041aa0
mov rcx, rsi
call fcn.14009b928
jmp 0x1400224fe
mov rdx, r12
mov rcx, rbx
sub rdx, rbx
nop word [rax + rax]
movzx eax, word [rcx]
mov word [rdx + rcx], ax
lea rcx, [rcx + 2]
test ax, ax
jne 0x1400221c0
mov rax, 0xffffffffffffffff
nop word [rax + rax]
cmp word [r12 + rax*2 + 2], r15w
lea rax, [rax + 1]
jne 0x1400221e0
mov ecx, 0x7e
mov edx, edi
mov word [r12 + rax*2], cx
mov rcx, r12
mov rdx, qword [rbp + rdx*8 - 0x70]
call fcn.14009b834
mov r12, rax
test rax, rax
jne 0x140022230
mov rdx, qword [rsp + 0x38]
lea rcx, str.Could_not_open_temporary_output_file__s_n
call fcn.140041aa0
mov rcx, rsi
call fcn.14009b928
mov r12, qword [rsp + 0x40]
jmp 0x1400224f6
mov r8, rsi
lea rcx, [rbp - 0x30]
mov edx, 0x400
call fcn.1400a62f0
test rax, rax
je 0x1400223cc
nop word [rax + rax]
lea rdx, [0x1400d3b10]
lea rcx, [rbp - 0x30]
call fcn.1400a65cc
mov rbx, rax
mov r8, 0xffffffffffffffff
nop word [rax + rax]
inc r8
cmp word [r13 + r8*2], r15w
jne 0x140022270
lea rcx, [rbp - 0x30]
mov rdx, r13
lea rcx, [rcx + rax*2]
call fcn.1400a6b44
test eax, eax
je 0x1400222a5
mov rdx, r12
lea rcx, [rbp - 0x30]
call fcn.1400a5d7c
mov rdi, qword [rsp + 0x28]
jmp 0x1400223b0
mov rax, 0xffffffffffffffff
nop dword [rax]
inc rax
cmp word [r13 + rax*2], r15w
jne 0x1400222b0
add rbx, rax
lea rcx, [rbp - 0x30]
lea rdx, [0x1400d3b10]
lea rcx, [rcx + rbx*2]
call fcn.1400a65cc
test rax, rax
je 0x14002228f
add rbx, rax
mov qword [rsp + 0x68], r15
mov rdi, r15
nop dword [rax]
nop word [rax + rax]
lea rcx, [rbp - 0x30]
mov rdx, r14
lea rcx, [rcx + rbx*2]
call fcn.140092e50
mov qword [rbp + rdi - 0x58], rax
mov rcx, rax
test rax, rax
je 0x14002233e
mov rbx, 0xffffffffffffffff
inc rbx
cmp word [r14 + rbx*2], r15w
jne 0x140022314
lea rdx, [rbp - 0x30]
mov word [rcx], r15w
sub rax, rdx
sar rax, 1
add rbx, rax
mov qword [rsp + rdi + 0x70], rbx
add rdi, 8
cmp rdi, 0x20
jb 0x1400222f0
cmp qword [rbp - 0x58], r15
je 0x14002228f
mov rsi, qword [rsp + 0x50]
mov rbx, r15
mov rax, r15
mov rax, qword [rsp + rax + 0x68]
lea r8, [rbp - 0x30]
mov r9, rsi
lea rdx, [0x1400e0920]
mov rcx, r12
lea r8, [r8 + rax*2]
call fcn.140012b20
lea rbx, [rbx + 1]
lea rax, [rbx*8]
cmp qword [rbp + rax - 0x58], r15
jne 0x140022353
mov rax, qword [rsp + rbx*8 + 0x68]
lea r8, [rbp - 0x30]
lea rdx, [0x1400e092c]
mov rcx, r12
lea r8, [r8 + rax*2]
call fcn.140012b20
mov rdi, qword [rsp + 0x58]
mov rsi, qword [rsp + 0x60]
mov qword [rsp + 0x28], rdi
mov r8, rsi
lea rcx, [rbp - 0x30]
mov edx, 0x400
call fcn.1400a62f0
test rax, rax
jne 0x140022250
jmp 0x1400223d3
mov dword [rsp + 0x30], edi
mov rdi, r15
mov rbx, qword [rsp + 0x40]
mov rcx, rsi
call fcn.14009b928
mov rcx, r12
mov qword [rsp + 0x28], rdi
mov rsi, rbx
call fcn.14009b928
mov r12, rbx
test rdi, rdi
je 0x1400224f1
lea rdx, [0x1400e01b4]
mov rcx, rbx
call fcn.14009b834
mov rcx, qword [rsp + 0x48]
lea rdx, [0x1400e0804]
mov rdi, rax
call fcn.14009b834
mov rbx, rax
test rdi, rdi
je 0x1400224bf
test rax, rax
je 0x1400224bf
cmp dword [rsp + 0x30], 2
lea rcx, [rsp + 0x20]
mov r9, rdi
mov r8d, 1
sete r15b
inc r15
mov rdx, r15
call fcn.1400a6f3c
cmp rax, 1
jne 0x1400224ad
mov rax, qword [rsp + 0x28]
mov esi, dword [rbp + 0x850]
mov qword [rsp + 0x28], rax
nop dword [rax]
test esi, esi
je 0x14002247b
cmp byte [rsp + 0x20], 0xd
je 0x140022491
mov r9, rbx
lea rcx, [rsp + 0x20]
mov r8d, 1
mov rdx, r15
call fcn.1400a6548
mov r9, rdi
lea rcx, [rsp + 0x20]
mov r8d, 1
mov rdx, r15
call fcn.1400a6f3c
cmp rax, 1
je 0x140022470
mov rcx, rdi
call fcn.14009b928
mov rcx, rbx
call fcn.14009b928
jmp 0x1400224f6
mov rdx, qword [rsp + 0x38]
lea rcx, str.Could_not_write__s___original_file_has_been_left_unmodified._n
call fcn.140041aa0
mov qword [rsp + 0x28], r15
test rdi, rdi
je 0x1400224e2
mov rcx, rdi
call fcn.14009b928
test rbx, rbx
je 0x1400224f6
mov rcx, rbx
call fcn.14009b928
jmp 0x1400224f6
mov qword [rsp + 0x28], rdi
mov rcx, r12
call fcn.1400a702c
mov rcx, qword [rsp + 0x48]
call fcn.14009b5a0
mov rcx, r12
call fcn.14009b5a0
mov rcx, r13
call fcn.14009b5a0
mov rcx, r14
call fcn.14009b5a0
mov rcx, qword [rsp + 0x50]
call fcn.14009b5a0
mov rax, qword [rsp + 0x28]
jmp 0x140022533
xor eax, eax
mov rcx, qword [rbp + 0x7d0]
xor rcx, rsp
call fcn.140092060
add rsp, 0x8e8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret