#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*/ d;

/* Variables and functions */
double excess_kurtosis(double *, int, double, double);
int /*<<< orphan*/ free(void *);
double kurtosis(double *, int, double, double);
scalar_t__ malloc(int);
double max(double *, int, int);
double mean(double *, int);
double median(double *, int, int);
int /*<<< orphan*/ memcpy(void *, void *, int);
double min(double *, int, int);
int /*<<< orphan*/ printf(char *, double);
double range(double *, int, int);
double skewness(double *, int, double, double);
int /*<<< orphan*/ sort_double(double *, int);
double stdev(double *, int);
double stdev_n1(double *, int);
double variance(double *, int);
double variance_n1(double *, int);
void test_statistic() {
  double d[] = {24, 28, 4,  26, 53, 73, 31, 27, 62, 77, 51,  82, 85, 52, 34,
                76, 45, 66, 70, 51, 49, 99, 50, 47, 21, 33,  58, 3,  19, 96,
                6,  64, 90, 35, 76, 75, 97, 39, 78, 59, 30,  45, 32, 58, 53,
                99, 70, 63, 31, 53, 15, 53, 86, 67, 55, 87,  55, 89, 80, 94,
                61, 96, 34, 65, 16, 81, 64, 4,  50, 4,  100, 41, 66, 52, 62,
                16, 77, 19, 24, 24, 49, 81, 50, 4,  22, 9,   54, 19, 38, 25,
                72, 39, 45, 37, 42, 57, 88, 67, 35, 33};
  double *sorted_data = (double *)malloc((100) * sizeof(double));
  memcpy((void *)(sorted_data), (void *)(d), (100) * sizeof((d)[0]));
  sort_double(sorted_data, 100);
  double mean_value = mean(d, 100);
  printf("function mean result: %f\n", mean_value);
  size_t cnt = (sizeof(d) / sizeof(d[0]));
  printf("function count result: %d\n", cnt);
  double min_value = min(d, 100, 0);
  printf("function min without sorted result: %f\n", min_value);
  min_value = min(sorted_data, 100, 1);
  printf("function min with sorted result: %f\n", min_value);
  double max_value = max(d, 100, 0);
  printf("function max without sorted result: %f\n", max_value);
  max_value = max(sorted_data, 100, 1);
  printf("function max with sorted result: %f\n", max_value);
  double median_value = median(d, 100, 0);
  printf("function median without sorted result: %f\n", median_value);
  median_value = median(sorted_data, 100, 1);
  printf("function median with sorted result: %f\n", median_value);
  double range_value = range(d, 100, 0);
  printf("function range without sorted result: %f\n", range_value);
  range_value = range(sorted_data, 100, 1);
  printf("function range with sorted result: %f\n", range_value);
  double variance_value = variance(d, 100);
  printf("function variance result: %f\n", variance_value);
  double variance_n1_value = variance_n1(d, 100);
  printf("function variance_n1 result: %f\n", variance_n1_value);
  double stdev_value = stdev(d, 100);
  printf("function stdev result: %f\n", stdev_value);
  double stdev_n1_value = stdev_n1(d, 100);
  printf("function stdev_n1 result: %f\n", stdev_n1_value);
  double kurtosis_value = kurtosis(d, 100, mean_value, stdev_value);
  printf("function kurtosis result: %f\n", kurtosis_value);
  double excess_kurtosis_value =
      excess_kurtosis(d, 100, mean_value, stdev_value);
  printf("function excess_kurosis result: %f\n", excess_kurtosis_value);
  double skewness_value = skewness(d, 100, mean_value, stdev_value);
  printf("function skewness result: %f\n", skewness_value);
  free((void *)(sorted_data));
}


x86 assembly (clang, -O0):
<test_statistic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3b0,%rsp
lea    0xdfe(%rip),%rsi
lea    -0x320(%rbp),%rdi
mov    %rdi,-0x3a0(%rbp)
mov    $0x320,%edx
call   10d0 <memcpy@plt>
mov    $0x320,%edi
mov    %edi,-0x3a4(%rbp)
call   10f0 <malloc@plt>
mov    -0x3a4(%rbp),%edx
mov    -0x3a0(%rbp),%rsi
mov    %rax,-0x328(%rbp)
mov    -0x328(%rbp),%rdi
call   10d0 <memcpy@plt>
mov    -0x328(%rbp),%rdi
mov    $0x64,%esi
mov    %esi,-0x394(%rbp)
call   10e0 <sort_double@plt>
mov    -0x3a0(%rbp),%rdi
mov    -0x394(%rbp),%esi
call   1120 <mean@plt>
movsd  %xmm0,-0x330(%rbp)
ff
movsd  -0x330(%rbp),%xmm0
ff
lea    0x1096(%rip),%rdi
call   1070 <printf@plt>
movq   $0x64,-0x338(%rbp)
movaps 0xd3f(%rip),%xmm1
movq   -0x338(%rbp),%xmm0
ff
punpckldq %xmm1,%xmm0
movapd 0xd3b(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
lea    0x106f(%rip),%rdi
call   1070 <printf@plt>
lea    -0x320(%rbp),%rdi
mov    $0x64,%esi
xor    %edx,%edx
call   1080 <min@plt>
movsd  %xmm0,-0x340(%rbp)
ff
movsd  -0x340(%rbp),%xmm0
ff
lea    0x105b(%rip),%rdi
call   1070 <printf@plt>
mov    -0x328(%rbp),%rdi
mov    $0x64,%esi
mov    $0x1,%edx
call   1080 <min@plt>
movsd  %xmm0,-0x340(%rbp)
ff
movsd  -0x340(%rbp),%xmm0
ff
lea    0x1051(%rip),%rdi
call   1070 <printf@plt>
lea    -0x320(%rbp),%rdi
mov    $0x64,%esi
xor    %edx,%edx
call   1090 <max@plt>
movsd  %xmm0,-0x348(%rbp)
ff
movsd  -0x348(%rbp),%xmm0
ff
lea    0x1047(%rip),%rdi
call   1070 <printf@plt>
mov    -0x328(%rbp),%rdi
mov    $0x64,%esi
mov    $0x1,%edx
call   1090 <max@plt>
movsd  %xmm0,-0x348(%rbp)
ff
movsd  -0x348(%rbp),%xmm0
ff
lea    0x103d(%rip),%rdi
call   1070 <printf@plt>
lea    -0x320(%rbp),%rdi
mov    $0x64,%esi
xor    %edx,%edx
call   1040 <median@plt>
movsd  %xmm0,-0x350(%rbp)
ff
movsd  -0x350(%rbp),%xmm0
ff
lea    0x1033(%rip),%rdi
call   1070 <printf@plt>
mov    -0x328(%rbp),%rdi
mov    $0x64,%esi
mov    $0x1,%edx
call   1040 <median@plt>
movsd  %xmm0,-0x350(%rbp)
ff
movsd  -0x350(%rbp),%xmm0
ff
lea    0x102c(%rip),%rdi
call   1070 <printf@plt>
lea    -0x320(%rbp),%rdi
mov    $0x64,%esi
xor    %edx,%edx
call   1100 <range@plt>
movsd  %xmm0,-0x358(%rbp)
ff
movsd  -0x358(%rbp),%xmm0
ff
lea    0x1025(%rip),%rdi
call   1070 <printf@plt>
mov    -0x328(%rbp),%rdi
mov    $0x64,%esi
mov    $0x1,%edx
call   1100 <range@plt>
movsd  %xmm0,-0x358(%rbp)
ff
movsd  -0x358(%rbp),%xmm0
ff
lea    0x101d(%rip),%rdi
call   1070 <printf@plt>
lea    -0x320(%rbp),%rdi
mov    $0x64,%esi
call   10b0 <variance@plt>
movsd  %xmm0,-0x360(%rbp)
ff
movsd  -0x360(%rbp),%xmm0
ff
lea    0x1017(%rip),%rdi
call   1070 <printf@plt>
lea    -0x320(%rbp),%rdi
mov    $0x64,%esi
call   1050 <variance_n1@plt>
movsd  %xmm0,-0x368(%rbp)
ff
movsd  -0x368(%rbp),%xmm0
ff
lea    0x1008(%rip),%rdi
call   1070 <printf@plt>
lea    -0x320(%rbp),%rdi
mov    $0x64,%esi
call   1060 <stdev@plt>
movsd  %xmm0,-0x370(%rbp)
ff
movsd  -0x370(%rbp),%xmm0
ff
lea    0xffc(%rip),%rdi
call   1070 <printf@plt>
lea    -0x320(%rbp),%rdi
mov    $0x64,%esi
call   10c0 <stdev_n1@plt>
movsd  %xmm0,-0x378(%rbp)
ff
movsd  -0x378(%rbp),%xmm0
ff
lea    0xfea(%rip),%rdi
call   1070 <printf@plt>
lea    -0x320(%rbp),%rdi
movsd  -0x330(%rbp),%xmm0
ff
movsd  -0x370(%rbp),%xmm1
ff
mov    $0x64,%esi
call   1130 <kurtosis@plt>
movsd  %xmm0,-0x380(%rbp)
ff
movsd  -0x380(%rbp),%xmm0
ff
lea    0xfcb(%rip),%rdi
call   1070 <printf@plt>
lea    -0x320(%rbp),%rdi
movsd  -0x330(%rbp),%xmm0
ff
movsd  -0x370(%rbp),%xmm1
ff
mov    $0x64,%esi
call   10a0 <excess_kurtosis@plt>
movsd  %xmm0,-0x388(%rbp)
ff
movsd  -0x388(%rbp),%xmm0
ff
lea    0xfac(%rip),%rdi
call   1070 <printf@plt>
lea    -0x320(%rbp),%rdi
movsd  -0x330(%rbp),%xmm0
ff
movsd  -0x370(%rbp),%xmm1
ff
mov    $0x64,%esi
call   1110 <skewness@plt>
movsd  %xmm0,-0x390(%rbp)
ff
movsd  -0x390(%rbp),%xmm0
ff
lea    0xf93(%rip),%rdi
call   1070 <printf@plt>
mov    -0x328(%rbp),%rdi
call   1030 <free@plt>
add    $0x3b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_statistic>:
push   %r14
push   %rbx
sub    $0x338,%rsp
lea    0xdef(%rip),%rsi
lea    0x10(%rsp),%r14
mov    $0x320,%edx
mov    %r14,%rdi
call   10d0 <memcpy@plt>
mov    $0x320,%edi
call   10f0 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x320,%edx
call   10d0 <memcpy@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   10e0 <sort_double@plt>
mov    %r14,%rdi
mov    $0x64,%esi
call   1120 <mean@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x10b9(%rip),%rdi
call   1070 <printf@plt>
lea    0x10c7(%rip),%rdi
movsd  0xd75(%rip),%xmm0
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x64,%esi
xor    %edx,%edx
call   1080 <min@plt>
lea    0x10bf(%rip),%rdi
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x1,%edx
call   1080 <min@plt>
lea    0x10c9(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x64,%esi
xor    %edx,%edx
call   1090 <max@plt>
lea    0x10d3(%rip),%rdi
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x1,%edx
call   1090 <max@plt>
lea    0x10dd(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x64,%esi
xor    %edx,%edx
call   1040 <median@plt>
lea    0x10e7(%rip),%rdi
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x1,%edx
call   1040 <median@plt>
lea    0x10f4(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x64,%esi
xor    %edx,%edx
call   1100 <range@plt>
lea    0x1101(%rip),%rdi
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x1,%edx
call   1100 <range@plt>
lea    0x110d(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x64,%esi
call   10b0 <variance@plt>
lea    0x111b(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x64,%esi
call   1050 <variance_n1@plt>
lea    0x1120(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x64,%esi
call   1060 <stdev@plt>
movsd  %xmm0,(%rsp)
lea    0x1123(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x64,%esi
call   10c0 <stdev_n1@plt>
lea    0x1125(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x64,%esi
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1130 <kurtosis@plt>
lea    0x111f(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x64,%esi
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   10a0 <excess_kurtosis@plt>
lea    0x1119(%rip),%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x64,%esi
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1110 <skewness@plt>
lea    0x1119(%rip),%rdi
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0x338,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.test_statistic.d = [100 x double] [double 2.400000e+01, double 2.800000e+01, double 4.000000e+00, double 2.600000e+01, double 5.300000e+01, double 7.300000e+01, double 3.100000e+01, double 2.700000e+01, double 6.200000e+01, double 7.700000e+01, double 5.100000e+01, double 8.200000e+01, double 8.500000e+01, double 5.200000e+01, double 3.400000e+01, double 7.600000e+01, double 4.500000e+01, double 6.600000e+01, double 7.000000e+01, double 5.100000e+01, double 4.900000e+01, double 9.900000e+01, double 5.000000e+01, double 4.700000e+01, double 2.100000e+01, double 3.300000e+01, double 5.800000e+01, double 3.000000e+00, double 1.900000e+01, double 9.600000e+01, double 6.000000e+00, double 6.400000e+01, double 9.000000e+01, double 3.500000e+01, double 7.600000e+01, double 7.500000e+01, double 9.700000e+01, double 3.900000e+01, double 7.800000e+01, double 5.900000e+01, double 3.000000e+01, double 4.500000e+01, double 3.200000e+01, double 5.800000e+01, double 5.300000e+01, double 9.900000e+01, double 7.000000e+01, double 6.300000e+01, double 3.100000e+01, double 5.300000e+01, double 1.500000e+01, double 5.300000e+01, double 8.600000e+01, double 6.700000e+01, double 5.500000e+01, double 8.700000e+01, double 5.500000e+01, double 8.900000e+01, double 8.000000e+01, double 9.400000e+01, double 6.100000e+01, double 9.600000e+01, double 3.400000e+01, double 6.500000e+01, double 1.600000e+01, double 8.100000e+01, double 6.400000e+01, double 4.000000e+00, double 5.000000e+01, double 4.000000e+00, double 1.000000e+02, double 4.100000e+01, double 6.600000e+01, double 5.200000e+01, double 6.200000e+01, double 1.600000e+01, double 7.700000e+01, double 1.900000e+01, double 2.400000e+01, double 2.400000e+01, double 4.900000e+01, double 8.100000e+01, double 5.000000e+01, double 4.000000e+00, double 2.200000e+01, double 9.000000e+00, double 5.400000e+01, double 1.900000e+01, double 3.800000e+01, double 2.500000e+01, double 7.200000e+01, double 3.900000e+01, double 4.500000e+01, double 3.700000e+01, double 4.200000e+01, double 5.700000e+01, double 8.800000e+01, double 6.700000e+01, double 3.500000e+01, double 3.300000e+01]
@.str = [26 x i8] c"function mean result: %f\0A\00"
@.str.1 = [27 x i8] c"function count result: %d\0A\00"
@.str.2 = [40 x i8] c"function min without sorted result: %f\0A\00"
@.str.3 = [37 x i8] c"function min with sorted result: %f\0A\00"
@.str.4 = [40 x i8] c"function max without sorted result: %f\0A\00"
@.str.5 = [37 x i8] c"function max with sorted result: %f\0A\00"
@.str.6 = [43 x i8] c"function median without sorted result: %f\0A\00"
@.str.7 = [40 x i8] c"function median with sorted result: %f\0A\00"
@.str.8 = [42 x i8] c"function range without sorted result: %f\0A\00"
@.str.9 = [39 x i8] c"function range with sorted result: %f\0A\00"
@.str.10 = [30 x i8] c"function variance result: %f\0A\00"
@.str.11 = [33 x i8] c"function variance_n1 result: %f\0A\00"
@.str.12 = [27 x i8] c"function stdev result: %f\0A\00"
@.str.13 = [30 x i8] c"function stdev_n1 result: %f\0A\00"
@.str.14 = [30 x i8] c"function kurtosis result: %f\0A\00"
@.str.15 = [36 x i8] c"function excess_kurosis result: %f\0A\00"
@.str.16 = [30 x i8] c"function skewness result: %f\0A\00"
define void @test_statistic() {
%1 = alloca [100 x double]
%2 = alloca double*
%3 = alloca double
%4 = alloca i64
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = bitcast [100 x double]* %1 to i8*
%17 = call i64 @malloc(i32 800)
%18 = inttoptr i64 %17 to double*
store double* %18, double** %2
%19 = load double*, double** %2
%20 = bitcast double* %19 to i8*
%21 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%22 = bitcast double* %21 to i8*
%23 = call i32 @memcpy(i8* %20, i8* %22, i32 800)
%24 = load double*, double** %2
%25 = call i32 @sort_double(double* %24, i32 100)
%26 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%27 = call double @mean(double* %26, i32 100)
store double %27, double* %3
%28 = load double, double* %3
%29 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double %28)
store i64 100, i64* %4
%30 = load i64, i64* %4
%31 = uitofp i64 %30 to double
%32 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), double %31)
%33 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%34 = call double @min(double* %33, i32 100, i32 0)
store double %34, double* %5
%35 = load double, double* %5
%36 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), double %35)
%37 = load double*, double** %2
%38 = call double @min(double* %37, i32 100, i32 1)
store double %38, double* %5
%39 = load double, double* %5
%40 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), double %39)
%41 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%42 = call double @max(double* %41, i32 100, i32 0)
store double %42, double* %6
%43 = load double, double* %6
%44 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), double %43)
%45 = load double*, double** %2
%46 = call double @max(double* %45, i32 100, i32 1)
store double %46, double* %6
%47 = load double, double* %6
%48 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), double %47)
%49 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%50 = call double @median(double* %49, i32 100, i32 0)
store double %50, double* %7
%51 = load double, double* %7
%52 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), double %51)
%53 = load double*, double** %2
%54 = call double @median(double* %53, i32 100, i32 1)
store double %54, double* %7
%55 = load double, double* %7
%56 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0), double %55)
%57 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%58 = call double @range(double* %57, i32 100, i32 0)
store double %58, double* %8
%59 = load double, double* %8
%60 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), double %59)
%61 = load double*, double** %2
%62 = call double @range(double* %61, i32 100, i32 1)
store double %62, double* %8
%63 = load double, double* %8
%64 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), double %63)
%65 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%66 = call double @variance(double* %65, i32 100)
store double %66, double* %9
%67 = load double, double* %9
%68 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), double %67)
%69 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%70 = call double @variance_n1(double* %69, i32 100)
store double %70, double* %10
%71 = load double, double* %10
%72 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0), double %71)
%73 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%74 = call double @stdev(double* %73, i32 100)
store double %74, double* %11
%75 = load double, double* %11
%76 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), double %75)
%77 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%78 = call double @stdev_n1(double* %77, i32 100)
store double %78, double* %12
%79 = load double, double* %12
%80 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), double %79)
%81 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%82 = load double, double* %3
%83 = load double, double* %11
%84 = call double @kurtosis(double* %81, i32 100, double %82, double %83)
store double %84, double* %13
%85 = load double, double* %13
%86 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), double %85)
%87 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%88 = load double, double* %3
%89 = load double, double* %11
%90 = call double @excess_kurtosis(double* %87, i32 100, double %88, double %89)
store double %90, double* %14
%91 = load double, double* %14
%92 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0), double %91)
%93 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%94 = load double, double* %3
%95 = load double, double* %11
%96 = call double @skewness(double* %93, i32 100, double %94, double %95)
store double %96, double* %15
%97 = load double, double* %15
%98 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), double %97)
%99 = load double*, double** %2
%100 = bitcast double* %99 to i8*
%101 = call i32 @free(i8* %100)
ret void
}

