Function at 0x61c840
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 eax, 1
mov r15, qword [rsp + 0x90]
mov r13d, r8d
mov dword [rsp + 0x88], r9d
mov rsi, rcx
mov r10, rdx
movzx ecx, byte [rsp + 0x88]
lea r8, [r13 + 1]
mov rbp, r13
mov edx, r8d
shl rax, cl
lea rax, [rax + rdx*2 + 8]
cmp rax, qword [rsp + 0x98]
mov rax, 0xffffffffffffffd2
seta dil
cmp r13d, 0xff
seta dl
or dil, dl
jne 0x61ca49
mov rax, 0xffffffffffffffd4
cmp r9d, 0xc
ja 0x61ca49
lea rax, [r8 + r8]
mov r12d, 1
lea r11, [rsi + 4]
mov r14d, 1
mov qword [rsp + 0x10], rax
lea r8, [r15 + rax]
mov ebx, r12d
movzx eax, word [rsp + 0x88]
shl ebx, cl
or eax, 0x10000
mov edx, ebx
lea r9d, [rbx - 1]
mov dword [rsp + 0xc], ebx
mov dword [rsp + 0x1c], eax
shr edx, 1
shr ebx, 3
mov dword [rsp], eax
mov eax, dword [rsp + 0x88]
lea edx, [rdx + rbx + 3]
mov dword [rsp + 0x18], edx
lea ecx, [rax - 1]
mov eax, r9d
shl r12d, cl
xor ecx, ecx
jmp 0x61c946
cmp bx, r12w
mov edx, 1
mov word [r15 + rcx*2], bx
lea rbx, [rcx + 1]
cmovge edi, edx
mov edx, 0
cmovge r14d, edx
cmp r13, rcx
je 0x61c96e
mov rcx, rbx
movzx ebx, word [r10 + rcx*2]
cmp bx, 0xffff
jne 0x61c920
mov ebx, eax
mov edx, 1
sub eax, 1
mov byte [r11 + rbx*4 + 2], cl
lea rbx, [rcx + 1]
mov word [r15 + rcx*2], dx
cmp r13, rcx
jne 0x61c943
mov edx, dword [rsp + 0x18]
test dil, dil
je 0x61c986
movzx ecx, word [rsp + 0x1c]
shl r14d, 0x10
or ecx, r14d
mov dword [rsp], ecx
mov edi, dword [rsp]
mov dword [rsi], edi
cmp eax, r9d
je 0x61ca5a
xor ecx, ecx
xor edi, edi
nop dword [rax + rax]
xor r8d, r8d
cmp word [r10], 0
mov r12d, edi
jle 0x61c9d6
nop dword [rax]
mov ebx, ecx
mov byte [r11 + rbx*4 + 2], r12b
nop word [rax + rax]
add ecx, edx
and ecx, r9d
cmp eax, ecx
jb 0x61c9c0
movsx ebx, word [r10]
add r8d, 1
cmp ebx, r8d
jg 0x61c9b0
lea r8d, [rdi + 1]
add r10, 2
cmp ebp, edi
je 0x61c9e7
mov edi, r8d
jmp 0x61c9a0
mov rax, 0xffffffffffffffff
test ecx, ecx
jne 0x61ca49
mov r11d, dword [rsp + 0xc]
xor r8d, r8d
movzx r10d, byte [rsp + 0x88]
mov r9d, r11d
nop word cs:[rax + rax]
movzx eax, byte [rsi + r8*4 + 6]
lea rdx, [r15 + rax*2]
movzx eax, word [rdx]
lea ecx, [rax + 1]
mov word [rdx], cx
bsr ecx, eax
xor ecx, 0x1f
lea ecx, [r10 + rcx - 0x1f]
shl eax, cl
mov byte [rsi + r8*4 + 7], cl
sub eax, r9d
mov word [rsi + r8*4 + 4], ax
add r8, 1
cmp r11d, r8d
ja 0x61ca10
xor eax, eax
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rdi, qword [rsp + 0x10]
mov qword [rsp], rax
lea r13, [r10 + r13*2 + 2]
xor ebx, ebx
movabs r14, 0x101010101010101
xor r9d, r9d
add rdi, 8
mov rax, rdi
movsx rdi, word [r10]
mov qword [r8 + r9], rbx
cmp di, 8
jle 0x61caec
movsx ecx, di
sub ecx, 9
mov ebp, ecx
shr ebp, 3
add ebp, 1
cmp ecx, 7
jbe 0x61cb4a
mov r12d, ebp
lea rcx, [rax + r9]
movq xmm0, rbx
shr r12d, 1
add rcx, r15
punpcklqdq xmm0, xmm0
shl r12, 4
add r12, rcx
movups xmmword [rcx], xmm0
add rcx, 0x10
cmp r12, rcx
jne 0x61cac0
mov r12d, ebp
and r12d, 0xfffffffe
lea ecx, [r12*8 + 8]
cmp r12d, ebp
je 0x61caec
movsxd rcx, ecx
lea rbp, [r8 + r9]
mov qword [rbp + rcx], rbx
add r10, 2
add r9, rdi
add rbx, r14
cmp r13, r10
jne 0x61ca7e
movsxd r9, dword [rsp + 0xc]
mov rax, qword [rsp]
xor ecx, ecx
sub r9, 1
and r9, 0xfffffffffffffffe
add r9, r8
movzx edi, byte [r8]
mov rbx, rax
mov r10, r8
add r8, 2
and rbx, rcx
add rcx, rdx
mov byte [r11 + rbx*4 + 2], dil
mov rbx, rax
movzx edi, byte [r8 - 1]
and rbx, rcx
add rcx, rdx
mov byte [r11 + rbx*4 + 2], dil
and rcx, rax
cmp r9, r10
jne 0x61cb11
jmp 0x61c9f2
mov ecx, 8
jmp 0x61cae0