Function at 0x140016830
Capabilities:
Encode data using xor

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x58
lea rbp, [rsp + 0x50]
mov qword [rbp], 0xfffffffffffffffe
mov qword [rbp - 0x20], r9
mov rsi, r8
mov rbx, rdx
mov rdi, rcx
mov r14, qword [rbp + 0x70]
test r14, r14
je 0x1400168b8
cmp r14, 1
jne 0x1400168f2
test rsi, rsi
je 0x140016977
js 0x140016b95
mov rax, qword [rbp - 0x20]
movzx r15d, byte [rax]
movzx eax, byte [0x14005a181]
mov r14d, 1
mov edx, 1
mov rcx, rsi
call fcn.140005de0
test rax, rax
je 0x140016b98
cmp rsi, 8
jae 0x140016a9f
xor ecx, ecx
jmp 0x140016b50
test rsi, rsi
je 0x140016981
js 0x140016ba3
movzx eax, byte [0x14005a181]
mov r15d, 1
mov edx, 1
mov rcx, rsi
call fcn.140005de0
test rax, rax
je 0x140016ba6
mov r14, rax
jmp 0x140016987
test rsi, rsi
je 0x1400169a1
mov qword [rbp - 0x28], rdi
mov rax, qword [rbp - 0x20]
movzx edi, byte [rax]
cmp r14, 3
mov r12d, 1
sbb r12, 0xffffffffffffffff
movzx r15d, byte [rbx]
movzx eax, byte [0x14005a181]
mov ecx, 8
mov edx, 1
call fcn.140005de0
test rax, rax
je 0x140016bb1
xor r15b, dil
mov byte [rax], r15b
mov qword [rbp - 0x18], 8
mov qword [rbp - 0x10], rax
mov qword [rbp - 8], 1
cmp rsi, 1
jne 0x1400169bd
mov rax, qword [rbp - 8]
mov rdi, qword [rbp - 0x28]
mov qword [rdi + 0x10], rax
mov rax, qword [rbp - 0x18]
mov qword [rdi], rax
mov rax, qword [rbp - 0x10]
mov qword [rdi + 8], rax
jmp 0x140016b6d
mov eax, 1
jmp 0x140016b62
mov r14d, 1
mov rcx, r14
mov rdx, rbx
mov r8, rsi
call sub.VCRUNTIME140.dll_memcpy
mov qword [rdi], rsi
mov qword [rdi + 8], r14
jmp 0x140016b69
mov qword [rdi], 0
mov qword [rdi + 8], 1
mov qword [rdi + 0x10], 0
jmp 0x140016b6d
add rsi, rbx
inc rbx
mov r13d, 1
test r14b, 1
je 0x1400169fe
jmp 0x140016a5e
mov rax, qword [rbp - 0x10]
inc rbx
mov byte [rax + r13], r15b
inc r13
mov qword [rbp - 8], r13
mov r12, rdi
cmp rbx, rsi
je 0x140016957
cmp r12, r14
jae 0x140016b81
lea rcx, [r12 + 2]
xor edi, edi
cmp rcx, r14
sete dil
cmovb rdi, rcx
movzx r15d, byte [rbx]
mov rcx, qword [rbp - 0x20]
xor r15b, byte [rcx + r12]
cmp r13, qword [rbp - 0x18]
jne 0x1400169e4
mov r8d, 1
lea rcx, [rbp - 0x18]
mov rdx, r13
call fcn.14003f1d0
jmp 0x1400169e0
mov rax, qword [rbp - 0x10]
inc rbx
mov byte [rax + r13], r15b
inc r13
mov qword [rbp - 8], r13
mov r12, rdi
cmp rbx, rsi
je 0x140016957
cmp r12, r14
jae 0x140016b81
lea rcx, [r12 + 2]
xor edi, edi
cmp rcx, r14
setne dil
cmovb rdi, rcx
movzx r15d, byte [rbx]
mov rcx, qword [rbp - 0x20]
xor r15b, byte [rcx + r12]
cmp r13, qword [rbp - 0x18]
jne 0x140016a44
mov r8d, 1
lea rcx, [rbp - 0x18]
mov rdx, r13
call fcn.14003f1d0
jmp 0x140016a40
movzx edx, r15b
cmp rsi, 0x20
jae 0x140016aad
xor ecx, ecx
jmp 0x140016b06
movabs rcx, 0x7fffffffffffffe0
and rcx, rsi
movd xmm0, edx
punpcklbw xmm0, xmm0
pshuflw xmm0, xmm0, 0
pshufd xmm0, xmm0, 0
xor r8d, r8d
nop
movdqu xmm1, xmmword [rbx + r8]
movdqu xmm2, xmmword [rbx + r8 + 0x10]
pxor xmm1, xmm0
pxor xmm2, xmm0
movdqu xmmword [rax + r8], xmm1
movdqu xmmword [rax + r8 + 0x10], xmm2
add r8, 0x20
cmp rcx, r8
jne 0x140016ad0
cmp rcx, rsi
je 0x140016b62
test sil, 0x18
je 0x140016b50
mov r8, rcx
movabs rcx, 0x7ffffffffffffff8
and rcx, rsi
movd xmm0, edx
punpcklbw xmm0, xmm0
pshuflw xmm0, xmm0, 0
nop word cs:[rax + rax]
movq xmm1, qword [rbx + r8]
pxor xmm1, xmm0
movq qword [rax + r8], xmm1
add r8, 8
cmp rcx, r8
jne 0x140016b30
cmp rcx, rsi
je 0x140016b62
nop
movzx edx, byte [rbx + rcx]
xor dl, r15b
mov byte [rax + rcx], dl
inc rcx
cmp rsi, rcx
jne 0x140016b50
mov qword [rdi], rsi
mov qword [rdi + 8], rax
mov qword [rdi + 0x10], rsi
mov rax, rdi
add rsp, 0x58
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
lea r8, [0x1400454a0]
mov rcx, r12
mov rdx, r14
call fcn.140042a40
ud2
xor r14d, r14d
mov rcx, r14
mov rdx, rsi
call fcn.140042770
xor r15d, r15d
mov rcx, r15
mov rdx, rsi
call fcn.140042770
mov ecx, 1
mov edx, 8
call fcn.140042770
int3