Function at 0x518b30
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x14
mov edx, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
lea edi, [edx + 3]
and edi, 0xfffffffc
mov ebx, edi
sub ebx, edx
cmp ebx, ecx
ja 0x518b87
cmp ebx, 4
ja 0x518b87
mov esi, ecx
sub esi, ebx
cmp esi, 4
jb 0x518b87
lea eax, [edx + ebx]
xor ecx, ecx
mov dword [ebp - 0x10], eax
mov eax, esi
and eax, 3
cmp edi, edx
mov edi, 0
je 0x518ce4
xor edi, edi
cmp ebx, 8
jae 0x518c46
mov ebx, edx
jmp 0x518cd0
xor eax, eax
test ecx, ecx
je 0x518f1f
cmp ecx, 8
mov esi, edx
jb 0x518c2b
movdqa xmm2, xmmword [0xa5c9d0]
movdqa xmm3, xmmword [0xa5c9e0]
mov edi, ecx
lea eax, [edx + 4]
pxor xmm0, xmm0
pxor xmm1, xmm1
and edi, 0xfffffff8
lea esi, [edx + edi]
mov ebx, edi
nop word cs:[eax + eax]
nop dword [eax + eax]
movd xmm5, dword [eax - 4]
movd xmm4, dword [eax]
add eax, 8
add ebx, 0xfffffff8
pcmpgtb xmm5, xmm2
pcmpgtb xmm4, xmm2
punpcklbw xmm5, xmm5
punpcklwd xmm5, xmm5
pand xmm5, xmm3
paddd xmm0, xmm5
punpcklbw xmm4, xmm4
punpcklwd xmm4, xmm4
pand xmm4, xmm3
paddd xmm1, xmm4
jne 0x518bd0
paddd xmm1, xmm0
cmp edi, ecx
pshufd xmm0, xmm1, 0xee
paddd xmm0, xmm1
pshufd xmm1, xmm0, 0x55
paddd xmm1, xmm0
movd eax, xmm1
je 0x518f1f
add edx, ecx
nop dword [eax]
xor ecx, ecx
cmp byte [esi], 0xc0
lea esi, [esi + 1]
setge cl
add eax, ecx
cmp esi, edx
jne 0x518c30
jmp 0x518f1f
movdqa xmm2, xmmword [0xa5c9d0]
movdqa xmm3, xmmword [0xa5c9e0]
mov edi, ebx
mov dword [ebp - 0x18], ebx
pxor xmm0, xmm0
pxor xmm1, xmm1
and edi, 0xfffffff8
lea ebx, [edx + edi]
add edx, 4
mov dword [ebp - 0x1c], edi
nop
movd xmm5, dword [edx - 4]
movd xmm4, dword [edx]
add edx, 8
add edi, 0xfffffff8
pcmpgtb xmm5, xmm2
pcmpgtb xmm4, xmm2
punpcklbw xmm5, xmm5
punpcklwd xmm5, xmm5
pand xmm5, xmm3
paddd xmm0, xmm5
punpcklbw xmm4, xmm4
punpcklwd xmm4, xmm4
pand xmm4, xmm3
paddd xmm1, xmm4
jne 0x518c70
mov edx, dword [ebp - 0x1c]
paddd xmm1, xmm0
pshufd xmm0, xmm1, 0xee
paddd xmm0, xmm1
pshufd xmm1, xmm0, 0x55
cmp dword [ebp - 0x18], edx
paddd xmm1, xmm0
movd edi, xmm1
je 0x518ce4
nop dword [eax + eax]
xor edx, edx
cmp byte [ebx], 0xc0
lea ebx, [ebx + 1]
setge dl
add edi, edx
mov edx, dword [ebp - 0x10]
cmp ebx, edx
jne 0x518cd0
test eax, eax
je 0x518d10
mov edx, esi
xor ecx, ecx
and edx, 0xfffffffc
add edx, dword [ebp - 0x10]
nop word cs:[eax + eax]
nop dword [eax]
xor ebx, ebx
cmp byte [edx], 0xc0
lea edx, [edx + 1]
setge bl
add ecx, ebx
dec eax
jne 0x518d00
add ecx, edi
movdqa xmm0, xmmword [0xa5c9f0]
mov edi, dword [ebp - 0x10]
shr esi, 2
pcmpeqd xmm1, xmm1
jmp 0x518d67
xor esi, esi
mov ecx, esi
shr esi, 8
mov ebx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x10]
and ecx, 0xff00ff
and esi, 0xff00ff
add esi, ecx
mov ecx, esi
shl ecx, 0x10
add ecx, esi
mov esi, dword [ebp - 0x18]
shr ecx, 0x10
add ecx, eax
sub esi, edi
lea edi, [ebx + edi*4]
test edx, edx
jne 0x518dfb
mov eax, ecx
test esi, esi
je 0x518f1f
mov edx, edi
cmp esi, 0xc0
mov edi, 0xc0
mov dword [ebp - 0x18], esi
cmovb edi, esi
mov dword [ebp - 0x1c], edx
mov ebx, edi
mov ecx, edi
and ebx, 0xfc
and ecx, 3
test ebx, ebx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x14], ebx
je 0x518d30
mov ecx, ebx
xor esi, esi
mov ebx, edx
shr ecx, 2
shl ecx, 4
nop word [eax + eax]
test ebx, ebx
je 0x518d32
movdqu xmm2, xmmword [ebx]
add ebx, 0x10
movdqa xmm3, xmm2
psrld xmm2, 6
pxor xmm3, xmm1
psrld xmm3, 7
por xmm2, xmm3
pand xmm2, xmm0
pshufd xmm3, xmm2, 0xee
paddd xmm3, xmm2
pshufd xmm2, xmm3, 0x55
paddd xmm2, xmm3
movd edx, xmm2
add esi, edx
add ecx, 0xfffffff0
jne 0x518db0
jmp 0x518d32
test ebx, ebx
je 0x518eff
mov eax, dword [ebp - 0x14]
lea edi, [edx - 1]
xor esi, esi
and edi, 0x3fffffff
cmp edi, 7
lea eax, [ebx + eax*4]
mov dword [ebp - 0x14], eax
jb 0x518ecf
mov eax, dword [ebp - 0x18]
inc edi
mov edx, 0xc0
mov esi, ebx
pxor xmm1, xmm1
pcmpeqd xmm3, xmm3
pxor xmm2, xmm2
mov dword [ebp - 0x20], edi
and edi, 0xfffffff8
mov esi, edi
cmp eax, 0xc0
cmovb edx, eax
mov eax, dword [ebp - 0x14]
and edx, 0xfc
lea edx, [ebx + edx*4 + 0x10]
lea eax, [eax + edi*4]
nop word [eax + eax]
movdqu xmm5, xmmword [edx - 0x10]
movdqu xmm4, xmmword [edx]
add edx, 0x20
add esi, 0xfffffff8
movdqa xmm6, xmm5
movdqa xmm7, xmm4
psrld xmm5, 6
psrld xmm4, 6
pxor xmm6, xmm3
pxor xmm7, xmm3
psrld xmm6, 7
psrld xmm7, 7
por xmm5, xmm6
por xmm4, xmm7
pand xmm5, xmm0
pand xmm4, xmm0
paddd xmm1, xmm5
paddd xmm2, xmm4
jne 0x518e60
paddd xmm2, xmm1
cmp dword [ebp - 0x20], edi
mov edx, dword [ebp - 0x10]
pshufd xmm0, xmm2, 0xee
paddd xmm0, xmm2
pshufd xmm1, xmm0, 0x55
paddd xmm1, xmm0
movd esi, xmm1
je 0x518f01
mov edi, dword [ebp - 0x14]
lea edx, [edi + edx*4]
nop word cs:[eax + eax]
nop
mov edi, dword [eax]
add eax, 4
mov ebx, edi
shr edi, 6
not ebx
shr ebx, 7
or edi, ebx
and edi, 0x1010101
add esi, edi
cmp eax, edx
jne 0x518ee0
jmp 0x518f01
xor esi, esi
mov eax, esi
shr esi, 8
and eax, 0xff00ff
and esi, 0xff00ff
add esi, eax
mov eax, esi
shl eax, 0x10
add eax, esi
shr eax, 0x10
add eax, ecx
add esp, 0x14
pop esi
pop edi
pop ebx
pop ebp
ret