#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);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
unsigned long strtoul(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  unsigned long n;
  if (argc != 2 || (n = strtoul(argv[1], NULL, 10)) >= 16) {
    fprintf(stderr, "%s <n=0...15>\n", argv[0]);
    exit(1);
  }
  switch (n) {
  case 0:
    printf("0");
    break;
  case 1:
    printf("1");
    break;
  case 2:
    printf("2");
    break;
  case 3:
    printf("3");
    break;
  case 4:
    printf("4");
    break;
  case 5:
    printf("5");
    break;
  case 6:
    printf("6");
    break;
  case 7:
    printf("7");
    break;
  case 8:
    printf("8");
    break;
  case 9:
    printf("9");
    break;
  case 10:
    printf("10");
    break;
  case 11:
    printf("11");
    break;
  case 12:
    printf("12");
    break;
  case 13:
    printf("13");
    break;
  case 14:
    printf("14");
    break;
  case 15:
    printf("15");
    break;
  }
  printf("\n");
}


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)
cmpl   $0x2,-0x8(%rbp)
jne    1184 <main+0x44>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x10,%rax
jb     11aa <main+0x6a>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea5(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
sub    $0xf,%rax
ja     12db <main+0x19b>
mov    -0x20(%rbp),%rax
lea    0xe39(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xe12(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xe03(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xdf4(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xde5(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xdd6(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xdc8(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xdba(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xdac(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xd9e(%rip),%rdi
call   1030 <printf@plt>
jmp    12db <main+0x19b>
lea    0xd90(%rip),%rdi
call   1030 <printf@plt>
lea    0xd6b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1258 <main+0x108>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtoul@plt>
cmp    $0x10,%rax
jae    1258 <main+0x108>
jae    124a <main+0xfa>
lea    0xe7c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x30,%edi
call   1030 <putchar@plt>
jmp    124a <main+0xfa>
mov    $0x31,%edi
call   1030 <putchar@plt>
jmp    124a <main+0xfa>
mov    $0x32,%edi
call   1030 <putchar@plt>
jmp    124a <main+0xfa>
mov    $0x33,%edi
call   1030 <putchar@plt>
jmp    124a <main+0xfa>
mov    $0x34,%edi
call   1030 <putchar@plt>
jmp    124a <main+0xfa>
mov    $0x35,%edi
call   1030 <putchar@plt>
jmp    124a <main+0xfa>
mov    $0x36,%edi
call   1030 <putchar@plt>
jmp    124a <main+0xfa>
mov    $0x37,%edi
call   1030 <putchar@plt>
jmp    124a <main+0xfa>
mov    $0x38,%edi
call   1030 <putchar@plt>
jmp    124a <main+0xfa>
mov    $0x39,%edi
call   1030 <putchar@plt>
jmp    124a <main+0xfa>
lea    0xe37(%rip),%rdi
jmp    1245 <main+0xf5>
lea    0xe31(%rip),%rdi
jmp    1245 <main+0xf5>
lea    0xe2b(%rip),%rdi
jmp    1245 <main+0xf5>
lea    0xe25(%rip),%rdi
jmp    1245 <main+0xf5>
lea    0xe1f(%rip),%rdi
jmp    1245 <main+0xf5>
lea    0xe19(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    0x2d81(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xdd5(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"%s <n=0...15>\0A\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [2 x i8] c"1\00"
@.str.3 = [2 x i8] c"2\00"
@.str.4 = [2 x i8] c"3\00"
@.str.5 = [2 x i8] c"4\00"
@.str.6 = [2 x i8] c"5\00"
@.str.7 = [2 x i8] c"6\00"
@.str.8 = [2 x i8] c"7\00"
@.str.9 = [2 x i8] c"8\00"
@.str.10 = [2 x i8] c"9\00"
@.str.11 = [3 x i8] c"10\00"
@.str.12 = [3 x i8] c"11\00"
@.str.13 = [3 x i8] c"12\00"
@.str.14 = [3 x i8] c"13\00"
@.str.15 = [3 x i8] c"14\00"
@.str.16 = [3 x i8] c"15\00"
@.str.17 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %15, label %9
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strtoul(i8* %12, i32* null, i32 10)
store i64 %13, i64* %6
%14 = icmp uge i64 %13, 16
br i1 %14, label %15, label %22
15: ; preds = %9, %2
%16 = load i32, i32* @stderr
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %9
%23 = load i64, i64* %6
switch i64 %23, label %56 [
i64 0, label %24
i64 1, label %26
i64 2, label %28
i64 3, label %30
i64 4, label %32
i64 5, label %34
i64 6, label %36
i64 7, label %38
i64 8, label %40
i64 9, label %42
i64 10, label %44
i64 11, label %46
i64 12, label %48
i64 13, label %50
i64 14, label %52
i64 15, label %54
]
24: ; preds = %22
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %56
26: ; preds = %22
%27 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %56
28: ; preds = %22
%29 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %56
30: ; preds = %22
%31 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %56
32: ; preds = %22
%33 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %56
34: ; preds = %22
%35 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %56
36: ; preds = %22
%37 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %56
38: ; preds = %22
%39 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %56
40: ; preds = %22
%41 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %56
42: ; preds = %22
%43 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %56
44: ; preds = %22
%45 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %56
46: ; preds = %22
%47 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %56
48: ; preds = %22
%49 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %56
50: ; preds = %22
%51 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
br label %56
52: ; preds = %22
%53 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
br label %56
54: ; preds = %22
%55 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
br label %56
56: ; preds = %22, %54, %52, %50, %48, %46, %44, %42, %40, %38, %36, %34, %32, %30, %28, %26, %24
%57 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
%58 = load i32, i32* %3
ret i32 %58
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"%s <n=0...15>\0A\00"
@.str.11 = [3 x i8] c"10\00"
@.str.12 = [3 x i8] c"11\00"
@.str.13 = [3 x i8] c"12\00"
@.str.14 = [3 x i8] c"13\00"
@.str.15 = [3 x i8] c"14\00"
@.str.16 = [3 x i8] c"15\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strtoul(i8* nocapture %6, i32* null, i32 10)
%8 = icmp ugt i64 %7, 15
br i1 %8, label %9, label %14
9: ; preds = %4, %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %1
%12 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %4
switch i64 %7, label %47 [
i64 0, label %15
i64 1, label %17
i64 2, label %19
i64 3, label %21
i64 4, label %23
i64 5, label %25
i64 6, label %27
i64 7, label %29
i64 8, label %31
i64 9, label %33
i64 10, label %35
i64 11, label %37
i64 12, label %39
i64 13, label %41
i64 14, label %43
i64 15, label %45
]
15: ; preds = %14
%16 = tail call i32 @putchar(i32 48)
br label %47
17: ; preds = %14
%18 = tail call i32 @putchar(i32 49)
br label %47
19: ; preds = %14
%20 = tail call i32 @putchar(i32 50)
br label %47
21: ; preds = %14
%22 = tail call i32 @putchar(i32 51)
br label %47
23: ; preds = %14
%24 = tail call i32 @putchar(i32 52)
br label %47
25: ; preds = %14
%26 = tail call i32 @putchar(i32 53)
br label %47
27: ; preds = %14
%28 = tail call i32 @putchar(i32 54)
br label %47
29: ; preds = %14
%30 = tail call i32 @putchar(i32 55)
br label %47
31: ; preds = %14
%32 = tail call i32 @putchar(i32 56)
br label %47
33: ; preds = %14
%34 = tail call i32 @putchar(i32 57)
br label %47
35: ; preds = %14
%36 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %47
37: ; preds = %14
%38 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %47
39: ; preds = %14
%40 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %47
41: ; preds = %14
%42 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
br label %47
43: ; preds = %14
%44 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
br label %47
45: ; preds = %14
%46 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
br label %47
47: ; preds = %14, %45, %43, %41, %39, %37, %35, %33, %31, %29, %27, %25, %23, %21, %19, %17, %15
%48 = tail call i32 @putchar(i32 10)
ret i32 0
}