double intra_loss_of_conf(double(*sum_boltz_ptr), double highest_factor,
                          unsigned long numberofframes) {
  double sum = 0.0;
  sum += sum_boltz_ptr[0];
  sum += sum_boltz_ptr[1];
  sum += sum_boltz_ptr[2];
  sum += sum_boltz_ptr[3];
  sum += sum_boltz_ptr[4];
  sum += sum_boltz_ptr[5];
  sum += sum_boltz_ptr[6];
  sum += sum_boltz_ptr[7];
  sum += sum_boltz_ptr[8];
  sum += sum_boltz_ptr[9];
  sum /= (double)numberofframes;
  sum /= highest_factor;
  return sum;
}


x86 assembly (clang, -O0):
<intra_loss_of_conf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x48(%rax),%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movaps 0xdfb(%rip),%xmm0
movq   -0x18(%rbp),%xmm1
punpckldq %xmm0,%xmm1
movapd 0xdfa(%rip),%xmm0
subpd  %xmm0,%xmm1
movaps %xmm1,%xmm0
unpckhpd %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<intra_loss_of_conf>:
xorpd  %xmm1,%xmm1
addsd  (%rdi),%xmm1
addsd  0x8(%rdi),%xmm1
addsd  0x10(%rdi),%xmm1
addsd  0x18(%rdi),%xmm1
addsd  0x20(%rdi),%xmm1
addsd  0x28(%rdi),%xmm1
addsd  0x30(%rdi),%xmm1
addsd  0x38(%rdi),%xmm1
addsd  0x40(%rdi),%xmm1
addsd  0x48(%rdi),%xmm1
movq   %rsi,%xmm2
punpckldq 0xebe(%rip),%xmm2
subpd  0xec6(%rip),%xmm2
movapd %xmm2,%xmm3
unpckhpd %xmm2,%xmm3
addsd  %xmm2,%xmm3
divsd  %xmm3,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @intra_loss_of_conf(double* %0, double %1, i64 %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca i64
%7 = alloca double
store double* %0, double** %4
store double %1, double* %5
store i64 %2, i64* %6
store double 0.000000e+00, double* %7
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double, double* %7
%12 = fadd double %11, %10
store double %12, double* %7
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = load double, double* %7
%17 = fadd double %16, %15
store double %17, double* %7
%18 = load double*, double** %4
%19 = getelementptr inbounds double, double* %18, i64 2
%20 = load double, double* %19
%21 = load double, double* %7
%22 = fadd double %21, %20
store double %22, double* %7
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 3
%25 = load double, double* %24
%26 = load double, double* %7
%27 = fadd double %26, %25
store double %27, double* %7
%28 = load double*, double** %4
%29 = getelementptr inbounds double, double* %28, i64 4
%30 = load double, double* %29
%31 = load double, double* %7
%32 = fadd double %31, %30
store double %32, double* %7
%33 = load double*, double** %4
%34 = getelementptr inbounds double, double* %33, i64 5
%35 = load double, double* %34
%36 = load double, double* %7
%37 = fadd double %36, %35
store double %37, double* %7
%38 = load double*, double** %4
%39 = getelementptr inbounds double, double* %38, i64 6
%40 = load double, double* %39
%41 = load double, double* %7
%42 = fadd double %41, %40
store double %42, double* %7
%43 = load double*, double** %4
%44 = getelementptr inbounds double, double* %43, i64 7
%45 = load double, double* %44
%46 = load double, double* %7
%47 = fadd double %46, %45
store double %47, double* %7
%48 = load double*, double** %4
%49 = getelementptr inbounds double, double* %48, i64 8
%50 = load double, double* %49
%51 = load double, double* %7
%52 = fadd double %51, %50
store double %52, double* %7
%53 = load double*, double** %4
%54 = getelementptr inbounds double, double* %53, i64 9
%55 = load double, double* %54
%56 = load double, double* %7
%57 = fadd double %56, %55
store double %57, double* %7
%58 = load i64, i64* %6
%59 = uitofp i64 %58 to double
%60 = load double, double* %7
%61 = fdiv double %60, %59
store double %61, double* %7
%62 = load double, double* %5
%63 = load double, double* %7
%64 = fdiv double %63, %62
store double %64, double* %7
%65 = load double, double* %7
ret double %65
}

LLVM IR (-O2):
define double @intra_loss_of_conf(double* nocapture %0, double %1, i64 %2) {
%4 = load double, double* %0
%5 = fadd double %4, 0.000000e+00
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = fadd double %5, %7
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fadd double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 3
%13 = load double, double* %12
%14 = fadd double %11, %13
%15 = getelementptr inbounds double, double* %0, i64 4
%16 = load double, double* %15
%17 = fadd double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 5
%19 = load double, double* %18
%20 = fadd double %17, %19
%21 = getelementptr inbounds double, double* %0, i64 6
%22 = load double, double* %21
%23 = fadd double %20, %22
%24 = getelementptr inbounds double, double* %0, i64 7
%25 = load double, double* %24
%26 = fadd double %23, %25
%27 = getelementptr inbounds double, double* %0, i64 8
%28 = load double, double* %27
%29 = fadd double %26, %28
%30 = getelementptr inbounds double, double* %0, i64 9
%31 = load double, double* %30
%32 = fadd double %29, %31
%33 = uitofp i64 %2 to double
%34 = fdiv double %32, %33
%35 = fdiv double %34, %1
ret double %35
}