Function at 0x57ed70
Capabilities:
Encode data using xor

Disassembly:
sub esp, 8
push ebx
mov ebx, dword [esp + 0x14]
mov eax, ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x1c]
sub eax, edi
and eax, 0xfffffffc
cmp eax, 0x80
jle 0x57ee01
mov ecx, dword [esp + 0x28]
mov esi, dword [esp + 0x24]
test esi, esi
jle 0x57ee5c
push ecx
push ebx
lea eax, [esp + 0x18]
push edi
push eax
call fcn.0057d340
mov edx, dword [esp + 0x20]
mov eax, esi
mov ebp, dword [esp + 0x24]
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 + 0x28]
push eax
push esi
jge 0x57ede1
push edx
push edi
call fcn.0057ed70
mov edi, ebp
jmp 0x57edec
push ebx
push ebp
call fcn.0057ed70
mov ebx, dword [esp + 0x20]
mov ecx, dword [esp + 0x38]
mov eax, ebx
sub eax, edi
add esp, 0x10
and eax, 0xfffffffc
cmp eax, 0x80
jg 0x57ed95
cmp edi, ebx
je 0x57efad
lea esi, [edi + 4]
cmp esi, ebx
je 0x57efad
mov eax, 4
sub eax, edi
mov dword [esp + 0x20], eax
nop
mov ebp, dword [esi]
mov edx, esi
movd xmm0, dword [edi]
cvtdq2pd xmm0, xmm0
movd xmm1, ebp
cvtdq2pd xmm1, xmm1
comisd xmm1, xmm0
jbe 0x57ef70
lea ecx, [eax - 4]
mov eax, esi
add ecx, esi
push ecx
sub eax, ecx
add eax, 4
push edi
push eax
call fcn.0086cdf0
add esp, 0xc
mov dword [edi], ebp
jmp 0x57ef9e
sub ebx, edi
mov eax, ebx
mov dword [esp + 0x20], ebx
sar eax, 2
mov esi, eax
mov dword [esp + 0x10], eax
sar esi, 1
test esi, esi
jle 0x57ef28
mov ebx, eax
lea ebp, [ebx - 1]
sar ebp, 1
nop
mov eax, dword [edi + esi*4 - 4]
dec esi
mov dword [esp + 0x1c], eax
mov edx, esi
mov ecx, esi
cmp esi, ebp
jge 0x57eec2
add ecx, ecx
xor eax, eax
movd xmm1, dword [edi + ecx*4 + 8]
movd xmm0, dword [edi + ecx*4 + 4]
cvtdq2pd xmm1, xmm1
cvtdq2pd xmm0, xmm0
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, ebp
jl 0x57ee91
cmp edx, ebp
jne 0x57eed5
test bl, 1
jne 0x57eed5
mov eax, dword [edi + ebx*4 - 4]
mov dword [edi + edx*4], eax
lea edx, [ebx - 1]
lea eax, [edx - 1]
sar eax, 1
cmp esi, edx
jge 0x57ef0d
movd xmm1, dword [esp + 0x1c]
cvtdq2pd xmm1, xmm1
nop dword [eax + eax]
mov ecx, dword [edi + eax*4]
movd xmm0, ecx
cvtdq2pd xmm0, xmm0
comisd xmm0, xmm1
jbe 0x57ef0d
mov dword [edi + edx*4], ecx
mov edx, eax
dec eax
sar eax, 1
cmp esi, edx
jl 0x57eef0
mov eax, dword [esp + 0x1c]
mov dword [edi + edx*4], eax
test esi, esi
jg 0x57ee80
mov ebx, dword [esp + 0x20]
mov ecx, dword [esp + 0x28]
mov eax, dword [esp + 0x10]
cmp eax, 2
jl 0x57efad
mov eax, dword [edi + ebx - 4]
mov dword [esp + 0x20], eax
mov eax, dword [edi]
mov dword [edi + ebx - 4], eax
lea eax, [esp + 0x20]
push ecx
push eax
lea eax, [ebx - 4]
sar eax, 2
push eax
push 0
push edi
call fcn.0057dab0
mov ecx, dword [esp + 0x3c]
add ebx, 0xfffffffc
mov eax, ebx
add esp, 0x14
and eax, 0xfffffffc
cmp eax, 8
jge 0x57ef31
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
mov ecx, dword [esi - 4]
lea eax, [esi - 4]
movd xmm0, ecx
cvtdq2pd xmm0, xmm0
comisd xmm1, xmm0
jbe 0x57ef9c
mov dword [edx], ecx
mov edx, eax
mov ecx, dword [eax - 4]
sub eax, 4
movd xmm0, ecx
cvtdq2pd xmm0, xmm0
comisd xmm1, xmm0
ja 0x57ef84
mov dword [edx], ebp
mov eax, dword [esp + 0x20]
add esi, 4
cmp esi, ebx
jne 0x57ee20
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret