#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(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int reply;
  while (1) {
    puts("\nEnter a value between 1 and 10, 0 to exit: ");
    scanf("%d", &reply);
    switch (reply) {
    case 0:
      exit(0);
    case 1:
    case 2:
    case 3:
    case 4:
    case 5: {
      puts("You entered 5 or below.\n");
      break;
    }
    case 6:
    case 7:
    case 8:
    case 9:
    case 10: {
      puts("You entered 6 or higher.\n");
      break;
    }
    default:
      puts("Between 1 and 10, please!\n");
    }
  }
  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    0xeb3(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     119d <main+0x6d>
jmp    1175 <main+0x45>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x5,%eax
jb     11a4 <main+0x74>
jmp    1189 <main+0x59>
mov    -0x18(%rbp),%eax
add    $0xfffffffa,%eax
sub    $0x5,%eax
jb     11b5 <main+0x85>
jmp    11c6 <main+0x96>
xor    %edi,%edi
call   1050 <exit@plt>
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
jmp    11d2 <main+0xa2>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
jmp    11d2 <main+0xa2>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%r14
lea    0xee4(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xedb(%rip),%rbx
lea    0xeed(%rip),%r13
lea    0xf00(%rip),%rbp
jmp    1175 <main+0x45>
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %rbx,%rdi
cmp    $0x5,%ecx
jb     1170 <main+0x40>
lea    -0x6(%rax),%ecx
cmp    $0x5,%ecx
jae    11a9 <main+0x79>
mov    %r13,%rdi
call   1030 <puts@plt>
jmp    1175 <main+0x45>
test   %eax,%eax
je     11b2 <main+0x82>
mov    %rbp,%rdi
jmp    1170 <main+0x40>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"\0AEnter a value between 1 and 10, 0 to exit: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"You entered 5 or below.\0A\00"
@.str.3 = [26 x i8] c"You entered 6 or higher.\0A\00"
@.str.4 = [27 x i8] c"Between 1 and 10, please!\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 = %2, %19
%8 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 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
switch i32 %10, label %17 [
i32 0, label %11
i32 1, label %13
i32 2, label %13
i32 3, label %13
i32 4, label %13
i32 5, label %13
i32 6, label %15
i32 7, label %15
i32 8, label %15
i32 9, label %15
i32 10, label %15
]
11: ; preds = %7
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %7, %7, %7, %7, %7
%14 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %19
15: ; preds = %7, %7, %7, %7, %7
%16 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %19
17: ; preds = %7
%18 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %19
19: ; preds = %17, %15, %13
br label %7
}

LLVM IR (-O2):
@.str = [45 x i8] c"\0AEnter a value between 1 and 10, 0 to exit: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"You entered 5 or below.\0A\00"
@.str.3 = [26 x i8] c"You entered 6 or higher.\0A\00"
@.str.4 = [27 x i8] c"Between 1 and 10, please!\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 = %13, %2
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 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
switch i32 %8, label %12 [
i32 0, label %9
i32 1, label %13
i32 2, label %13
i32 3, label %13
i32 4, label %13
i32 5, label %13
i32 6, label %11
i32 7, label %11
i32 8, label %11
i32 9, label %11
i32 10, label %11
]
9: ; preds = %5
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %5, %5, %5, %5, %5
br label %13
12: ; preds = %5
br label %13
13: ; preds = %5, %5, %5, %5, %5, %12, %11
%14 = phi i8* [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), %12 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), %11 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %5 ]
%15 = call i32 @puts(i8* dereferenceable(1) %14)
br label %5
}