Function at 0x515c50
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x50
mov edx, dword [ecx + 0x20]
push ebx
mov ebx, dword [ecx]
push ebp
mov ebp, dword [ecx + 8]
push esi
mov esi, dword [ecx + 0x2c]
mov eax, esi
imul eax, dword [esp + 0x64]
mov dword [esp + 0x38], edx
sar edx, 3
push edi
mov edi, dword [esp + 0x64]
mov dword [esp + 0x30], edx
mov edx, dword [esp + 0x70]
add edx, edi
add ebx, eax
mov dword [esp + 0x38], edx
mov dword [esp + 0x20], edx
lea edx, [ebx + esi]
mov dword [esp + 0x10], edx
mov edx, dword [ecx + 4]
add edx, eax
add ebp, eax
lea edi, [edx + esi]
mov dword [esp + 0x14], edi
lea edi, [esi + ebp]
mov dword [esp + 0x18], edi
mov edi, dword [ecx + 0xc]
mov ecx, dword [ecx + 0x1c]
add edi, eax
add ecx, eax
mov eax, dword [esp + 0x30]
mov dword [esp + 0x70], edi
add edi, esi
test eax, eax
mov dword [esp + 0x24], ebx
mov dword [esp + 0x68], edx
mov dword [esp + 0x28], ebp
mov dword [esp + 0x1c], edi
mov dword [esp + 0x2c], ecx
jle 0x515fce
push esi
push edi
pcmpeqb mm7, mm7
movq mm6, qword [0x583350]
pxor mm7, mm6
mov esi, dword [esp + 0x2c]
mov edi, dword [esp + 0x18]
movq mm0, qword [esi]
movq mm1, qword [edi]
movq mm4, mm0
movq mm2, mm1
pand mm0, mm6
pand mm1, mm6
pand mm4, mm7
pand mm2, mm7
psrlw mm4, 8
psrlw mm2, 8
movq mm3, mm0
movq mm5, mm0
paddw mm2, mm1
paddw mm2, mm0
paddw mm2, mm4
movq qword [esp + 0x60], mm2
psubusb mm3, mm1
psubusb mm1, mm0
psubusb mm5, mm4
psubusb mm4, mm0
por mm1, mm3
por mm5, mm4
paddw mm5, mm1
movq qword [esp + 0x58], mm5
mov esi, dword [esp + 0x70]
mov edi, dword [esp + 0x1c]
movq mm0, qword [esi]
movq mm1, qword [edi]
movq mm4, mm0
movq mm2, mm1
pand mm0, mm6
pand mm1, mm6
pand mm4, mm7
pand mm2, mm7
psrlw mm4, 8
psrlw mm2, 8
movq mm3, mm0
movq mm5, mm0
paddw mm2, mm1
paddw mm2, mm0
paddw mm2, mm4
movq qword [esp + 0x50], mm2
psubusb mm3, mm1
psubusb mm5, mm4
psubusb mm1, mm0
psubusb mm4, mm0
por mm1, mm3
por mm5, mm4
paddw mm5, mm1
movq mm0, qword [esp + 0x58]
pmaxsw mm5, mm0
movq qword [esp + 0x58], mm5
mov esi, dword [esp + 0x30]
mov edi, dword [esp + 0x20]
movq mm0, qword [esi]
movq mm1, qword [edi]
movq mm4, mm0
movq mm2, mm1
pand mm0, mm6
pand mm1, mm6
pand mm4, mm7
pand mm2, mm7
psrlw mm4, 8
psrlw mm2, 8
movq mm3, mm0
movq mm5, mm0
paddw mm2, mm1
paddw mm2, mm0
paddw mm2, mm4
movq qword [esp + 0x48], mm2
psubusb mm3, mm1
psubusb mm5, mm4
psubusb mm1, mm0
psubusb mm4, mm0
por mm1, mm3
por mm5, mm4
paddw mm5, mm1
movq mm0, qword [esp + 0x58]
pmaxsw mm5, mm0
movq qword [esp + 0x58], mm5
mov esi, dword [esp + 0x78]
mov edi, dword [esp + 0x24]
movq mm0, qword [esi]
movq mm1, qword [edi]
movq mm4, mm0
movq mm2, mm1
pand mm0, mm6
pand mm1, mm6
pand mm4, mm7
pand mm2, mm7
psrlw mm4, 8
psrlw mm2, 8
movq mm3, mm0
movq mm5, mm0
paddw mm2, mm1
paddw mm2, mm0
paddw mm2, mm4
movq qword [esp + 0x38], mm2
psubusb mm3, mm1
psubusb mm5, mm4
psubusb mm1, mm0
psubusb mm4, mm0
por mm1, mm3
por mm5, mm4
paddw mm5, mm1
movq mm6, qword [esp + 0x58]
pmaxsw mm6, mm5
movq mm0, qword [esp + 0x60]
movq mm1, qword [esp + 0x50]
movq mm3, qword [esp + 0x48]
movq mm2, qword [esp + 0x38]
movq mm4, mm0
movq mm7, mm1
psubusw mm4, mm3
psubusw mm7, mm2
psubusw mm3, mm0
psubusw mm2, mm1
por mm4, mm3
por mm7, mm2
pmaxsw mm7, mm4
movd mm0, dword [0x583360]
movd mm1, dword [0x583364]
movd mm2, dword [0x583368]
pshufw mm1, mm1, 0
pshufw mm2, mm2, 0
pshufw mm0, mm0, 0
pcmpgtw mm0, mm6
pand mm1, mm0
pandn mm0, mm2
paddb mm0, mm1
pcmpgtw mm0, mm7
mov esi, dword [esp + 0x34]
movq mm4, qword [0x583358]
movq mm2, qword [esi]
movd mm3, dword [0x58336c]
punpcklbw mm3, mm3
punpcklbw mm3, mm3
punpcklbw mm3, mm3
pand mm2, mm0
pand mm4, mm0
pcmpgtb mm3, mm2
pand mm4, mm3
paddb mm2, mm4
movq qword [esi], mm2
movq qword [esp + 0x60], mm3
mov esi, dword [esp + 0x70]
mov edi, dword [esp + 0x1c]
movq mm0, qword [esi - 1]
movq mm3, qword [edi - 1]
movq mm1, qword [esi]
movq mm4, qword [edi]
movq mm2, qword [esi + 1]
movq mm5, qword [edi + 1]
movq mm6, mm5
movq mm7, mm0
psubusb mm6, mm0
psubusb mm0, mm5
por mm0, mm6
pavgb mm5, mm7
movq mm6, mm3
movq mm7, mm2
psubusb mm6, mm2
psubusb mm2, mm3
por mm2, mm6
pavgb mm3, mm7
movq mm6, mm4
movq mm7, mm1
psubusb mm6, mm1
psubusb mm1, mm4
por mm1, mm6
pavgb mm4, mm7
movq mm6, mm1
pminub mm6, mm2
pminub mm6, mm0
pcmpeqb mm1, mm6
pcmpeqb mm2, mm6
pand mm4, mm1
pand mm3, mm2
por mm2, mm1
pandn mm2, mm5
pandn mm1, mm3
por mm4, mm2
por mm4, mm1
mov esi, dword [esp + 0x2c]
mov edi, dword [esp + 0x30]
movq mm0, qword [esi]
movq mm2, qword [edi]
pavgb mm0, mm2
mov edi, dword [esp + 0x28]
movq mm6, qword [esp + 0x60]
pcmpeqb mm7, mm7
pxor mm7, mm6
pand mm4, mm6
pand mm0, mm7
por mm0, mm4
movq qword [edi], mm0
pop esi
pop edi
mov edi, dword [esp + 0x68]
mov esi, 8
add edi, esi
mov dword [esp + 0x68], edi
add dword [esp + 0x70], esi
add dword [esp + 0x10], esi
add dword [esp + 0x14], esi
add dword [esp + 0x18], esi
add dword [esp + 0x1c], esi
mov edi, dword [esp + 0x20]
add ebx, esi
add ebp, esi
add edi, esi
add ecx, esi
dec eax
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebp
mov dword [esp + 0x20], edi
mov dword [esp + 0x2c], ecx
jne 0x515cd4
mov al, byte [edx]
mov esi, dword [esp + 0x38]
mov byte [esi], al
mov cl, byte [edx + 1]
mov eax, dword [esp + 0x3c]
mov byte [esi + 1], cl
mov cl, byte [edx + eax - 2]
mov byte [esi + eax - 2], cl
mov cl, byte [edx + eax - 1]
mov byte [esi + eax - 1], cl
mov ecx, dword [esp + 0x6c]
mov eax, dword [esp + 0x64]
shr ecx, 3
test ecx, ecx
je 0x516018
nop
mov esi, dword [edx]
mov dword [eax], esi
mov esi, dword [edx + 4]
add edx, 4
add eax, 4
mov dword [eax], esi
add eax, 4
add edx, 4
dec ecx
jne 0x516000
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x50
ret