#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 */
double INT_MAX;
double INT_MIN;
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, double *);
int main() {
  int i = 0;
  double cislo;
  double min = INT_MAX;
  double max = INT_MIN;
  printf("Zadej 5 cisel v rozsahu <%lf, %lf>", -3.0, 3.0);
  while (i < 5) {
    if (scanf("%lf", &cislo) != 1) {
      printf("Chybne zadani\n");
      return 1;
    }
    if ((cislo >= -3.0) && (cislo <= 3.0))
      i++;
    else
      printf("Zadane cislo je mimo povoleny rozsah\n");
    if (cislo < min)
      min = cislo;
    if (cislo > max)
      max = cislo;
  }
  printf("Nejmensi cislo je %lf\n", min);
  printf("Nejvetsi cislo je %lf\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0x2eab(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    0x2e93(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xeb3(%rip),%rdi
movsd  0xe9b(%rip),%xmm0
movsd  0xe9b(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
cmpl   $0x5,-0x8(%rbp)
jge    1234 <main+0x114>
lea    0xeae(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     11b1 <main+0x91>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1261 <main+0x141>
movsd  -0x10(%rbp),%xmm0
movsd  0xe42(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11e9 <main+0xc9>
movsd  0xe38(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11e9 <main+0xc9>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11f7 <main+0xd7>
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1215 <main+0xf5>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    122f <main+0x10f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1174 <main+0x54>
movsd  -0x18(%rbp),%xmm0
lea    0xe2c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe30(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x2ea7(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    0x2e8e(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,(%rsp)
lea    0xeae(%rip),%rdi
movsd  0xe96(%rip),%xmm0
movsd  0xe96(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
xor    %ebp,%ebp
lea    0xeb1(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xed7(%rip),%r15
jmp    11bd <main+0x8d>
mov    %r15,%rdi
call   1030 <puts@plt>
movsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
minsd  0x8(%rsp),%xmm0
maxsd  (%rsp),%xmm1
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
cmp    $0x5,%ebp
jge    11f0 <main+0xc0>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    121a <main+0xea>
movsd  0x10(%rsp),%xmm1
ucomisd 0xe25(%rip),%xmm1
jb     1190 <main+0x60>
movsd  0xe23(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1190 <main+0x60>
add    $0x1,%ebp
jmp    119e <main+0x6e>
lea    0xe40(%rip),%rdi
mov    $0x1,%al
movsd  %xmm1,(%rsp)
call   1040 <printf@plt>
lea    0xe44(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
jmp    122b <main+0xfb>
lea    0xe69(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@INT_MAX = global double 0.000000e+00
@INT_MIN = global double 0.000000e+00
@.str = [35 x i8] c"Zadej 5 cisel v rozsahu <%lf, %lf>\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [15 x i8] c"Chybne zadani\0A\00"
@.str.3 = [38 x i8] c"Zadane cislo je mimo povoleny rozsah\0A\00"
@.str.4 = [23 x i8] c"Nejmensi cislo je %lf\0A\00"
@.str.5 = [23 x i8] c"Nejvetsi cislo je %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store i32 0, i32* %2
%6 = load double, double* @INT_MAX
store double %6, double* %4
%7 = load double, double* @INT_MIN
store double %7, double* %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double -3.000000e+00, double 3.000000e+00)
br label %9
9: ; preds = %40, %0
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 5
br i1 %11, label %12, label %41
12: ; preds = %9
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%14 = icmp ne i32 %13, 1
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %46
17: ; preds = %12
%18 = load double, double* %3
%19 = fcmp oge double %18, -3.000000e+00
br i1 %19, label %20, label %26
20: ; preds = %17
%21 = load double, double* %3
%22 = fcmp ole double %21, 3.000000e+00
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %28
26: ; preds = %20, %17
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
%29 = load double, double* %3
%30 = load double, double* %4
%31 = fcmp olt double %29, %30
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = load double, double* %3
store double %33, double* %4
br label %34
34: ; preds = %32, %28
%35 = load double, double* %3
%36 = load double, double* %5
%37 = fcmp ogt double %35, %36
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = load double, double* %3
store double %39, double* %5
br label %40
40: ; preds = %38, %34
br label %9
41: ; preds = %9
%42 = load double, double* %4
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), double %42)
%44 = load double, double* %5
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), double %44)
store i32 0, i32* %1
br label %46
46: ; preds = %41, %15
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
@INT_MAX = global double 0.000000e+00
@INT_MIN = global double 0.000000e+00
@.str = [35 x i8] c"Zadej 5 cisel v rozsahu <%lf, %lf>\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.4 = [23 x i8] c"Nejmensi cislo je %lf\0A\00"
@.str.5 = [23 x i8] c"Nejvetsi cislo je %lf\0A\00"
@str = [37 x i8] c"Zadane cislo je mimo povoleny rozsah\00"
@str.6 = [14 x i8] c"Chybne zadani\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = load double, double* @INT_MAX
%4 = load double, double* @INT_MIN
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double -3.000000e+00, double 3.000000e+00)
br label %6
6: ; preds = %0, %24
%7 = phi double [ %4, %0 ], [ %30, %24 ]
%8 = phi double [ %3, %0 ], [ %28, %24 ]
%9 = phi i32 [ 0, %0 ], [ %26, %24 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%11 = icmp eq i32 %10, 1
br i1 %11, label %14, label %12
12: ; preds = %6
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0))
br label %35
14: ; preds = %6
%15 = load double, double* %1
%16 = fcmp oge double %15, -3.000000e+00
%17 = fcmp ole double %15, 3.000000e+00
%18 = and i1 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = add nsw i32 %9, 1
br label %24
21: ; preds = %14
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%23 = load double, double* %1
br label %24
24: ; preds = %21, %19
%25 = phi double [ %15, %19 ], [ %23, %21 ]
%26 = phi i32 [ %20, %19 ], [ %9, %21 ]
%27 = fcmp olt double %25, %8
%28 = select i1 %27, double %25, double %8
%29 = fcmp ogt double %25, %7
%30 = select i1 %29, double %25, double %7
%31 = icmp slt i32 %26, 5
br i1 %31, label %6, label %32
32: ; preds = %24
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), double %28)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), double %30)
br label %35
35: ; preds = %32, %12
%36 = phi i32 [ 1, %12 ], [ 0, %32 ]
ret i32 %36
}