#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double freqmap_comp(double *f1, double *f2) {
  double score = 0;
  size_t i;
  for (i = 0; i < 27; ++i)
    score += f1[i] * f2[i];
  return score;
}


x86 assembly (clang, -O0):
<freqmap_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1b,-0x20(%rbp)
jae    1164 <freqmap_comp+0x64>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <freqmap_comp+0x1c>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<freqmap_comp>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  (%rsi),%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
mulsd  0x8(%rsi),%xmm1
addsd  %xmm2,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
movsd  0x18(%rdi),%xmm1
mulsd  0x18(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x20(%rdi),%xmm0
mulsd  0x20(%rsi),%xmm0
addsd  %xmm1,%xmm0
movsd  0x28(%rdi),%xmm1
mulsd  0x28(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x30(%rdi),%xmm0
mulsd  0x30(%rsi),%xmm0
addsd  %xmm1,%xmm0
movsd  0x38(%rdi),%xmm1
mulsd  0x38(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x40(%rdi),%xmm0
mulsd  0x40(%rsi),%xmm0
addsd  %xmm1,%xmm0
movsd  0x48(%rdi),%xmm1
mulsd  0x48(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x50(%rdi),%xmm0
mulsd  0x50(%rsi),%xmm0
addsd  %xmm1,%xmm0
movsd  0x58(%rdi),%xmm1
mulsd  0x58(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x60(%rdi),%xmm0
mulsd  0x60(%rsi),%xmm0
addsd  %xmm1,%xmm0
movsd  0x68(%rdi),%xmm1
mulsd  0x68(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x70(%rdi),%xmm0
mulsd  0x70(%rsi),%xmm0
addsd  %xmm1,%xmm0
movsd  0x78(%rdi),%xmm1
mulsd  0x78(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x80(%rdi),%xmm0
mulsd  0x80(%rsi),%xmm0
addsd  %xmm1,%xmm0
movsd  0x88(%rdi),%xmm1
mulsd  0x88(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x90(%rdi),%xmm0
mulsd  0x90(%rsi),%xmm0
addsd  %xmm1,%xmm0
movsd  0x98(%rdi),%xmm1
mulsd  0x98(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0xa0(%rdi),%xmm0
mulsd  0xa0(%rsi),%xmm0
addsd  %xmm1,%xmm0
movsd  0xa8(%rdi),%xmm1
mulsd  0xa8(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0xb0(%rdi),%xmm0
mulsd  0xb0(%rsi),%xmm0
addsd  %xmm1,%xmm0
movsd  0xb8(%rdi),%xmm1
mulsd  0xb8(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0xc0(%rdi),%xmm0
mulsd  0xc0(%rsi),%xmm0
addsd  %xmm1,%xmm0
movsd  0xc8(%rdi),%xmm1
mulsd  0xc8(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0xd0(%rdi),%xmm0
mulsd  0xd0(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @freqmap_comp(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca i64
store double* %0, double** %3
store double* %1, double** %4
store double 0.000000e+00, double* %5
store i64 0, i64* %6
br label %7
7: ; preds = %21, %2
%8 = load i64, i64* %6
%9 = icmp ult i64 %8, 27
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load double*, double** %3
%12 = load i64, i64* %6
%13 = getelementptr inbounds double, double* %11, i64 %12
%14 = load double, double* %13
%15 = load double*, double** %4
%16 = load i64, i64* %6
%17 = getelementptr inbounds double, double* %15, i64 %16
%18 = load double, double* %17
%19 = load double, double* %5
%20 = call double @llvm.fmuladd.f64(double %14, double %18, double %19)
store double %20, double* %5
br label %21
21: ; preds = %10
%22 = load i64, i64* %6
%23 = add i64 %22, 1
store i64 %23, i64* %6
br label %7
24: ; preds = %7
%25 = load double, double* %5
ret double %25
}

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