#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int atgc, char **argv) {
  int num = 0;
  printf("enter number: ");
  scanf("%d", &num);
  printf("Number: %d\n", num);
  switch (num) {
  case 10:
    printf("you have entered ten\n");
    break;
  case 11:
    printf("you have entered eleven\n");
    break;
  case 12:
    printf("you have entered twelve\n");
    break;
  default:
    printf("default value\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)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x19(%rbp)
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x19(%rbp),%al
mov    -0x14(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0xa,%eax
je     11a6 <main+0x86>
jmp    1184 <main+0x64>
mov    -0x18(%rbp),%eax
sub    $0xb,%eax
je     11b9 <main+0x99>
jmp    1195 <main+0x75>
mov    -0x18(%rbp),%eax
sub    $0xc,%eax
je     11cc <main+0xac>
jmp    11df <main+0xbf>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ed <main+0xcd>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ed <main+0xcd>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ed <main+0xcd>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
add    $0xfffffff6,%eax
cmp    $0x2,%eax
ja     1188 <main+0x58>
cltq
lea    0xef5(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    118f <main+0x5f>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"enter number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"Number: %d\0A\00"
@.str.3 = [22 x i8] c"you have entered ten\0A\00"
@.str.4 = [25 x i8] c"you have entered eleven\0A\00"
@.str.5 = [25 x i8] c"you have entered twelve\0A\00"
@.str.6 = [15 x i8] c"default value\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
store i32 0, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %6
switch i32 %11, label %18 [
i32 10, label %12
i32 11, label %14
i32 12, label %16
]
12: ; preds = %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %20
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %20
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
br label %20
18: ; preds = %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %20
20: ; preds = %18, %16, %14, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"enter number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"Number: %d\0A\00"
@str = [24 x i8] c"you have entered twelve\00"
@str.7 = [24 x i8] c"you have entered eleven\00"
@str.8 = [21 x i8] c"you have entered ten\00"
@str.9 = [14 x i8] c"default value\00"
@reltable.main = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @str.8 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @str.7 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @str to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32)]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = add i32 %9, -10
%11 = icmp ult i32 %10, 3
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = sext i32 %10 to i64
%14 = shl i64 %13, 2
%15 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.main to i8*), i64 %14)
br label %16
16: ; preds = %2, %12
%17 = phi i8* [ %15, %12 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.9, i64 0, i64 0), %2 ]
%18 = call i32 @puts(i8* dereferenceable(1) %17)
ret i32 0
}