#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ pow(double, double);
double squared_euclidean128(double x[128], double y[128]) {
  double Sum = 0.0;
  for (int i = 0; i < 128; i += 4) {
    Sum += pow((x[i] - y[i]), 2.0);
    Sum += pow((x[i + 1] - y[i + 1]), 2.0);
    Sum += pow((x[i + 2] - y[i + 2]), 2.0);
    Sum += pow((x[i + 3] - y[i + 3]), 2.0);
  }
  return Sum;
}


x86 assembly (clang, -O0):
<squared_euclidean128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x80,-0x1c(%rbp)
jge    1240 <squared_euclidean128+0x130>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xea2(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xe62(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xe22(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xde2(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x1c(%rbp)
jmp    112f <squared_euclidean128+0x1f>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<squared_euclidean128>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
xorpd  %xmm0,%xmm0
mov    $0xfffffffffffffffc,%rbx
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%r15,%rbx,8),%xmm0
subsd  0x20(%r14,%rbx,8),%xmm0
movsd  0xeb4(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x28(%r15,%rbx,8),%xmm0
subsd  0x28(%r14,%rbx,8),%xmm0
movsd  0xe85(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x30(%r15,%rbx,8),%xmm0
subsd  0x30(%r14,%rbx,8),%xmm0
movsd  0xe56(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x38(%r15,%rbx,8),%xmm0
subsd  0x38(%r14,%rbx,8),%xmm0
movsd  0xe27(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x4,%rbx
cmp    $0x7c,%rbx
jb     1130 <squared_euclidean128+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double @squared_euclidean128(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store double 0.000000e+00, double* %5
store i32 0, i32* %6
br label %7
7: ; preds = %77, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 128
br i1 %9, label %10, label %80
10: ; preds = %7
%11 = load double*, double** %3
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
%20 = load double, double* %19
%21 = fsub double %15, %20
%22 = call i64 @pow(double %21, double 2.000000e+00)
%23 = sitofp i64 %22 to double
%24 = load double, double* %5
%25 = fadd double %24, %23
store double %25, double* %5
%26 = load double*, double** %3
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %26, i64 %29
%31 = load double, double* %30
%32 = load double*, double** %4
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %32, i64 %35
%37 = load double, double* %36
%38 = fsub double %31, %37
%39 = call i64 @pow(double %38, double 2.000000e+00)
%40 = sitofp i64 %39 to double
%41 = load double, double* %5
%42 = fadd double %41, %40
store double %42, double* %5
%43 = load double*, double** %3
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 2
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %43, i64 %46
%48 = load double, double* %47
%49 = load double*, double** %4
%50 = load i32, i32* %6
%51 = add nsw i32 %50, 2
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %49, i64 %52
%54 = load double, double* %53
%55 = fsub double %48, %54
%56 = call i64 @pow(double %55, double 2.000000e+00)
%57 = sitofp i64 %56 to double
%58 = load double, double* %5
%59 = fadd double %58, %57
store double %59, double* %5
%60 = load double*, double** %3
%61 = load i32, i32* %6
%62 = add nsw i32 %61, 3
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %60, i64 %63
%65 = load double, double* %64
%66 = load double*, double** %4
%67 = load i32, i32* %6
%68 = add nsw i32 %67, 3
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %66, i64 %69
%71 = load double, double* %70
%72 = fsub double %65, %71
%73 = call i64 @pow(double %72, double 2.000000e+00)
%74 = sitofp i64 %73 to double
%75 = load double, double* %5
%76 = fadd double %75, %74
store double %76, double* %5
br label %77
77: ; preds = %10
%78 = load i32, i32* %6
%79 = add nsw i32 %78, 4
store i32 %79, i32* %6
br label %7
80: ; preds = %7
%81 = load double, double* %5
ret double %81
}

LLVM IR (-O2):
define double @squared_euclidean128(double* nocapture %0, double* nocapture %1) {
br label %4
3: ; preds = %4
ret double %41
4: ; preds = %2, %4
%5 = phi i64 [ 0, %2 ], [ %42, %4 ]
%6 = phi double [ 0.000000e+00, %2 ], [ %41, %4 ]
%7 = getelementptr inbounds double, double* %0, i64 %5
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 %5
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = tail call i64 @pow(double %11, double 2.000000e+00)
%13 = sitofp i64 %12 to double
%14 = fadd double %6, %13
%15 = or i64 %5, 1
%16 = getelementptr inbounds double, double* %0, i64 %15
%17 = load double, double* %16
%18 = getelementptr inbounds double, double* %1, i64 %15
%19 = load double, double* %18
%20 = fsub double %17, %19
%21 = tail call i64 @pow(double %20, double 2.000000e+00)
%22 = sitofp i64 %21 to double
%23 = fadd double %14, %22
%24 = or i64 %5, 2
%25 = getelementptr inbounds double, double* %0, i64 %24
%26 = load double, double* %25
%27 = getelementptr inbounds double, double* %1, i64 %24
%28 = load double, double* %27
%29 = fsub double %26, %28
%30 = tail call i64 @pow(double %29, double 2.000000e+00)
%31 = sitofp i64 %30 to double
%32 = fadd double %23, %31
%33 = or i64 %5, 3
%34 = getelementptr inbounds double, double* %0, i64 %33
%35 = load double, double* %34
%36 = getelementptr inbounds double, double* %1, i64 %33
%37 = load double, double* %36
%38 = fsub double %35, %37
%39 = tail call i64 @pow(double %38, double 2.000000e+00)
%40 = sitofp i64 %39 to double
%41 = fadd double %32, %40
%42 = add nuw nsw i64 %5, 4
%43 = icmp ult i64 %5, 124
br i1 %43, label %4, label %3
}