Function at 0x1002cf70
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0xc
mov edx, dword [esp + 0x10]
mov ecx, 1
push ebx
mov ebx, dword [esp + 0x1c]
push ebp
movsx eax, word [edx]
xor ebp, ebp
push esi
push edi
mov edi, dword [esp + 0x2c]
shl eax, 0x10
sar eax, 6
mov dword [esp + 0x10], ecx
mov dword [edi], eax
cmp ebx, ecx
jle 0x1002d067
mov eax, ecx
lea ebp, [ecx + ecx]
xor ebx, ebx
shr eax, 1
mov dword [esp + 0x2c], eax
je 0x1002d017
dec ecx
lea esi, [edi + ecx*4]
mov ecx, eax
mov eax, dword [edi + ebx*4]
mov dword [esp + 0x18], eax
mov eax, dword [esi]
mov dword [esp + 0x14], eax
movsx eax, word [edx + ebp]
shl eax, 0x10
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x2c]
imul dword [esp + 0x14]
mov dword [esp + 0x2c], edx
mov eax, dword [esp + 0x2c]
add eax, eax
add dword [edi + ebx*4], eax
mov eax, dword [esp + 0x20]
movsx eax, word [eax + ebp]
shl eax, 0x10
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x2c]
imul dword [esp + 0x18]
mov dword [esp + 0x2c], edx
mov eax, dword [esp + 0x2c]
lea esi, [esi - 4]
mov edx, dword [esp + 0x20]
add eax, eax
add dword [esi + 4], eax
inc ebx
cmp ebx, ecx
jl 0x1002cfb6
mov ecx, dword [esp + 0x10]
test cl, 1
je 0x1002d047
mov eax, dword [edi + ebx*4]
mov dword [esp + 0x18], eax
movsx eax, word [edx + ebp]
shl eax, 0x10
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x2c]
imul dword [esp + 0x18]
mov dword [esp + 0x2c], edx
mov eax, dword [esp + 0x2c]
mov edx, dword [esp + 0x20]
add eax, eax
add dword [edi + ebx*4], eax
movsx eax, word [edx + ebp]
mov ebx, dword [esp + 0x28]
shl eax, 0x10
sar eax, 6
mov dword [edi + ecx*4], eax
inc ecx
mov dword [esp + 0x10], ecx
cmp ecx, ebx
jl 0x1002cfa1
xor ebp, ebp
xor ecx, ecx
test ebx, ebx
jle 0x1002d0f4
cmp ebx, 8
jb 0x1002d0d7
cmp dword [0x100a1f0c], 2
jl 0x1002d0d7
mov eax, ebx
xorps xmm1, xmm1
and eax, 0xfffffff8
xorps xmm2, xmm2
nop word [eax + eax]
movups xmm0, xmmword [edi + ecx*4]
pabsd xmm0, xmm0
pmaxsd xmm1, xmm0
movups xmm0, xmmword [edi + ecx*4 + 0x10]
add ecx, 8
pabsd xmm0, xmm0
pmaxsd xmm2, xmm0
cmp ecx, eax
jl 0x1002d090
pmaxsd xmm1, xmm2
movaps xmm0, xmm1
psrldq xmm0, 8
pmaxsd xmm1, xmm0
movups xmm0, xmm1
psrldq xmm0, 4
pmaxsd xmm1, xmm0
movd ebp, xmm1
cmp ecx, ebx
jge 0x1002d0f4
nop dword [eax + eax]
mov eax, dword [edi + ecx*4]
cdq
xor eax, edx
sub eax, edx
cmp ebp, eax
cmovg eax, ebp
inc ecx
mov ebp, eax
cmp ecx, ebx
jl 0x1002d0e0
test ebp, ebp
jne 0x1002d0fc
xor eax, eax
jmp 0x1002d125
test ebp, ebp
mov dword [esp + 0x20], 0
mov eax, ebp
mov ecx, 0x1f
not eax
cmovns eax, ebp
bsr eax, eax
setne dl
sub ecx, eax
test dl, dl
mov eax, 0x20
cmovne eax, ecx
dec eax
mov ebp, 6
cmp eax, ebp
mov ecx, ebp
cmovl ecx, eax
xor esi, esi
movd xmm1, ecx
test ebx, ebx
jle 0x1002d231
cmp ebx, 0x10
jb 0x1002d217
mov edx, dword [esp + 0x24]
lea eax, [edi - 4]
add edx, 0xfffffffe
lea eax, [eax + ebx*4]
lea edx, [edx + ebx*2]
cmp dword [esp + 0x24], eax
ja 0x1002d166
cmp edx, edi
jae 0x1002d217
mov edx, dword [esp + 0x24]
mov eax, ebx
and eax, 0xfffffff0
add edx, 0x10
mov dword [esp + 0x20], eax
lea eax, [edi + 0x20]
nop dword [eax]
movups xmm0, xmmword [eax - 0x20]
add esi, 0x10
lea eax, [eax + 0x40]
lea edx, [edx + 0x20]
pslld xmm0, xmm1
psrad xmm0, 0x10
pshufhw xmm0, xmm0, 0xd8
pshuflw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [edx - 0x30], xmm0
movups xmm0, xmmword [eax - 0x50]
pslld xmm0, xmm1
psrad xmm0, 0x10
pshufhw xmm0, xmm0, 0xd8
pshuflw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [edx - 0x28], xmm0
movups xmm0, xmmword [eax - 0x40]
pslld xmm0, xmm1
psrad xmm0, 0x10
pshufhw xmm0, xmm0, 0xd8
pshuflw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [edx - 0x20], xmm0
movups xmm0, xmmword [eax - 0x30]
pslld xmm0, xmm1
psrad xmm0, 0x10
pshufhw xmm0, xmm0, 0xd8
pshuflw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [edx - 0x18], xmm0
cmp esi, dword [esp + 0x20]
jl 0x1002d180
cmp esi, ebx
jge 0x1002d231
mov eax, dword [esp + 0x24]
nop
mov edx, dword [edi + esi*4]
shl edx, cl
sar edx, 0x10
mov word [eax + esi*2], dx
inc esi
cmp esi, ebx
jl 0x1002d220
pop edi
sub ebp, ecx
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0xc
ret