Function at 0x14009a4e0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x48
mov rbx, qword [rdx]
mov r11d, r8d
mov r10, qword [rcx + 0x18]
mov rsi, rcx
mov r9, qword [rcx]
mov eax, dword [r10 + 8]
cdq
sub eax, edx
mov edx, dword [r10 + 4]
sar eax, 1
cmp r8d, eax
cmovg r11d, eax
shl edx, 2
xor ebp, ebp
mov dword [rsp + 0xa0], r11d
mov dword [rsp + 0xa8], edx
test r11d, r11d
jle 0x14009a67a
movsxd r12, edx
mov rcx, r10
mov qword [rsp + 8], r12
nop word [rax + rax]
imul eax, ebp, 0xff
xor r15d, r15d
cdq
idiv r11d
not al
cmp dword [rcx + 4], r15d
jle 0x14009a649
mov r12, qword [rsp + 0x90]
mov edi, 0xff
movzx esi, al
mov r14, rbx
mov rax, rbx
mov r13, rbx
sub rax, r9
sub edi, esi
sub r14, r9
sub r13, r9
add rax, 2
mov rcx, r9
mov r11, rax
nop word [rax + rax]
movzx r8d, byte [r14 + rcx]
inc r15d
movzx eax, byte [rcx]
lea rcx, [rcx + 4]
imul eax, edi
imul r8d, esi
add r8d, eax
mov eax, 0x80808081
imul r8d
add edx, r8d
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
movzx eax, byte [rcx - 3]
mov byte [rcx - 4], dl
movzx r8d, byte [rcx + r13 - 3]
imul eax, edi
imul r8d, esi
add r8d, eax
mov eax, 0x80808081
imul r8d
add edx, r8d
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
movzx eax, byte [rcx - 2]
mov byte [rcx - 3], dl
movzx r8d, byte [r11 + rcx - 4]
imul eax, edi
mov byte [rcx - 1], 0xff
imul r8d, esi
add r8d, eax
mov eax, 0x80808081
imul r8d
add edx, r8d
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rcx - 2], dl
mov r10, qword [r12 + 0x18]
cmp r15d, dword [r10 + 4]
jl 0x14009a5a0
mov r11d, dword [rsp + 0xa0]
mov r12, qword [rsp + 8]
add rbx, r12
add r9, r12
inc ebp
mov rcx, r10
cmp ebp, r11d
jl 0x14009a550
mov rbx, qword [rsp + 0x98]
mov rsi, qword [rsp + 0x90]
mov edx, dword [rsp + 0xa8]
mov rbx, qword [rbx]
mov r9, qword [rsi]
mov eax, dword [r10 + 8]
xor edi, edi
sub eax, r11d
mov dword [rsp + 0x98], edi
imul eax, edx
cdqe
lea r14, [rax + rbx]
mov qword [rsp], r14
lea r8, [rax + r9]
test r11d, r11d
jle 0x14009a84b
mov rax, qword [rsi + 0x18]
lea r10, [r8 + 2]
movsxd rbx, edx
lea rbp, [r14 + 2]
mov qword [rsp + 0x30], rbx
mov qword [rsp + 0x10], r10
mov ecx, dword [rax + 4]
mov qword [rsp + 8], rbp
nop word [rax + rax]
mov eax, edi
mov dword [rsp + 0xa8], 0
sub eax, r11d
inc eax
imul eax, eax, 0xff
cdq
idiv r11d
dec al
test ecx, ecx
jle 0x14009a81f
mov r11d, dword [rsp + 0xa8]
mov r15, r14
mov rdi, qword [rsp + 0x90]
sub r15, r8
movzx ebx, al
mov r12, rbp
mov rax, rbp
mov r13, r10
sub rax, r8
mov esi, 0xff
sub esi, ebx
sub r12, r8
dec rax
sub r13, r8
mov qword [rsp + 0x18], rax
mov r9, r8
mov r14, qword [rsp + 0x18]
mov rax, r10
sub rax, r8
dec rax
mov qword [rsp + 0x20], rax
mov rax, r10
mov rbp, qword [rsp + 0x20]
sub rax, r8
inc rax
mov r10, rax
nop word [rax + rax]
movzx ecx, byte [r9 + r15]
inc r11d
movzx eax, byte [r9]
lea r9, [r9 + 4]
imul eax, esi
imul ecx, ebx
add ecx, eax
mov eax, 0x80808081
imul ecx
add edx, ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
movzx eax, byte [r9 + rbp - 4]
mov byte [r9 - 4], dl
movzx ecx, byte [r14 + r9 - 4]
imul eax, esi
imul ecx, ebx
add ecx, eax
mov eax, 0x80808081
imul ecx
add edx, ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
movzx eax, byte [r9 + r13 - 4]
mov byte [r9 + rbp - 4], dl
movzx ecx, byte [r12 + r9 - 4]
imul eax, esi
imul ecx, ebx
mov byte [r10 + r9 - 4], 0xff
add ecx, eax
mov eax, 0x80808081
imul ecx
add edx, ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [r9 + r13 - 4], dl
mov rax, qword [rdi + 0x18]
mov ecx, dword [rax + 4]
cmp r11d, ecx
jl 0x14009a760
mov r11d, dword [rsp + 0xa0]
mov r10, qword [rsp + 0x10]
mov rbx, qword [rsp + 0x30]
mov edi, dword [rsp + 0x98]
mov rbp, qword [rsp + 8]
mov r14, qword [rsp]
add r14, rbx
add rbp, rbx
add r10, rbx
mov qword [rsp], r14
inc edi
mov qword [rsp + 8], rbp
add r8, rbx
mov qword [rsp + 0x10], r10
mov dword [rsp + 0x98], edi
cmp edi, r11d
jl 0x14009a6d0
add rsp, 0x48
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret