#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, int, int);
int sscanf(char *, char *, int *, char *);
int liesInt(int a, int b) {
  char ein[10];
  int wert, ok;
  char z;
  do {
    gets(ein);
    ok = sscanf(ein, "%d%c", &wert, &z);
    if (ok != 1 || wert < b || wert > a) {
      printf("\nWrong input!  The number must be bigger than %d and lower than "
             "%d\n",
             b, a);
    }
  } while (ok != 1 || wert < b || wert > a);
  return wert;
}


x86 assembly (clang, -O0):
<liesInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x12(%rbp),%rdi
lea    0xeae(%rip),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1d(%rbp),%rcx
call   1050 <sscanf@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    1184 <liesInt+0x54>
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1184 <liesInt+0x54>
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1196 <liesInt+0x66>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    119b <liesInt+0x6b>
mov    $0x1,%al
cmpl   $0x1,-0x1c(%rbp)
mov    %al,-0x1e(%rbp)
jne    11c7 <liesInt+0x97>
mov    -0x18(%rbp),%ecx
mov    $0x1,%al
cmp    -0x8(%rbp),%ecx
mov    %al,-0x1e(%rbp)
jl     11c7 <liesInt+0x97>
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
setg   %al
mov    %al,-0x1e(%rbp)
mov    -0x1e(%rbp),%al
test   $0x1,%al
jne    113e <liesInt+0xe>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<liesInt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xe(%rsp),%r14
lea    0xeb2(%rip),%r15
lea    0x8(%rsp),%r12
lea    0x7(%rsp),%r13
jmp    1170 <liesInt+0x40>
nopw   0x0(%rax,%rax,1)
lea    0xe9e(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
mov    %r14,%rdi
call   1040 <gets@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1160 <liesInt+0x30>
mov    0x8(%rsp),%eax
cmp    %ebx,%eax
jl     11b0 <liesInt+0x80>
cmp    %ebp,%eax
jg     11b0 <liesInt+0x80>
cmp    %ebx,%eax
jl     1170 <liesInt+0x40>
cmp    %ebp,%eax
jg     1170 <liesInt+0x40>
jmp    11ca <liesInt+0x9a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xe4e(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
mov    0x8(%rsp),%eax
cmp    %ebx,%eax
jge    119e <liesInt+0x6e>
jmp    1170 <liesInt+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%c\00"
@.str.1 = [68 x i8] c"\0AWrong input! The number must be bigger than %d and lower than %d\0A\00"
define i32 @liesInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [10 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %9
9: ; preds = %40, %2
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%11 = call i32 @gets(i8* %10)
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%13 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %6, i8* %8)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 1
br i1 %15, label %24, label %16
16: ; preds = %9
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %24, label %20
20: ; preds = %16
%21 = load i32, i32* %6
%22 = load i32, i32* %3
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %28
24: ; preds = %20, %16, %9
%25 = load i32, i32* %4
%26 = load i32, i32* %3
%27 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0), i32 %25, i32 %26)
br label %28
28: ; preds = %24, %20
br label %29
29: ; preds = %28
%30 = load i32, i32* %7
%31 = icmp ne i32 %30, 1
br i1 %31, label %40, label %32
32: ; preds = %29
%33 = load i32, i32* %6
%34 = load i32, i32* %4
%35 = icmp slt i32 %33, %34
br i1 %35, label %40, label %36
36: ; preds = %32
%37 = load i32, i32* %6
%38 = load i32, i32* %3
%39 = icmp sgt i32 %37, %38
br label %40
40: ; preds = %36, %32, %29
%41 = phi i1 [ true, %32 ], [ true, %29 ], [ %39, %36 ]
br i1 %41, label %9, label %42
42: ; preds = %40
%43 = load i32, i32* %6
ret i32 %43
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%c\00"
@.str.1 = [68 x i8] c"\0AWrong input! The number must be bigger than %d and lower than %d\0A\00"
define i32 @liesInt(i32 %0, i32 %1) {
%3 = alloca [10 x i8]
%4 = alloca i32
%5 = alloca i8
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = bitcast i32* %4 to i8*
br label %8
8: ; preds = %27, %2
%9 = call i32 @gets(i8* %6)
%10 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %4, i8* %5)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, %1
%15 = icmp sgt i32 %13, %0
%16 = or i1 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %12
%18 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %0)
%19 = load i32, i32* %4
br label %22
20: ; preds = %8
%21 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %0)
br label %27
22: ; preds = %12, %17
%23 = phi i32 [ %13, %12 ], [ %19, %17 ]
%24 = icmp slt i32 %23, %1
%25 = icmp sgt i32 %23, %0
%26 = or i1 %24, %25
br i1 %26, label %27, label %28
27: ; preds = %22, %20
br label %8
28: ; preds = %22
ret i32 %23
}