Function at 0x180180780
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.180165bd0
mov dword [rsp + 0x44], eax
cmp dword [rsp + 0x44], 0x20
jle 0x180180841
mov dword [rsp + 0x44], 0x20
jmp 0x180180851
mov rax, qword [rsp + 0x28]
add rax, 0x48
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x30]
cmp qword [rsp + 0x28], rax
jae 0x180180a6c
mov qword [rsp + 0x50], 0
mov eax, dword [rsp + 0x44]
mov dword [rsp + 0x58], eax
mov dword [rsp + 0x48], 0
jmp 0x180180886
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 0x180180a51
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 0x1801808c6
jmp 0x18018087c
mov rax, qword [rsp + 0x60]
mov eax, dword [rax + 0x18]
and eax, 2
test eax, eax
je 0x1801808dc
mov byte [rsp + 0x78], 1
jmp 0x1801808e1
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 0x180180907
mov dword [rsp + 0x7c], 1
jmp 0x18018090f
mov dword [rsp + 0x7c], 0
cmp dword [rsp + 0x7c], 0
je 0x180180920
mov byte [rsp + 0x80], 1
jmp 0x180180928
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 0x180180a4c
mov rax, qword [rsp + 0x28]
movsx eax, word [rax]
mov rcx, qword [rsp + 0x60]
sub eax, dword [rcx]
test eax, eax
jge 0x180180975
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 0x18018098b
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 0x1801809ba
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 0x1801809d1
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 0x1801809f1
mov rax, qword [rsp + 0x60]
add rax, 0xc
mov qword [rsp + 0x70], rax
jmp 0x1801809fb
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 0x180180a1f
mov eax, dword [rsp + 0x6c]
neg eax
mov dword [rsp + 0x6c], eax
mov edx, dword [rsp + 0x40]
mov ecx, dword [rsp + 0x6c]
call fcn.180165bd0
mov dword [rsp + 0x6c], eax
mov eax, dword [rsp + 0x58]
cmp dword [rsp + 0x6c], eax
jge 0x180180a4c
mov eax, dword [rsp + 0x6c]
mov dword [rsp + 0x58], eax
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x50], rax
jmp 0x18018087c
cmp qword [rsp + 0x50], 0
je 0x180180a67
mov rax, qword [rsp + 0x28]
mov rcx, qword [rsp + 0x50]
mov qword [rax + 0x18], rcx
jmp 0x180180843
add rsp, 0x90
pop rdi
ret