Function at 0x14016d380
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push r15
push r14
push rsi
push rdi
push rbx
sub rsp, 0x30
mov rax, qword [0x140448038]
xor rax, rsp
mov qword [rsp + 0x28], rax
mov rsi, qword [rcx + 0x10]
test rsi, rsi
je 0x14016d725
mov rdi, rcx
lea rax, [rcx + 0x28]
cmp rsi, rax
je 0x14016d3de
movsxd rcx, dword [rdi + 0x18]
add rcx, rsi
add rcx, 0xfffffffffffffff0
mov qword [rdi + 8], rcx
mov qword [rdi + 0x10], rax
cmp qword [rdi + 0x48], 1
jne 0x14016d725
mov qword [rdi + 0x48], 2
jmp 0x14016d725
mov rax, qword [rdi + 8]
movups xmm0, xmmword [rax]
movups xmmword [rsi], xmm0
cmp dword [rdi + 0x54], 0
jle 0x14016d6d0
test r8d, r8d
js case.default.0x14016d4d3
movsxd r10, edx
add r10, rsi
lea rax, [rdi + 0x38]
cmp r10, rax
jae case.default.0x14016d4d3
lea rcx, [0x140429db0]
movzx r9d, byte [r10]
test r9b, r9b
js 0x14016d426
inc r10
mov rdx, r10
jmp 0x14016d4a3
movzx r11d, byte [r10 + 1]
mov edx, r11d
shl edx, 7
add r9d, edx
add r9d, 0xffffff80
lea rdx, [r10 + 2]
test r11b, r11b
jns 0x14016d4a3
movzx r11d, byte [rdx]
mov edx, r11d
shl edx, 0xe
add r9d, edx
add r9d, 0xffffc000
mov edx, 2
test r11b, r11b
jns 0x14016d49d
movzx r11d, byte [r10 + 3]
mov edx, r11d
shl edx, 0x15
add r9d, edx
add r9d, 0xffe00000
mov edx, 3
test r11b, r11b
jns 0x14016d49d
movzx edx, byte [r10 + 4]
test dl, dl
js case.default.0x14016d4d3
shl edx, 0x1c
add r9d, edx
add r9d, 0xf0000000
mov edx, 4
add rdx, r10
inc rdx
test rdx, rdx
je case.default.0x14016d4d3
cmp rdx, rax
ja case.default.0x14016d4d3
test r9d, r9d
je 0x14016d6d0
and r9d, 7
cmp r9d, 5
ja case.default.0x14016d4d3
movsxd r9, dword [rcx + r9*4]
add r9, rcx
jmp r9
cmp byte [rdx], 0
js 0x14016d5ab
inc rdx
mov r10, rdx
jmp 0x14016d61c
add rdx, 8
jmp 0x14016d624
movzx r9d, byte [rdx]
lea r10, [rdx + 1]
test r9b, r9b
jns 0x14016d569
movzx r11d, byte [r10]
mov r10d, r11d
shl r10d, 7
add r9d, r10d
add r9d, 0xffffff80
mov r10d, 1
test r11b, r11b
jns 0x14016d563
movzx r11d, byte [rdx + 2]
mov r10d, r11d
shl r10d, 0xe
add r9d, r10d
add r9d, 0xffffc000
mov r10d, 2
test r11b, r11b
jns 0x14016d563
movzx r11d, byte [rdx + 3]
mov r10d, r11d
shl r10d, 0x15
add r9d, r10d
add r9d, 0xffe00000
mov r10d, 3
test r11b, r11b
js 0x14016d632
add r10, rdx
inc r10
test r10, r10
je case.default.0x14016d4d3
movsxd rdx, r9d
mov r9, rax
sub r9, r10
cmp r9, rdx
jl case.default.0x14016d4d3
add r10, rdx
mov rdx, r10
jmp 0x14016d624
inc r8d
jmp 0x14016d624
test r8d, r8d
jle 0x14016d6d0
dec r8d
jmp 0x14016d624
add rdx, 4
jmp 0x14016d624
lea r10, [rdx + 2]
cmp byte [rdx + 1], 0
jns 0x14016d61c
mov r9d, 2
cmp byte [r10], 0
jns 0x14016d615
mov r9d, 3
cmp byte [rdx + 3], 0
jns 0x14016d615
mov r9d, 4
cmp byte [rdx + 4], 0
jns 0x14016d615
mov r9d, 5
cmp byte [rdx + 5], 0
jns 0x14016d615
mov r9d, 6
cmp byte [rdx + 6], 0
jns 0x14016d615
mov r9d, 7
cmp byte [rdx + 7], 0
jns 0x14016d615
mov r9d, 8
cmp byte [rdx + 8], 0
jns 0x14016d615
mov r9d, 9
cmp byte [rdx + 9], 0
js case.default.0x14016d4d3
lea r10, [rdx + r9]
inc r10
mov rdx, r10
test r10, r10
je case.default.0x14016d4d3
mov r10, rdx
cmp rdx, rax
jb 0x14016d415
jmp case.default.0x14016d4d3
movzx r10d, byte [rdx + 4]
cmp r10d, 7
ja case.default.0x14016d4d3
shl r10d, 0x1c
add r9d, r10d
add r9d, 0xf0000000
cmp r9d, 0x7fffffef
ja case.default.0x14016d4d3
add rdx, 5
mov r10, rdx
jmp 0x14016d569
movabs rax, 0xaaaaaaaaaaaaaaaa
lea rbx, [rsp + 0x20]
mov qword [rbx], rax
lea r14, [rdi + 0x18]
mov rcx, qword [rdi + 0x20]
mov rax, qword [rcx]
mov rax, qword [rax + 8]
mov rdx, rbx
mov r8, r14
call qword [case.0x1402ceef0.0]
test al, al
je 0x14016d6c9
mov r15d, dword [rdi + 0x18]
sub dword [rdi + 0x54], r15d
cmp r15d, 0x11
jge 0x14016d6fb
test r15d, r15d
jle 0x14016d676
lea rcx, [rdi + 0x38]
mov rdx, qword [rsp + 0x20]
mov r8, r15
call fcn.140255620
mov qword [rdi + 0x10], rsi
add r15, rsi
mov qword [rdi + 8], r15
cmp qword [rdi + 0x48], 2
jae 0x14016d71a
jmp 0x14016d725
mov dword [rdi + 0x54], 0
cmp qword [rdi + 0x48], 2
jne 0x14016d6e2
mov rax, qword [rdi + 8]
sub rax, rsi
mov qword [rdi + 0x48], rax
mov qword [rdi + 0x10], 0
lea rax, [rdi + 0x38]
mov qword [rdi + 8], rax
mov dword [rdi + 0x18], 0
jmp 0x14016d725
lea rax, [rdi + 0x38]
mov rcx, qword [rsp + 0x20]
movups xmm0, xmmword [rcx]
movups xmmword [rdi + 0x38], xmm0
mov qword [rdi + 0x10], rcx
mov qword [rdi + 8], rax
cmp qword [rdi + 0x48], 1
jbe 0x14016d725
add rdi, 0x48
mov qword [rdi], 1
mov rcx, qword [rsp + 0x28]
xor rcx, rsp
call fcn.140253b80
mov rax, rsi
add rsp, 0x30
pop rbx
pop rdi
pop rsi
pop r14
pop r15
ret