#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 */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ returnStandardDeviation(double *, int);
int main(int argc, const char *argv[]) {
  double s[] = {312.2, 32.1, 44.1, 435.0, 48.5};
  int nS = sizeof(s) / sizeof(s[0]);
  printf("The standard deviation is %lf.\n", returnStandardDeviation(s, nS));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xead(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe98(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe83(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe6e(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x5,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1050 <returnStandardDeviation@plt>
mov    %eax,%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x4048400000000000,%rax
40 48 40
mov    %rax,0x20(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <returnStandardDeviation@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"The standard deviation is %lf.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x double]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [5 x double]* %6 to i8*
%9 = bitcast i8* %8 to [5 x double]*
%10 = getelementptr inbounds [5 x double], [5 x double]* %9, i32 0, i32 0
store double 3.122000e+02, double* %10
%11 = getelementptr inbounds [5 x double], [5 x double]* %9, i32 0, i32 1
store double 3.210000e+01, double* %11
%12 = getelementptr inbounds [5 x double], [5 x double]* %9, i32 0, i32 2
store double 4.410000e+01, double* %12
%13 = getelementptr inbounds [5 x double], [5 x double]* %9, i32 0, i32 3
store double 4.350000e+02, double* %13
%14 = getelementptr inbounds [5 x double], [5 x double]* %9, i32 0, i32 4
store double 4.850000e+01, double* %14
store i32 5, i32* %7
%15 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 0
%16 = load i32, i32* %7
%17 = call i32 @returnStandardDeviation(double* %15, i32 %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"The standard deviation is %lf.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x double]
%4 = bitcast [5 x double]* %3 to i8*
%5 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 0
%6 = bitcast [5 x double]* %3 to <2 x double>*
store <2 x double> <double 3.122000e+02, double 3.210000e+01>, <2 x double>* %6
%7 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 2
%8 = bitcast double* %7 to <2 x double>*
store <2 x double> <double 4.410000e+01, double 4.350000e+02>, <2 x double>* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 4
store double 4.850000e+01, double* %9
%10 = call i32 @returnStandardDeviation(double* %5, i32 5)
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}