#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 StatCovMomentFloat(float *, float *, int, int, int, int);
int StatMomentFloat(float *, int, int, int);
double sqrt(int);
double StatCorrcoefFloat(float a[], float b[], int n, int s) {
  return StatCovMomentFloat(a, b, n, s, 1, 1) /
         sqrt(StatMomentFloat(a, n, 1, 2) * StatMomentFloat(b, n, 1, 2));
}


x86 assembly (clang, -O0):
<StatCorrcoefFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <StatCovMomentFloat@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1040 <StatMomentFloat@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1040 <StatMomentFloat@plt>
mov    -0x24(%rbp),%edi
imul   %eax,%edi
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StatCorrcoefFloat>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1030 <StatCovMomentFloat@plt>
movsd  %xmm0,(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1040 <StatMomentFloat@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1040 <StatMomentFloat@plt>
imul   %eax,%ebp
mov    %ebp,%edi
call   1050 <sqrt@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @StatCorrcoefFloat(float* %0, float* %1, i32 %2, i32 %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca i32
%8 = alloca i32
store float* %0, float** %5
store float* %1, float** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load float*, float** %5
%10 = load float*, float** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call double @StatCovMomentFloat(float* %9, float* %10, i32 %11, i32 %12, i32 1, i32 1)
%14 = load float*, float** %5
%15 = load i32, i32* %7
%16 = call i32 @StatMomentFloat(float* %14, i32 %15, i32 1, i32 2)
%17 = load float*, float** %6
%18 = load i32, i32* %7
%19 = call i32 @StatMomentFloat(float* %17, i32 %18, i32 1, i32 2)
%20 = mul nsw i32 %16, %19
%21 = call double @sqrt(i32 %20)
%22 = fdiv double %13, %21
ret double %22
}

LLVM IR (-O2):
define double @StatCorrcoefFloat(float* %0, float* %1, i32 %2, i32 %3) {
%5 = tail call double @StatCovMomentFloat(float* %0, float* %1, i32 %2, i32 %3, i32 1, i32 1)
%6 = tail call i32 @StatMomentFloat(float* %0, i32 %2, i32 1, i32 2)
%7 = tail call i32 @StatMomentFloat(float* %1, i32 %2, i32 1, i32 2)
%8 = mul nsw i32 %7, %6
%9 = tail call double @sqrt(i32 %8)
%10 = fdiv double %5, %9
ret double %10
}