Function at 0x470f60
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x54
mov eax, ecx
push ebx
push esi
push edi
mov esi, dword [eax + 8]
mov dword [esp + 0x20], eax
test esi, esi
je 0x47128f
mov edi, dword [eax + 0xc]
test edi, edi
je 0x47128f
movsd xmm0, qword [eax]
xor ecx, ecx
comisd xmm0, xmmword [esi]
mov ebx, 1
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x14], ebx
movsd qword [esp + 0x38], xmm0
jb 0x470fd7
nop word [eax + eax]
subsd xmm0, qword [esi + ecx*8]
lea eax, [ecx + 1]
xor ebx, 1
xor ecx, ecx
cmp eax, edi
cmovne ecx, eax
comisd xmm0, xmmword [esi + ecx*8]
jae 0x470fb0
mov dword [esp + 0x14], ebx
mov dword [esp + 0x1c], ecx
movsd qword [esp + 0x38], xmm0
mov ecx, edx
call fcn.00470280
mov esi, eax
mov dword [esp + 0x18], esi
call fcn.0046f8c0
mov ecx, dword [esi + 0x1c]
mov edi, eax
mov edx, 8
add ecx, dword [edi + 0x1c]
mov esi, dword [edi + 0x20]
cmp ecx, esi
jle 0x47102a
test esi, esi
cmove esi, edx
cmp esi, ecx
jge 0x47100c
add esi, esi
cmp esi, ecx
jl 0x471006
lea eax, [esi*4]
push eax
push dword [edi + 0x18]
call fcn.004916a4
add esp, 8
mov dword [edi + 0x18], eax
mov dword [edi + 0x20], esi
mov edx, 8
mov eax, dword [esp + 0x18]
mov esi, dword [edi + 0x2c]
mov eax, dword [eax + 0x28]
add eax, dword [edi + 0x28]
cmp eax, esi
jle 0x471061
test esi, esi
cmove esi, edx
cmp esi, eax
jge 0x47104a
add esi, esi
cmp esi, eax
jl 0x471044
mov eax, esi
shl eax, 4
push eax
push dword [edi + 0x24]
call fcn.004916a4
add esp, 8
mov dword [edi + 0x24], eax
mov dword [edi + 0x2c], esi
mov esi, dword [esp + 0x18]
mov ecx, dword [esi + 0x18]
mov eax, dword [esi + 0x1c]
mov dword [esp + 0x10], ecx
lea edx, [ecx + eax*4]
mov eax, dword [esi + 0x24]
mov dword [esp + 0x24], edx
mov dword [esp + 0xc], eax
cmp ecx, edx
jae 0x471259
nop word [eax + eax]
cmp dword [esp + 0x14], 0
movsd xmm0, qword [esp + 0x38]
movsd xmm1, qword [eax + 8]
mov esi, dword [esp + 0x1c]
movsd qword [esp + 0x40], xmm0
movsd xmm0, qword [eax]
movsd qword [esp + 0x28], xmm0
movsd qword [esp + 0x30], xmm1
je 0x4710e1
movaps xmm2, xmm1
mov ecx, edi
movaps xmm1, xmm0
call fcn.0046f910
movsd xmm0, qword [esp + 0x28]
movsd xmm1, qword [esp + 0x30]
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x24]
add ecx, 4
add eax, 0x10
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], eax
cmp ecx, edx
jae 0x471255
cmp dword [ecx], 1
jne 0x471286
movsd xmm2, qword [eax]
movsd xmm3, qword [eax + 8]
subsd xmm2, xmm0
subsd xmm3, xmm1
movaps xmm1, xmm2
movsd qword [esp + 0x48], xmm2
movaps xmm0, xmm3
mulsd xmm1, xmm2
mulsd xmm0, xmm3
movsd qword [esp + 0x50], xmm3
addsd xmm0, xmm1
call fcn.0049fa50
mov eax, dword [esp + 0x20]
movaps xmm3, xmm0
movsd xmm4, qword [esp + 0x40]
xorps xmm0, xmm0
movaps xmm2, xmm3
movsd qword [esp + 0x58], xmm3
subsd xmm2, xmm0
movaps xmm5, xmm0
mov eax, dword [eax + 8]
movsd xmm1, qword [eax + esi*8]
subsd xmm1, xmm4
comisd xmm2, xmm1
jbe 0x4711ef
nop word [eax + eax]
movsd xmm0, qword [eax + esi*8]
mov ecx, edi
subsd xmm0, xmm4
addsd xmm0, xmm5
movsd qword [esp + 0x40], xmm0
divsd xmm0, xmm3
movaps xmm1, xmm0
mulsd xmm0, qword [esp + 0x50]
mulsd xmm1, qword [esp + 0x48]
addsd xmm0, qword [esp + 0x30]
addsd xmm1, qword [esp + 0x28]
movaps xmm2, xmm0
test ebx, ebx
je 0x4711b2
call fcn.0046f9e0
jmp 0x4711b7
call fcn.0046f910
mov ecx, dword [esp + 0x20]
xor eax, eax
movsd xmm3, qword [esp + 0x58]
test ebx, ebx
movsd xmm5, qword [esp + 0x40]
movaps xmm0, xmm3
sete al
subsd xmm0, xmm5
mov ebx, eax
xorps xmm4, xmm4
lea eax, [esi + 1]
xor esi, esi
cmp eax, dword [ecx + 0xc]
cmovne esi, eax
mov eax, dword [ecx + 8]
comisd xmm0, xmmword [eax + esi*8]
ja 0x471170
mov eax, dword [esp + 0xc]
subsd xmm3, xmm5
movsd xmm0, qword [eax]
movsd xmm1, qword [eax + 8]
addsd xmm4, xmm3
movsd qword [esp + 0x28], xmm0
movsd qword [esp + 0x30], xmm1
movsd qword [esp + 0x40], xmm4
test ebx, ebx
je 0x471237
movaps xmm2, xmm1
mov ecx, edi
movaps xmm1, xmm0
call fcn.0046f9e0
movsd xmm0, qword [esp + 0x28]
movsd xmm1, qword [esp + 0x30]
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x10]
add eax, 0x10
mov edx, dword [esp + 0x24]
add ecx, 4
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], eax
cmp ecx, edx
jb 0x4710f7
mov esi, dword [esp + 0x18]
add dword [esi], 0xffffffff
jne 0x47127d
push dword [esi + 0x18]
call fcn.00491497
add esp, 4
push dword [esi + 0x24]
call fcn.00491497
add esp, 4
push esi
call fcn.00491497
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [esp + 0x14]
jmp 0x471090
mov ecx, edx
call fcn.0046fef0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret