#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int n;
start:
  puts("Enter a number between 0 and 10: ");
  scanf("%d", &n);
  if (n < 0 || n > 10)
    goto start;
  else if (n == 0)
    goto location0;
  else if (n == 1)
    goto location1;
  else
    goto location2;
location0:
  puts("You entered 0.\n");
  goto end;
location1:
  puts("You entered 1.\n");
  goto end;
location2:
  puts("You entered something between 2 and 10.\n");
end:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
jl     1166 <main+0x46>
cmpl   $0xa,-0x14(%rbp)
jle    116b <main+0x4b>
jmp    1136 <main+0x16>
cmpl   $0x0,-0x14(%rbp)
jne    117a <main+0x5a>
jmp    118e <main+0x6e>
cmpl   $0x1,-0x14(%rbp)
jne    1189 <main+0x69>
jmp    119f <main+0x7f>
jmp    11b0 <main+0x90>
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
jmp    11bc <main+0x9c>
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
jmp    11bc <main+0x9c>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r14
lea    0xeeb(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0xa,%eax
ja     1140 <main+0x20>
cmp    $0x1,%eax
lea    0xecf(%rip),%rcx
lea    0xed8(%rip),%rdx
cmove  %rcx,%rdx
test   %eax,%eax
lea    0xeab(%rip),%rdi
cmovne %rdx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Enter a number between 0 and 10: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"You entered 0.\0A\00"
@.str.3 = [16 x i8] c"You entered 1.\0A\00"
@.str.4 = [41 x i8] c"You entered something between 2 and 10.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %15, %2
%8 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 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* %6)
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = load i32, i32* %6
%14 = icmp sgt i32 %13, 10
br i1 %14, label %15, label %16
15: ; preds = %12, %7
br label %7
16: ; preds = %12
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16
br label %25
20: ; preds = %16
%21 = load i32, i32* %6
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %24
23: ; preds = %20
br label %27
24: ; preds = %20
br label %29
25: ; preds = %19
%26 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %31
27: ; preds = %23
%28 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %31
29: ; preds = %24
%30 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
br label %31
31: ; preds = %29, %27, %25
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Enter a number between 0 and 10: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"You entered 0.\0A\00"
@.str.3 = [16 x i8] c"You entered 1.\0A\00"
@.str.4 = [41 x i8] c"You entered something between 2 and 10.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %5, %2
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = icmp ugt i32 %8, 10
br i1 %9, label %5, label %10
10: ; preds = %5
%11 = icmp eq i32 %8, 1
%12 = select i1 %11, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0)
%13 = icmp eq i32 %8, 0
%14 = select i1 %13, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %12
%15 = call i32 @puts(i8* dereferenceable(1) %14)
ret i32 0
}