Function at 0x1400d2180
Capabilities:
Encrypt data using salsa20 or chacha

Disassembly:
push rdi
sub rsp, 0x20
cmp rdx, 0x400
ja 0x1400d21c0
lea rax, [rdx + 7]
shr rax, 3
mov rax, qword [rcx + rax*8 + 8]
mov r9, qword [rax + 0x10]
test r9, r9
je 0x1400d21c0
mov rdx, qword [r9]
add dword [rax + 0x18], 1
mov qword [rax + 0x10], rdx
test r8b, r8b
jne 0x1400d21d8
mov rax, r9
add rsp, 0x20
pop rdi
ret
xor r9d, r9d
movzx r8d, r8b
add rsp, 0x20
pop rdi
jmp fcn.1400d81f0
mov ecx, 8
test byte [rax + 0xf], 1
je 0x1400d2200
mov rax, qword [0x140207500]
cmp byte [rax], 0
je 0x1400d2208
mov rdi, r9
xor eax, eax
rep stosb byte [rdi], al
jmp 0x1400d21b4
mov ecx, dword [rax + 0x1c]
jmp 0x1400d21e3
mov r8, rcx
xor edx, edx
mov rcx, r9
call sub.msvcrt.dll_memset
mov r9, rax
jmp 0x1400d21b4
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x38
mov rbp, qword [0x140207460]
mov rax, qword [rbp]
mov qword [rsp + 0x28], rax
xor eax, eax
mov rbx, r8
mov r8d, dword [rsp + 0x90]
mov rdi, r9
lea r13, [rbx - 1]
mov r12d, r8d
test r9, r9
jne 0x140187ca0
cmp rdx, rbx
jb 0x140187ca0
cmp rdx, 0x80
ja 0x140187ba7
test r13, rdx
je 0x140187d00
cmp rbx, 0x1000000
ja 0x140187cb2
lea rdx, [rdx + rbx - 1]
movzx r8d, r8b
call 0x1400d2180
mov rsi, rax
test rax, rax
je 0x140187d20
add rdi, rax
mov rdx, rax
and r13, rdi
je 0x140187c80
xor r12d, r12d
add rbx, rsi
sub rbx, r13
cmp rbx, rsi
je 0x140187c1e
lea rcx, [rsi - 1]
mov rax, rsi
and rcx, 0xfffffffffe000000
sub rax, rcx
shr rax, 0x10
lea rax, [rax + rax*4]
shl rax, 4
mov r8d, dword [rcx + rax + 0x10c]
add rax, 0x108
sub rax, r8
or byte [rcx + rax + 0xe], 2
mov rax, rsi
mov rsi, rbx
nop dword [rax]
test r12b, r12b
je 0x140187c80
sub rdx, 1
mov rbx, rsi
and rdx, 0xfffffffffe000000
sub rbx, rax
sub rax, rdx
shr rax, 0x10
lea rax, [rax + rax*4]
shl rax, 4
mov r8d, dword [rdx + rax + 0x10c]
lea rcx, [rax + 0x108]
mov rax, rcx
sub rax, r8
add rdx, rax
mov r8d, dword [rdx + 0x1c]
cmp r8, 0x7fffffff
ja 0x140187d40
sub r8, rbx
test r8, r8
jg 0x140187ce8
nop
mov rax, qword [rsp + 0x28]
sub rax, qword [rbp]
jne 0x140187d5f
mov rax, rsi
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
cmp rbx, 0x1000000
jbe 0x140187bb4
test rdi, rdi
jne 0x140187d20
mov eax, 0x401
mov r9, rbx
cmp rdx, rax
cmovb rdx, rax
xor r8d, r8d
call fcn.1400d20f0
mov rsi, rax
test rax, rax
je 0x140187d20
mov rdx, rax
and r13, rax
je 0x140187c28
jmp 0x140187be0
mov rax, qword [0x140207500]
cmp byte [rax], 0
je 0x140187d30
mov rdi, rsi
mov rcx, r8
xor eax, eax
rep stosb byte [rdi], al
jmp 0x140187c80
mov rax, qword [rsp + 0x28]
sub rax, qword [rbp]
jne 0x140187d5f
movzx r8d, r8b
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
jmp 0x1400d2180
xor esi, esi
jmp 0x140187c80
xor edx, edx
mov rcx, rsi
call sub.msvcrt.dll_memset
jmp 0x140187c80
lea rcx, [rdx - 1]
lea r8, [rsp + 0x20]
and rcx, 0xfffffffffe000000
call fcn.1400db160
mov r8, qword [rsp + 0x20]
jmp 0x140187c76
call fcn.1401be670
nop
nop word cs:[rax + rax]
push rsi
push rbx
mov eax, dword [rsp + 0x38]
mov r11, rcx
test r8, r8
je 0x140187dd0
lea r10, [r8 - 1]
test r8, r10
jne 0x140187dd0
test rdx, rdx
js 0x140187dd0
movzx eax, al
cmp rdx, 0x400
ja 0x140187dd8
cmp rdx, r8
jb 0x140187dd8
lea rcx, [rdx + 7]
shr rcx, 3
mov rbx, qword [r11 + rcx*8 + 8]
mov rcx, qword [rbx + 0x10]
lea rsi, [rcx + r9]
test rsi, r10
jne 0x140187dd8
test rcx, rcx
je 0x140187dd8
mov r8, rdx
mov r9d, eax
mov rdx, rbx
mov rcx, r11
pop rbx
pop rsi
jmp fcn.1400d1fe0
xor eax, eax
pop rbx
pop rsi
ret
mov rcx, r11
mov dword [rsp + 0x38], eax
pop rbx
pop rsi
jmp 0x140187b50