Function at 0x140196ed0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x38
cmp dword [r8 + 0x48], 5
mov r12, rcx
mov qword [rsp + 0x98], r9
je 0x1401971e3
mov r8d, dword [rdx + 0x10]
mov r14, qword [rdx]
mov r13d, dword [rdx + 0x18]
mov eax, r8d
mov ecx, r8d
shr eax, 3
and ecx, 7
movzx eax, byte [r14 + rax]
shl eax, cl
xor ecx, ecx
shr al, 7
cmp r8d, r13d
setl cl
add r8d, ecx
movzx ecx, al
test al, al
mov dword [rdx + 0x10], r8d
mov dword [r12 + 0x90e0], ecx
je 0x140197160
lea rbx, [r12 + 0x8dc4]
xor esi, esi
mov r15, qword [0x1404449c0]
jmp 0x140196f8b
sub r8d, 2
cmp r8b, 2
jbe 0x1401970e1
cmp r9d, 6
je 0x1401970e1
cmp r9d, 6
ja 0x14019713e
test r9d, r9d
je 0x140197162
add esi, 1
add rbx, 0xc
cmp esi, 0x42
je 0x140197162
mov r8d, dword [rdx + 0x10]
mov rdi, qword [0x140441840]
mov eax, r8d
mov ecx, r8d
shr eax, 3
and ecx, 7
mov eax, dword [r14 + rax]
bswap eax
shl eax, cl
shr eax, 0x17
movzx r10d, byte [rdi + rax]
movzx r9d, byte [r15 + rax]
add r10d, r8d
mov eax, r9d
mov r8d, r9d
cmp r10d, r13d
cmova r10d, r13d
and eax, 0xfffffffd
cmp al, 1
mov dword [rdx + 0x10], r10d
mov dword [rbx], r9d
jne 0x140196f50
mov eax, dword [r12 + 0x90f8]
mov rbp, qword [rdx]
mov ecx, r10d
and ecx, 7
mov edi, dword [rdx + 0x18]
mov dword [rsp + 0x28], eax
mov eax, r10d
shr eax, 3
mov r11d, dword [rbp + rax]
bswap r11d
shl r11d, cl
lea ecx, [r10 + 0x10]
shr r11d, 0xf0
cmp ecx, edi
cmova ecx, edi
shl r11d, 0x10
mov eax, ecx
and ecx, 7
shr eax, 3
mov eax, dword [rbp + rax]
bswap eax
shl eax, cl
mov ecx, r10d
shr eax, 0xf0
or eax, 1
neg ecx
or eax, r11d
bsr eax, eax
xor eax, 0x1f
cmp eax, ecx
jl 0x140197045
mov ecx, edi
sub ecx, r10d
cmp ecx, eax
cmovg ecx, eax
lea ebp, [rax + 1]
add r10d, ecx
mov dword [rdx + 0x10], r10d
cmp ebp, 0x19
jbe 0x1401971b1
mov ecx, r10d
shr ecx, 3
mov ebp, dword [r14 + rcx]
mov ecx, r10d
add r10d, 0x10
and ecx, 7
bswap ebp
shl ebp, cl
shr ebp, 0xf0
cmp edi, r10d
cmovbe r10d, edi
sub eax, 0xf
mov ecx, r10d
mov dword [rdx + 0x10], r10d
shr ecx, 3
mov r11d, dword [r14 + rcx]
mov ecx, eax
neg ecx
mov byte [rsp + 0x2f], cl
mov ecx, r10d
add r10d, eax
and ecx, 7
bswap r11d
shl r11d, cl
movzx ecx, byte [rsp + 0x2f]
shr r11d, cl
cmp r10d, edi
mov ecx, eax
cmova r10d, edi
shl ebp, cl
mov dword [rdx + 0x10], r10d
or r11d, ebp
mov eax, dword [r12 + 0x90fc]
sub r8d, 2
lea ecx, [rax - 1]
mov eax, dword [rsp + 0x28]
sub eax, r11d
and eax, ecx
cmp r8b, 2
mov dword [rbx + 4], eax
ja 0x140196f5e
mov r8d, dword [rdx + 0x10]
mov rdi, qword [0x140441840]
mov eax, r8d
mov ecx, r8d
shr eax, 3
and ecx, 7
mov eax, dword [r14 + rax]
bswap eax
shl eax, cl
shr eax, 0x17
movzx ecx, byte [rdi + rax]
movzx eax, byte [r15 + rax]
add r8d, ecx
cmp dword [rdx + 0x18], r8d
cmovbe r8d, dword [rdx + 0x18]
cmp eax, 0x1f
mov dword [rdx + 0x10], r8d
ja 0x140197191
cmp eax, 0xf
jbe 0x140197131
cmp r9d, 4
jne 0x140197180
cmp eax, 0x10
jne 0x140197180
cmp r9d, 6
mov dword [rbx + 8], eax
jbe 0x140196f72
mov rcx, qword [rsp + 0x98]
lea r8, str.illegal_memory_management_control_operation__d_n
mov edx, 0x10
call fcn.14036cf30
mov eax, 0xffffffff
jmp 0x14019716c
xor esi, esi
mov dword [r12 + 0x90dc], esi
xor eax, eax
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
cmp r9d, 2
jne 0x140197191
cmp dword [r12 + 0x5834], 3
jne 0x140197131
mov rcx, qword [rsp + 0x98]
lea r8, str.illegal_long_ref_in_memory_management_control_operation__d_n
mov edx, 0x10
call fcn.14036cf30
mov eax, 0xffffffff
jmp 0x14019716c
mov eax, r10d
mov ecx, r10d
add r10d, ebp
shr eax, 3
and ecx, 7
mov r11d, dword [r14 + rax]
mov eax, ebp
neg eax
bswap r11d
shl r11d, cl
mov ecx, eax
shr r11d, cl
cmp edi, r10d
cmovbe r10d, edi
mov dword [rdx + 0x10], r10d
jmp 0x1401970bc
mov eax, dword [rdx + 0x10]
mov r9d, dword [rdx + 0x18]
mov r8, qword [rdx]
add eax, 1
cmp eax, r9d
cmova eax, r9d
mov ecx, eax
mov dword [rdx + 0x10], eax
shr ecx, 3
movzx r8d, byte [r8 + rcx]
mov ecx, eax
and ecx, 7
shl r8d, cl
xor ecx, ecx
cmp r9d, eax
setg cl
xor esi, esi
add eax, ecx
test r8b, r8b
mov dword [rdx + 0x10], eax
jns 0x14019723d
mov dword [r12 + 0x8dc4], 6
mov dword [r12 + 0x8dcc], 0
mov esi, 1
mov dword [r12 + 0x90e0], 1
jmp 0x140197162