#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 */
scalar_t__ pow(float, double);
double get_rmse(float *test_rating, double *predict_data) {
  int m, n, i, j;
  double numerator = 0;
  double denominator = 2089384;
#pragma omp parallel for private(i) reduction(+ : numerator)
  for (i = 0; i < 2089384; i++) {
    numerator += pow((test_rating[i] - predict_data[i]), 2.0);
  }
  return (numerator / denominator);
}


x86 assembly (clang, -O0):
<get_rmse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1fe1a8,-0x1c(%rbp)
jge    1195 <get_rmse+0x85>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xe95(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113c <get_rmse+0x2c>
movsd  -0x28(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rmse>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
xorpd  %xmm0,%xmm0
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,0x8(%rsp)
movss  -0x4(%r15,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  -0x8(%r14,%rbx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xeac(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  (%r15,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  (%r14,%rbx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xe77(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x2,%rbx
cmp    $0x1fe1a9,%rbx
jne    1130 <get_rmse+0x20>
divsd  0xe57(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double @get_rmse(float* %0, double* %1) {
%3 = alloca float*
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store float* %0, float** %3
store double* %1, double** %4
store double 0.000000e+00, double* %9
store double 0x413FE1A800000000, double* %10
store i32 0, i32* %7
br label %11
11: ; preds = %32, %2
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 2089384
br i1 %13, label %14, label %35
14: ; preds = %11
%15 = load float*, float** %3
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* %15, i64 %17
%19 = load float, float* %18
%20 = fpext float %19 to double
%21 = load double*, double** %4
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %21, i64 %23
%25 = load double, double* %24
%26 = fsub double %20, %25
%27 = fptrunc double %26 to float
%28 = call i64 @pow(float %27, double 2.000000e+00)
%29 = sitofp i64 %28 to double
%30 = load double, double* %9
%31 = fadd double %30, %29
store double %31, double* %9
br label %32
32: ; preds = %14
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %11
35: ; preds = %11
%36 = load double, double* %9
%37 = load double, double* %10
%38 = fdiv double %36, %37
ret double %38
}

LLVM IR (-O2):
define double @get_rmse(float* nocapture %0, double* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %27, %3 ]
%5 = phi double [ 0.000000e+00, %2 ], [ %26, %3 ]
%6 = getelementptr inbounds float, float* %0, i64 %4
%7 = load float, float* %6
%8 = fpext float %7 to double
%9 = getelementptr inbounds double, double* %1, i64 %4
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = fptrunc double %11 to float
%13 = tail call i64 @pow(float %12, double 2.000000e+00)
%14 = sitofp i64 %13 to double
%15 = fadd double %5, %14
%16 = or i64 %4, 1
%17 = getelementptr inbounds float, float* %0, i64 %16
%18 = load float, float* %17
%19 = fpext float %18 to double
%20 = getelementptr inbounds double, double* %1, i64 %16
%21 = load double, double* %20
%22 = fsub double %19, %21
%23 = fptrunc double %22 to float
%24 = tail call i64 @pow(float %23, double 2.000000e+00)
%25 = sitofp i64 %24 to double
%26 = fadd double %15, %25
%27 = add nuw nsw i64 %4, 2
%28 = icmp eq i64 %27, 2089384
br i1 %28, label %29, label %3
29: ; preds = %3
%30 = fdiv double %26, 0x413FE1A800000000
ret double %30
}