Function at 0x10046680
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, dword [esp + 8]
push ebp
mov ebp, dword [esp + 0x10]
mov eax, ebp
sub eax, ebx
and eax, 0xfffffffc
push esi
push edi
cmp eax, 0x80
jle 0x10046a20
nop
mov eax, ebp
sub eax, ebx
cmp dword [esp + 0x1c], 0
jle 0x10046a86
movss xmm2, dword [ebx]
sar eax, 3
cvtps2pd xmm0, xmm2
lea esi, [ebx + eax*4]
lea eax, [ebp - 4]
sub eax, ebx
sar eax, 2
cmp eax, 0x28
jle 0x1004682d
inc eax
sar eax, 3
lea ecx, [eax*8]
shl eax, 2
mov dword [esp + 0x14], ecx
movss xmm3, dword [eax + ebx]
cvtps2pd xmm1, xmm3
comisd xmm1, xmm0
jbe 0x100466f6
movss dword [eax + ebx], xmm2
movss dword [ebx], xmm3
movss xmm1, dword [ecx + ebx]
movss xmm2, dword [eax + ebx]
cvtps2pd xmm3, xmm1
cvtps2pd xmm0, xmm2
comisd xmm3, xmm0
jbe 0x1004672c
movss dword [ecx + ebx], xmm2
movss dword [eax + ebx], xmm1
movss xmm2, dword [ebx]
cvtps2pd xmm0, xmm2
comisd xmm3, xmm0
jbe 0x1004672c
movss dword [eax + ebx], xmm2
movss dword [ebx], xmm1
movss xmm3, dword [esi]
mov ecx, esi
sub ecx, eax
cvtps2pd xmm1, xmm3
movss xmm2, dword [ecx]
cvtps2pd xmm0, xmm2
comisd xmm1, xmm0
jbe 0x1004674c
movss dword [esi], xmm2
movss dword [ecx], xmm3
movss xmm1, dword [eax + esi]
movss xmm2, dword [esi]
cvtps2pd xmm3, xmm1
cvtps2pd xmm0, xmm2
comisd xmm3, xmm0
jbe 0x1004677f
movss dword [eax + esi], xmm2
movss dword [esi], xmm1
movss xmm2, dword [ecx]
cvtps2pd xmm0, xmm2
comisd xmm3, xmm0
jbe 0x1004677f
movss dword [esi], xmm2
movss dword [ecx], xmm1
lea ecx, [ebp - 4]
lea edi, [ebp - 4]
sub ecx, eax
sub edi, dword [esp + 0x14]
movss xmm3, dword [ecx]
movss xmm2, dword [edi]
cvtps2pd xmm1, xmm3
cvtps2pd xmm0, xmm2
comisd xmm1, xmm0
jbe 0x100467a7
movss dword [ecx], xmm2
movss dword [edi], xmm3
movss xmm1, dword [ebp - 4]
movss xmm2, dword [ecx]
cvtps2pd xmm3, xmm1
cvtps2pd xmm0, xmm2
comisd xmm3, xmm0
jbe 0x100467da
movss dword [ebp - 4], xmm2
movss dword [ecx], xmm1
movss xmm2, dword [edi]
cvtps2pd xmm0, xmm2
comisd xmm3, xmm0
jbe 0x100467da
movss dword [ecx], xmm2
movss dword [edi], xmm1
movss xmm3, dword [esi]
movss xmm2, dword [eax + ebx]
cvtps2pd xmm1, xmm3
cvtps2pd xmm0, xmm2
comisd xmm1, xmm0
jbe 0x100467f8
movss dword [esi], xmm2
movss dword [eax + ebx], xmm3
movss xmm1, dword [ecx]
movss xmm2, dword [esi]
cvtps2pd xmm3, xmm1
cvtps2pd xmm0, xmm2
comisd xmm3, xmm0
jbe 0x10046875
movss dword [ecx], xmm2
movss dword [esi], xmm1
movss xmm2, dword [eax + ebx]
cvtps2pd xmm0, xmm2
comisd xmm3, xmm0
jbe 0x10046875
movss dword [esi], xmm2
movss dword [eax + ebx], xmm1
jmp 0x10046875
movss xmm3, dword [esi]
cvtps2pd xmm1, xmm3
comisd xmm1, xmm0
jbe 0x10046842
movss dword [esi], xmm2
movss dword [ebx], xmm3
movss xmm1, dword [ebp - 4]
movss xmm2, dword [esi]
cvtps2pd xmm3, xmm1
cvtps2pd xmm0, xmm2
comisd xmm3, xmm0
jbe 0x10046875
movss dword [ebp - 4], xmm2
movss dword [esi], xmm1
movss xmm2, dword [ebx]
cvtps2pd xmm0, xmm2
comisd xmm3, xmm0
jbe 0x10046875
movss dword [esi], xmm2
movss dword [ebx], xmm1
lea edi, [esi + 4]
cmp ebx, esi
jae 0x100468a1
movss xmm1, dword [esi]
movss xmm2, dword [esi - 4]
cvtps2pd xmm0, xmm2
cvtps2pd xmm1, xmm1
comisd xmm0, xmm1
ja 0x100468a1
comisd xmm1, xmm0
ja 0x100468a1
add esi, 0xfffffffc
movaps xmm1, xmm2
cmp ebx, esi
jb 0x10046880
cmp edi, ebp
jae 0x100468d1
movss xmm2, dword [esi]
nop dword [eax]
movss xmm0, dword [edi]
xorps xmm1, xmm1
cvtps2pd xmm0, xmm0
cvtss2sd xmm1, xmm2
comisd xmm0, xmm1
ja 0x100468d1
comisd xmm1, xmm0
ja 0x100468d1
add edi, 4
cmp edi, ebp
jb 0x100468b0
mov ecx, edi
mov edx, esi
cmp ecx, ebp
jae 0x10046914
nop dword [eax]
movss xmm0, dword [esi]
movss xmm2, dword [ecx]
cvtps2pd xmm0, xmm0
cvtps2pd xmm1, xmm2
comisd xmm0, xmm1
ja 0x1004690d
comisd xmm1, xmm0
ja 0x10046914
cmp edi, ecx
je 0x1004690a
movss xmm0, dword [edi]
movss dword [edi], xmm2
movss dword [ecx], xmm0
add edi, 4
add ecx, 4
cmp ecx, ebp
jb 0x100468e0
cmp edx, ebx
jbe 0x10046959
lea eax, [edx - 4]
nop dword [eax + eax]
movss xmm2, dword [eax]
movss xmm1, dword [esi]
cvtps2pd xmm0, xmm2
cvtps2pd xmm1, xmm1
comisd xmm0, xmm1
ja 0x1004694d
comisd xmm1, xmm0
ja 0x10046957
sub esi, 4
cmp esi, eax
je 0x1004694d
movss xmm0, dword [esi]
movss dword [esi], xmm2
movss dword [eax], xmm0
sub edx, 4
sub eax, 4
cmp ebx, edx
jb 0x10046920
cmp edx, ebx
jne 0x10046989
cmp ecx, ebp
je 0x100469cb
cmp edi, ecx
je 0x1004696f
movss xmm0, dword [esi]
mov eax, dword [edi]
mov dword [esi], eax
movss dword [edi], xmm0
movss xmm0, dword [esi]
add edi, 4
mov eax, dword [ecx]
mov dword [esi], eax
add esi, 4
movss dword [ecx], xmm0
add ecx, 4
jmp 0x100468d5
add edx, 0xfffffffc
cmp ecx, ebp
jne 0x100469b7
sub esi, 4
cmp edx, esi
je 0x100469a3
movss xmm0, dword [edx]
mov eax, dword [esi]
mov dword [edx], eax
movss dword [esi], xmm0
movss xmm0, dword [esi]
sub edi, 4
mov eax, dword [edi]
mov dword [esi], eax
movss dword [edi], xmm0
jmp 0x100468d5
movss xmm0, dword [ecx]
mov eax, dword [edx]
mov dword [ecx], eax
add ecx, 4
movss dword [edx], xmm0
jmp 0x100468d5
mov edx, dword [esp + 0x1c]
mov ecx, ebp
push dword [esp + 0x20]
mov eax, edx
sub ecx, edi
sar eax, 2
and ecx, 0xfffffffc
sar edx, 1
add edx, eax
mov eax, esi
sub eax, ebx
mov dword [esp + 0x20], edx
and eax, 0xfffffffc
push edx
cmp eax, ecx
jge 0x100469fe
push esi
push ebx
call fcn.10046680
mov ebx, edi
jmp 0x10046a0b
push ebp
push edi
call fcn.10046680
mov ebp, esi
mov dword [esp + 0x28], ebp
mov eax, ebp
add esp, 0x10
sub eax, ebx
and eax, 0xfffffffc
cmp eax, 0x80
jg 0x100466a0
cmp ebx, ebp
je 0x10046bcd
lea esi, [ebx + 4]
cmp esi, ebp
je 0x10046bcd
mov edi, 4
sub edi, ebx
nop word [eax + eax]
movss xmm3, dword [esi]
mov ecx, esi
movss xmm0, dword [ebx]
cvtps2pd xmm1, xmm3
cvtps2pd xmm0, xmm0
movss dword [esp + 0x18], xmm3
comisd xmm1, xmm0
jbe 0x10046b8f
lea ecx, [esi - 4]
mov eax, esi
add ecx, edi
push ecx
sub eax, ecx
add eax, 4
push ebx
push eax
call fcn.1008bd50
movss xmm0, dword [esp + 0x24]
add esp, 0xc
movss dword [ebx], xmm0
jmp 0x10046bc2
sar eax, 2
mov esi, eax
mov dword [esp + 0x14], eax
sar esi, 1
test esi, esi
jle 0x10046b38
lea edi, [eax - 1]
sar edi, 1
lea ebp, [eax - 1]
movss xmm3, dword [ebx + esi*4 - 4]
dec esi
mov edx, esi
mov ecx, esi
cmp esi, edi
jge 0x10046ae3
add ecx, ecx
xor eax, eax
movss xmm1, dword [ebx + ecx*4 + 8]
movss xmm0, dword [ebx + ecx*4 + 4]
cvtps2pd xmm1, xmm1
cvtps2pd xmm0, xmm0
comisd xmm1, xmm0
seta al
xor eax, 1
inc eax
add ecx, eax
mov eax, dword [ebx + ecx*4]
mov dword [ebx + edx*4], eax
mov edx, ecx
cmp ecx, edi
jl 0x10046ab0
mov eax, dword [esp + 0x14]
cmp edx, edi
jne 0x10046af4
test al, 1
jne 0x10046af4
mov eax, dword [ebx + eax*4 - 4]
mov dword [ebx + edx*4], eax
mov edx, ebp
lea eax, [edx - 1]
sar eax, 1
cmp esi, edx
jge 0x10046b23
nop dword [eax]
movss xmm2, dword [ebx + eax*4]
xorps xmm0, xmm0
cvtps2pd xmm1, xmm2
cvtss2sd xmm0, xmm3
comisd xmm1, xmm0
jbe 0x10046b23
movss dword [ebx + edx*4], xmm2
mov edx, eax
dec eax
sar eax, 1
cmp esi, edx
jl 0x10046b00
mov eax, dword [esp + 0x14]
movss dword [ebx + edx*4], xmm3
test esi, esi
jg 0x10046aa1
mov ebp, dword [esp + 0x18]
mov eax, ebp
sub eax, ebx
and eax, 0xfffffffc
cmp eax, 8
jl 0x10046bcd
sub ebp, ebx
nop word [eax + eax]
movss xmm0, dword [ebx + ebp - 4]
mov eax, dword [ebx]
push dword [esp + 0x20]
mov dword [ebx + ebp - 4], eax
lea eax, [esp + 0x1c]
push eax
lea eax, [ebp - 4]
movss dword [esp + 0x20], xmm0
sar eax, 2
push eax
push 0
push ebx
call fcn.10045040
add ebp, 0xfffffffc
add esp, 0x14
mov eax, ebp
and eax, 0xfffffffc
cmp eax, 8
jge 0x10046b50
pop edi
pop esi
pop ebp
pop ebx
ret
movss xmm2, dword [esi - 4]
lea eax, [esi - 4]
cvtps2pd xmm0, xmm2
comisd xmm1, xmm0
jbe 0x10046bbe
movss dword [ecx], xmm2
xorps xmm1, xmm1
movss xmm2, dword [eax - 4]
mov ecx, eax
sub eax, 4
cvtps2pd xmm0, xmm2
cvtss2sd xmm1, xmm3
comisd xmm1, xmm0
ja 0x10046ba0
movss dword [ecx], xmm3
add esi, 4
cmp esi, ebp
jne 0x10046a40
pop edi
pop esi
pop ebp
pop ebx
ret