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

/* Variables and functions */
double arithmeticAvg(int *, int);
double findMedian(int *, int);
double findMod(int *, int);
double harmonicAvg(int *, int);
int /*<<< orphan*/ printf(char *, ...);
double standartDeviation(int *, int);
int main(void) {
  int sayilar[] = {2, 5, 1, 2, 7, 13, 15, 9, 4, 8};
  int i;
  int elemanSayisi = sizeof(sayilar) / sizeof(sayilar[0]);
  printf("+-------------------------------+\n");
  printf("| Ortalama hesaplama fasilitesi |\n");
  printf("+-------------------------------+\n");
  printf("| Aritmetik Ortalama :     %.2f |\n",
         arithmeticAvg(sayilar, elemanSayisi));
  printf("| Harmonik Ortalama  :     %.2f |\n",
         harmonicAvg(sayilar, elemanSayisi));
  printf("| Standart Sapma     :     %.2f |\n",
         standartDeviation(sayilar, elemanSayisi));
  printf("| Mod                :     %.2f |\n", findMod(sayilar, elemanSayisi));
  printf("| Medyan             :     %.2f |\n",
         findMedian(sayilar, elemanSayisi));
  printf("+-------------------------------+\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe76(%rip),%rsi
mov    $0x28,%edx
call   1070 <memcpy@plt>
movl   $0xa,-0x38(%rbp)
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%esi
call   1050 <arithmeticAvg@plt>
lea    0xe96(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%esi
call   1080 <harmonicAvg@plt>
lea    0xe9f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%esi
call   1090 <standartDeviation@plt>
lea    0xea8(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%esi
call   1030 <findMod@plt>
lea    0xeb1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%esi
call   1060 <findMedian@plt>
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    0xea2(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xe86(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe6a(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xf58(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xf27(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <arithmeticAvg@plt>
lea    0xe54(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <harmonicAvg@plt>
lea    0xe5c(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1090 <standartDeviation@plt>
lea    0xe64(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <findMod@plt>
lea    0xe6c(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <findMedian@plt>
lea    0xe74(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.sayilar = [10 x i32] [i32 2, i32 5, i32 1, i32 2, i32 7, i32 13, i32 15, i32 9, i32 4, i32 8]
@.str = [35 x i8] c"+-------------------------------+\0A\00"
@.str.1 = [35 x i8] c"| Ortalama hesaplama fasilitesi |\0A\00"
@.str.2 = [35 x i8] c"| Aritmetik Ortalama : %.2f |\0A\00"
@.str.3 = [35 x i8] c"| Harmonik Ortalama : %.2f |\0A\00"
@.str.4 = [35 x i8] c"| Standart Sapma : %.2f |\0A\00"
@.str.5 = [35 x i8] c"| Mod : %.2f |\0A\00"
@.str.6 = [35 x i8] c"| Medyan : %.2f |\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %2 to i8*
store i32 10, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %4
%11 = call double @arithmeticAvg(i32* %9, i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), double %11)
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%14 = load i32, i32* %4
%15 = call double @harmonicAvg(i32* %13, i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %15)
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%18 = load i32, i32* %4
%19 = call double @standartDeviation(i32* %17, i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), double %19)
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%22 = load i32, i32* %4
%23 = call double @findMod(i32* %21, i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), double %23)
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%26 = load i32, i32* %4
%27 = call double @findMedian(i32* %25, i32 %26)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), double %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.sayilar = [10 x i32] [i32 2, i32 5, i32 1, i32 2, i32 7, i32 13, i32 15, i32 9, i32 4, i32 8]
@.str.2 = [35 x i8] c"| Aritmetik Ortalama : %.2f |\0A\00"
@.str.3 = [35 x i8] c"| Harmonik Ortalama : %.2f |\0A\00"
@.str.4 = [35 x i8] c"| Standart Sapma : %.2f |\0A\00"
@.str.5 = [35 x i8] c"| Mod : %.2f |\0A\00"
@.str.6 = [35 x i8] c"| Medyan : %.2f |\0A\00"
@str.7 = [34 x i8] c"| Ortalama hesaplama fasilitesi |\00"
@str.9 = [34 x i8] c"+-------------------------------+\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.9, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.9, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call double @arithmeticAvg(i32* %6, i32 10)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), double %7)
%9 = call double @harmonicAvg(i32* %6, i32 10)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %9)
%11 = call double @standartDeviation(i32* %6, i32 10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), double %11)
%13 = call double @findMod(i32* %6, i32 10)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), double %13)
%15 = call double @findMedian(i32* %6, i32 10)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), double %15)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.9, i64 0, i64 0))
ret i32 0
}