Function at 0x4bf450
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0xc
push ebx
mov ebx, dword [esp + 0x18]
mov eax, ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x20]
sub eax, edi
and eax, 0xfffffffc
cmp eax, 0x80
jle 0x4bf4e1
mov ecx, dword [esp + 0x2c]
mov esi, dword [esp + 0x28]
test esi, esi
jle 0x4bf55e
push ecx
push ebx
lea eax, [esp + 0x1c]
push edi
push eax
call fcn.004bd980
mov edx, dword [esp + 0x24]
mov eax, esi
mov ebp, dword [esp + 0x28]
mov ecx, ebx
sar eax, 2
add esp, 0x10
sar esi, 1
sub ecx, ebp
add esi, eax
and ecx, 0xfffffffc
mov eax, edx
sub eax, edi
and eax, 0xfffffffc
cmp eax, ecx
mov eax, dword [esp + 0x2c]
push eax
push esi
jge 0x4bf4c1
push edx
push edi
call fcn.004bf450
mov edi, ebp
jmp 0x4bf4cc
push ebx
push ebp
call fcn.004bf450
mov ebx, dword [esp + 0x24]
mov ecx, dword [esp + 0x3c]
mov eax, ebx
sub eax, edi
add esp, 0x10
and eax, 0xfffffffc
cmp eax, 0x80
jg 0x4bf475
cmp edi, ebx
je 0x4bf70e
lea esi, [edi + 4]
cmp esi, ebx
je 0x4bf70e
mov ecx, 4
sub ecx, edi
mov dword [esp + 0x20], ecx
nop
mov eax, dword [esi]
mov ebp, esi
mov dword [esp + 0x24], eax
movd xmm1, eax
cvtdq2pd xmm1, xmm1
shr eax, 0x1f
addsd xmm1, qword [eax*8 + 0x71a1f0]
mov eax, dword [edi]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x71a1f0]
comisd xmm1, xmm0
jbe 0x4bf6af
add ecx, 0xfffffffc
mov eax, esi
add ecx, esi
push ecx
sub eax, ecx
add eax, 4
push edi
push eax
call fcn.006d8770
mov eax, dword [esp + 0x30]
add esp, 0xc
mov dword [edi], eax
jmp 0x4bf6ff
sub ebx, edi
mov eax, ebx
mov dword [esp + 0x24], ebx
sar eax, 2
mov ebp, eax
mov dword [esp + 0x10], eax
sar ebp, 1
test ebp, ebp
jle 0x4bf660
mov ebx, eax
lea esi, [ebx - 1]
sar esi, 1
mov dword [esp + 0x14], esi
mov eax, dword [edi + ebp*4 - 4]
dec ebp
mov dword [esp + 0x20], eax
mov edx, ebp
mov ecx, ebp
cmp ebp, esi
jge 0x4bf5e2
add ecx, ecx
mov eax, dword [edi + ecx*4 + 8]
movd xmm1, eax
shr eax, 0x1f
cvtdq2pd xmm1, xmm1
addsd xmm1, qword [eax*8 + 0x71a1f0]
mov eax, dword [edi + ecx*4 + 4]
movd xmm0, eax
shr eax, 0x1f
cvtdq2pd xmm0, xmm0
addsd xmm0, qword [eax*8 + 0x71a1f0]
xor eax, eax
comisd xmm1, xmm0
seta al
xor eax, 1
inc eax
add ecx, eax
mov eax, dword [edi + ecx*4]
mov dword [edi + edx*4], eax
mov edx, ecx
cmp ecx, esi
jl 0x4bf595
cmp edx, esi
jne 0x4bf5f5
test bl, 1
jne 0x4bf5f5
mov eax, dword [edi + ebx*4 - 4]
mov dword [edi + edx*4], eax
lea edx, [ebx - 1]
lea ecx, [edx - 1]
sar ecx, 1
cmp ebp, edx
jge 0x4bf645
mov eax, dword [esp + 0x20]
movd xmm1, eax
cvtdq2pd xmm1, xmm1
shr eax, 0x1f
addsd xmm1, qword [eax*8 + 0x71a1f0]
mov esi, dword [edi + ecx*4]
mov eax, esi
shr eax, 0x1f
movd xmm0, esi
cvtdq2pd xmm0, xmm0
addsd xmm0, qword [eax*8 + 0x71a1f0]
comisd xmm0, xmm1
jbe 0x4bf641
mov dword [edi + edx*4], esi
mov edx, ecx
dec ecx
sar ecx, 1
cmp ebp, edx
jl 0x4bf616
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x20]
mov dword [edi + edx*4], eax
test ebp, ebp
jg 0x4bf584
mov ebx, dword [esp + 0x24]
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x10]
cmp eax, 2
jl 0x4bf70e
nop dword [eax]
mov eax, dword [edi + ebx - 4]
mov dword [esp + 0x24], eax
mov eax, dword [edi]
mov dword [edi + ebx - 4], eax
lea eax, [esp + 0x24]
push ecx
push eax
lea eax, [ebx - 4]
sar eax, 2
push eax
push 0
push edi
call fcn.004bdff0
mov ecx, dword [esp + 0x40]
add ebx, 0xfffffffc
mov eax, ebx
add esp, 0x14
and eax, 0xfffffffc
cmp eax, 8
jge 0x4bf670
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov ecx, dword [esi - 4]
lea edx, [esi - 4]
mov eax, ecx
shr eax, 0x1f
movd xmm0, ecx
cvtdq2pd xmm0, xmm0
addsd xmm0, qword [eax*8 + 0x71a1f0]
comisd xmm1, xmm0
jbe 0x4bf6f8
mov dword [ebp], ecx
mov ebp, edx
mov ecx, dword [edx - 4]
sub edx, 4
mov eax, ecx
shr eax, 0x1f
movd xmm0, ecx
cvtdq2pd xmm0, xmm0
addsd xmm0, qword [eax*8 + 0x71a1f0]
comisd xmm1, xmm0
ja 0x4bf6d1
mov eax, dword [esp + 0x24]
mov dword [ebp], eax
mov ecx, dword [esp + 0x20]
add esi, 4
cmp esi, ebx
jne 0x4bf500
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret