double simpsn(f, delta)
double f[];
double delta;
{
  extern double simcon[];
  double ans;
  int i;
  ans = simcon[8 / 2] * f[8 / 2];
  for (i = 0; i < 8 / 2; i++)
    ans += simcon[i] * (f[i] + f[8 - i]);
  return (ans * delta * 8);
}


x86 assembly (clang, -O0):
<simpsn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    0x2ecc(%rip),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    1189 <simpsn+0x89>
movslq -0x1c(%rbp),%rcx
mov    0x2e9d(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    $0x8,%ecx
sub    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <simpsn+0x2e>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe65(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<simpsn>:
mov    0x2ed9(%rip),%rax
movsd  0x20(%rax),%xmm1
mulsd  0x20(%rdi),%xmm1
movsd  (%rdi),%xmm2
addsd  0x40(%rdi),%xmm2
movsd  0x8(%rdi),%xmm3
mulsd  (%rax),%xmm2
addsd  %xmm1,%xmm2
addsd  0x38(%rdi),%xmm3
mulsd  0x8(%rax),%xmm3
addsd  %xmm2,%xmm3
movsd  0x10(%rdi),%xmm1
addsd  0x30(%rdi),%xmm1
mulsd  0x10(%rax),%xmm1
addsd  %xmm3,%xmm1
movsd  0x18(%rdi),%xmm2
addsd  0x28(%rdi),%xmm2
mulsd  0x18(%rax),%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
mulsd  0xe99(%rip),%xmm0
ret

LLVM IR (-O0):
@simcon = external global [0 x double]
define double @simpsn(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
%7 = load double, double* getelementptr inbounds ([0 x double], [0 x double]* @simcon, i64 0, i64 4)
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 4
%10 = load double, double* %9
%11 = fmul double %7, %10
store double %11, double* %5
store i32 0, i32* %6
br label %12
12: ; preds = %34, %2
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 4
br i1 %14, label %15, label %37
15: ; preds = %12
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [0 x double], [0 x double]* @simcon, i64 0, i64 %17
%19 = load double, double* %18
%20 = load double*, double** %3
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %20, i64 %22
%24 = load double, double* %23
%25 = load double*, double** %3
%26 = load i32, i32* %6
%27 = sub nsw i32 8, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %25, i64 %28
%30 = load double, double* %29
%31 = fadd double %24, %30
%32 = load double, double* %5
%33 = call double @llvm.fmuladd.f64(double %19, double %31, double %32)
store double %33, double* %5
br label %34
34: ; preds = %15
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %12
37: ; preds = %12
%38 = load double, double* %5
%39 = load double, double* %4
%40 = fmul double %38, %39
%41 = fmul double %40, 8.000000e+00
ret double %41
}

LLVM IR (-O2):
@simcon = external global [0 x double]
define double @simpsn(double* nocapture %0, double %1) {
%3 = load double, double* getelementptr inbounds ([0 x double], [0 x double]* @simcon, i64 0, i64 4)
%4 = getelementptr inbounds double, double* %0, i64 4
%5 = load double, double* %4
%6 = fmul double %3, %5
%7 = load double, double* getelementptr inbounds ([0 x double], [0 x double]* @simcon, i64 0, i64 0)
%8 = load double, double* %0
%9 = getelementptr inbounds double, double* %0, i64 8
%10 = load double, double* %9
%11 = fadd double %8, %10
%12 = tail call double @llvm.fmuladd.f64(double %7, double %11, double %6)
%13 = load double, double* getelementptr inbounds ([0 x double], [0 x double]* @simcon, i64 0, i64 1)
%14 = getelementptr inbounds double, double* %0, i64 1
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %0, i64 7
%17 = load double, double* %16
%18 = fadd double %15, %17
%19 = tail call double @llvm.fmuladd.f64(double %13, double %18, double %12)
%20 = load double, double* getelementptr inbounds ([0 x double], [0 x double]* @simcon, i64 0, i64 2)
%21 = getelementptr inbounds double, double* %0, i64 2
%22 = load double, double* %21
%23 = getelementptr inbounds double, double* %0, i64 6
%24 = load double, double* %23
%25 = fadd double %22, %24
%26 = tail call double @llvm.fmuladd.f64(double %20, double %25, double %19)
%27 = load double, double* getelementptr inbounds ([0 x double], [0 x double]* @simcon, i64 0, i64 3)
%28 = getelementptr inbounds double, double* %0, i64 3
%29 = load double, double* %28
%30 = getelementptr inbounds double, double* %0, i64 5
%31 = load double, double* %30
%32 = fadd double %29, %31
%33 = tail call double @llvm.fmuladd.f64(double %27, double %32, double %26)
%34 = fmul double %33, %1
%35 = fmul double %34, 8.000000e+00
ret double %35
}