Function at 0x61c440
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, 0x28
mov r12d, 1
mov rbp, qword [rsp + 0x90]
mov dword [rsp + 0x88], r9d
mov rsi, rcx
mov rdi, rdx
movzx ecx, byte [rsp + 0x88]
mov dword [rsp + 0x80], r8d
shl r12d, cl
mov qword [rsp], 8
mov eax, r12d
lea edx, [r12 - 1]
shr eax, 1
test r9d, r9d
je 0x61c4a4
mov ecx, eax
lea rbx, [rcx*4 + 4]
mov qword [rsp], rbx
mov ecx, r12d
shr ecx, 3
lea r8d, [rax + rcx + 3]
mov eax, dword [rsp + 0x80]
movzx ecx, byte [rsp + 0x88]
lea r9d, [rax + 2]
lea r13d, [rax + 1]
mov eax, 1
shl rax, cl
lea r15, [r9 + r9]
add rax, r9
lea r11, [rbp + r15]
shr rax, 1
lea rcx, [rax*4 + 8]
mov rax, 0xffffffffffffffd4
cmp rcx, qword [rsp + 0x98]
ja 0x61c602
movzx eax, word [rsp + 0x88]
mov word [rsp + 0x16], r12w
mov word [rsi], ax
movzx eax, word [rsp + 0x80]
mov word [rsi + 2], ax
xor eax, eax
mov word [rbp], ax
lea eax, [r12 + 1]
mov word [rsp + 0x18], ax
mov eax, r13d
lea rax, [rbp + rax*2]
mov qword [rsp + 8], rax
test r13d, r13d
je 0x61c81d
mov ecx, edx
xor ebx, ebx
xor r9d, r9d
mov r10d, 1
xor eax, eax
jmp 0x61c56b
add eax, r9d
add r10d, 1
add ebx, 1
mov word [r14], ax
cmp r13d, r10d
jb 0x61c59a
mov eax, ebx
movzx r9d, word [rbp + rax*2]
movzx eax, word [rdi + rax*2]
mov r14d, r10d
lea r14, [rbp + r14*2]
cmp ax, 0xffff
jne 0x61c550
lea eax, [r9 + 1]
add r10d, 1
mov word [r14], ax
mov eax, ecx
sub ecx, 1
mov byte [r11 + rax], bl
add ebx, 1
cmp r13d, r10d
jae 0x61c563
mov rax, qword [rsp + 8]
movzx ebx, word [rsp + 0x18]
mov word [rax], bx
cmp ecx, edx
je 0x61c6ea
mov r15d, dword [rsp + 0x80]
xor r14d, r14d
xor eax, eax
nop dword [rax]
movsx r10d, word [rdi + r14*2]
test r10d, r10d
jle 0x61c5f2
mov ebx, r14d
xor r9d, r9d
mov r13d, eax
mov byte [r11 + r13], bl
nop word [rax + rax]
add eax, r8d
and eax, edx
cmp ecx, eax
jb 0x61c5e0
add r9d, 1
cmp r10d, r9d
jne 0x61c5d0
lea r9, [r14 + 1]
cmp r15, r14
je 0x61c613
mov r14, r9
jmp 0x61c5c0
xor eax, eax
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
test r12d, r12d
je 0x61c647
movzx r9d, word [rsp + 0x16]
xor eax, eax
movzx edx, byte [r11 + rax]
lea rcx, [rbp + rdx*2]
movzx edx, word [rcx]
lea r8d, [rdx + 1]
mov word [rcx], r8w
lea ecx, [r9 + rax]
add rax, 1
mov word [rsi + rdx*2 + 4], cx
cmp r12d, eax
ja 0x61c620
mov eax, dword [rsp + 0x88]
mov rbp, qword [rsp]
xor r8d, r8d
xor r9d, r9d
lea r10d, [rax + 1]
mov r11d, eax
lea ebx, [rax - 0x1f]
shl r10d, 0x10
shl r11d, 0x10
sub r10d, r12d
sub r11d, r12d
mov r12d, dword [rsp + 0x80]
jmp 0x61c6c0
lea ecx, [rax + 1]
test cx, 0xfffd
je 0x61c6da
lea ecx, [rax - 1]
mov r15d, eax
bsr ecx, ecx
xor ecx, 0x1f
add ecx, ebx
mov r13d, ecx
shl r15d, cl
mov ecx, r9d
add r9d, eax
shl r13d, 0x10
sub ecx, eax
sub r13d, r15d
mov dword [rdx], ecx
mov dword [rdx + 4], r13d
add r8d, 1
cmp r12d, r8d
jb 0x61c600
mov edx, r8d
movsx eax, word [rdi + rdx*2]
lea rdx, [rbp + rdx*8]
add rdx, rsi
test ax, ax
jne 0x61c680
mov dword [rdx + 4], r10d
jmp 0x61c6b3
lea eax, [r9 - 1]
mov dword [rdx + 4], r11d
add r9d, 1
mov dword [rdx], eax
jmp 0x61c6b3
mov eax, dword [rsp + 0x80]
mov ebx, r12d
mov r14, rdi
xor r10d, r10d
mov qword [rsp + 8], rbx
lea rcx, [r11 + rbx]
xor r9d, r9d
lea r13, [rdi + rax*2 + 2]
mov rax, r15
mov dword [rsp + 0x18], edx
add rax, rbx
mov dword [rsp + 0x1c], r8d
mov rdx, r13
mov r8, rax
movsx rbx, word [r14]
mov qword [rcx + r9], r10
cmp bx, 8
jle 0x61c79b
movsx eax, bx
sub eax, 9
mov r13d, eax
shr r13d, 3
add r13d, 1
cmp eax, 7
jbe 0x61c813
mov r15d, r13d
lea rax, [r9 + r8 + 8]
movq xmm0, r10
shr r15d, 1
add rax, rbp
punpcklqdq xmm0, xmm0
shl r15, 4
add r15, rax
nop word cs:[rax + rax]
movups xmmword [rax], xmm0
add rax, 0x10
cmp r15, rax
jne 0x61c770
mov r15d, r13d
and r15d, 0xfffffffe
lea eax, [r15*8 + 8]
cmp r15d, r13d
je 0x61c79b
cdqe
lea r13, [rcx + r9]
mov qword [r13 + rax], r10
movabs rax, 0x101010101010101
add r14, 2
add r9, rbx
add r10, rax
cmp rdx, r14
jne 0x61c720
mov edx, dword [rsp + 0x18]
mov r8d, dword [rsp + 0x1c]
cmp qword [rsp + 8], 0
je 0x61c647
mov rax, qword [rsp + 8]
sub rax, 1
and rax, 0xfffffffffffffffe
lea r10, [rcx + rax + 2]
xor eax, eax
movzx ebx, byte [rcx]
mov r9, rax
add rax, r8
add rcx, 2
and r9, rdx
mov byte [r11 + r9], bl
mov r9, rax
movzx ebx, byte [rcx - 1]
add rax, r8
and r9, rdx
and rax, rdx
mov byte [r11 + r9], bl
cmp rcx, r10
jne 0x61c7e1
jmp 0x61c618
mov eax, 8
jmp 0x61c790
lea ebx, [r12 + 1]
mov word [rax], bx
mov eax, r12d
mov qword [rsp + 8], rax
lea rcx, [r11 + rax]
jmp 0x61c7c1