#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 *);
double lese_gleitkommazahl(char *ausgabetext, double min, double max) {
  double zahl;
  printf("%s", ausgabetext);
  int funde = scanf("%lf", &zahl);
  if (funde == 1) {
    if (min >= zahl && zahl >= max) {
      printf("Bitte geben Sie eine Zahl zwischen %lf und %lf an!", min, max);
    }
  } else {
    printf("Bitte geben Sie eine Zahl zwischen %lf und %lf an!", min, max);
  }
  return zahl;
}


x86 assembly (clang, -O0):
<lese_gleitkommazahl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x1,-0x24(%rbp)
jne    11a2 <lese_gleitkommazahl+0x82>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     119d <lese_gleitkommazahl+0x7d>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     119d <lese_gleitkommazahl+0x7d>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe71(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    11ba <lese_gleitkommazahl+0x9a>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe54(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lese_gleitkommazahl>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
cmp    $0x1,%eax
jne    1172 <lese_gleitkommazahl+0x52>
movsd  (%rsp),%xmm2
ucomisd %xmm2,%xmm0
jb     1180 <lese_gleitkommazahl+0x60>
ucomisd %xmm1,%xmm2
jb     1180 <lese_gleitkommazahl+0x60>
lea    0xe8e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [51 x i8] c"Bitte geben Sie eine Zahl zwischen %lf und %lf an!\00"
define double @lese_gleitkommazahl(i8* %0, double %1, double %2) {
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
store i8* %0, i8** %4
store double %1, double* %5
store double %2, double* %6
%9 = load i8*, i8** %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %7)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %27
14: ; preds = %3
%15 = load double, double* %5
%16 = load double, double* %7
%17 = fcmp oge double %15, %16
br i1 %17, label %18, label %26
18: ; preds = %14
%19 = load double, double* %7
%20 = load double, double* %6
%21 = fcmp oge double %19, %20
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load double, double* %5
%24 = load double, double* %6
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), double %23, double %24)
br label %26
26: ; preds = %22, %18, %14
br label %31
27: ; preds = %3
%28 = load double, double* %5
%29 = load double, double* %6
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), double %28, double %29)
br label %31
31: ; preds = %27, %26
%32 = load double, double* %7
ret double %32
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [51 x i8] c"Bitte geben Sie eine Zahl zwischen %lf und %lf an!\00"
define double @lese_gleitkommazahl(i8* %0, double %1, double %2) {
%4 = alloca double
%5 = bitcast double* %4 to i8*
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load double, double* %4
%11 = fcmp ugt double %10, %1
%12 = fcmp ult double %10, %2
%13 = or i1 %11, %12
br i1 %13, label %16, label %14
14: ; preds = %3, %9
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), double %1, double %2)
br label %16
16: ; preds = %14, %9
%17 = load double, double* %4
ret double %17
}