LLVM IR (-O2):
@__const.test_statistic.d = [100 x double] [double 2.400000e+01, double 2.800000e+01, double 4.000000e+00, double 2.600000e+01, double 5.300000e+01, double 7.300000e+01, double 3.100000e+01, double 2.700000e+01, double 6.200000e+01, double 7.700000e+01, double 5.100000e+01, double 8.200000e+01, double 8.500000e+01, double 5.200000e+01, double 3.400000e+01, double 7.600000e+01, double 4.500000e+01, double 6.600000e+01, double 7.000000e+01, double 5.100000e+01, double 4.900000e+01, double 9.900000e+01, double 5.000000e+01, double 4.700000e+01, double 2.100000e+01, double 3.300000e+01, double 5.800000e+01, double 3.000000e+00, double 1.900000e+01, double 9.600000e+01, double 6.000000e+00, double 6.400000e+01, double 9.000000e+01, double 3.500000e+01, double 7.600000e+01, double 7.500000e+01, double 9.700000e+01, double 3.900000e+01, double 7.800000e+01, double 5.900000e+01, double 3.000000e+01, double 4.500000e+01, double 3.200000e+01, double 5.800000e+01, double 5.300000e+01, double 9.900000e+01, double 7.000000e+01, double 6.300000e+01, double 3.100000e+01, double 5.300000e+01, double 1.500000e+01, double 5.300000e+01, double 8.600000e+01, double 6.700000e+01, double 5.500000e+01, double 8.700000e+01, double 5.500000e+01, double 8.900000e+01, double 8.000000e+01, double 9.400000e+01, double 6.100000e+01, double 9.600000e+01, double 3.400000e+01, double 6.500000e+01, double 1.600000e+01, double 8.100000e+01, double 6.400000e+01, double 4.000000e+00, double 5.000000e+01, double 4.000000e+00, double 1.000000e+02, double 4.100000e+01, double 6.600000e+01, double 5.200000e+01, double 6.200000e+01, double 1.600000e+01, double 7.700000e+01, double 1.900000e+01, double 2.400000e+01, double 2.400000e+01, double 4.900000e+01, double 8.100000e+01, double 5.000000e+01, double 4.000000e+00, double 2.200000e+01, double 9.000000e+00, double 5.400000e+01, double 1.900000e+01, double 3.800000e+01, double 2.500000e+01, double 7.200000e+01, double 3.900000e+01, double 4.500000e+01, double 3.700000e+01, double 4.200000e+01, double 5.700000e+01, double 8.800000e+01, double 6.700000e+01, double 3.500000e+01, double 3.300000e+01]
@.str = [26 x i8] c"function mean result: %f\0A\00"
@.str.1 = [27 x i8] c"function count result: %d\0A\00"
@.str.2 = [40 x i8] c"function min without sorted result: %f\0A\00"
@.str.3 = [37 x i8] c"function min with sorted result: %f\0A\00"
@.str.4 = [40 x i8] c"function max without sorted result: %f\0A\00"
@.str.5 = [37 x i8] c"function max with sorted result: %f\0A\00"
@.str.6 = [43 x i8] c"function median without sorted result: %f\0A\00"
@.str.7 = [40 x i8] c"function median with sorted result: %f\0A\00"
@.str.8 = [42 x i8] c"function range without sorted result: %f\0A\00"
@.str.9 = [39 x i8] c"function range with sorted result: %f\0A\00"
@.str.10 = [30 x i8] c"function variance result: %f\0A\00"
@.str.11 = [33 x i8] c"function variance_n1 result: %f\0A\00"
@.str.12 = [27 x i8] c"function stdev result: %f\0A\00"
@.str.13 = [30 x i8] c"function stdev_n1 result: %f\0A\00"
@.str.14 = [30 x i8] c"function kurtosis result: %f\0A\00"
@.str.15 = [36 x i8] c"function excess_kurosis result: %f\0A\00"
@.str.16 = [30 x i8] c"function skewness result: %f\0A\00"
define void @test_statistic() {
%1 = alloca [100 x double]
%2 = bitcast [100 x double]* %1 to i8*
%3 = tail call i64 @malloc(i32 800)
%4 = inttoptr i64 %3 to double*
%5 = inttoptr i64 %3 to i8*
%6 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i8* %5, i8* %2, i32 800)
%8 = call i32 @sort_double(double* %4, i32 100)
%9 = call double @mean(double* %6, i32 100)
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), double 1.000000e+02)
%12 = call double @min(double* %6, i32 100, i32 0)
%13 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = call double @min(double* %4, i32 100, i32 1)
%15 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), double %14)
%16 = call double @max(double* %6, i32 100, i32 0)
%17 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), double %16)
%18 = call double @max(double* %4, i32 100, i32 1)
%19 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), double %18)
%20 = call double @median(double* %6, i32 100, i32 0)
%21 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), double %20)
%22 = call double @median(double* %4, i32 100, i32 1)
%23 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0), double %22)
%24 = call double @range(double* %6, i32 100, i32 0)
%25 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), double %24)
%26 = call double @range(double* %4, i32 100, i32 1)
%27 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), double %26)
%28 = call double @variance(double* %6, i32 100)
%29 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), double %28)
%30 = call double @variance_n1(double* %6, i32 100)
%31 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0), double %30)
%32 = call double @stdev(double* %6, i32 100)
%33 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), double %32)
%34 = call double @stdev_n1(double* %6, i32 100)
%35 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), double %34)
%36 = call double @kurtosis(double* %6, i32 100, double %9, double %32)
%37 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), double %36)
%38 = call double @excess_kurtosis(double* %6, i32 100, double %9, double %32)
%39 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0), double %38)
%40 = call double @skewness(double* %6, i32 100, double %9, double %32)
%41 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), double %40)
%42 = call i32 @free(i8* %5)
ret void
}