#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*/ printf(char *, ...);
int scanf(char *, double *);
int main() {
  double pole[8] = {
      0,
  };
  double minimum, maximum, prumer = 0;
  unsigned int i = 0;
  printf("Celkem zadej %u cisel.\n", 8);
  for (i = 0; i < 8; ++i) {
    printf("Ted zadavas cislo %u z %u: ", i + 1, 8);
    if (scanf("%lf", &pole[i]) != 1) {
      printf("Chybne zadani\n\a");
      return 1;
    }
  }
  minimum = maximum = pole[0];
  for (i = 0; i < 8; ++i) {
    if (pole[i] < minimum)
      minimum = pole[i];
    if (pole[i] > maximum)
      maximum = pole[i];
    prumer += pole[i];
  }
  prumer /= 8;
  printf("Maximum je %lf\n", maximum);
  printf("Minimum je %lf\n", minimum);
  printf("Stredni hodnota je: %lf\n", prumer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
lea    0xea3(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x6c(%rbp)
cmpl   $0x8,-0x6c(%rbp)
jae    11eb <main+0xbb>
mov    -0x6c(%rbp),%esi
add    $0x1,%esi
lea    0xe91(%rip),%rdi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x6c(%rbp),%eax
lea    -0x50(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe8c(%rip),%rdi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     11d8 <main+0xa8>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12ca <main+0x19a>
jmp    11dd <main+0xad>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1178 <main+0x48>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x6c(%rbp)
cmpl   $0x8,-0x6c(%rbp)
jae    1274 <main+0x144>
mov    -0x6c(%rbp),%eax
movsd  -0x50(%rbp,%rax,8),%xmm1
movsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1231 <main+0x101>
mov    -0x6c(%rbp),%eax
movsd  -0x50(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x6c(%rbp),%eax
movsd  -0x50(%rbp,%rax,8),%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    1253 <main+0x123>
mov    -0x6c(%rbp),%eax
movsd  -0x50(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x6c(%rbp),%eax
movsd  -0x50(%rbp,%rax,8),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1201 <main+0xd1>
movsd  -0x68(%rbp),%xmm0
movsd  0xd7f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
lea    0xdba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x58(%rbp),%xmm0
lea    0xdb7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x68(%rbp),%xmm0
lea    0xdb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xec6(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x1,%ebx
mov    $0x1,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    13d6 <main+0x2b6>
lea    0xe96(%rip),%rdi
mov    $0x2,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
lea    0xe95(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    13d6 <main+0x2b6>
lea    0xe64(%rip),%rdi
mov    $0x3,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
lea    0xe63(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    13d6 <main+0x2b6>
lea    0xe32(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
lea    0xe31(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    13d6 <main+0x2b6>
lea    0xe00(%rip),%rdi
mov    $0x5,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x20(%rsp),%rsi
lea    0xdff(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    13d6 <main+0x2b6>
lea    0xdce(%rip),%rdi
mov    $0x6,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x28(%rsp),%rsi
lea    0xdcd(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    13d6 <main+0x2b6>
lea    0xd9c(%rip),%rdi
mov    $0x7,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x30(%rsp),%rsi
lea    0xd9b(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    13d6 <main+0x2b6>
lea    0xd6a(%rip),%rdi
mov    $0x8,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x38(%rsp),%rsi
lea    0xd69(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    13d6 <main+0x2b6>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
xorpd  %xmm5,%xmm5
addsd  %xmm0,%xmm5
movapd %xmm1,%xmm2
minsd  %xmm0,%xmm2
addsd  %xmm1,%xmm5
maxsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
movapd %xmm0,%xmm3
minsd  %xmm2,%xmm3
addsd  %xmm0,%xmm5
maxsd  %xmm1,%xmm0
movsd  0x18(%rsp),%xmm1
movapd %xmm1,%xmm2
minsd  %xmm3,%xmm2
addsd  %xmm1,%xmm5
maxsd  %xmm0,%xmm1
movsd  0x20(%rsp),%xmm0
movapd %xmm0,%xmm3
minsd  %xmm2,%xmm3
addsd  %xmm0,%xmm5
maxsd  %xmm1,%xmm0
movsd  0x28(%rsp),%xmm1
movapd %xmm1,%xmm2
minsd  %xmm3,%xmm2
addsd  %xmm1,%xmm5
maxsd  %xmm0,%xmm1
movsd  0x30(%rsp),%xmm3
movapd %xmm3,%xmm4
minsd  %xmm2,%xmm4
addsd  %xmm3,%xmm5
maxsd  %xmm1,%xmm3
movsd  0x38(%rsp),%xmm0
movapd %xmm0,%xmm1
minsd  %xmm4,%xmm1
movsd  %xmm1,0x40(%rsp)
addsd  %xmm0,%xmm5
maxsd  %xmm3,%xmm0
mulsd  0xc6a(%rip),%xmm5
movsd  %xmm5,0x48(%rsp)
lea    0xcad(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xcaf(%rip),%rdi
movsd  0x40(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xcab(%rip),%rdi
movsd  0x48(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %ebx,%ebx
jmp    13e4 <main+0x2c4>
lea    0xc63(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Celkem zadej %u cisel.\0A\00"
@.str.1 = [28 x i8] c"Ted zadavas cislo %u z %u: \00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [16 x i8] c"Chybne zadani\0A\07\00"
@.str.4 = [16 x i8] c"Maximum je %lf\0A\00"
@.str.5 = [16 x i8] c"Minimum je %lf\0A\00"
@.str.6 = [25 x i8] c"Stredni hodnota je: %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x double]
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [8 x double]* %2 to i8*
store double 0.000000e+00, double* %5
store i32 0, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 8)
store i32 0, i32* %6
br label %9
9: ; preds = %24, %0
%10 = load i32, i32* %6
%11 = icmp ult i32 %10, 8
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = load i32, i32* %6
%14 = add i32 %13, 1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 8)
%16 = load i32, i32* %6
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 %17
%19 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %18)
%20 = icmp ne i32 %19, 1
br i1 %20, label %21, label %23
21: ; preds = %12
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %1
br label %76
23: ; preds = %12
br label %24
24: ; preds = %23
%25 = load i32, i32* %6
%26 = add i32 %25, 1
store i32 %26, i32* %6
br label %9
27: ; preds = %9
%28 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 0
%29 = load double, double* %28
store double %29, double* %4
store double %29, double* %3
store i32 0, i32* %6
br label %30
30: ; preds = %64, %27
%31 = load i32, i32* %6
%32 = icmp ult i32 %31, 8
br i1 %32, label %33, label %67
33: ; preds = %30
%34 = load i32, i32* %6
%35 = zext i32 %34 to i64
%36 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 %35
%37 = load double, double* %36
%38 = load double, double* %3
%39 = fcmp olt double %37, %38
br i1 %39, label %40, label %45
40: ; preds = %33
%41 = load i32, i32* %6
%42 = zext i32 %41 to i64
%43 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 %42
%44 = load double, double* %43
store double %44, double* %3
br label %45
45: ; preds = %40, %33
%46 = load i32, i32* %6
%47 = zext i32 %46 to i64
%48 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 %47
%49 = load double, double* %48
%50 = load double, double* %4
%51 = fcmp ogt double %49, %50
br i1 %51, label %52, label %57
52: ; preds = %45
%53 = load i32, i32* %6
%54 = zext i32 %53 to i64
%55 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 %54
%56 = load double, double* %55
store double %56, double* %4
br label %57
57: ; preds = %52, %45
%58 = load i32, i32* %6
%59 = zext i32 %58 to i64
%60 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 %59
%61 = load double, double* %60
%62 = load double, double* %5
%63 = fadd double %62, %61
store double %63, double* %5
br label %64
64: ; preds = %57
%65 = load i32, i32* %6
%66 = add i32 %65, 1
store i32 %66, i32* %6
br label %30
67: ; preds = %30
%68 = load double, double* %5
%69 = fdiv double %68, 8.000000e+00
store double %69, double* %5
%70 = load double, double* %4
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %70)
%72 = load double, double* %3
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), double %72)
%74 = load double, double* %5
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), double %74)
store i32 0, i32* %1
br label %76
76: ; preds = %67, %21
%77 = load i32, i32* %1
ret i32 %77
}

LLVM IR (-O2):
@.str = [24 x i8] c"Celkem zadej %u cisel.\0A\00"
@.str.1 = [28 x i8] c"Ted zadavas cislo %u z %u: \00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [16 x i8] c"Chybne zadani\0A\07\00"
@.str.4 = [16 x i8] c"Maximum je %lf\0A\00"
@.str.5 = [16 x i8] c"Minimum je %lf\0A\00"
@.str.6 = [25 x i8] c"Stredni hodnota je: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 8)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 8)
%5 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %43
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 8)
%10 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 1
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %10)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %43
13: ; preds = %8
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 8)
%15 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 2
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %15)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %43
18: ; preds = %13
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 8)
%20 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 3
%21 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %20)
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %43
23: ; preds = %18
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 8)
%25 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 4
%26 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %25)
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %43
28: ; preds = %23
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 8)
%30 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 5
%31 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %30)
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %43
33: ; preds = %28
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 7, i32 8)
%35 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 6
%36 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %35)
%37 = icmp eq i32 %36, 1
br i1 %37, label %38, label %43
38: ; preds = %33
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 8)
%40 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 7
%41 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %40)
%42 = icmp eq i32 %41, 1
br i1 %42, label %45, label %43
43: ; preds = %38, %33, %28, %23, %18, %13, %8, %0
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %94
45: ; preds = %38
%46 = load double, double* %5
%47 = fadd double %46, 0.000000e+00
%48 = load double, double* %10
%49 = fcmp olt double %48, %46
%50 = select i1 %49, double %48, double %46
%51 = fcmp ogt double %48, %46
%52 = select i1 %51, double %48, double %46
%53 = fadd double %47, %48
%54 = load double, double* %15
%55 = fcmp olt double %54, %50
%56 = select i1 %55, double %54, double %50
%57 = fcmp ogt double %54, %52
%58 = select i1 %57, double %54, double %52
%59 = fadd double %53, %54
%60 = load double, double* %20
%61 = fcmp olt double %60, %56
%62 = select i1 %61, double %60, double %56
%63 = fcmp ogt double %60, %58
%64 = select i1 %63, double %60, double %58
%65 = fadd double %59, %60
%66 = load double, double* %25
%67 = fcmp olt double %66, %62
%68 = select i1 %67, double %66, double %62
%69 = fcmp ogt double %66, %64
%70 = select i1 %69, double %66, double %64
%71 = fadd double %65, %66
%72 = load double, double* %30
%73 = fcmp olt double %72, %68
%74 = select i1 %73, double %72, double %68
%75 = fcmp ogt double %72, %70
%76 = select i1 %75, double %72, double %70
%77 = fadd double %71, %72
%78 = load double, double* %35
%79 = fcmp olt double %78, %74
%80 = select i1 %79, double %78, double %74
%81 = fcmp ogt double %78, %76
%82 = select i1 %81, double %78, double %76
%83 = fadd double %77, %78
%84 = load double, double* %40
%85 = fcmp olt double %84, %80
%86 = select i1 %85, double %84, double %80
%87 = fcmp ogt double %84, %82
%88 = select i1 %87, double %84, double %82
%89 = fadd double %83, %84
%90 = fmul double %89, 1.250000e-01
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %88)
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), double %86)
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), double %90)
br label %94
94: ; preds = %45, %43
%95 = phi i32 [ 1, %43 ], [ 0, %45 ]
ret i32 %95
}