Function at 0x59b280
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, 0x48
cmp qword [rcx + 0x38], r9
mov r12, qword [rdx + 0x48]
lea rbp, [r9 + 2]
mov r13, r8
mov r15, rcx
mov r14, rdx
mov qword [rsp + 0xa8], r9
cmove rbp, r9
call fcn.0059a6e0
cmp qword [rsp + 0xb0], 0
mov r8, rax
je 0x59b2d2
mov rax, qword [rsp + 0xb0]
mov dword [rax], 0
cmp r13, qword [r15 + 0x30]
je 0x59b4b0
movzx edx, word [r13 - 2]
movzx ecx, dh
movzx edx, dl
add rcx, 0x2e
mov rax, qword [r12 + rcx*8]
movsx r9d, word [rax + rdx*2]
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], r13
mov rdx, r14
mov rcx, r15
call fcn.0059ab00
test rax, rax
mov rbx, rax
je 0x59b4d7
test byte [r15 + 0x10], 8
mov qword [rax + 0x20], r13
je 0x59b430
cmp rbp, r13
jbe 0x59b4cf
lea rsi, [r13 + 2]
jmp 0x59b343
mov qword [rax + 0x20], rsi
add rsi, 2
cmp rbp, rdi
mov rbx, rax
jbe 0x59b3a0
movzx eax, word [rsi - 2]
lea r11, [rsi - 2]
mov rdi, rsi
movzx edx, ah
movzx eax, al
add rdx, 0x2e
mov rdx, qword [r12 + rdx*8]
movsx rdx, word [rdx + rax*2]
mov rax, qword [rbx + 0x28]
mov rax, qword [rax + rdx*8]
mov r9, rdx
test rax, rax
jne 0x59b333
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], rsi
mov r8, rbx
mov rdx, r14
mov rcx, r15
mov qword [rsp + 0x38], r11
call fcn.0059ab00
test rax, rax
mov r11, qword [rsp + 0x38]
jne 0x59b333
mov rdi, r11
nop dword [rax + rax]
mov rax, qword [r15 + 0x38]
cmp rdi, rax
jne 0x59b3b7
cmp qword [rsp + 0xa8], rax
je 0x59b4e0
mov ecx, dword [r14 + 4]
mov rax, qword [r14 + 0x50]
mov rdx, qword [r14 + 0x18]
test ecx, ecx
jle 0x59b410
sub ecx, 1
add rcx, 1
lea r8, [rcx*8]
shl rcx, 6
sub rcx, r8
add rcx, rdx
jmp 0x59b3f0
test rax, rax
je 0x59b404
add rdx, 0x38
cmp rdx, rcx
je 0x59b410
test byte [rdx + 0xc], 2
je 0x59b3e7
mov r8, qword [rdx + 0x20]
cmp r8, rax
je 0x59b3e7
cmp rax, r8
jae 0x59b3e2
add rdx, 0x38
mov rax, r8
cmp rdx, rcx
jne 0x59b3f0
test rax, rax
je 0x59b4d7
sub rax, 2
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
cmp rbp, r13
lea rsi, [r13 + 2]
ja 0x59b454
jmp 0x59b4cf
mov qword [rax + 0x20], rsi
add rsi, 2
cmp rbp, rdi
mov rbx, rax
jbe 0x59b3a0
movzx eax, word [rsi - 2]
lea r11, [rsi - 2]
mov rdi, rsi
movzx edx, ah
movzx eax, al
add rdx, 0x2e
mov rdx, qword [r12 + rdx*8]
movsx rdx, word [rdx + rax*2]
mov rax, qword [rbx + 0x28]
mov rax, qword [rax + rdx*8]
mov r9, rdx
test rax, rax
jne 0x59b440
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], rsi
mov r8, rbx
mov rdx, r14
mov rcx, r15
mov qword [rsp + 0x38], r11
call fcn.0059ab00
test rax, rax
mov r11, qword [rsp + 0x38]
jne 0x59b440
jmp 0x59b398
mov eax, dword [r15 + 0x10]
mov rdx, qword [r14 + 0x40]
and eax, 1
xor eax, 1
cdqe
add rax, 8
movsx r9d, word [rdx + rax*2 + 4]
jmp 0x59b2f4
mov rdi, r13
jmp 0x59b3a0
xor eax, eax
jmp 0x59b41d
cmp qword [rsp + 0xb0], 0
je 0x59b4f9
mov rax, qword [rsp + 0xb0]
mov dword [rax], 1
xor eax, eax
test byte [r15 + 0x10], 2
mov rdx, qword [r14 + 0x40]
mov r8, rbx
mov rcx, r15
sete al
add rax, 8
movsx r9d, word [rdx + rax*2 + 8]
mov rdx, r14
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], rdi
call fcn.0059ab00
test rax, rax
mov rdx, rax
je 0x59b3b7
test byte [rdx + 0xc], 2
mov rax, rdi
jne 0x59b41d
mov qword [rdx + 0x20], rdi
jmp 0x59b3b7