#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 GetInt();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Give me an int between 1 and 10: ");
  int n = GetInt();
  switch (n) {
  case 1:
  case 2:
  case 3:
    printf("You picked a small int!\n");
    break;
  case 4:
  case 5:
  case 6:
  case 7:
    printf("You picked a medium int!\n");
    break;
  case 8:
  case 9:
  case 10:
    printf("You picked a large int!\n");
  default:
    printf("You picked an invalid int!\n");
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <GetInt@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x3,%eax
jb     1184 <main+0x64>
jmp    115c <main+0x3c>
mov    -0xc(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x4,%eax
jb     1195 <main+0x75>
jmp    1170 <main+0x50>
mov    -0xc(%rbp),%eax
add    $0xfffffff8,%eax
sub    $0x3,%eax
jb     11a6 <main+0x86>
jmp    11b2 <main+0x92>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    11be <main+0x9e>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    11be <main+0x9e>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <GetInt@plt>
cmp    $0xa,%eax
ja     1173 <main+0x43>
mov    $0xf0,%ecx
bt     %eax,%ecx
jb     117c <main+0x4c>
mov    $0xe,%ecx
bt     %eax,%ecx
jb     1185 <main+0x55>
mov    $0x700,%ecx
bt     %eax,%ecx
jae    1173 <main+0x43>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
jmp    118c <main+0x5c>
lea    0xed2(%rip),%rdi
jmp    118c <main+0x5c>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Give me an int between 1 and 10: \00"
@.str.1 = [25 x i8] c"You picked a small int!\0A\00"
@.str.2 = [26 x i8] c"You picked a medium int!\0A\00"
@.str.3 = [25 x i8] c"You picked a large int!\0A\00"
@.str.4 = [28 x i8] c"You picked an invalid int!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @GetInt()
store i32 %4, i32* %2
%5 = load i32, i32* %2
switch i32 %5, label %12 [
i32 1, label %6
i32 2, label %6
i32 3, label %6
i32 4, label %8
i32 5, label %8
i32 6, label %8
i32 7, label %8
i32 8, label %10
i32 9, label %10
i32 10, label %10
]
6: ; preds = %0, %0, %0
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %14
8: ; preds = %0, %0, %0, %0
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %14
10: ; preds = %0, %0, %0
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %0, %10
%13 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %14
14: ; preds = %12, %8, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [34 x i8] c"Give me an int between 1 and 10: \00"
@str = [24 x i8] c"You picked a large int!\00"
@str.5 = [27 x i8] c"You picked an invalid int!\00"
@str.6 = [25 x i8] c"You picked a medium int!\00"
@str.7 = [24 x i8] c"You picked a small int!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @GetInt()
switch i32 %2, label %6 [
i32 1, label %7
i32 2, label %7
i32 3, label %7
i32 4, label %3
i32 5, label %3
i32 6, label %3
i32 7, label %3
i32 8, label %4
i32 9, label %4
i32 10, label %4
]
3: ; preds = %0, %0, %0, %0
br label %7
4: ; preds = %0, %0, %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %0, %4
br label %7
7: ; preds = %0, %0, %0, %6, %3
%8 = phi i8* [ getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0), %3 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @str.7, i64 0, i64 0), %0 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @str.7, i64 0, i64 0), %0 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @str.7, i64 0, i64 0), %0 ]
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}