#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 */
int /*<<< orphan*/ calc_average(double *, int);
int /*<<< orphan*/ calc_dispersion(double *, int);
int /*<<< orphan*/ calc_standard_error(double *, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  double measured[33] = {160, 161, 155, 158, 157, 163, 163, 168, 153, 160, 168,
                         151, 152, 160, 155, 164, 161, 166, 156, 164, 157, 160,
                         155, 155, 167, 162, 159, 160, 158, 158, 165, 157, 160};
  printf("average:    %lf\n", calc_average(measured, 33));
  printf("dispersion: %lf\n", calc_dispersion(measured, 33));
  printf("std err:    %lf\n", calc_standard_error(measured, 33));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
lea    0xe90(%rip),%rsi
mov    $0x108,%edx
call   1050 <memcpy@plt>
lea    -0x110(%rbp),%rdi
mov    $0x21,%esi
call   1060 <calc_average@plt>
mov    %eax,%esi
lea    0xf74(%rip),%rdi
call   1030 <printf@plt>
lea    -0x110(%rbp),%rdi
mov    $0x21,%esi
call   1040 <calc_dispersion@plt>
mov    %eax,%esi
lea    0xf66(%rip),%rdi
call   1030 <printf@plt>
lea    -0x110(%rbp),%rdi
mov    $0x21,%esi
call   1070 <calc_standard_error@plt>
mov    %eax,%esi
lea    0xf58(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x110,%rsp
lea    0xea1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x108,%edx
mov    %rbx,%rdi
call   1050 <memcpy@plt>
mov    %rbx,%rdi
mov    $0x21,%esi
call   1060 <calc_average@plt>
lea    0xf85(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x21,%esi
call   1040 <calc_dispersion@plt>
lea    0xf7b(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x21,%esi
call   1070 <calc_standard_error@plt>
lea    0xf71(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.measured = [33 x double] [double 1.600000e+02, double 1.610000e+02, double 1.550000e+02, double 1.580000e+02, double 1.570000e+02, double 1.630000e+02, double 1.630000e+02, double 1.680000e+02, double 1.530000e+02, double 1.600000e+02, double 1.680000e+02, double 1.510000e+02, double 1.520000e+02, double 1.600000e+02, double 1.550000e+02, double 1.640000e+02, double 1.610000e+02, double 1.660000e+02, double 1.560000e+02, double 1.640000e+02, double 1.570000e+02, double 1.600000e+02, double 1.550000e+02, double 1.550000e+02, double 1.670000e+02, double 1.620000e+02, double 1.590000e+02, double 1.600000e+02, double 1.580000e+02, double 1.580000e+02, double 1.650000e+02, double 1.570000e+02, double 1.600000e+02]
@.str = [17 x i8] c"average: %lf\0A\00"
@.str.1 = [17 x i8] c"dispersion: %lf\0A\00"
@.str.2 = [17 x i8] c"std err: %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [33 x double]
store i32 0, i32* %1
%3 = bitcast [33 x double]* %2 to i8*
%4 = getelementptr inbounds [33 x double], [33 x double]* %2, i64 0, i64 0
%5 = call i32 @calc_average(double* %4, i32 33)
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [33 x double], [33 x double]* %2, i64 0, i64 0
%8 = call i32 @calc_dispersion(double* %7, i32 33)
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [33 x double], [33 x double]* %2, i64 0, i64 0
%11 = call i32 @calc_standard_error(double* %10, i32 33)
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.measured = [33 x double] [double 1.600000e+02, double 1.610000e+02, double 1.550000e+02, double 1.580000e+02, double 1.570000e+02, double 1.630000e+02, double 1.630000e+02, double 1.680000e+02, double 1.530000e+02, double 1.600000e+02, double 1.680000e+02, double 1.510000e+02, double 1.520000e+02, double 1.600000e+02, double 1.550000e+02, double 1.640000e+02, double 1.610000e+02, double 1.660000e+02, double 1.560000e+02, double 1.640000e+02, double 1.570000e+02, double 1.600000e+02, double 1.550000e+02, double 1.550000e+02, double 1.670000e+02, double 1.620000e+02, double 1.590000e+02, double 1.600000e+02, double 1.580000e+02, double 1.580000e+02, double 1.650000e+02, double 1.570000e+02, double 1.600000e+02]
@.str = [17 x i8] c"average: %lf\0A\00"
@.str.1 = [17 x i8] c"dispersion: %lf\0A\00"
@.str.2 = [17 x i8] c"std err: %lf\0A\00"
define i32 @main() {
%1 = alloca [33 x double]
%2 = bitcast [33 x double]* %1 to i8*
%3 = getelementptr inbounds [33 x double], [33 x double]* %1, i64 0, i64 0
%4 = call i32 @calc_average(double* %3, i32 33)
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @calc_dispersion(double* %3, i32 33)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @calc_standard_error(double* %3, i32 33)
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}