Function at 0x4fb1d0
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x58
movaps xmmword [rsp + 0x30], xmm6
movaps xmmword [rsp + 0x40], xmm7
mov esi, dword [r8 + 0x28]
mov qword [rsp + 0xa0], rcx
mov rdi, rdx
mov r13, r8
test esi, esi
jne 0x4fb230
mov dword [rcx + 8], 0
mov eax, 1
movaps xmm6, xmmword [rsp + 0x30]
movaps xmm7, xmmword [rsp + 0x40]
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
lea r12d, [rsi + rsi]
mov rcx, rdi
mov edx, r12d
call fcn.004fb020
test rax, rax
je 0x4fb4c0
mov eax, dword [r13 + 0x30]
mov rbp, qword [r13 + 0x20]
xor dword [rdi + 0x10], eax
mov rbx, qword [rdi]
mov ecx, dword [rdi + 8]
test r12d, r12d
jle 0x4fb354
lea eax, [r12 - 1]
cmp eax, 2
jbe 0x4fb550
mov edx, r12d
mov dword [rsp + 0x20], ecx
movd xmm3, dword [rsp + 0x20]
mov rax, rbx
shr edx, 2
movdqa xmm2, xmmword [0x008a8520]
movdqa xmm5, xmmword [0x008a8530]
pxor xmm4, xmm4
shl rdx, 5
pshufd xmm6, xmm3, 0
pxor xmm3, xmm3
add rdx, rbx
nop word [rax + rax]
movdqa xmm0, xmm2
movdqa xmm7, xmm3
paddd xmm2, xmm5
add rax, 0x20
psubd xmm0, xmm6
psrld xmm0, 0x1f
movdqa xmm1, xmm0
punpckldq xmm0, xmm4
punpckhdq xmm1, xmm4
psubq xmm7, xmm1
movdqa xmm1, xmm7
movdqu xmm7, xmmword [rax - 0x10]
pand xmm1, xmm7
movdqa xmm7, xmm3
psubq xmm7, xmm0
movups xmmword [rax - 0x10], xmm1
movdqa xmm0, xmm7
movdqu xmm7, xmmword [rax - 0x20]
pand xmm0, xmm7
movups xmmword [rax - 0x20], xmm0
cmp rax, rdx
jne 0x4fb2b0
mov eax, r12d
and eax, 0xfffffffc
cmp r12d, eax
je 0x4fb354
mov edx, eax
movsxd r8, eax
add eax, 1
sub edx, ecx
shr edx, 0x1f
neg rdx
and qword [rbx + r8*8], rdx
cmp eax, r12d
jge 0x4fb354
mov edx, eax
movsxd r8, eax
add eax, 1
sub edx, ecx
shr edx, 0x1f
neg rdx
and qword [rbx + r8*8], rdx
cmp r12d, eax
jle 0x4fb354
movsxd rdx, eax
sub eax, ecx
shr eax, 0x1f
neg rax
and qword [rbx + rdx*8], rax
mov dword [rdi + 8], r12d
mov r12, qword [r13 + 0x50]
test esi, esi
jle 0x4fb501
lea eax, [rsi - 1]
movsxd r11, esi
xor r14d, r14d
mov dword [rsp + 0x2c], eax
lea r15, [r11*8]
lea r13, [rbx + rax*8 + 8]
mov qword [rsp + 0x20], rax
mov r9, qword [rbx]
mov rcx, rbx
mov rdx, rbp
mov r8d, esi
imul r9, r12
call fcn.005eee40
mov rcx, qword [rbx + r15]
xor edx, edx
add rax, r14
add rax, rcx
cmp rcx, rax
mov qword [rbx + r15], rax
setne dl
or rdx, r14
mov r10, rdx
xor edx, edx
cmp rcx, rax
setae dl
add rbx, 8
and rdx, r10
mov r14, rdx
cmp rbx, r13
jne 0x4fb383
mov rcx, qword [rsp + 0xa0]
mov edx, esi
call fcn.004fb020
test rax, rax
je 0x4fb4c0
mov rax, qword [rsp + 0xa0]
mov r12, qword [rdi]
mov r9d, esi
mov r8, rbp
mov rcx, qword [rsp + 0xa0]
mov dword [rax + 8], esi
mov eax, dword [rdi + 0x10]
lea rdi, [r12 + r15]
mov rbx, qword [rcx]
mov rdx, rdi
mov dword [rcx + 0x10], eax
mov rcx, rbx
call fcn.005ef130
mov rcx, r14
sub rcx, rax
lea rax, [r12 + r15 + 0x10]
cmp rbx, rax
lea rax, [rbx + 0x10]
setae dl
cmp rdi, rax
setae al
or dl, al
je 0x4fb4d0
cmp dword [rsp + 0x2c], 1
jbe 0x4fb4d0
mov qword [rsp + 0x20], rcx
mov edx, esi
movq xmm2, qword [rsp + 0x20]
xor eax, eax
shr edx, 1
pxor xmm1, xmm1
punpcklqdq xmm2, xmm2
shl rdx, 4
movdqu xmm5, xmmword [rbx + rax]
movdqu xmm0, xmmword [rdi + rax]
pxor xmm0, xmm5
pand xmm0, xmm2
pxor xmm0, xmm5
movups xmmword [rbx + rax], xmm0
movups xmmword [rdi + rax], xmm1
add rax, 0x10
cmp rax, rdx
jne 0x4fb462
mov eax, esi
and eax, 0xfffffffe
cmp eax, esi
je 0x4fb4b5
shl rax, 3
add rdi, rax
add rax, rbx
mov rdx, qword [rax]
mov r10, qword [rdi]
xor r10, rdx
and r10, rcx
xor r10, rdx
mov qword [rax], r10
mov qword [rdi], 0
mov eax, 1
jmp 0x4fb20c
xor eax, eax
jmp 0x4fb20c
xor eax, eax
jmp 0x4fb4d7
mov rax, rdx
mov r8, qword [rbx + rax*8]
mov rdx, qword [rdi + rax*8]
xor rdx, r8
and rdx, rcx
xor rdx, r8
mov qword [rbx + rax*8], rdx
lea rdx, [rax + 1]
mov qword [rdi + rax*8], 0
cmp rax, qword [rsp + 0x20]
jne 0x4fb4d4
jmp 0x4fb4b5
mov rcx, qword [rsp + 0xa0]
mov edx, esi
call fcn.004fb020
test rax, rax
je 0x4fb4c0
mov rax, qword [rsp + 0xa0]
movsxd rdx, esi
mov r9d, esi
mov r8, rbp
mov rcx, qword [rsp + 0xa0]
mov dword [rax + 8], esi
mov eax, dword [rdi + 0x10]
mov dword [rcx + 0x10], eax
mov rax, qword [rdi]
mov rcx, qword [rcx]
lea rdx, [rax + rdx*8]
call fcn.005ef130
mov eax, 1
jmp 0x4fb20c
mov eax, ecx
neg eax
shr eax, 0x1f
neg rax
and qword [rbx], rax
mov eax, 1
jmp 0x4fb32c