Function at 0x401e40
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x1c
push ebx
push esi
mov ebx, edx
push edi
mov edi, ecx
mov eax, ebx
sub eax, edi
and eax, 0xfffffff8
cmp eax, 0x100
jle 0x401ed2
mov eax, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
test esi, esi
jle 0x401f2e
push eax
push ebx
mov edx, edi
lea ecx, [esp + 0x18]
call fcn.004020a0
mov ecx, dword [esp + 0x1c]
mov eax, esi
sar eax, 2
mov edx, ebx
sar esi, 1
add esp, 8
add esi, eax
sub edx, ecx
mov eax, dword [esp + 0x10]
and edx, 0xfffffff8
sub eax, edi
and eax, 0xfffffff8
cmp eax, edx
mov eax, dword [ebp + 0xc]
push eax
push esi
jge 0x401eb3
mov edx, dword [esp + 0x18]
mov ecx, edi
call fcn.00401e40
mov edi, dword [esp + 0x1c]
jmp 0x401ebe
mov edx, ebx
call fcn.00401e40
mov ebx, dword [esp + 0x18]
mov eax, ebx
add esp, 8
sub eax, edi
and eax, 0xfffffff8
cmp eax, 0x100
mov eax, dword [ebp + 0xc]
jg 0x401e64
cmp edi, ebx
je 0x40208b
lea edx, [edi + 8]
mov esi, edx
cmp esi, ebx
je 0x40208b
mov eax, 8
sub eax, edi
mov dword [esp + 0x10], eax
movsd xmm1, qword [esi]
mov ecx, esi
movsd xmm0, qword [edi]
comisd xmm0, xmm1
movsd qword [esp + 0x20], xmm1
jbe 0x402056
add eax, 0xfffffff8
add eax, esi
push eax
push edi
push edx
call sub.VCRUNTIME140.dll_memmove
movsd xmm0, qword [esp + 0x2c]
lea edx, [edi + 8]
add esp, 0xc
movsd qword [edi], xmm0
jmp 0x40207c
sub ebx, edi
mov ecx, ebx
mov dword [esp + 0x10], ebx
sar ecx, 3
mov esi, ecx
mov dword [esp + 0x1c], ecx
sar esi, 1
test esi, esi
jle 0x402003
mov ebx, dword [esp + 0x1c]
lea ecx, [ecx - 1]
sar ecx, 1
mov dword [esp + 0x18], ecx
nop word [eax + eax]
movsd xmm1, qword [edi + esi*8 - 8]
dec esi
mov dword [esp + 0x20], esi
mov edx, esi
mov eax, esi
cmp esi, ecx
jge 0x401fb2
mov esi, dword [esp + 0x18]
nop word [eax + eax]
lea ecx, [eax + eax]
xor eax, eax
movsd xmm0, qword [edi + ecx*8 + 8]
comisd xmm0, xmmword [edi + ecx*8 + 0x10]
seta al
xor eax, 1
inc eax
add eax, ecx
movsd xmm0, qword [edi + eax*8]
movsd qword [edi + edx*8], xmm0
mov edx, eax
cmp eax, esi
jl 0x401f80
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
cmp edx, ecx
jne 0x401fc9
test bl, 1
jne 0x401fc9
movsd xmm0, qword [edi + ebx*8 - 8]
movsd qword [edi + edx*8], xmm0
lea edx, [ebx - 1]
cmp esi, edx
jge 0x401feb
nop dword [eax]
lea eax, [edx - 1]
sar eax, 1
movsd xmm0, qword [edi + eax*8]
comisd xmm1, xmm0
jbe 0x401feb
movsd qword [edi + edx*8], xmm0
mov edx, eax
cmp esi, eax
jl 0x401fd0
movsd qword [edi + edx*8], xmm1
test esi, esi
jg 0x401f60
mov ebx, dword [esp + 0x10]
mov eax, dword [ebp + 0xc]
mov ecx, dword [esp + 0x1c]
cmp ecx, 2
jl 0x40208b
nop dword [eax]
movsd xmm0, qword [edi + ebx - 8]
xor edx, edx
push eax
lea eax, [esp + 0x14]
movsd qword [esp + 0x14], xmm0
movsd xmm0, qword [edi]
mov ecx, edi
push eax
lea eax, [ebx - 8]
movsd qword [edi + ebx - 8], xmm0
sar eax, 3
push eax
call fcn.004023b0
add ebx, 0xfffffff8
add esp, 0xc
mov eax, ebx
and eax, 0xfffffff8
cmp eax, 0x10
mov eax, dword [ebp + 0xc]
jge 0x402010
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
movsd xmm0, qword [esi - 8]
lea eax, [esi - 8]
comisd xmm0, xmm1
jbe 0x402078
movsd qword [ecx], xmm0
mov ecx, eax
movsd xmm0, qword [eax - 8]
sub eax, 8
comisd xmm0, xmm1
ja 0x402064
movsd qword [ecx], xmm1
mov eax, dword [esp + 0x10]
add esi, 8
cmp esi, ebx
jne 0x401ef2
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret