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


x86 assembly (clang, -O0):
<getIntInputCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1159 <getIntInputCheck+0x39>
jmp    11a6 <getIntInputCheck+0x86>
mov    $0x0,%al
call   1030 <_flushall@plt>
lea    0xe99(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     11a1 <getIntInputCheck+0x81>
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     119c <getIntInputCheck+0x7c>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     119c <getIntInputCheck+0x7c>
movl   $0x1,-0xc(%rbp)
jmp    11a1 <getIntInputCheck+0x81>
jmp    1143 <getIntInputCheck+0x23>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIntInputCheck>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r12d
mov    %edi,%ebp
movl   $0x0,0xc(%rsp)
lea    0xec0(%rip),%r14
lea    0xc(%rsp),%r15
jmp    1154 <getIntInputCheck+0x34>
nopw   0x0(%rax,%rax,1)
test   %ebx,%ebx
jne    1182 <getIntInputCheck+0x62>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <_flushall@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
test   %eax,%eax
je     1150 <getIntInputCheck+0x30>
mov    0xc(%rsp),%eax
cmp    %ebp,%eax
setge  %cl
cmp    %r12d,%eax
setle  %al
and    %cl,%al
movzbl %al,%ebx
jmp    1150 <getIntInputCheck+0x30>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %d\00"
define i32 @getIntInputCheck(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %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 i32, i32* %7
%19 = load i32, i32* %3
%20 = icmp sge i32 %18, %19
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i32, i32* %7
%23 = load i32, i32* %4
%24 = icmp sle i32 %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 i32, i32* %7
ret i32 %29
}

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define i32 @getIntInputCheck(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %2, %15
%6 = call i32 (...) @_flushall()
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %5
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, %0
%12 = icmp sle i32 %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 i32, i32* %3
ret i32 %19
}