double fourier(data, ex)
double data[2][11];
double ex;
{
  register int k;
  double fivesm, sixsm;
  sixsm = data[0][0] / 2.0;
  fivesm = 0.0;
  for (k = 1; k < 11; k++) {
    sixsm += (double)(data[0][k] * cos((double)k * ex));
    fivesm += (double)(data[1][k] * sin((double)k * ex));
  }
  sixsm = sixsm + fivesm;
  return (sixsm);
}


x86 assembly (clang, -O0):
<fourier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0xb,-0x14(%rbp)
jge    11e8 <fourier+0xc8>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  0x58(%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <fourier+0x39>
movsd  -0x28(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fourier>:
push   %rbx
sub    $0x40,%rsp
movsd  %xmm0,0x18(%rsp)
mov    %rdi,%rbx
movsd  (%rdi),%xmm1
mulsd  0xec6(%rip),%xmm1
movapd %xmm1,0x30(%rsp)
movsd  0x8(%rdi),%xmm1
movapd %xmm1,(%rsp)
call   1040 <cos@plt>
movaps %xmm0,0x20(%rsp)
movsd  0x60(%rbx),%xmm0
unpcklpd (%rsp),%xmm0
movaps %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
unpcklpd 0x20(%rsp),%xmm0
mulpd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
unpcklpd 0x30(%rsp),%xmm1
addpd  %xmm1,%xmm0
movapd %xmm0,0x30(%rsp)
movsd  0x18(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x10(%rbx),%xmm1
movaps %xmm1,(%rsp)
call   1040 <cos@plt>
movapd %xmm0,0x20(%rsp)
movsd  0x68(%rbx),%xmm0
unpcklpd (%rsp),%xmm0
movaps %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
unpcklpd 0x20(%rsp),%xmm0
mulpd  (%rsp),%xmm0
addpd  0x30(%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
movsd  0xe20(%rip),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rbx),%xmm1
movaps %xmm1,(%rsp)
call   1040 <cos@plt>
movapd %xmm0,0x20(%rsp)
movsd  0x70(%rbx),%xmm0
unpcklpd (%rsp),%xmm0
movaps %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
unpcklpd 0x20(%rsp),%xmm0
mulpd  (%rsp),%xmm0
addpd  0x30(%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
movsd  0xdd0(%rip),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rbx),%xmm1
movaps %xmm1,(%rsp)
call   1040 <cos@plt>
movapd %xmm0,0x20(%rsp)
movsd  0x78(%rbx),%xmm0
unpcklpd (%rsp),%xmm0
movaps %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
unpcklpd 0x20(%rsp),%xmm0
mulpd  (%rsp),%xmm0
addpd  0x30(%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
movsd  0xd80(%rip),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x28(%rbx),%xmm1
movaps %xmm1,(%rsp)
call   1040 <cos@plt>
movapd %xmm0,0x20(%rsp)
movsd  0x80(%rbx),%xmm0
unpcklpd (%rsp),%xmm0
movaps %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
unpcklpd 0x20(%rsp),%xmm0
mulpd  (%rsp),%xmm0
addpd  0x30(%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
movsd  0xd2d(%rip),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x30(%rbx),%xmm1
movaps %xmm1,(%rsp)
call   1040 <cos@plt>
movapd %xmm0,0x20(%rsp)
movsd  0x88(%rbx),%xmm0
unpcklpd (%rsp),%xmm0
movaps %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
unpcklpd 0x20(%rsp),%xmm0
mulpd  (%rsp),%xmm0
addpd  0x30(%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
movsd  0xcda(%rip),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x38(%rbx),%xmm1
movaps %xmm1,(%rsp)
call   1040 <cos@plt>
movapd %xmm0,0x20(%rsp)
movsd  0x90(%rbx),%xmm0
unpcklpd (%rsp),%xmm0
movaps %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
unpcklpd 0x20(%rsp),%xmm0
mulpd  (%rsp),%xmm0
addpd  0x30(%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
movsd  0xc87(%rip),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x40(%rbx),%xmm1
movaps %xmm1,(%rsp)
call   1040 <cos@plt>
movapd %xmm0,0x20(%rsp)
movsd  0x98(%rbx),%xmm0
unpcklpd (%rsp),%xmm0
movaps %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
unpcklpd 0x20(%rsp),%xmm0
mulpd  (%rsp),%xmm0
addpd  0x30(%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
movsd  0xc34(%rip),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x48(%rbx),%xmm1
movaps %xmm1,(%rsp)
call   1040 <cos@plt>
movapd %xmm0,0x20(%rsp)
movsd  0xa0(%rbx),%xmm0
unpcklpd (%rsp),%xmm0
movaps %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
unpcklpd 0x20(%rsp),%xmm0
mulpd  (%rsp),%xmm0
addpd  0x30(%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0xbdb(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x50(%rbx),%xmm1
movaps %xmm1,(%rsp)
call   1040 <cos@plt>
movapd %xmm0,0x20(%rsp)
movsd  0xa8(%rbx),%xmm0
unpcklpd (%rsp),%xmm0
movaps %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
unpcklpd 0x20(%rsp),%xmm0
mulpd  (%rsp),%xmm0
addpd  0x30(%rsp),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define double @fourier([11 x double]* nocapture %0, double %1) {
%3 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 0, i64 0
%4 = load double, double* %3
%5 = fmul double %4, 5.000000e-01
%6 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 0, i64 1
%7 = load double, double* %6
%8 = tail call double @cos(double %1)
%9 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 1, i64 1
%10 = load double, double* %9
%11 = tail call double @sin(double %1)
%12 = insertelement <2 x double> poison, double %10, i64 0
%13 = insertelement <2 x double> %12, double %7, i64 1
%14 = insertelement <2 x double> poison, double %11, i64 0
%15 = insertelement <2 x double> %14, double %8, i64 1
%16 = insertelement <2 x double> <double 0.000000e+00, double poison>, double %5, i64 1
%17 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %13, <2 x double> %15, <2 x double> %16)
%18 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 0, i64 2
%19 = load double, double* %18
%20 = fmul double %1, 2.000000e+00
%21 = tail call double @cos(double %20)
%22 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 1, i64 2
%23 = load double, double* %22
%24 = tail call double @sin(double %20)
%25 = insertelement <2 x double> poison, double %23, i64 0
%26 = insertelement <2 x double> %25, double %19, i64 1
%27 = insertelement <2 x double> poison, double %24, i64 0
%28 = insertelement <2 x double> %27, double %21, i64 1
%29 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %26, <2 x double> %28, <2 x double> %17)
%30 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 0, i64 3
%31 = load double, double* %30
%32 = fmul double %1, 3.000000e+00
%33 = tail call double @cos(double %32)
%34 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 1, i64 3
%35 = load double, double* %34
%36 = tail call double @sin(double %32)
%37 = insertelement <2 x double> poison, double %35, i64 0
%38 = insertelement <2 x double> %37, double %31, i64 1
%39 = insertelement <2 x double> poison, double %36, i64 0
%40 = insertelement <2 x double> %39, double %33, i64 1
%41 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %38, <2 x double> %40, <2 x double> %29)
%42 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 0, i64 4
%43 = load double, double* %42
%44 = fmul double %1, 4.000000e+00
%45 = tail call double @cos(double %44)
%46 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 1, i64 4
%47 = load double, double* %46
%48 = tail call double @sin(double %44)
%49 = insertelement <2 x double> poison, double %47, i64 0
%50 = insertelement <2 x double> %49, double %43, i64 1
%51 = insertelement <2 x double> poison, double %48, i64 0
%52 = insertelement <2 x double> %51, double %45, i64 1
%53 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %50, <2 x double> %52, <2 x double> %41)
%54 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 0, i64 5
%55 = load double, double* %54
%56 = fmul double %1, 5.000000e+00
%57 = tail call double @cos(double %56)
%58 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 1, i64 5
%59 = load double, double* %58
%60 = tail call double @sin(double %56)
%61 = insertelement <2 x double> poison, double %59, i64 0
%62 = insertelement <2 x double> %61, double %55, i64 1
%63 = insertelement <2 x double> poison, double %60, i64 0
%64 = insertelement <2 x double> %63, double %57, i64 1
%65 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %62, <2 x double> %64, <2 x double> %53)
%66 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 0, i64 6
%67 = load double, double* %66
%68 = fmul double %1, 6.000000e+00
%69 = tail call double @cos(double %68)
%70 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 1, i64 6
%71 = load double, double* %70
%72 = tail call double @sin(double %68)
%73 = insertelement <2 x double> poison, double %71, i64 0
%74 = insertelement <2 x double> %73, double %67, i64 1
%75 = insertelement <2 x double> poison, double %72, i64 0
%76 = insertelement <2 x double> %75, double %69, i64 1
%77 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %74, <2 x double> %76, <2 x double> %65)
%78 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 0, i64 7
%79 = load double, double* %78
%80 = fmul double %1, 7.000000e+00
%81 = tail call double @cos(double %80)
%82 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 1, i64 7
%83 = load double, double* %82
%84 = tail call double @sin(double %80)
%85 = insertelement <2 x double> poison, double %83, i64 0
%86 = insertelement <2 x double> %85, double %79, i64 1
%87 = insertelement <2 x double> poison, double %84, i64 0
%88 = insertelement <2 x double> %87, double %81, i64 1
%89 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %86, <2 x double> %88, <2 x double> %77)
%90 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 0, i64 8
%91 = load double, double* %90
%92 = fmul double %1, 8.000000e+00
%93 = tail call double @cos(double %92)
%94 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 1, i64 8
%95 = load double, double* %94
%96 = tail call double @sin(double %92)
%97 = insertelement <2 x double> poison, double %95, i64 0
%98 = insertelement <2 x double> %97, double %91, i64 1
%99 = insertelement <2 x double> poison, double %96, i64 0
%100 = insertelement <2 x double> %99, double %93, i64 1
%101 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %98, <2 x double> %100, <2 x double> %89)
%102 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 0, i64 9
%103 = load double, double* %102
%104 = fmul double %1, 9.000000e+00
%105 = tail call double @cos(double %104)
%106 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 1, i64 9
%107 = load double, double* %106
%108 = tail call double @sin(double %104)
%109 = insertelement <2 x double> poison, double %107, i64 0
%110 = insertelement <2 x double> %109, double %103, i64 1
%111 = insertelement <2 x double> poison, double %108, i64 0
%112 = insertelement <2 x double> %111, double %105, i64 1
%113 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %110, <2 x double> %112, <2 x double> %101)
%114 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 0, i64 10
%115 = load double, double* %114
%116 = fmul double %1, 1.000000e+01
%117 = tail call double @cos(double %116)
%118 = getelementptr inbounds [11 x double], [11 x double]* %0, i64 1, i64 10
%119 = load double, double* %118
%120 = tail call double @sin(double %116)
%121 = insertelement <2 x double> poison, double %119, i64 0
%122 = insertelement <2 x double> %121, double %115, i64 1
%123 = insertelement <2 x double> poison, double %120, i64 0
%124 = insertelement <2 x double> %123, double %117, i64 1
%125 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %122, <2 x double> %124, <2 x double> %113)
%126 = shufflevector <2 x double> %125, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%127 = fadd <2 x double> %125, %126
%128 = extractelement <2 x double> %127, i64 0
ret double %128
}