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

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x870
mov rax, qword [0x140106438]
xor rax, rsp
mov qword [rsp + 0x860], rax
mov r14, qword [0x1401128c8]
lea rax, [0x1400e0718]
xor ebp, ebp
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x40], rdx
lea rax, str.w__ccsUTF_8
mov qword [rsp + 0x50], rax
lea rax, str.w__ccsUTF_16LE
mov qword [rsp + 0x58], rax
mov rdi, rdx
mov qword [rsp + 0x38], r14
mov rbx, rcx
mov qword [rsp + 0x30], rbp
mov esi, ebp
mov word [rsp + 0x20], bp
mov r15d, ebp
mov dword [rsp + 0x28], ebp
mov r12d, ebp
test r14, r14
je 0x140021471
test rcx, rcx
je 0x140021471
test rdx, rdx
je 0x140021471
cmp byte [r14], sil
je 0x140021471
cmp byte [rcx], sil
je 0x140021471
cmp byte [rdx], sil
je 0x140021471
mov rcx, r14
mov qword [rsp + 0x8c0], r13
call fcn.140003550
mov r13, rax
test rax, rax
jne 0x140021069
mov rdx, r14
lea rcx, str.Could_not_convert__s_to_UTF_16
call fcn.140041aa0
jmp 0x140021422
mov rcx, rbx
call fcn.140003550
mov rsi, rax
test rax, rax
jne 0x14002108d
mov rdx, rbx
lea rcx, str.Could_not_convert__s_to_UTF_16
call fcn.140041aa0
jmp 0x140021422
mov rcx, rdi
call fcn.140003550
mov qword [rsp + 0x30], rax
test rax, rax
jne 0x1400210b3
mov rdx, rdi
lea rcx, str.Could_not_convert__s_to_UTF_16
call fcn.140041aa0
jmp 0x140021422
lea rdx, str.r__ccsUNICODE
mov rcx, r13
call fcn.14009b834
mov r14, rax
test rax, rax
jne 0x1400210e0
mov rdx, qword [rsp + 0x38]
lea rcx, str.Could_not_open_file__s_n
call fcn.140041aa0
jmp 0x140021422
mov edx, 2
lea rcx, [rsp + 0x20]
mov r9, r14
lea r8d, [rdx - 1]
call fcn.1400a6f3c
cmp rax, 1
jne 0x140021130
movzx eax, word [rsp + 0x20]
cmp eax, 0xbbef
je 0x14002111b
cmp eax, 0xfeff
mov ebx, 2
cmovne ebx, ebp
mov dword [rsp + 0x28], ebx
jmp 0x140021123
mov dword [rsp + 0x28], 1
xor r8d, r8d
xor edx, edx
mov rcx, r14
call fcn.1400a5ff0
mov rcx, 0xffffffffffffffff
nop word [rax + rax]
inc rcx
cmp word [r13 + rcx*2], bp
jne 0x140021140
add rcx, 2
mov edx, 2
call fcn.1400966e0
mov r15, rax
test rax, rax
jne 0x14002117a
lea rcx, str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.140041aa0
mov rcx, r14
call fcn.14009b928
jmp 0x140021422
mov rdx, r15
mov rcx, r13
sub rdx, r13
nop dword [rax]
nop word [rax + rax]
movzx eax, word [rcx]
mov word [rdx + rcx], ax
lea rcx, [rcx + 2]
test ax, ax
jne 0x140021190
mov rax, 0xffffffffffffffff
nop word [rax + rax]
cmp word [r15 + rax*2 + 2], bp
lea rax, [rax + 1]
jne 0x1400211b0
mov edx, dword [rsp + 0x28]
mov ecx, 0x7e
mov word [r15 + rax*2], cx
mov rcx, r15
mov rdx, qword [rsp + rdx*8 + 0x48]
call fcn.14009b834
mov rdi, rax
test rax, rax
jne 0x1400211f8
mov rdx, qword [rsp + 0x38]
lea rcx, str.Could_not_open_temporary_output_file__s_n
call fcn.140041aa0
mov rcx, r14
jmp 0x140021415
mov r8, r14
lea rcx, [rsp + 0x60]
mov edx, 0x400
call fcn.1400a62f0
test rax, rax
je 0x140021324
lea rdx, [0x1400d3b10]
lea rcx, [rsp + 0x60]
call fcn.1400a65cc
mov rbx, rax
mov edx, 0xffdf
lea rax, [rsp + 0x60]
movzx ecx, word [rax + rbx*2]
lea rax, [rax + rbx*2]
sub cx, 0x3b
test dx, cx
je 0x1400212f7
mov r8, 0xffffffffffffffff
nop dword [rax]
inc r8
cmp word [rsi + r8*2], bp
jne 0x140021250
mov rdx, rsi
mov rcx, rax
call fcn.1400a6b44
test eax, eax
jne 0x1400212f7
mov rax, 0xffffffffffffffff
inc rax
cmp word [rsi + rax*2], bp
jne 0x140021274
add rbx, rax
lea rcx, [rsp + 0x60]
lea rdx, [0x1400d3b10]
lea rcx, [rcx + rbx*2]
call fcn.1400a65cc
add rbx, rax
lea rcx, [rsp + 0x60]
cmp word [rsp + rbx*2 + 0x60], 0x3d
jne 0x1400212fc
inc rbx
lea rdx, [0x1400d3b10]
lea rcx, [rcx + rbx*2]
call fcn.1400a65cc
add rax, rbx
add rax, rax
cmp rax, 0x800
jae 0x140021475
mov rdx, rdi
mov word [rsp + rax + 0x60], bp
lea rcx, [rsp + 0x60]
call fcn.1400a5d7c
mov r8, qword [rsp + 0x30]
lea rdx, [0x1400e07e8]
mov rcx, rdi
call fcn.140012b20
mov r12, qword [rsp + 0x40]
jmp 0x140021304
lea rcx, [rsp + 0x60]
mov rdx, rdi
call fcn.1400a5d7c
mov r8, r14
lea rcx, [rsp + 0x60]
mov edx, 0x400
call fcn.1400a62f0
test rax, rax
jne 0x140021213
test r12, r12
jne 0x140021340
mov r9, qword [rsp + 0x30]
lea rdx, str._s___s_n
mov r8, rsi
mov rcx, rdi
call fcn.140012b20
mov r12, qword [rsp + 0x40]
mov rcx, r14
call fcn.14009b928
mov rcx, rdi
call fcn.14009b928
lea rdx, [0x1400e01b4]
mov rcx, r15
call fcn.14009b834
lea rdx, [0x1400e0804]
mov rcx, r13
mov rbx, rax
call fcn.14009b834
mov rdi, rax
test rbx, rbx
je 0x1400213ec
test rax, rax
je 0x1400213ec
cmp dword [rsp + 0x28], 2
lea rcx, [rsp + 0x24]
mov r9, rbx
mov r8d, 1
sete bpl
inc rbp
mov rdx, rbp
call fcn.1400a6f3c
cmp rax, 1
jne 0x1400213e2
nop word [rax + rax]
mov r9, rdi
lea rcx, [rsp + 0x24]
mov r8d, 1
mov rdx, rbp
call fcn.1400a6548
mov r9, rbx
lea rcx, [rsp + 0x24]
mov r8d, 1
mov rdx, rbp
call fcn.1400a6f3c
cmp rax, 1
je 0x1400213b0
mov rcx, rbx
call fcn.14009b928
jmp 0x140021412
mov rdx, qword [rsp + 0x38]
lea rcx, str.Could_not_write__s___original_file_has_been_left_unmodified_n
call fcn.140041aa0
mov r12, rbp
test rbx, rbx
je 0x14002140d
mov rcx, rbx
call fcn.14009b928
test rdi, rdi
je 0x14002141a
mov rcx, rdi
call fcn.14009b928
mov rcx, r15
call fcn.1400a702c
mov rcx, r13
call fcn.14009b5a0
mov rcx, r15
call fcn.14009b5a0
mov rcx, rsi
call fcn.14009b5a0
mov rcx, qword [rsp + 0x30]
call fcn.14009b5a0
mov r13, qword [rsp + 0x8c0]
mov rax, r12
mov rcx, qword [rsp + 0x860]
xor rcx, rsp
call fcn.140092060
add rsp, 0x870
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret
xor eax, eax
jmp 0x14002144f
call fcn.140092188
int3