Function at 0x4c5d60
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x10
mov eax, dword [esp + 0x2c]
mov edi, dword [ecx + 4]
sub eax, edi
cmp eax, 0xa0000001
jb 0x4c5ff8
mov esi, ecx
mov dword [esp + 4], edx
mov edx, dword [esp + 0x28]
mov ebp, dword [esp + 0x24]
movzx ecx, byte [ebp + 4]
mov dword [esp + 0xc], esi
mov eax, 1
shl eax, cl
xor ebx, ebx
cmp dword [ebp + 0x1c], 6
setae bl
mov ecx, dword [ebp + 8]
sub ecx, ebx
mov ebx, 1
shl ebx, cl
lea ecx, [ebx - 1]
mov esi, edx
sub esi, edi
and ecx, esi
cmp ebx, 3
mov edi, 2
cmovae edi, ebx
xor ebp, ebp
cmp ecx, 2
cmovb ebp, edi
cmp ebx, eax
cmovbe ebx, eax
mov edi, dword [esp + 0xc]
add ebx, ecx
add ebx, ebp
mov ecx, dword [esp + 4]
sub esi, ebx
sub edx, ebx
mov dword [edi + 4], edx
add dword [edi + 8], esi
mov eax, dword [edi + 0x10]
lea ebx, [esi + 2]
mov edx, eax
sub edx, esi
cmp eax, ebx
mov eax, dword [edi + 0xc]
mov ebp, 2
cmovb edx, ebp
mov dword [edi + 0x10], edx
mov edx, eax
sub edx, esi
mov dword [esp + 8], ebx
cmp eax, ebx
mov ebx, 1
cmovb edx, ebp
mov dword [edi + 0xc], edx
inc dword [edi + 0x14]
mov eax, dword [ecx + 8]
mov dword [ecx + 0x10], eax
mov ebp, dword [esp + 0x24]
movzx ecx, byte [ebp + 0xc]
mov edx, 1
shl edx, cl
mov ecx, dword [edi + 0x4c]
mov dword [esp], esi
push esi
call fcn.004c6120
add esp, 4
mov eax, dword [ebp + 0x1c]
cmp dword [edi + 0x5c], 0
je 0x4c5f82
movzx ecx, byte [ebp + 8]
shl ebx, cl
mov ecx, dword [edi + 0x54]
cmp eax, 6
jne 0x4c5fa1
lea eax, [ebx + 0xf]
test ebx, ebx
cmovns eax, ebx
cmp ebx, 0x10
jl 0x4c5fae
sar eax, 4
movd xmm0, dword [esp + 8]
pshufd xmm0, xmm0, 0
movd xmm1, dword [esp]
pshufd xmm1, xmm1, 0
add ecx, 0x30
movdqa xmm2, xmmword [0x87cc40]
movdqa xmm3, xmmword [0x87cc50]
pxor xmm0, xmm3
nop dword [eax]
movdqu xmm4, xmmword [ecx - 0x30]
movdqa xmm5, xmm4
movdqa xmm6, xmm4
pxor xmm4, xmm3
movdqa xmm7, xmm0
pcmpgtd xmm7, xmm4
movdqu xmm4, xmmword [ecx - 0x20]
pcmpeqd xmm5, xmm2
psubd xmm6, xmm1
pandn xmm7, xmm6
movdqa xmm6, xmm5
pandn xmm6, xmm7
psubd xmm6, xmm5
movdqu xmmword [ecx - 0x30], xmm6
movdqa xmm5, xmm4
pcmpeqd xmm5, xmm2
movdqa xmm6, xmm4
psubd xmm6, xmm1
pxor xmm4, xmm3
movdqa xmm7, xmm0
pcmpgtd xmm7, xmm4
pandn xmm7, xmm6
movdqa xmm4, xmm5
pandn xmm4, xmm7
psubd xmm4, xmm5
movdqu xmmword [ecx - 0x20], xmm4
movdqu xmm4, xmmword [ecx - 0x10]
movdqa xmm5, xmm4
pcmpeqd xmm5, xmm2
movdqa xmm6, xmm4
psubd xmm6, xmm1
pxor xmm4, xmm3
movdqa xmm7, xmm0
pcmpgtd xmm7, xmm4
pandn xmm7, xmm6
movdqa xmm4, xmm5
pandn xmm4, xmm7
psubd xmm4, xmm5
movdqu xmmword [ecx - 0x10], xmm4
movdqu xmm4, xmmword [ecx]
movdqa xmm5, xmm4
movdqa xmm6, xmm4
pxor xmm4, xmm3
movdqa xmm7, xmm0
pcmpgtd xmm7, xmm4
pcmpeqd xmm5, xmm2
psubd xmm6, xmm1
pandn xmm7, xmm6
movdqa xmm4, xmm5
pandn xmm4, xmm7
psubd xmm4, xmm5
movdqu xmmword [ecx], xmm4
add ecx, 0x40
dec eax
jne 0x4c5ea0
jmp 0x4c5fae
cmp eax, 1
je 0x4c5fae
lea ecx, [eax - 3]
cmp ecx, 2
ja 0x4c5e47
cmp dword [ebp + 0x84], 1
je 0x4c5fae
jmp 0x4c5e47
mov edx, ebx
push dword [esp]
call fcn.004c6120
add esp, 4
mov ecx, dword [edi + 0x20]
test ecx, ecx
mov esi, dword [esp]
je 0x4c5fcb
mov edx, 1
shl edx, cl
mov ecx, dword [edi + 0x50]
push esi
call fcn.004c6120
add esp, 4
mov ecx, dword [esp + 4]
mov eax, dword [ecx + 0xc]
cmp dword [ecx + 0x10], eax
jae 0x4c5fda
mov dword [ecx + 0x10], eax
mov eax, dword [edi + 0x1c]
xor ecx, ecx
sub eax, esi
cmovb eax, ecx
mov dword [edi + 0x1c], eax
mov dword [edi + 0x18], 0
mov dword [edi + 0xa4], 0
add esp, 0x10
pop esi
pop edi
pop ebx
pop ebp
ret