Function at 0x10046be0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov edi, dword [ebp + 0xc]
mov eax, edi
sub eax, ebx
and eax, 0xfffffff8
cmp eax, 0x100
jle 0x10046ddc
mov ecx, dword [ebp + 0x14]
mov eax, edi
sub eax, ebx
cmp dword [ebp + 0x10], 0
jle 0x10046e3c
sar eax, 4
push ecx
lea esi, [ebx + eax*8]
lea eax, [edi - 8]
push eax
push esi
push ebx
call fcn.100440e0
add esp, 0x10
lea edi, [esi + 8]
cmp ebx, esi
jae 0x10046c54
movsd xmm0, qword [esi]
movsd xmm1, qword [esi - 8]
comisd xmm1, xmm0
ja 0x10046c54
movsd xmm0, qword [esi]
comisd xmm0, xmm1
ja 0x10046c54
add esi, 0xfffffff8
movaps xmm0, xmm1
cmp ebx, esi
jb 0x10046c35
mov eax, dword [ebp + 0xc]
cmp edi, eax
jae 0x10046c77
movsd xmm1, qword [esi]
nop
movsd xmm0, qword [edi]
comisd xmm0, xmm1
ja 0x10046c77
comisd xmm1, xmm0
ja 0x10046c77
add edi, 8
cmp edi, eax
jb 0x10046c60
mov edx, dword [ebp + 0xc]
mov eax, edi
mov ecx, esi
nop
cmp eax, edx
jae 0x10046cb5
movsd xmm0, qword [esi]
movsd xmm1, qword [eax]
comisd xmm0, xmm1
ja 0x10046cae
comisd xmm1, xmm0
ja 0x10046cb5
mov edx, dword [ebp + 0xc]
cmp edi, eax
je 0x10046cab
movsd xmm0, qword [edi]
movsd qword [edi], xmm1
movsd qword [eax], xmm0
add edi, 8
add eax, 8
cmp eax, edx
jb 0x10046c84
cmp ecx, ebx
jbe 0x10046cf6
lea edx, [ecx - 8]
nop dword [eax]
movsd xmm1, qword [edx]
movsd xmm0, qword [esi]
comisd xmm1, xmm0
ja 0x10046ce7
comisd xmm0, xmm1
ja 0x10046cf1
sub esi, 8
cmp esi, edx
je 0x10046ce7
movsd xmm0, qword [esi]
movsd qword [esi], xmm1
movsd qword [edx], xmm0
sub ecx, 8
sub edx, 8
cmp ebx, ecx
jb 0x10046cc0
mov edx, dword [ebp + 0xc]
cmp ecx, ebx
jne 0x10046d32
cmp eax, edx
je 0x10046d81
cmp edi, eax
je 0x10046d14
movsd xmm0, qword [edi]
movsd xmm1, qword [esi]
movsd qword [esi], xmm0
movsd qword [edi], xmm1
movsd xmm0, qword [eax]
add edi, 8
movsd xmm1, qword [esi]
movsd qword [esi], xmm0
add esi, 8
movsd qword [eax], xmm1
add eax, 8
jmp 0x10046c80
add ecx, 0xfffffff8
cmp eax, edx
jne 0x10046d69
sub esi, 8
cmp ecx, esi
je 0x10046d50
movsd xmm0, qword [esi]
movsd xmm1, qword [ecx]
movsd qword [ecx], xmm0
movsd qword [esi], xmm1
movsd xmm0, qword [edi - 8]
sub edi, 8
movsd xmm1, qword [esi]
movsd qword [esi], xmm0
movsd qword [edi], xmm1
jmp 0x10046c80
movsd xmm1, qword [eax]
movsd xmm0, qword [ecx]
movsd qword [eax], xmm0
add eax, 8
movsd qword [ecx], xmm1
jmp 0x10046c80
mov edx, dword [ebp + 0x10]
mov eax, edx
mov ecx, dword [ebp + 0xc]
sar eax, 2
sub ecx, edi
sar edx, 1
and ecx, 0xfffffff8
add edx, eax
mov eax, esi
sub eax, ebx
mov dword [ebp + 0x10], edx
and eax, 0xfffffff8
cmp eax, ecx
mov eax, dword [ebp + 0x14]
push eax
push edx
jge 0x10046db6
push esi
push ebx
call fcn.10046be0
mov ebx, edi
mov edi, dword [ebp + 0xc]
jmp 0x10046dc4
push dword [ebp + 0xc]
push edi
call fcn.10046be0
mov edi, esi
mov dword [ebp + 0xc], edi
mov ecx, dword [ebp + 0x14]
mov eax, edi
sub eax, ebx
add esp, 0x10
and eax, 0xfffffff8
cmp eax, 0x100
jg 0x10046c07
cmp ebx, edi
je 0x10046f7a
lea esi, [ebx + 8]
cmp esi, edi
je 0x10046f7a
mov eax, 8
sub eax, ebx
mov dword [esp + 0x18], eax
nop word [eax + eax]
movsd xmm1, qword [esi]
mov ecx, esi
comisd xmm1, xmmword [ebx]
movsd qword [esp + 0x10], xmm1
jbe 0x10046f45
lea ecx, [eax - 8]
mov eax, esi
add ecx, esi
push ecx
sub eax, ecx
add eax, 8
push ebx
push eax
call fcn.1008bd50
movsd xmm0, qword [esp + 0x1c]
add esp, 0xc
movsd qword [ebx], xmm0
jmp 0x10046f6b
sar eax, 3
mov esi, eax
mov dword [esp + 0xc], eax
sar esi, 1
test esi, esi
jle 0x10046ef0
lea ecx, [eax - 1]
mov dword [esp + 0x18], ecx
sar ecx, 1
mov dword [esp + 0x10], ecx
mov edi, ecx
nop
movsd xmm1, qword [ebx + esi*8 - 8]
dec esi
mov edx, esi
mov ecx, esi
cmp esi, edi
jge 0x10046e9d
nop
add ecx, ecx
xor eax, eax
movsd xmm0, qword [ebx + ecx*8 + 0x10]
comisd xmm0, xmmword [ebx + ecx*8 + 8]
seta al
inc ecx
xor eax, 1
add ecx, eax
movsd xmm0, qword [ebx + ecx*8]
movsd qword [ebx + edx*8], xmm0
mov edx, ecx
cmp ecx, edi
jl 0x10046e70
mov eax, dword [esp + 0xc]
cmp edx, edi
jne 0x10046eb4
test al, 1
jne 0x10046eb4
movsd xmm0, qword [ebx + eax*8 - 8]
movsd qword [ebx + edx*8], xmm0
mov edx, dword [esp + 0x18]
lea eax, [edx - 1]
sar eax, 1
cmp esi, edx
jge 0x10046ed9
nop dword [eax]
movsd xmm0, qword [ebx + eax*8]
comisd xmm0, xmm1
jbe 0x10046ed9
movsd qword [ebx + edx*8], xmm0
mov edx, eax
dec eax
sar eax, 1
cmp esi, edx
jl 0x10046ec0
mov eax, dword [esp + 0xc]
movsd qword [ebx + edx*8], xmm1
test esi, esi
jg 0x10046e60
mov edi, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x14]
mov eax, edi
sub eax, ebx
and eax, 0xfffffff8
cmp eax, 0x10
jl 0x10046f7a
sub edi, ebx
nop
movsd xmm0, qword [ebx + edi - 8]
lea eax, [esp + 0x18]
push ecx
push eax
lea eax, [edi - 8]
movsd qword [esp + 0x20], xmm0
movsd xmm0, qword [ebx]
sar eax, 3
push eax
push 0
push ebx
movsd qword [ebx + edi - 8], xmm0
call fcn.100450f0
mov ecx, dword [ebp + 0x14]
add edi, 0xfffffff8
mov eax, edi
add esp, 0x14
and eax, 0xfffffff8
cmp eax, 0x10
jge 0x10046f00
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
movsd xmm0, qword [esi - 8]
lea eax, [esi - 8]
comisd xmm1, xmm0
jbe 0x10046f67
movsd qword [ecx], xmm0
mov ecx, eax
movsd xmm0, qword [eax - 8]
sub eax, 8
comisd xmm1, xmm0
ja 0x10046f53
movsd qword [ecx], xmm1
mov eax, dword [esp + 0x18]
add esi, 8
cmp esi, edi
jne 0x10046e00
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret