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


x86 assembly (clang, -O0):
<StatCorrcoefInt>:
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   1040 <StatCovMomentInt@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <StatMomentInt@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <StatMomentInt@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):
<StatCorrcoefInt>:
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   1040 <StatCovMomentInt@plt>
movsd  %xmm0,(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <StatMomentInt@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <StatMomentInt@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 @StatCorrcoefInt(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call double @StatCovMomentInt(i32* %9, i32* %10, i32 %11, i32 %12, i32 1, i32 1)
%14 = load i32*, i32** %5
%15 = load i32, i32* %7
%16 = call i32 @StatMomentInt(i32* %14, i32 %15, i32 1, i32 2)
%17 = load i32*, i32** %6
%18 = load i32, i32* %7
%19 = call i32 @StatMomentInt(i32* %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 @StatCorrcoefInt(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call double @StatCovMomentInt(i32* %0, i32* %1, i32 %2, i32 %3, i32 1, i32 1)
%6 = tail call i32 @StatMomentInt(i32* %0, i32 %2, i32 1, i32 2)
%7 = tail call i32 @StatMomentInt(i32* %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
}