#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 */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  char c;
  int input = -1;
  while (input < 5 || input > 10) {
    printf("Geben Sie eine Zahl zwischen 5 und 10 ein: ");
    scanf("%d", &input);
    while ((c = getchar()) != '\n' && c != EOF) {
    }
  }
  printf("Die Zahl ist %d", input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x5,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     115f <main+0x2f>
cmpl   $0xa,-0xc(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    116f <main+0x3f>
jmp    11d8 <main+0xa8>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xe(%rbp)
je     11be <main+0x8e>
movsbl -0x5(%rbp),%eax
mov    0x2e35(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
test   $0x1,%al
jne    11ce <main+0x9e>
jmp    11d3 <main+0xa3>
jmp    118d <main+0x5d>
jmp    1146 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0xeb9(%rip),%r14
lea    0xeeb(%rip),%r15
lea    0x4(%rsp),%r12
mov    0x2e8e(%rip),%rbx
jmp    116c <main+0x3c>
nopl   0x0(%rax)
mov    0x4(%rsp),%esi
lea    -0xb(%rsi),%eax
cmp    $0xfffffff9,%eax
ja     11a1 <main+0x71>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     1160 <main+0x30>
cmp    (%rbx),%al
jne    1190 <main+0x60>
jmp    1160 <main+0x30>
lea    0xe84(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Geben Sie eine Zahl zwischen 5 und 10 ein: \00"
@.str.1 = [3 x i8] c"%d\00"
@EOF = global i8 0
@.str.2 = [16 x i8] c"Die Zahl ist %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %3
br label %4
4: ; preds = %28, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 10
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ true, %4 ], [ %9, %7 ]
br i1 %11, label %12, label %29
12: ; preds = %10
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %15
15: ; preds = %27, %12
%16 = call signext i8 (...) @getchar()
store i8 %16, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 10
br i1 %18, label %19, label %25
19: ; preds = %15
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = load i8, i8* @EOF
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %21, %23
br label %25
25: ; preds = %19, %15
%26 = phi i1 [ false, %15 ], [ %24, %19 ]
br i1 %26, label %27, label %28
27: ; preds = %25
br label %15
28: ; preds = %25
br label %4
29: ; preds = %10
%30 = load i32, i32* %3
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"Geben Sie eine Zahl zwischen 5 und 10 ein: \00"
@.str.1 = [3 x i8] c"%d\00"
@EOF = global i8 0
@.str.2 = [16 x i8] c"Die Zahl ist %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -1, i32* %1
br label %7
3: ; preds = %10
%4 = load i32, i32* %1
%5 = add i32 %4, -11
%6 = icmp ult i32 %5, -6
br i1 %6, label %7, label %16
7: ; preds = %0, %3
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
br label %10
10: ; preds = %10, %7
%11 = call signext i8 (...) @getchar()
%12 = icmp ne i8 %11, 10
%13 = load i8, i8* @EOF
%14 = icmp ne i8 %11, %13
%15 = select i1 %12, i1 %14, i1 false
br i1 %15, label %10, label %3
16: ; preds = %3
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}