void hs48(double *p, double *x, int m, int n, void *data) {
  register int i;
  double t1, t2, t3;
  t1 = p[0] - 1.0;
  t2 = p[1] - p[2];
  t3 = p[3] - p[4];
  for (i = 0; i < n; ++i)
    x[i] = t1 * t1 + t2 * t2 + t3 * t3;
}


x86 assembly (clang, -O0):
<hs48>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xeda(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11b9 <hs48+0xb9>
movsd  -0x30(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1164 <hs48+0x64>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hs48>:
test   %ecx,%ecx
jle    124e <hs48+0x14e>
movsd  0x18(%rdi),%xmm0
subsd  0x20(%rdi),%xmm0
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm2
subsd  0x10(%rdi),%xmm2
addsd  0xed8(%rip),%xmm1
mulsd  %xmm2,%xmm2
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    %ecx,%eax
cmp    $0x4,%ecx
jae    114a <hs48+0x4a>
xor    %ecx,%ecx
jmp    1240 <hs48+0x140>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%rcx),%rdx
mov    %rdx,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
mov    %edi,%r8d
and    $0x7,%r8d
cmp    $0x1c,%rdx
jae    117a <hs48+0x7a>
xor    %edx,%edx
jmp    1205 <hs48+0x105>
and    $0xfffffffffffffff8,%rdi
xor    %edx,%edx
movupd %xmm1,(%rsi,%rdx,8)
movupd %xmm1,0x10(%rsi,%rdx,8)
movupd %xmm1,0x20(%rsi,%rdx,8)
movupd %xmm1,0x30(%rsi,%rdx,8)
movupd %xmm1,0x40(%rsi,%rdx,8)
movupd %xmm1,0x50(%rsi,%rdx,8)
movupd %xmm1,0x60(%rsi,%rdx,8)
movupd %xmm1,0x70(%rsi,%rdx,8)
movupd %xmm1,0x80(%rsi,%rdx,8)
movupd %xmm1,0x90(%rsi,%rdx,8)
movupd %xmm1,0xa0(%rsi,%rdx,8)
movupd %xmm1,0xb0(%rsi,%rdx,8)
movupd %xmm1,0xc0(%rsi,%rdx,8)
movupd %xmm1,0xd0(%rsi,%rdx,8)
movupd %xmm1,0xe0(%rsi,%rdx,8)
movupd %xmm1,0xf0(%rsi,%rdx,8)
add    $0x20,%rdx
add    $0xfffffffffffffff8,%rdi
jne    1180 <hs48+0x80>
test   %r8,%r8
je     1234 <hs48+0x134>
lea    (%rsi,%rdx,8),%rdx
add    $0x10,%rdx
shl    $0x5,%r8
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
movupd %xmm1,-0x10(%rdx,%rdi,1)
movupd %xmm1,(%rdx,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%r8
jne    1220 <hs48+0x120>
cmp    %rax,%rcx
je     124e <hs48+0x14e>
nopl   0x0(%rax)
movsd  %xmm0,(%rsi,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1240 <hs48+0x140>
ret

LLVM IR (-O0):
define void @hs48(double* %0, double* %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%15 = load double*, double** %6
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = fsub double %17, 1.000000e+00
store double %18, double* %12
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = load double*, double** %6
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = fsub double %21, %24
store double %25, double* %13
%26 = load double*, double** %6
%27 = getelementptr inbounds double, double* %26, i64 3
%28 = load double, double* %27
%29 = load double*, double** %6
%30 = getelementptr inbounds double, double* %29, i64 4
%31 = load double, double* %30
%32 = fsub double %28, %31
store double %32, double* %14
store i32 0, i32* %11
br label %33
33: ; preds = %51, %5
%34 = load i32, i32* %11
%35 = load i32, i32* %9
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %54
37: ; preds = %33
%38 = load double, double* %12
%39 = load double, double* %12
%40 = load double, double* %13
%41 = load double, double* %13
%42 = fmul double %40, %41
%43 = call double @llvm.fmuladd.f64(double %38, double %39, double %42)
%44 = load double, double* %14
%45 = load double, double* %14
%46 = call double @llvm.fmuladd.f64(double %44, double %45, double %43)
%47 = load double*, double** %7
%48 = load i32, i32* %11
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %47, i64 %49
store double %46, double* %50
br label %51
51: ; preds = %37
%52 = load i32, i32* %11
%53 = add nsw i32 %52, 1
store i32 %53, i32* %11
br label %33
54: ; preds = %33
ret void
}

LLVM IR (-O2):
define void @hs48(double* nocapture %0, double* nocapture writeonly %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %105
7: ; preds = %5
%8 = getelementptr inbounds double, double* %0, i64 3
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %0, i64 4
%11 = load double, double* %10
%12 = fsub double %9, %11
%13 = getelementptr inbounds double, double* %0, i64 1
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %0, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = load double, double* %0
%19 = fadd double %18, -1.000000e+00
%20 = fmul double %17, %17
%21 = tail call double @llvm.fmuladd.f64(double %19, double %19, double %20)
%22 = tail call double @llvm.fmuladd.f64(double %12, double %12, double %21)
%23 = zext i32 %3 to i64
%24 = icmp ult i32 %3, 4
br i1 %24, label %98, label %25
25: ; preds = %7
%26 = and i64 %23, 4294967292
%27 = insertelement <2 x double> poison, double %22, i64 0
%28 = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> zeroinitializer
%29 = insertelement <2 x double> poison, double %22, i64 0
%30 = shufflevector <2 x double> %29, <2 x double> poison, <2 x i32> zeroinitializer
%31 = add nsw i64 %26, -4
%32 = lshr exact i64 %31, 2
%33 = add nuw nsw i64 %32, 1
%34 = and i64 %33, 7
%35 = icmp ult i64 %31, 28
br i1 %35, label %83, label %36
36: ; preds = %25
%37 = and i64 %33, 9223372036854775800
br label %38
38: ; preds = %38, %36
%39 = phi i64 [ 0, %36 ], [ %80, %38 ]
%40 = phi i64 [ 0, %36 ], [ %81, %38 ]
%41 = getelementptr inbounds double, double* %1, i64 %39
%42 = bitcast double* %41 to <2 x double>*
store <2 x double> %28, <2 x double>* %42
%43 = getelementptr inbounds double, double* %41, i64 2
%44 = bitcast double* %43 to <2 x double>*
store <2 x double> %30, <2 x double>* %44
%45 = or i64 %39, 4
%46 = getelementptr inbounds double, double* %1, i64 %45
%47 = bitcast double* %46 to <2 x double>*
store <2 x double> %28, <2 x double>* %47
%48 = getelementptr inbounds double, double* %46, i64 2
%49 = bitcast double* %48 to <2 x double>*
store <2 x double> %30, <2 x double>* %49
%50 = or i64 %39, 8
%51 = getelementptr inbounds double, double* %1, i64 %50
%52 = bitcast double* %51 to <2 x double>*
store <2 x double> %28, <2 x double>* %52
%53 = getelementptr inbounds double, double* %51, i64 2
%54 = bitcast double* %53 to <2 x double>*
store <2 x double> %30, <2 x double>* %54
%55 = or i64 %39, 12
%56 = getelementptr inbounds double, double* %1, i64 %55
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> %28, <2 x double>* %57
%58 = getelementptr inbounds double, double* %56, i64 2
%59 = bitcast double* %58 to <2 x double>*
store <2 x double> %30, <2 x double>* %59
%60 = or i64 %39, 16
%61 = getelementptr inbounds double, double* %1, i64 %60
%62 = bitcast double* %61 to <2 x double>*
store <2 x double> %28, <2 x double>* %62
%63 = getelementptr inbounds double, double* %61, i64 2
%64 = bitcast double* %63 to <2 x double>*
store <2 x double> %30, <2 x double>* %64
%65 = or i64 %39, 20
%66 = getelementptr inbounds double, double* %1, i64 %65
%67 = bitcast double* %66 to <2 x double>*
store <2 x double> %28, <2 x double>* %67
%68 = getelementptr inbounds double, double* %66, i64 2
%69 = bitcast double* %68 to <2 x double>*
store <2 x double> %30, <2 x double>* %69
%70 = or i64 %39, 24
%71 = getelementptr inbounds double, double* %1, i64 %70
%72 = bitcast double* %71 to <2 x double>*
store <2 x double> %28, <2 x double>* %72
%73 = getelementptr inbounds double, double* %71, i64 2
%74 = bitcast double* %73 to <2 x double>*
store <2 x double> %30, <2 x double>* %74
%75 = or i64 %39, 28
%76 = getelementptr inbounds double, double* %1, i64 %75
%77 = bitcast double* %76 to <2 x double>*
store <2 x double> %28, <2 x double>* %77
%78 = getelementptr inbounds double, double* %76, i64 2
%79 = bitcast double* %78 to <2 x double>*
store <2 x double> %30, <2 x double>* %79
%80 = add nuw i64 %39, 32
%81 = add i64 %40, 8
%82 = icmp eq i64 %81, %37
br i1 %82, label %83, label %38
83: ; preds = %38, %25
%84 = phi i64 [ 0, %25 ], [ %80, %38 ]
%85 = icmp eq i64 %34, 0
br i1 %85, label %96, label %86
86: ; preds = %83, %86
%87 = phi i64 [ %93, %86 ], [ %84, %83 ]
%88 = phi i64 [ %94, %86 ], [ 0, %83 ]
%89 = getelementptr inbounds double, double* %1, i64 %87
%90 = bitcast double* %89 to <2 x double>*
store <2 x double> %28, <2 x double>* %90
%91 = getelementptr inbounds double, double* %89, i64 2
%92 = bitcast double* %91 to <2 x double>*
store <2 x double> %30, <2 x double>* %92
%93 = add nuw i64 %87, 4
%94 = add i64 %88, 1
%95 = icmp eq i64 %94, %34
br i1 %95, label %96, label %86
96: ; preds = %86, %83
%97 = icmp eq i64 %26, %23
br i1 %97, label %105, label %98
98: ; preds = %7, %96
%99 = phi i64 [ 0, %7 ], [ %26, %96 ]
br label %100
100: ; preds = %98, %100
%101 = phi i64 [ %103, %100 ], [ %99, %98 ]
%102 = getelementptr inbounds double, double* %1, i64 %101
store double %22, double* %102
%103 = add nuw nsw i64 %101, 1
%104 = icmp eq i64 %103, %23
br i1 %104, label %105, label %100
105: ; preds = %100, %96, %5
ret void
}