Function at 0x66a180
Capabilities:
Encode data using xor
Encrypt data using salsa20 or chacha

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xd8
movups xmmword [rsp + 0xa0], xmm6
movups xmmword [rsp + 0xb0], xmm7
movups xmmword [rsp + 0xc0], xmm8
mov rax, qword [rsp + 0x140]
mov ebx, dword [r9]
mov esi, dword [r9 + 4]
mov edi, dword [r9 + 8]
mov r14d, dword [r9 + 0x14]
mov r10d, dword [r9 + 0x18]
mov r15d, dword [r9 + 0x1c]
mov qword [rsp + 0x130], r8
mov r8d, dword [rax]
cmp qword [rsp + 0x130], 0
mov qword [rsp + 0x120], rcx
mov dword [rsp + 0x30], r8d
mov r8d, dword [rax + 4]
mov qword [rsp + 0x128], rdx
mov ecx, dword [r9 + 0xc]
mov dword [rsp + 0x34], r8d
mov edx, dword [r9 + 0x10]
mov r8d, dword [rax + 8]
mov eax, dword [rax + 0xc]
mov dword [rsp + 0x38], ebx
mov dword [rsp + 0x3c], esi
mov dword [rsp + 0x40], edi
mov dword [rsp + 0x44], ecx
mov dword [rsp + 0x48], edx
mov dword [rsp + 0x4c], r14d
mov dword [rsp + 0x50], r10d
mov dword [rsp + 0x54], r15d
mov dword [rsp + 0x58], r8d
mov dword [rsp + 0x5c], eax
je 0x66a644
movd xmm1, ecx
movd xmm5, edi
movd xmm2, esi
movdqu xmm6, xmmword [str.expand_32_byte_k]
punpckldq xmm5, xmm1
movd xmm4, ebx
movd xmm1, r15d
movd xmm3, r10d
punpckldq xmm4, xmm2
movd xmm2, edx
punpckldq xmm3, xmm1
movd xmm1, r14d
movd xmm7, eax
punpckldq xmm2, xmm1
movd xmm1, r8d
punpckldq xmm1, xmm7
nop word cs:[rax + rax]
cmp qword [rsp + 0x130], 0x3f
jbe 0x66a8f0
sub qword [rsp + 0x130], 0x40
mov qword [rsp + 0x28], 0x40
mov esi, dword [rsp + 0x54]
mov r14d, dword [rsp + 0x5c]
mov ebx, 0x6b206574
mov dword [rsp + 0x24], 0xa
mov eax, dword [rsp + 0x58]
mov r8d, dword [rsp + 0x34]
mov r10d, 0x79622d32
mov r13d, 0x61707865
mov edx, dword [rsp + 0x30]
mov r12d, dword [rsp + 0x50]
mov dword [rsp], esi
mov esi, 0x3320646e
mov r11d, dword [rsp + 0x4c]
mov r9d, dword [rsp + 0x48]
mov r15d, dword [rsp + 0x44]
mov ecx, dword [rsp + 0x40]
mov edi, dword [rsp + 0x3c]
mov ebp, dword [rsp + 0x38]
nop dword [rax + rax]
add r13d, ebp
add esi, edi
add r10d, ecx
xor edx, r13d
xor r8d, esi
xor eax, r10d
rol edx, 0x10
rol r8d, 0x10
add r9d, edx
add r11d, r8d
rol eax, 0x10
xor ebp, r9d
xor edi, r11d
add r12d, eax
rol ebp, 0xc
rol edi, 0xc
xor ecx, r12d
add r13d, ebp
add esi, edi
rol ecx, 0xc
xor edx, r13d
xor r8d, esi
add r10d, ecx
rol edx, 8
rol r8d, 8
xor eax, r10d
add r9d, edx
add r11d, r8d
xor ebp, r9d
xor edi, r11d
mov dword [rsp + 0x1c], r9d
rol ebp, 7
rol edi, 7
mov dword [rsp + 0x20], r11d
rol eax, 8
add ebx, r15d
add r13d, edi
xor r14d, ebx
add r12d, eax
mov r9d, r14d
mov r14d, dword [rsp]
xor ecx, r12d
rol r9d, 0x10
rol ecx, 7
add r14d, r9d
add esi, ecx
xor r15d, r14d
mov r11d, r14d
xor edx, esi
rol r15d, 0xc
rol edx, 0x10
add ebx, r15d
xor r9d, ebx
rol r9d, 8
add r11d, r9d
xor r9d, r13d
rol r9d, 0x10
xor r15d, r11d
add r11d, edx
add r12d, r9d
rol r15d, 7
xor edi, r12d
rol edi, 0xc
add r13d, edi
xor r9d, r13d
mov r14d, r9d
mov r9d, dword [rsp + 0x1c]
rol r14d, 8
add r12d, r14d
xor edi, r12d
rol edi, 7
xor ecx, r11d
add r10d, r15d
add ebx, ebp
rol ecx, 0xc
xor r8d, r10d
xor eax, ebx
rol r8d, 0x10
add esi, ecx
rol eax, 0x10
xor edx, esi
add r9d, r8d
rol edx, 8
xor r15d, r9d
add r11d, edx
rol r15d, 0xc
xor ecx, r11d
mov dword [rsp], r11d
mov r11d, dword [rsp + 0x20]
add r10d, r15d
xor r8d, r10d
rol ecx, 7
add r11d, eax
rol r8d, 8
xor ebp, r11d
add r9d, r8d
rol ebp, 0xc
xor r15d, r9d
add ebx, ebp
rol r15d, 7
xor eax, ebx
rol eax, 8
add r11d, eax
xor ebp, r11d
rol ebp, 7
sub dword [rsp + 0x24], 1
jne 0x66a310
movd xmm0, ebx
movd xmm7, r10d
movd xmm8, esi
punpckldq xmm7, xmm0
movd xmm0, r13d
punpckldq xmm0, xmm8
movd xmm8, edi
punpcklqdq xmm0, xmm7
movd xmm7, ecx
paddd xmm0, xmm6
movups xmmword [rsp + 0x60], xmm0
movd xmm0, r15d
punpckldq xmm7, xmm0
movd xmm0, ebp
punpckldq xmm0, xmm8
movd xmm8, r11d
punpcklqdq xmm0, xmm7
movdqu xmm7, xmm4
punpcklqdq xmm7, xmm5
paddd xmm0, xmm7
movd xmm7, r12d
movups xmmword [rsp + 0x70], xmm0
movd xmm0, dword [rsp]
punpckldq xmm7, xmm0
movd xmm0, r9d
punpckldq xmm0, xmm8
movd xmm8, r8d
punpcklqdq xmm0, xmm7
movdqu xmm7, xmm2
punpcklqdq xmm7, xmm3
paddd xmm0, xmm7
movd xmm7, eax
mov rax, qword [rsp + 0x120]
movups xmmword [rsp + 0x80], xmm0
movd xmm0, r14d
punpckldq xmm7, xmm0
movd xmm0, edx
add rax, 0xf
sub rax, qword [rsp + 0x128]
punpckldq xmm0, xmm8
movd xmm8, dword [rsp + 0x34]
punpcklqdq xmm0, xmm7
movd xmm7, dword [rsp + 0x30]
punpckldq xmm7, xmm8
punpcklqdq xmm7, xmm1
paddd xmm0, xmm7
movups xmmword [rsp + 0x90], xmm0
cmp rax, 0x1e
jbe 0x66a910
mov rsi, qword [rsp + 0x28]
lea rax, [rsi - 1]
cmp rax, 0xe
jbe 0x66a910
mov rax, rsi
mov rsi, qword [rsp + 0x128]
movdqu xmm0, xmmword [rsp + 0x60]
shr rax, 4
movdqu xmm7, xmmword [rsi]
mov rsi, qword [rsp + 0x120]
pxor xmm0, xmm7
movups xmmword [rsp], xmm7
movups xmmword [rsi], xmm0
cmp rax, 1
je 0x66a678
mov rsi, qword [rsp + 0x128]
movdqu xmm0, xmmword [rsp + 0x70]
movdqu xmm7, xmmword [rsi + 0x10]
mov rsi, qword [rsp + 0x120]
pxor xmm0, xmm7
movups xmmword [rsp], xmm7
movups xmmword [rsi + 0x10], xmm0
cmp rax, 2
je 0x66a678
mov rsi, qword [rsp + 0x128]
movdqu xmm0, xmmword [rsp + 0x80]
movdqu xmm7, xmmword [rsi + 0x20]
mov rsi, qword [rsp + 0x120]
pxor xmm0, xmm7
movups xmmword [rsp], xmm7
movups xmmword [rsi + 0x20], xmm0
cmp rax, 4
jne 0x66a678
mov rax, qword [rsp + 0x128]
movdqu xmm0, xmmword [rsp + 0x90]
movdqu xmm7, xmmword [rax + 0x30]
pxor xmm0, xmm7
movups xmmword [rsp], xmm7
movups xmmword [rsi + 0x30], xmm0
mov rax, qword [rsp + 0x28]
add dword [rsp + 0x30], 1
add qword [rsp + 0x120], rax
add qword [rsp + 0x128], rax
cmp qword [rsp + 0x130], 0
jne 0x66a290
movups xmm6, xmmword [rsp + 0xa0]
movups xmm7, xmmword [rsp + 0xb0]
movups xmm8, xmmword [rsp + 0xc0]
add rsp, 0xd8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rbx, qword [rsp + 0x28]
mov rax, rbx
and rax, 0xfffffffffffffff0
test bl, 0xf
je 0x66a61b
mov rsi, qword [rsp + 0x128]
movzx edx, byte [rsi + rax]
mov rsi, qword [rsp + 0x120]
xor dl, byte [rsp + rax + 0x60]
mov byte [rsi + rax], dl
lea rdx, [rax + 1]
cmp rbx, rdx
jbe 0x66a61b
mov rsi, qword [rsp + 0x128]
lea rdx, [rax + 2]
movzx ecx, byte [rsi + rax + 1]
mov rsi, qword [rsp + 0x120]
xor cl, byte [rsp + rax + 0x61]
mov byte [rsi + rax + 1], cl
cmp rbx, rdx
jbe 0x66a61b
mov rsi, qword [rsp + 0x128]
lea rdx, [rax + 3]
movzx ecx, byte [rsi + rax + 2]
mov rsi, qword [rsp + 0x120]
xor cl, byte [rsp + rax + 0x62]
mov byte [rsi + rax + 2], cl
cmp rbx, rdx
jbe 0x66a61b
mov rsi, qword [rsp + 0x128]
lea rdx, [rax + 4]
movzx ecx, byte [rsi + rax + 3]
mov rsi, qword [rsp + 0x120]
xor cl, byte [rsp + rax + 0x63]
mov byte [rsi + rax + 3], cl
cmp rbx, rdx
jbe 0x66a61b
mov rsi, qword [rsp + 0x128]
lea rdx, [rax + 5]
movzx ecx, byte [rsi + rax + 4]
mov rsi, qword [rsp + 0x120]
xor cl, byte [rsp + rax + 0x64]
mov byte [rsi + rax + 4], cl
cmp rbx, rdx
jbe 0x66a61b
mov rsi, qword [rsp + 0x128]
lea rdx, [rax + 6]
movzx ecx, byte [rsi + rax + 5]
mov rsi, qword [rsp + 0x120]
xor cl, byte [rsp + rax + 0x65]
mov byte [rsi + rax + 5], cl
cmp rbx, rdx
jbe 0x66a61b
mov rsi, qword [rsp + 0x128]
lea rdx, [rax + 7]
movzx ecx, byte [rsi + rax + 6]
mov rsi, qword [rsp + 0x120]
xor cl, byte [rsp + rax + 0x66]
mov byte [rsi + rax + 6], cl
cmp rbx, rdx
jbe 0x66a61b
mov rsi, qword [rsp + 0x128]
lea rdx, [rax + 8]
movzx ecx, byte [rsi + rax + 7]
mov rsi, qword [rsp + 0x120]
xor cl, byte [rsp + rax + 0x67]
mov byte [rsi + rax + 7], cl
cmp rbx, rdx
jbe 0x66a61b
mov rsi, qword [rsp + 0x128]
lea rdx, [rax + 9]
movzx ecx, byte [rsi + rax + 8]
mov rsi, qword [rsp + 0x120]
xor cl, byte [rsp + rax + 0x68]
mov byte [rsi + rax + 8], cl
cmp rbx, rdx
jbe 0x66a61b
mov rsi, qword [rsp + 0x128]
lea rdx, [rax + 0xa]
movzx ecx, byte [rsi + rax + 9]
mov rsi, qword [rsp + 0x120]
xor cl, byte [rsp + rax + 0x69]
mov byte [rsi + rax + 9], cl
cmp rbx, rdx
jbe 0x66a61b
mov rsi, qword [rsp + 0x128]
lea rdx, [rax + 0xb]
movzx ecx, byte [rsi + rax + 0xa]
mov rsi, qword [rsp + 0x120]
xor cl, byte [rsp + rax + 0x6a]
mov byte [rsi + rax + 0xa], cl
cmp rbx, rdx
jbe 0x66a61b
mov rsi, qword [rsp + 0x128]
lea rdx, [rax + 0xc]
movzx ecx, byte [rsi + rax + 0xb]
mov rsi, qword [rsp + 0x120]
xor cl, byte [rsp + rax + 0x6b]
mov byte [rsi + rax + 0xb], cl
cmp rbx, rdx
jbe 0x66a61b
mov rsi, qword [rsp + 0x128]
lea rdx, [rax + 0xd]
movzx ecx, byte [rsi + rax + 0xc]
mov rsi, qword [rsp + 0x120]
xor cl, byte [rsp + rax + 0x6c]
mov byte [rsi + rax + 0xc], cl
cmp rbx, rdx
jbe 0x66a61b
mov rsi, qword [rsp + 0x128]
lea rdx, [rax + 0xe]
movzx ecx, byte [rsi + rax + 0xd]
mov rsi, qword [rsp + 0x120]
xor cl, byte [rsp + rax + 0x6d]
mov byte [rsi + rax + 0xd], cl
cmp rbx, rdx
jbe 0x66a61b
mov rbx, qword [rsp + 0x128]
movzx ecx, byte [rbx + rax + 0xe]
xor cl, byte [rsp + rax + 0x6e]
mov byte [rsi + rax + 0xe], cl
jmp 0x66a61b
mov rax, qword [rsp + 0x130]
mov qword [rsp + 0x130], 0
mov qword [rsp + 0x28], rax
jmp 0x66a2b1
mov r8, qword [rsp + 0x28]
mov r9, qword [rsp + 0x120]
xor eax, eax
lea rcx, [rsp + 0x60]
mov r10, qword [rsp + 0x128]
nop dword [rax]
movzx edx, byte [rcx + rax]
xor dl, byte [r10 + rax]
mov byte [r9 + rax], dl
add rax, 1
cmp r8, rax
jne 0x66a930
jmp 0x66a61b