#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*/ _flushall();
int scanf(char *, double *);
double getDoubleInputCheck(double minGood, double maxGood) {
  int goodInputMain = 0, goodInputSub = 0;
  double input = 0.0;
  while (!goodInputMain) {
    _flushall();
    goodInputSub = scanf(" %lf", &input);
    if (goodInputSub) {
      if ((input >= minGood) && (input <= maxGood)) {
        goodInputMain = 1;
      }
    }
  }
  return input;
}


x86 assembly (clang, -O0):
<getDoubleInputCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115e <getDoubleInputCheck+0x3e>
jmp    11b7 <getDoubleInputCheck+0x97>
mov    $0x0,%al
call   1030 <_flushall@plt>
lea    0xe94(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11b2 <getDoubleInputCheck+0x92>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     11ad <getDoubleInputCheck+0x8d>
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11ad <getDoubleInputCheck+0x8d>
movl   $0x1,-0x14(%rbp)
jmp    11b2 <getDoubleInputCheck+0x92>
jmp    1148 <getDoubleInputCheck+0x28>
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDoubleInputCheck>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xebc(%rip),%r14
lea    0x8(%rsp),%rbx
jmp    1154 <getDoubleInputCheck+0x34>
nopl   0x0(%rax,%rax,1)
test   %ebp,%ebp
jne    118f <getDoubleInputCheck+0x6f>
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <_flushall@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %eax,%eax
je     1150 <getDoubleInputCheck+0x30>
movsd  0x8(%rsp),%xmm0
ucomisd 0x10(%rsp),%xmm0
setae  %al
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
setae  %cl
and    %al,%cl
movzbl %cl,%ebp
jmp    1150 <getDoubleInputCheck+0x30>
movsd  0x8(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c" %lf\00"
define double @getDoubleInputCheck(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
store i32 0, i32* %5
store i32 0, i32* %6
store double 0.000000e+00, double* %7
br label %8
8: ; preds = %27, %2
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %28
12: ; preds = %8
%13 = call i32 (...) @_flushall()
%14 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %7)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %27
17: ; preds = %12
%18 = load double, double* %7
%19 = load double, double* %3
%20 = fcmp oge double %18, %19
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load double, double* %7
%23 = load double, double* %4
%24 = fcmp ole double %22, %23
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 1, i32* %5
br label %26
26: ; preds = %25, %21, %17
br label %27
27: ; preds = %26, %12
br label %8
28: ; preds = %8
%29 = load double, double* %7
ret double %29
}

LLVM IR (-O2):
@.str = [5 x i8] c" %lf\00"
define double @getDoubleInputCheck(double %0, double %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
br label %5
5: ; preds = %2, %15
%6 = call i32 (...) @_flushall()
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %5
%10 = load double, double* %3
%11 = fcmp oge double %10, %0
%12 = fcmp ole double %10, %1
%13 = and i1 %11, %12
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %9, %5
%16 = phi i32 [ 0, %5 ], [ %14, %9 ]
%17 = icmp eq i32 %16, 0
br i1 %17, label %5, label %18
18: ; preds = %15
%19 = load double, double* %3
ret double %19
}