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

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x50
cmp byte [r9 + 8], 9
mov r12, r9
mov r13d, dword [rsp + 0xa0]
mov rbx, r8
mov rdi, rdx
mov rsi, rcx
mov ebp, 0xffffff53
jne 0x14014874b
test rcx, rcx
je 0x14014848d
cmp qword [rcx + 0x178], 0
jne 0x14014848d
lea rax, [rcx + 0x180]
mov qword [rcx + 0x178], rax
test rdi, rdi
je 0x1401484aa
cmp qword [rdx + 0x178], 0
jne 0x1401484aa
lea rax, [rdx + 0x180]
mov qword [rdx + 0x178], rax
cmp r13d, 1
jne 0x1401485f8
test rsi, rsi
je 0x1401485ae
mov r14, qword [rcx + 0x178]
lea rdx, [r8 + 0x80]
movzx r15d, word [r9]
test r14, r14
je 0x140148588
test rdx, rdx
je 0x140148588
lea eax, [r15 - 0x10]
mov ecx, 0xffef
test cx, ax
jne 0x140148588
test dl, 3
je 0x14014850a
mov r8d, r15d
lea rcx, [rsp + 0x30]
call fcn.14014dae0
lea rdx, [rsp + 0x30]
mov eax, dword [rdx]
lea rcx, [rdx + 0x10]
mov dword [r14 + 0x10], eax
lea r8, str.expand_32_byte_kexpand_16_byte_k
mov eax, dword [rdx + 4]
cmp r15d, 0x20
mov dword [r14 + 0x14], eax
mov eax, dword [rdx + 8]
cmovne rcx, rdx
mov dword [r14 + 0x18], eax
mov eax, dword [rdx + 0xc]
mov dword [r14 + 0x1c], eax
lea rax, [0x1401d6170]
cmovne r8, rax
mov eax, dword [rcx]
mov dword [r14 + 0x20], eax
mov eax, dword [rcx + 4]
mov dword [r14 + 0x24], eax
mov eax, dword [rcx + 8]
mov dword [r14 + 0x28], eax
mov eax, dword [rcx + 0xc]
mov dword [r14 + 0x2c], eax
mov eax, dword [r8]
mov dword [r14], eax
mov eax, dword [r8 + 4]
mov dword [r14 + 4], eax
mov eax, dword [r8 + 8]
mov dword [r14 + 8], eax
mov eax, dword [r8 + 0xc]
mov dword [r14 + 0xc], eax
xor eax, eax
mov dword [r14 + 0x40], 0
jmp 0x14014858a
mov eax, ebp
movsd xmm0, qword [rbx + 0xc0]
mov ecx, dword [rbx + 0xc8]
movsd qword [rbx + 0xe8], xmm0
mov dword [rbx + 0xf0], ecx
test eax, eax
jne 0x140148fd4
test rdi, rdi
je 0x140148733
movzx r8d, word [r12]
lea rdx, [rbx + 0xa0]
mov rcx, qword [rdi + 0x178]
call fcn.140147050
movsd xmm0, qword [rbx + 0xd0]
mov ecx, dword [rbx + 0xd8]
movsd qword [rbx + 0xf4], xmm0
mov dword [rbx + 0xfc], ecx
test eax, eax
je 0x140148733
jmp 0x140148fd4
test rsi, rsi
je 0x1401486f2
mov r14, qword [rcx + 0x178]
lea rdx, [r8 + 0xa0]
movzx r15d, word [r9]
test r14, r14
je 0x1401486cc
test rdx, rdx
je 0x1401486cc
lea eax, [r15 - 0x10]
mov ecx, 0xffef
test cx, ax
jne 0x1401486cc
test dl, 3
je 0x14014864e
mov r8d, r15d
lea rcx, [rsp + 0x30]
call fcn.14014dae0
lea rdx, [rsp + 0x30]
mov eax, dword [rdx]
lea rcx, [rdx + 0x10]
mov dword [r14 + 0x10], eax
lea r8, str.expand_32_byte_kexpand_16_byte_k
mov eax, dword [rdx + 4]
cmp r15d, 0x20
mov dword [r14 + 0x14], eax
mov eax, dword [rdx + 8]
cmovne rcx, rdx
mov dword [r14 + 0x18], eax
mov eax, dword [rdx + 0xc]
mov dword [r14 + 0x1c], eax
lea rax, [0x1401d6170]
cmovne r8, rax
mov eax, dword [rcx]
mov dword [r14 + 0x20], eax
mov eax, dword [rcx + 4]
mov dword [r14 + 0x24], eax
mov eax, dword [rcx + 8]
mov dword [r14 + 0x28], eax
mov eax, dword [rcx + 0xc]
mov dword [r14 + 0x2c], eax
mov eax, dword [r8]
mov dword [r14], eax
mov eax, dword [r8 + 4]
mov dword [r14 + 4], eax
mov eax, dword [r8 + 8]
mov dword [r14 + 8], eax
mov eax, dword [r8 + 0xc]
mov dword [r14 + 0xc], eax
xor eax, eax
mov dword [r14 + 0x40], 0
jmp 0x1401486ce
mov eax, ebp
movsd xmm0, qword [rbx + 0xd0]
mov ecx, dword [rbx + 0xd8]
movsd qword [rbx + 0xe8], xmm0
mov dword [rbx + 0xf0], ecx
test eax, eax
jne 0x140148fd4
test rdi, rdi
je 0x140148733
movzx r8d, word [r12]
lea rdx, [rbx + 0x80]
mov rcx, qword [rdi + 0x178]
call fcn.140147050
movsd xmm0, qword [rbx + 0xc0]
mov ecx, dword [rbx + 0xc8]
movsd qword [rbx + 0xf4], xmm0
mov dword [rbx + 0xfc], ecx
test eax, eax
jne 0x140148fd4
test rsi, rsi
je 0x14014873f
mov byte [rsi + 0x1c5], 1
test rdi, rdi
je 0x14014874b
mov byte [rdi + 0x1c5], 1
cmp byte [r12 + 8], 4
jne 0x140148abd
test rsi, rsi
je 0x140148796
mov rax, qword [rsi]
test rax, rax
jne 0x140148786
mov rax, qword [0x143e6b7e0]
mov ecx, 0x198
test rax, rax
je 0x140148779
call rax
jmp 0x14014877e
call fcn.14003fdc8
mov qword [rsi], rax
test rax, rax
je 0x1401487c5
xor edx, edx
mov r8d, 0x198
mov rcx, rax
call fcn.14014e180
test rdi, rdi
je 0x1401487df
mov rax, qword [rdi]
test rax, rax
jne 0x1401487cf
mov rax, qword [0x143e6b7e0]
mov ecx, 0x198
test rax, rax
je 0x1401487b8
call rax
jmp 0x1401487bd
call fcn.14003fdc8
mov qword [rdi], rax
test rax, rax
jne 0x1401487cf
mov eax, 0xffffff83
jmp 0x140148fd4
xor edx, edx
mov r8d, 0x198
mov rcx, rax
call fcn.14014e180
test rsi, rsi
je 0x140148801
mov rax, qword [rsi]
test rax, rax
je 0x140148eac
mov rcx, qword [rsp + 0xa8]
mov qword [rax + 0x190], rcx
jmp 0x140148809
mov rcx, qword [rsp + 0xa8]
test rdi, rdi
je 0x140148821
mov rax, qword [rdi]
test rax, rax
je 0x140148eac
mov qword [rax + 0x190], rcx
cmp r13d, 1
jne 0x1401489c0
test rsi, rsi
je 0x1401488ef
mov r14, qword [rsi]
lea r13, [rbx + 0xc0]
lea r15, [rbx + 0x80]
test r14, r14
je 0x1401489b9
test r15, r15
je 0x1401489b9
xorps xmm0, xmm0
xor eax, eax
movups xmmword [r14], xmm0
mov r8, r14
xor edx, edx
movups xmmword [r14 + 0x10], xmm0
mov rcx, r15
movups xmmword [r14 + 0x20], xmm0
movups xmmword [r14 + 0x30], xmm0
movups xmmword [r14 + 0x40], xmm0
movups xmmword [r14 + 0x50], xmm0
movups xmmword [r14 + 0x60], xmm0
movups xmmword [r14 + 0x70], xmm0
mov dword [r14 + 0x180], eax
mov dword [r14 + 0x188], eax
call fcn.140142a60
test eax, eax
jne 0x140148fd4
lea r8, [r14 + 0x80]
lea rcx, [r15 + 8]
lea edx, [rax + 1]
call fcn.140142a60
test eax, eax
jne 0x140148fd4
lea r8, [r14 + 0x100]
xor edx, edx
lea rcx, [r15 + 0x10]
call fcn.140142a60
test eax, eax
jne 0x140148fd4
test r13, r13
je 0x1401489b2
mov rax, qword [r13]
mov qword [r14 + 0x180], rax
test rdi, rdi
je 0x140148a9d
lea r13, [rbx + 0xd0]
lea r15, [rbx + 0xa0]
mov r14, qword [rdi]
test r14, r14
je 0x1401489b9
test r15, r15
je 0x1401489b9
xorps xmm0, xmm0
lea rcx, [r15 + 0x10]
movups xmmword [r14], xmm0
xor eax, eax
mov r8, r14
movups xmmword [r14 + 0x10], xmm0
movups xmmword [r14 + 0x20], xmm0
lea edx, [rax + 1]
movups xmmword [r14 + 0x30], xmm0
movups xmmword [r14 + 0x40], xmm0
movups xmmword [r14 + 0x50], xmm0
movups xmmword [r14 + 0x60], xmm0
movups xmmword [r14 + 0x70], xmm0
mov dword [r14 + 0x180], eax
mov dword [r14 + 0x188], eax
call fcn.140142a60
test eax, eax
jne 0x140148fd4
lea r8, [r14 + 0x80]
xor edx, edx
lea rcx, [r15 + 8]
call fcn.140142a60
test eax, eax
jne 0x140148fd4
lea r8, [r14 + 0x100]
mov rcx, r15
lea edx, [rax + 1]
call fcn.140142a60
test eax, eax
jne 0x140148fd4
test r13, r13
je 0x140148a94
mov rax, qword [r13]
jmp 0x140148a96
xor eax, eax
jmp 0x1401488e8
mov eax, ebp
jmp 0x140148fd4
test rsi, rsi
je 0x140148a7c
mov r14, qword [rsi]
lea r13, [rbx + 0xd0]
lea r15, [rbx + 0xa0]
test r14, r14
je 0x1401489b9
test r15, r15
je 0x1401489b9
xorps xmm0, xmm0
xor eax, eax
movups xmmword [r14], xmm0
mov r8, r14
xor edx, edx
movups xmmword [r14 + 0x10], xmm0
mov rcx, r15
movups xmmword [r14 + 0x20], xmm0
movups xmmword [r14 + 0x30], xmm0
movups xmmword [r14 + 0x40], xmm0
movups xmmword [r14 + 0x50], xmm0
movups xmmword [r14 + 0x60], xmm0
movups xmmword [r14 + 0x70], xmm0
mov dword [r14 + 0x180], eax
mov dword [r14 + 0x188], eax
call fcn.140142a60
test eax, eax
jne 0x140148fd4
lea r8, [r14 + 0x80]
lea rcx, [r15 + 8]
lea edx, [rax + 1]
call fcn.140142a60
test eax, eax
jne 0x140148fd4
lea r8, [r14 + 0x100]
xor edx, edx
lea rcx, [r15 + 0x10]
call fcn.140142a60
test eax, eax
jne 0x140148fd4
test r13, r13
je 0x140148a73
mov rax, qword [r13]
jmp 0x140148a75
xor eax, eax
mov qword [r14 + 0x180], rax
test rdi, rdi
je 0x140148a9d
lea r13, [rbx + 0xc0]
lea r15, [rbx + 0x80]
jmp 0x140148906
xor eax, eax
mov qword [r14 + 0x180], rax
test rsi, rsi
je 0x140148aa9
mov byte [rsi + 0x1c5], 1
mov r13d, dword [rsp + 0xa0]
test rdi, rdi
je 0x140148abd
mov byte [rdi + 0x1c5], 1
cmp byte [r12 + 8], 6
jne 0x140148cf3
lea r14, [rsi + 8]
test rsi, rsi
je 0x140148aee
mov rcx, qword [r14]
test rcx, rcx
jne 0x140148ae1
lea rcx, [rsi + 0x10]
mov qword [r14], rcx
xor edx, edx
mov r8d, 0x150
call fcn.14014e180
lea r15, [rdi + 8]
test rdi, rdi
je 0x140148b19
mov rcx, qword [r15]
test rcx, rcx
jne 0x140148b06
lea rcx, [rdi + 0x10]
mov qword [r15], rcx
xor edx, edx
mov r8d, 0x150
call fcn.14014e180
lea rcx, [rsi + 8]
jmp 0x140148b1c
mov rcx, r14
mov rax, r15
test rsi, rsi
je 0x140148b59
mov rax, qword [r14]
test rax, rax
je 0x140148eac
mov rdx, qword [rsp + 0xa8]
xorps xmm0, xmm0
mov qword [rax + 0x148], rdx
xor r10d, r10d
movups xmmword [rax + 0x134], xmm0
mov dword [rax + 0x144], r10d
lea rax, [rdi + 8]
jmp 0x140148b64
mov rdx, qword [rsp + 0xa8]
xor r10d, r10d
test rdi, rdi
je 0x140148b91
mov rcx, qword [r15]
test rcx, rcx
je 0x140148eac
mov qword [rcx + 0x148], rdx
xorps xmm0, xmm0
movups xmmword [rcx + 0x134], xmm0
mov dword [rcx + 0x144], r10d
lea rcx, [rsi + 8]
cmp r13d, 1
jne 0x140148c3e
test rsi, rsi
je 0x140148be7
mov rcx, qword [rcx]
test rcx, rcx
je 0x1401489b9
movzx r8d, word [r12]
cmp r8d, 0xf0
ja 0x1401489b9
lea r9, [rbx + 0xc0]
mov dword [rsp + 0x28], r13d
lea rdx, [rbx + 0x80]
mov dword [rsp + 0x20], r10d
call fcn.14013d8c0
test eax, eax
jne 0x140148fd4
lea rax, [rdi + 8]
test rdi, rdi
je 0x140148cdb
mov rcx, qword [rax]
test rcx, rcx
je 0x1401489b9
movzx r8d, word [r12]
cmp r8d, 0xf0
ja 0x1401489b9
lea r9, [rbx + 0xd0]
mov dword [rsp + 0x28], 1
lea rdx, [rbx + 0xa0]
mov dword [rsp + 0x20], 1
call fcn.14013d8c0
test eax, eax
je 0x140148cdb
jmp 0x140148fd4
test rsi, rsi
je 0x140148c8d
mov rcx, qword [rcx]
test rcx, rcx
je 0x1401489b9
movzx r8d, word [r12]
cmp r8d, 0xf0
ja 0x1401489b9
lea r9, [rbx + 0xd0]
mov dword [rsp + 0x28], 1
lea rdx, [rbx + 0xa0]
mov dword [rsp + 0x20], r10d
call fcn.14013d8c0
test eax, eax
jne 0x140148fd4
lea rax, [rdi + 8]
test rdi, rdi
je 0x140148cdb
mov rcx, qword [rax]
test rcx, rcx
je 0x1401489b9
movzx r8d, word [r12]
cmp r8d, 0xf0
ja 0x1401489b9
lea r9, [rbx + 0xc0]
mov dword [rsp + 0x28], 1
lea rdx, [rbx + 0x80]
mov dword [rsp + 0x20], 1
call fcn.14013d8c0
test eax, eax
jne 0x140148fd4
test rsi, rsi
je 0x140148ce7
mov byte [rsi + 0x1c5], 1
test rdi, rdi
je 0x140148cf3
mov byte [rdi + 0x1c5], 1
cmp byte [r12 + 8], 7
jne 0x140148fb4
lea r15, [rsi + 8]
test rsi, rsi
je 0x140148d24
mov rcx, qword [r15]
test rcx, rcx
jne 0x140148d17
lea rcx, [rsi + 0x10]
mov qword [r15], rcx
xor edx, edx
mov r8d, 0x150
call fcn.14014e180
test rdi, rdi
je 0x140148d4d
mov rcx, qword [rdi + 8]
test rcx, rcx
jne 0x140148d3a
lea rcx, [rdi + 0x10]
mov qword [rdi + 8], rcx
xor edx, edx
mov r8d, 0x150
call fcn.14014e180
lea r14, [rsi + 8]
jmp 0x140148d50
mov r14, r15
test rsi, rsi
je 0x140148d86
mov rax, qword [r15]
test rax, rax
je 0x140148eac
mov rcx, qword [rsp + 0xa8]
xorps xmm0, xmm0
mov qword [rax + 0x148], rcx
xor r15d, r15d
movups xmmword [rax + 0x134], xmm0
mov dword [rax + 0x144], r15d
jmp 0x140148d91
mov rcx, qword [rsp + 0xa8]
xor r15d, r15d
test rdi, rdi
je 0x140148dbf
mov rax, qword [rdi + 8]
test rax, rax
je 0x140148eac
xorps xmm0, xmm0
mov qword [rax + 0x148], rcx
movups xmmword [rax + 0x134], xmm0
mov dword [rax + 0x144], r15d
lea r14, [rsi + 8]
cmp r13d, 1
jne 0x140148eb6
test rsi, rsi
je 0x140148e73
movzx r8d, word [r12]
lea rdx, [rbx + 0x80]
mov rcx, qword [r14]
call fcn.140141300
test eax, eax
jne 0x140148fd4
cmp dword [rsp + 0xc0], 0
lea rdx, [rbx + 0xc0]
movsd xmm0, qword [rdx]
mov eax, dword [rdx + 8]
movsd qword [rbx + 0xe8], xmm0
mov dword [rbx + 0xf0], eax
jne 0x140148e73
mov r14, qword [r14]
test r14, r14
je 0x1401489b9
mov rcx, qword [rsp + 0xb8]
test rcx, rcx
je 0x1401489b9
test rdx, rdx
je 0x1401489b9
mov eax, dword [rdx]
lea r8d, [r13 + 7]
lea rdx, [r14 + 0xfc]
mov dword [r14 + 0xf8], eax
call fcn.140146240
mov ebp, eax
test eax, eax
jne 0x1401489b9
mov qword [r14 + 0x118], 0
mov dword [r14 + 0x120], shutdown
test rdi, rdi
je 0x140148f9c
movzx r8d, word [r12]
lea rdx, [rbx + 0xa0]
mov rcx, qword [rdi + 8]
call fcn.140141300
test eax, eax
jne 0x140148fd4
movsd xmm0, qword [rbx + 0xd0]
mov eax, dword [rbx + 0xd8]
jmp 0x140148f8e
mov eax, 0xffffff4a
jmp 0x140148fd4
test rsi, rsi
je 0x140148f62
movzx r8d, word [r12]
lea rdx, [rbx + 0xa0]
mov rcx, qword [r14]
call fcn.140141300
test eax, eax
jne 0x140148fd4
cmp dword [rsp + 0xc0], 0
lea rdx, [rbx + 0xd0]
movsd xmm0, qword [rdx]
mov eax, dword [rdx + 8]
movsd qword [rbx + 0xe8], xmm0
mov dword [rbx + 0xf0], eax
jne 0x140148f62
mov r14, qword [r14]
test r14, r14
je 0x1401489b9
mov rcx, qword [rsp + 0xb8]
test rcx, rcx
je 0x1401489b9
test rdx, rdx
je 0x1401489b9
mov eax, dword [rdx]
mov r8d, 8
lea rdx, [r14 + 0xfc]
mov dword [r14 + 0xf8], eax
call fcn.140146240
mov ebp, eax
test eax, eax
jne 0x1401489b9
mov qword [r14 + 0x118], 0
mov dword [r14 + 0x120], shutdown
test rdi, rdi
je 0x140148f9c
movzx r8d, word [r12]
lea rdx, [rbx + 0x80]
mov rcx, qword [rdi + 8]
call fcn.140141300
test eax, eax
jne 0x140148fd4
movsd xmm0, qword [rbx + 0xc0]
mov eax, dword [rbx + 0xc8]
movsd qword [rbx + 0xf4], xmm0
mov dword [rbx + 0xfc], eax
test rsi, rsi
je 0x140148fa8
mov byte [rsi + 0x1c5], 1
test rdi, rdi
je 0x140148fb4
mov byte [rdi + 0x1c5], 1
test rsi, rsi
je 0x140148fc2
xor eax, eax
mov qword [rbx + 0x108], rax
test rdi, rdi
je 0x140148fd2
mov qword [rbx + 0x100], 0
xor eax, eax
lea r11, [rsp + 0x50]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret