#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, int);
int /*<<< orphan*/ scanf(char *, int *);
int erfasse_ganze_zahl(int min, int max) {
  int eingabe = 0;
  do {
    scanf("\n%i", &eingabe);
    if (eingabe < min && eingabe > max) {
      printf("\nBitte eine Zahl zwischen %i und %i eingeben!\n", min, max);
    } else {
    }
  } while (eingabe < min && eingabe > max);
  return eingabe;
}


x86 assembly (clang, -O0):
<erfasse_ganze_zahl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1174 <erfasse_ganze_zahl+0x54>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1174 <erfasse_ganze_zahl+0x54>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    1179 <erfasse_ganze_zahl+0x59>
jmp    1179 <erfasse_ganze_zahl+0x59>
jmp    117e <erfasse_ganze_zahl+0x5e>
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0xd(%rbp)
jge    119b <erfasse_ganze_zahl+0x7b>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1135 <erfasse_ganze_zahl+0x15>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erfasse_ganze_zahl>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
movl   $0x0,0xc(%rsp)
lea    0xec1(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xeb9(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %ebp,%eax
jge    1177 <erfasse_ganze_zahl+0x57>
cmp    %ebx,%eax
jle    1177 <erfasse_ganze_zahl+0x57>
mov    %r12,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
cmp    %ebp,%eax
jge    117f <erfasse_ganze_zahl+0x5f>
cmp    %ebx,%eax
jg     1150 <erfasse_ganze_zahl+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0A%i\00"
@.str.1 = [47 x i8] c"\0ABitte eine Zahl zwischen %i und %i eingeben!\0A\00"
define i32 @erfasse_ganze_zahl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %29, %2
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %5)
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %6
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %17)
br label %20
19: ; preds = %11, %6
br label %20
20: ; preds = %19, %15
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = load i32, i32* %3
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i32, i32* %5
%27 = load i32, i32* %4
%28 = icmp sgt i32 %26, %27
br label %29
29: ; preds = %25, %21
%30 = phi i1 [ false, %21 ], [ %28, %25 ]
br i1 %30, label %6, label %31
31: ; preds = %29
%32 = load i32, i32* %5
ret i32 %32
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%i\00"
@.str.1 = [47 x i8] c"\0ABitte eine Zahl zwischen %i und %i eingeben!\0A\00"
define i32 @erfasse_ganze_zahl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %14, %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, %0
%9 = icmp sgt i32 %7, %1
%10 = and i1 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %5
%12 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1)
%13 = load i32, i32* %3
br label %14
14: ; preds = %11, %5
%15 = phi i32 [ %13, %11 ], [ %7, %5 ]
%16 = icmp slt i32 %15, %0
%17 = icmp sgt i32 %15, %1
%18 = and i1 %16, %17
br i1 %18, label %5, label %19
19: ; preds = %14
ret i32 %15
}