#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 = 19315653;
#pragma omp parallel for private(i) reduction(+ : numerator)
  for (i = 0; i < 19315653; 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   $0x126bbc5,-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
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%ebx
xchg   %ax,%ax
movss  -0x4(%r15,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  -0x8(%r14,%rbx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xeb2(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
cmp    $0x126bbc5,%rbx
je     11af <get_rmse+0x9f>
movsd  %xmm0,0x8(%rsp)
movss  (%r15,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  (%r14,%rbx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xe74(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
add    $0x2,%rbx
movsd  %xmm1,0x8(%rsp)
jmp    1130 <get_rmse+0x20>
divsd  0xe51(%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 0x41726BBC50000000, double* %10
store i32 0, i32* %7
br label %11
11: ; preds = %32, %2
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 19315653
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 = %18, %2
%4 = phi i64 [ 0, %2 ], [ %29, %18 ]
%5 = phi double [ 0.000000e+00, %2 ], [ %28, %18 ]
%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 = icmp eq i64 %16, 19315653
br i1 %17, label %30, label %18
18: ; preds = %3
%19 = getelementptr inbounds float, float* %0, i64 %16
%20 = load float, float* %19
%21 = fpext float %20 to double
%22 = getelementptr inbounds double, double* %1, i64 %16
%23 = load double, double* %22
%24 = fsub double %21, %23
%25 = fptrunc double %24 to float
%26 = tail call i64 @pow(float %25, double 2.000000e+00)
%27 = sitofp i64 %26 to double
%28 = fadd double %15, %27
%29 = add nuw nsw i64 %4, 2
br label %3
30: ; preds = %3
%31 = fdiv double %15, 0x41726BBC50000000
ret double %31
}