Function at 0x10157256
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x40
mov esi, esp
mov eax, dword [0x101db764]
mov edx, dword [ebp + 0x14]
xor eax, ebp
lea ecx, [edx*4]
mov dword [esi + 0x38], eax
mov eax, ecx
call fcn.1015e8d0
mov ebx, esp
and ebx, 0xfffffff0
mov esp, ebx
mov eax, ecx
call fcn.1015e8d0
mov edi, esp
and edi, 0xfffffff0
mov esp, edi
xor eax, eax
inc eax
test edx, edx
cmovg eax, edx
xor ecx, ecx
shl eax, 2
push eax
push ecx
push ebx
call fcn.10161ee0
mov edx, edi
add esp, 0xc
movaps xmm1, xmmword [0x101bb4e0]
xorps xmm0, xmm0
xor eax, eax
mov ecx, dword [ebp + 8]
movss xmm2, dword [ecx + eax*4]
mov edi, ecx
xor ecx, ecx
ucomiss xmm0, xmm2
andps xmm2, xmm1
seta cl
mov dword [edx + eax*4], ecx
mov ecx, dword [ebp + 0xc]
movss dword [edi + eax*4], xmm2
xor edi, edi
mov dword [ecx + eax*4], edi
inc eax
cmp eax, dword [ebp + 0x14]
jl 0x101572ba
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x10]
xorps xmm4, xmm4
mov dword [esi + 0x14], edx
sar eax, 1
cmp eax, ecx
jge 0x10157402
mov edi, dword [ebp + 8]
xor eax, eax
xorps xmm0, xmm0
addss xmm0, dword [edi + eax*4]
inc eax
cmp eax, dword [ebp + 0x14]
jl 0x10157303
ucomiss xmm0, dword [0x101c5cd0]
mov edx, dword [ebp + 0x14]
jbe 0x10157327
movss xmm1, dword [0x101c5d80]
ucomiss xmm1, xmm0
ja 0x1015735c
mov eax, dword [ebp + 8]
cmp edx, 1
mov ecx, 2
cmovg ecx, edx
lea ecx, [ecx*4 - 4]
mov dword [eax], 0x3f800000
lea eax, [eax + 4]
push ecx
push 0
push eax
call fcn.10161ee0
mov ecx, dword [ebp + 0x10]
add esp, 0xc
movss xmm0, dword [0x10187150]
movss xmm2, dword [0x10187150]
xorps xmm1, xmm1
cvtsi2ss xmm1, ecx
mov edx, dword [ebp + 8]
xorps xmm4, xmm4
xor edi, edi
mov dword [esi + 0x10], ebx
addss xmm1, dword [0x101c1f24]
divss xmm2, xmm0
mulss xmm2, xmm1
movss dword [esi + 8], xmm2
movss xmm0, dword [edx + edi*4]
movaps xmmword [esi + 0x20], xmm4
mov dword [esi + 0xc], ecx
mulss xmm0, dword [esi + 8]
cvtss2sd xmm0, xmm0
sub esp, 8
movsd qword [esp], xmm0
call fcn.1016b1e0
movaps xmm4, xmmword [esi + 0x20]
mov edx, dword [ebp + 8]
mov ecx, dword [esi + 0xc]
add esp, 8
fstp dword [esi + 0x1c]
mov ebx, dword [ebp + 0xc]
cvttss2si eax, dword [esi + 0x1c]
mov dword [ebx + edi*4], eax
mov ebx, dword [esi + 0x10]
xorps xmm0, xmm0
cvtsi2ss xmm0, eax
movd xmm1, eax
sub ecx, eax
movss xmm2, dword [edx + edi*4]
movaps xmm3, xmm0
addss xmm0, xmm0
pshufd xmm1, xmm1, 0x50
cvtdq2ps xmm1, xmm1
movss dword [ebx + edi*4], xmm0
inc edi
cmp edi, dword [ebp + 0x14]
unpcklps xmm3, xmm2
mulps xmm1, xmm3
addps xmm4, xmm1
jl 0x1015738b
jmp 0x10157405
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0x14]
mov edi, eax
lea eax, [eax + 3]
cmp ecx, eax
jle 0x10157435
xorps xmm0, xmm0
cvtsi2ss xmm0, ecx
movaps xmm1, xmm0
mulss xmm1, xmm0
mulss xmm0, dword [ebx]
mov ebx, dword [ebp + 0xc]
addss xmm4, xmm1
add dword [ebx], ecx
addss xmm0, xmm4
jmp 0x10157506
test ecx, ecx
jle 0x10157500
xor eax, eax
mov dword [esi + 0xc], ecx
movaps xmm3, xmm4
movaps xmm2, xmm4
movss xmm1, dword [ebx]
movaps xmmword [esi + 0x20], xmm4
mov dword [esi + 8], eax
shufps xmm3, xmm4, 0xe5
addss xmm2, dword [0x10187150]
movaps xmm6, xmm3
addss xmm6, dword [edx]
xor edx, edx
xor ecx, ecx
inc edx
addss xmm1, xmm2
mulss xmm6, xmm6
movaps xmm4, xmm6
mov eax, dword [ebp + 8]
movss xmm7, dword [ebx + edx*4]
movaps xmm5, xmm1
movss xmm0, dword [eax + edx*4]
addss xmm7, xmm2
mulss xmm4, xmm7
addss xmm0, xmm3
mulss xmm0, xmm0
mulss xmm5, xmm0
ucomiss xmm5, xmm4
cmpltss xmm4, xmm5
andps xmm0, xmm4
andnps xmm4, xmm6
cmova ecx, edx
orps xmm4, xmm0
ja 0x101574b3
movaps xmm7, xmm1
inc edx
movaps xmm6, xmm4
movaps xmm1, xmm7
cmp edx, edi
jl 0x10157476
movss xmm1, dword [ebx + ecx*4]
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
movaps xmm3, xmmword [esi + 0x20]
movaps xmm4, xmm1
addss xmm1, dword [0x1019b0b4]
movss xmm0, dword [eax + ecx*4]
movss xmm3, xmm2
movss dword [ebx + ecx*4], xmm1
inc dword [edx + ecx*4]
mov edx, eax
unpcklps xmm4, xmm0
mov eax, dword [esi + 8]
mov ecx, dword [esi + 0xc]
addps xmm4, xmm3
inc eax
cmp eax, ecx
jne 0x10157442
mov ebx, dword [ebp + 0xc]
movaps xmm0, xmm4
xor eax, eax
mov ecx, dword [esi + 0x14]
mov ecx, dword [ecx + eax*4]
mov edx, ecx
neg edx
xor edx, dword [ebx + eax*4]
add edx, ecx
mov dword [ebx + eax*4], edx
inc eax
cmp eax, edi
jl 0x10157508
movss dword [esi + 0x18], xmm0
fld dword [esi + 0x18]
fstp xword [esi + 0x20]
mov ecx, dword [esi + 0x38]
xor ecx, ebp
call fcn.1015e65c
fld xword [esi + 0x20]
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret