Function at 0x40caff
Capabilities:
Encode data using xor

Disassembly:
push str.Optimize_chunks..
call fcn.00402f96
push ebp
mov ebp, esp
sub esp, 0x7c
mov dword [ebp - 0x54], ebx
cmp dword [0x410490], 1
je 0x40cd6c
pushal
mov eax, dword [0x4105b4]
add eax, 0x1e
imul eax, eax, 0xc
mov eax, eax
call fcn.00407d2a
push eax
mov dword [ebp - 0x14], eax
pop eax
mov eax, eax
call fcn.00407d2a
mov dword [ebp - 0x10], eax
push esi
push edi
lea esi, [0x54cd04]
lea edi, [ebp - 0x7c]
mov ecx, 9
cld
rep movsd dword es:[edi], dword [esi]
pop edi
pop esi
push dword [0x41047a]
push dword [0x410490]
push dword [0x54cd54]
pop dword [ebp - 0x58]
pop dword [ebp - 0x3c]
pop dword [ebp - 0x38]
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x30], fcn.00408592
mov dword [ebp - 0x34], fcn.0040c3c0
mov ebx, 0x54c908
mov eax, dword [ebx]
mov dword [ebp - 4], eax
mov eax, dword [ebx + 4]
mov dword [ebp - 8], eax
mov eax, dword [ebx + 4]
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x18], eax
mov al, byte [ebx + 0xc]
mov byte [ebp - 0x4f], al
cmp al, 0x74
jne 0x40cbe1
mov eax, dword [ebp - 0x3c]
shr eax, 2
mov edx, eax
imul eax, dword [ebp - 0x54]
mov ecx, eax
add ecx, edx
inc eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x3c], ecx
xor ecx, ecx
mov ebx, dword [ebp - 0x3c]
and ebx, 3
inc ebx
inc ebx
cmp byte [ebp - 0x54], 3
cmove ecx, ebx
add dword [ebp - 0x3c], ecx
shl eax, 4
add eax, dword [ebp - 0x58]
mov eax, dword [eax + 8]
mov dword [ebp - 0x24], eax
jmp 0x40cbfe
xor eax, eax
mov ebx, 1
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x1c], ebx
mov ecx, dword [ebp - 0x38]
mov dx, word [ecx]
or dx, dx
cmove dx, bx
mov word [ecx], bx
cld
mov edi, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x6c]
mov eax, dword [ebp - 0x1c]
repne scasw ax, word es:[edi]
sub edi, 2
mov esi, edi
push edi
sub esi, dword [ebp - 0x38]
imul esi, esi, 6
add esi, dword [ebp - 0x64]
mov dword [ebp - 0x2c], esi
add edi, 2
or ecx, 0xffffffff
mov eax, dword [ebp - 0x1c]
repe scasw ax, word es:[edi]
pop ebx
sub edi, ebx
sub edi, 2
shr edi, 1
mov dword [ebp - 0x28], edi
cld
lea edi, [edi + edi*2]
mov dword [ebp - 0x40], edi
mov ecx, edi
mov esi, dword [ebp - 0x2c]
mov edi, dword [ebp - 0x10]
push ecx
rep movsd dword es:[edi], dword [esi]
mov esi, dword [ebp - 0x10]
mov edi, dword [ebp - 0x14]
pop ecx
call dword [ebp - 0x34]
mov esi, dword [ebp - 0x10]
mov edi, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x28]
lea ecx, [ecx + ecx*2]
xor edx, edx
cld
lodsd eax, dword [esi]
mov ebx, dword [esi]
cmp ebx, eax
jne 0x40cc6a
loop 0x40cc5f
jmp 0x40cc6e
stosd dword es:[edi], eax
inc edx
loop 0x40cc5f
mov dword [ebp - 0x20], edx
xor ecx, ecx
mov esi, dword [ebp - 0x14]
lodsd eax, dword [esi]
imul eax, eax, 0xc
push eax
add eax, dword [ebp - 0x68]
mov edi, dword [ebp - 0x24]
add edi, ecx
imul edi, edi, 0xc
push edi
add edi, dword [ebp - 4]
xchg esi, eax
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
xchg esi, eax
pop edi
pop eax
add edi, dword [ebp - 8]
add eax, dword [ebp - 0x74]
xchg esi, eax
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
xchg esi, eax
inc ecx
cmp ecx, dword [ebp - 0x20]
jne 0x40cc76
cld
mov esi, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x40]
shr ecx, 3
inc ecx
mov dword [ebp - 0x40], ecx
xor ecx, ecx
mov edi, dword [ebp - 0x2c]
pcmpeqd xmm1, xmm1
push ecx
mov edx, ecx
add edx, dword [ebp - 0x24]
lodsd eax, dword [esi]
mov ebx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x40]
mov edi, dword [ebp - 0x2c]
movd xmm0, edx
movd xmm2, eax
shufps xmm0, xmm0, 0
shufps xmm2, xmm2, 0
movups xmm6, xmmword [edi]
movups xmm7, xmmword [edi + 0x10]
pcmpeqd xmm6, xmm2
pcmpeqd xmm7, xmm2
movaps xmm5, xmm6
movaps xmm4, xmm7
xorps xmm5, xmm1
xorps xmm4, xmm1
andps xmm5, xmmword [ebx]
andps xmm4, xmmword [ebx + 0x10]
andps xmm6, xmm0
andps xmm7, xmm0
por xmm5, xmm6
por xmm4, xmm7
movaps xmmword [ebx], xmm5
movaps xmmword [ebx + 0x10], xmm4
add ebx, 0x20
add edi, 0x20
loop 0x40ccd9
pop ecx
inc ecx
cmp ecx, dword [ebp - 0x20]
jne 0x40ccb9
mov edi, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x28]
lea ecx, [ecx + ecx*2]
mov esi, dword [ebp - 0x10]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x20]
add dword [ebp - 0x24], edx
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x1c], eax
cmp eax, dword [ebp - 0x3c]
jle 0x40cbfe
cmp byte [ebp - 0x54], 3
je 0x40cd52
cmp byte [ebp - 0x4f], 0x74
je 0x40cd5b
mov ebx, dword [ebp - 0x24]
mov dword [0x54cd10], ebx
popal
mov eax, dword [ebp - 0x10]
call fcn.00407d44
mov eax, dword [ebp - 0x14]
call fcn.00407d44
mov esp, ebp
pop ebp
ret