Function at 0x180181710
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov dword [rsp + 0x18], r8d
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rdi
sub rsp, 0x90
movsxd rax, dword [rsp + 0xb0]
imul rax, rax, 0x898
mov rcx, qword [rsp + 0xa0]
lea rax, [rcx + rax + 0x38]
mov qword [rsp + 0x20], rax
mov rax, qword [rsp + 0x20]
mov rax, qword [rax + 0x18]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x20]
movsxd rax, dword [rax + 0x10]
imul rax, rax, 0x48
mov rcx, qword [rsp + 0x28]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0x30], rax
movsxd rax, dword [rsp + 0xb0]
imul rax, rax, 0x1c58
mov rcx, qword [rsp + 0xa8]
lea rax, [rcx + rax + 0x3c]
mov qword [rsp + 0x38], rax
mov rax, qword [rsp + 0x38]
mov eax, dword [rax]
mov dword [rsp + 0x40], eax
xor edx, edx
mov rax, qword [rsp + 0xa8]
mov eax, dword [rax + 0x38]
mov ecx, 0x28
div ecx
mov edx, dword [rsp + 0x40]
mov ecx, eax
call fcn.180166b60
mov dword [rsp + 0x44], eax
cmp dword [rsp + 0x44], 0x20
jle 0x1801817d1
mov dword [rsp + 0x44], 0x20
jmp 0x1801817e1
mov rax, qword [rsp + 0x28]
add rax, 0x48
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x30]
cmp qword [rsp + 0x28], rax
jae 0x1801819fc
mov qword [rsp + 0x50], 0
mov eax, dword [rsp + 0x44]
mov dword [rsp + 0x58], eax
mov dword [rsp + 0x48], 0
jmp 0x180181816
mov eax, dword [rsp + 0x48]
inc eax
mov dword [rsp + 0x48], eax
mov rax, qword [rsp + 0x38]
mov eax, dword [rax + 0xd8]
cmp dword [rsp + 0x48], eax
jae 0x1801819e1
mov eax, dword [rsp + 0x48]
imul rax, rax, 0x1c
mov rcx, qword [rsp + 0x38]
lea rax, [rcx + rax + 0xdc]
mov qword [rsp + 0x60], rax
mov rax, qword [rsp + 0x60]
mov eax, dword [rax + 0x18]
and eax, 1
test eax, eax
jne 0x180181856
jmp 0x18018180c
mov rax, qword [rsp + 0x60]
mov eax, dword [rax + 0x18]
and eax, 2
test eax, eax
je 0x18018186c
mov byte [rsp + 0x78], 1
jmp 0x180181871
mov byte [rsp + 0x78], 0
movzx eax, byte [rsp + 0x78]
mov byte [rsp + 0x68], al
mov rax, qword [rsp + 0x28]
movsx eax, byte [rax + 0xd]
mov rcx, qword [rsp + 0x20]
cmp eax, dword [rcx + 0x20]
jne 0x180181897
mov dword [rsp + 0x7c], 1
jmp 0x18018189f
mov dword [rsp + 0x7c], 0
cmp dword [rsp + 0x7c], 0
je 0x1801818b0
mov byte [rsp + 0x80], 1
jmp 0x1801818b8
mov byte [rsp + 0x80], 0
movzx eax, byte [rsp + 0x80]
mov byte [rsp + 0x69], al
movzx eax, byte [rsp + 0x68]
movzx ecx, byte [rsp + 0x69]
xor eax, ecx
test eax, eax
je 0x1801819dc
mov rax, qword [rsp + 0x28]
movsx eax, word [rax]
mov rcx, qword [rsp + 0x60]
sub eax, dword [rcx]
test eax, eax
jge 0x180181905
mov rax, qword [rsp + 0x28]
movsx eax, word [rax]
mov rcx, qword [rsp + 0x60]
sub eax, dword [rcx]
neg eax
mov dword [rsp + 0x84], eax
jmp 0x18018191b
mov rax, qword [rsp + 0x28]
movsx eax, word [rax]
mov rcx, qword [rsp + 0x60]
sub eax, dword [rcx]
mov dword [rsp + 0x84], eax
mov rax, qword [rsp + 0x28]
movsx eax, word [rax]
mov rcx, qword [rsp + 0x60]
sub eax, dword [rcx + 0xc]
test eax, eax
jge 0x18018194a
mov rax, qword [rsp + 0x28]
movsx eax, word [rax]
mov rcx, qword [rsp + 0x60]
sub eax, dword [rcx + 0xc]
neg eax
mov dword [rsp + 0x88], eax
jmp 0x180181961
mov rax, qword [rsp + 0x28]
movsx eax, word [rax]
mov rcx, qword [rsp + 0x60]
sub eax, dword [rcx + 0xc]
mov dword [rsp + 0x88], eax
mov eax, dword [rsp + 0x88]
cmp dword [rsp + 0x84], eax
jle 0x180181981
mov rax, qword [rsp + 0x60]
add rax, 0xc
mov qword [rsp + 0x70], rax
jmp 0x18018198b
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x70], rax
mov rax, qword [rsp + 0x28]
movsx eax, word [rax]
mov rcx, qword [rsp + 0x70]
sub eax, dword [rcx]
mov dword [rsp + 0x6c], eax
cmp dword [rsp + 0x6c], 0
jge 0x1801819af
mov eax, dword [rsp + 0x6c]
neg eax
mov dword [rsp + 0x6c], eax
mov edx, dword [rsp + 0x40]
mov ecx, dword [rsp + 0x6c]
call fcn.180166b60
mov dword [rsp + 0x6c], eax
mov eax, dword [rsp + 0x58]
cmp dword [rsp + 0x6c], eax
jge 0x1801819dc
mov eax, dword [rsp + 0x6c]
mov dword [rsp + 0x58], eax
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x50], rax
jmp 0x18018180c
cmp qword [rsp + 0x50], 0
je 0x1801819f7
mov rax, qword [rsp + 0x28]
mov rcx, qword [rsp + 0x50]
mov qword [rax + 0x18], rcx
jmp 0x1801817d3
add rsp, 0x90
pop rdi
ret