int monte_solution(double *ifld, double *ofld) {
  double V, M, w, w2;
  double E, I, L, a1, a2, F1, F2, ar1, ar2;
  E = ifld[0];
  I = ifld[1];
  L = ifld[2];
  ar1 = ifld[3];
  ar2 = ifld[4];
  F1 = ifld[5];
  F2 = ifld[6];
  a1 = ar1 * L;
  a2 = ar2 * L;
  M = a1 * F1 + a2 * F2;
  V = F1 + F2;
  w = (F1 * a1 * a1 / (6.0 * E * I)) * (3.0 * L - a1) +
      (F2 * a2 * a2 / (6.0 * E * I)) * (3.0 * L - a2);
  w2 = 2 * ((F1 * a1 * a1 / (6.0 * E * I)) * (3.0 * L - a1) +
            (F2 * a2 * a2 / (6.0 * E * I)) * (3.0 * L - a2));
  ofld[0] = M;
  ofld[1] = V;
  ofld[2] = w;
  ofld[3] = w2;
  return (0);
}


x86 assembly (clang, -O0):
<monte_solution>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x78(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x60(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  0xe3e(%rip),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xdff(%rip),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movsd  0xde8(%rip),%xmm3
mulsd  -0x38(%rbp),%xmm3
mulsd  -0x40(%rbp),%xmm3
divsd  %xmm3,%xmm1
movsd  -0x48(%rbp),%xmm3
movsd  -0x58(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
movsd  0xda9(%rip),%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x60(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
movsd  0xd81(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd42(%rip),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  0xd2b(%rip),%xmm3
mulsd  -0x38(%rbp),%xmm3
mulsd  -0x40(%rbp),%xmm3
divsd  %xmm3,%xmm0
movsd  -0x48(%rbp),%xmm3
movsd  -0x58(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
movsd  0xcec(%rip),%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xcc8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<monte_solution>:
movsd  (%rdi),%xmm2
movsd  0x10(%rdi),%xmm0
movsd  0x28(%rdi),%xmm1
movsd  0x30(%rdi),%xmm8
movsd  0x18(%rdi),%xmm4
mulsd  %xmm0,%xmm4
movsd  0x20(%rdi),%xmm5
mulsd  %xmm0,%xmm5
movapd %xmm5,%xmm6
mulsd  %xmm8,%xmm6
movapd %xmm4,%xmm7
mulsd  0xecd(%rip),%xmm0
movapd %xmm0,%xmm3
subsd  %xmm4,%xmm3
mulsd  %xmm1,%xmm4
addsd  %xmm8,%xmm1
mulsd  %xmm4,%xmm7
mulsd  0xea8(%rip),%xmm2
addsd  %xmm6,%xmm4
mulsd  0x8(%rdi),%xmm2
divsd  %xmm2,%xmm7
mulsd  %xmm7,%xmm3
mulsd  %xmm5,%xmm6
divsd  %xmm2,%xmm6
subsd  %xmm5,%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm3,%xmm0
movsd  %xmm4,(%rsi)
movsd  %xmm1,0x8(%rsi)
movsd  %xmm0,0x10(%rsi)
addsd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @monte_solution(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = load double, double* %6
%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 = getelementptr inbounds double, double* %0, i64 5
%13 = load double, double* %12
%14 = getelementptr inbounds double, double* %0, i64 6
%15 = load double, double* %14
%16 = fmul double %7, %9
%17 = fmul double %7, %11
%18 = fmul double %17, %15
%19 = tail call double @llvm.fmuladd.f64(double %16, double %13, double %18)
%20 = fadd double %13, %15
%21 = fmul double %16, %13
%22 = fmul double %16, %21
%23 = fmul double %3, 6.000000e+00
%24 = fmul double %23, %5
%25 = fdiv double %22, %24
%26 = fneg double %16
%27 = tail call double @llvm.fmuladd.f64(double %7, double 3.000000e+00, double %26)
%28 = fmul double %17, %18
%29 = fdiv double %28, %24
%30 = fneg double %17
%31 = tail call double @llvm.fmuladd.f64(double %7, double 3.000000e+00, double %30)
%32 = fmul double %31, %29
%33 = tail call double @llvm.fmuladd.f64(double %25, double %27, double %32)
%34 = fmul double %33, 2.000000e+00
store double %19, double* %1
%35 = getelementptr inbounds double, double* %1, i64 1
store double %20, double* %35
%36 = getelementptr inbounds double, double* %1, i64 2
store double %33, double* %36
%37 = getelementptr inbounds double, double* %1, i64 3
store double %34, double* %37
ret i32 0
}