#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int scanf(char *, int *);
int /*<<< orphan*/ stderr;
void checkInput(int *num) {
  if ((scanf("%d", num)) != 1) {
    if (*num > 100) {
      fprintf(stderr, "Over 100!");
      exit(EXIT_FAILURE);
    }
    fprintf(stderr, "Wrong input values!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     11a8 <checkInput+0x78>
mov    -0x8(%rbp),%rax
cmpl   $0x64,(%rax)
jle    1185 <checkInput+0x55>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xe78(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkInput>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    114a <checkInput+0x1a>
pop    %rbx
ret
cmpl   $0x65,(%rbx)
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
jl     1161 <checkInput+0x31>
lea    0xea4(%rip),%rsi
jmp    1168 <checkInput+0x38>
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.1 = [10 x i8] c"Over 100!\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [20 x i8] c"Wrong input values!\00"
define void @checkInput(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %20
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, 100
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %6
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.1 = [10 x i8] c"Over 100!\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [20 x i8] c"Wrong input values!\00"
define void @checkInput(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %16, label %4
4: ; preds = %1
%5 = load i32, i32* %0
%6 = icmp sgt i32 %5, 100
%7 = load i32, i32* @stderr
br i1 %6, label %8, label %12
8: ; preds = %4
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %4
%13 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = tail call i32 @exit(i32 %14)
unreachable
16: ; preds = %1
ret void
}