Function at 0x402de0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
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 0x402fdc
mov edx, dword [ebp + 0x14]
mov eax, edi
sub eax, ebx
cmp dword [ebp + 0x10], 0
mov dword [ebp + 8], eax
jle 0x403027
sar eax, 4
push edx
lea esi, [ebx + eax*8]
lea eax, [edi - 8]
push eax
push esi
push ebx
call fcn.004029b0
add esp, 0x10
lea edi, [esi + 8]
cmp ebx, esi
jae 0x402e50
movsd xmm1, qword [esi]
movsd xmm0, qword [esi - 8]
comisd xmm1, xmm0
ja 0x402e50
comisd xmm0, xmm1
ja 0x402e50
add esi, 0xfffffff8
movaps xmm1, xmm0
cmp ebx, esi
jb 0x402e35
mov eax, dword [ebp + 0xc]
cmp edi, eax
jae 0x402e77
movsd xmm1, qword [esi]
nop dword [eax + eax]
movsd xmm0, qword [edi]
comisd xmm1, xmm0
ja 0x402e77
comisd xmm0, xmm1
ja 0x402e77
add edi, 8
cmp edi, eax
jb 0x402e60
mov edx, dword [ebp + 0xc]
mov eax, edi
mov ecx, esi
nop
cmp eax, edx
jae 0x402eb5
movsd xmm0, qword [esi]
movsd xmm1, qword [eax]
comisd xmm1, xmm0
ja 0x402eae
comisd xmm0, xmm1
ja 0x402eb5
mov edx, dword [ebp + 0xc]
cmp edi, eax
je 0x402eab
movsd xmm0, qword [edi]
movsd qword [edi], xmm1
movsd qword [eax], xmm0
add edi, 8
add eax, 8
cmp eax, edx
jb 0x402e84
cmp ecx, ebx
jbe 0x402ef6
lea edx, [ecx - 8]
nop dword [eax]
movsd xmm1, qword [edx]
movsd xmm0, qword [esi]
comisd xmm0, xmm1
ja 0x402ee7
comisd xmm1, xmm0
ja 0x402ef1
sub esi, 8
cmp esi, edx
je 0x402ee7
movsd xmm0, qword [esi]
movsd qword [esi], xmm1
movsd qword [edx], xmm0
sub ecx, 8
sub edx, 8
cmp ebx, ecx
jb 0x402ec0
mov edx, dword [ebp + 0xc]
cmp ecx, ebx
jne 0x402f32
cmp eax, edx
je 0x402f81
cmp edi, eax
je 0x402f14
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 0x402e80
add ecx, 0xfffffff8
cmp eax, edx
jne 0x402f69
sub esi, 8
cmp ecx, esi
je 0x402f50
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 0x402e80
movsd xmm1, qword [eax]
movsd xmm0, qword [ecx]
movsd qword [eax], xmm0
add eax, 8
movsd qword [ecx], xmm1
jmp 0x402e80
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 0x402fb6
push esi
push ebx
call fcn.00402de0
mov ebx, edi
mov edi, dword [ebp + 0xc]
jmp 0x402fc4
push dword [ebp + 0xc]
push edi
call fcn.00402de0
mov edi, esi
mov dword [ebp + 0xc], edi
mov edx, dword [ebp + 0x14]
mov eax, edi
sub eax, ebx
add esp, 0x10
and eax, 0xfffffff8
cmp eax, 0x100
jg 0x402e04
cmp ebx, edi
je 0x403158
lea ecx, [ebx + 8]
cmp ecx, edi
je 0x403158
nop
movsd xmm1, qword [ecx]
mov edx, ecx
movsd xmm0, qword [ebx]
comisd xmm0, xmm1
movsd qword [ebp - 8], xmm1
jbe 0x403127
lea esi, [ecx + 8]
push esi
push ecx
push ebx
call fcn.00402660
movsd xmm0, qword [ebp - 8]
add esp, 0xc
movsd qword [ebx], xmm0
mov ecx, esi
jmp 0x403150
mov ecx, eax
sar ecx, 3
mov esi, ecx
mov dword [ebp + 0xc], ecx
sar esi, 1
test esi, esi
jle 0x4030ce
lea edi, [ecx - 1]
sar edi, 1
movsd xmm1, qword [ebx + esi*8 - 8]
dec esi
mov edx, esi
mov eax, esi
cmp esi, edi
jge 0x40307d
nop
lea ecx, [eax + eax]
xor eax, eax
movsd xmm0, qword [ebx + ecx*8 + 8]
comisd xmm0, xmmword [ebx + ecx*8 + 0x10]
seta al
xor eax, 1
inc eax
add eax, ecx
movsd xmm0, qword [ebx + eax*8]
movsd qword [ebx + edx*8], xmm0
mov edx, eax
cmp eax, edi
jl 0x403050
mov ecx, dword [ebp + 0xc]
cmp edx, edi
jne 0x403094
test cl, 1
jne 0x403094
movsd xmm0, qword [ebx + ecx*8 - 8]
movsd qword [ebx + edx*8], xmm0
lea edx, [ecx - 1]
cmp esi, edx
jge 0x4030bb
nop dword [eax + eax]
lea eax, [edx - 1]
sar eax, 1
movsd xmm0, qword [ebx + eax*8]
comisd xmm1, xmm0
jbe 0x4030bb
movsd qword [ebx + edx*8], xmm0
mov edx, eax
cmp esi, eax
jl 0x4030a0
movsd qword [ebx + edx*8], xmm1
test esi, esi
jg 0x403040
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0x14]
cmp ecx, 2
jl 0x403158
nop word [eax + eax]
movsd xmm0, qword [ebx + eax - 8]
lea ecx, [ebp - 8]
movsd qword [ebp - 8], xmm0
movsd xmm0, qword [ebx]
movsd qword [ebx + eax - 8], xmm0
add eax, 0xfffffff8
push edx
push ecx
mov dword [ebp + 8], eax
sar eax, 3
push eax
push 0
push ebx
call fcn.00402d30
mov eax, dword [ebp + 8]
add esp, 0x14
mov edx, dword [ebp + 0x14]
and eax, 0xfffffff8
cmp eax, 0x10
mov eax, dword [ebp + 8]
jge 0x4030e0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
movsd xmm0, qword [ecx - 8]
lea eax, [ecx - 8]
comisd xmm0, xmm1
jbe 0x403149
movsd qword [edx], xmm0
mov edx, eax
movsd xmm0, qword [eax - 8]
sub eax, 8
comisd xmm0, xmm1
ja 0x403135
movsd qword [edx], xmm1
add ecx, 8
cmp ecx, edi
jne 0x402ff0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret