#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 *);
int main(void) {
  int d1, d2;
  printf("Enter a two-digit number: ");
  scanf("%1d%1d", &d1, &d2);
  printf("You entered the number ");
  if (d1 == 1) {
    switch (d2) {
    case 0:
      printf("ten");
      break;
    case 1:
      printf("eleven");
      break;
    case 2:
      printf("twelve");
      break;
    case 3:
      printf("thirteen");
      break;
    case 4:
      printf("fourteen");
      break;
    case 5:
      printf("fiveteen");
      break;
    case 6:
      printf("sixteen");
      break;
    case 7:
      printf("seventeen");
      break;
    case 8:
      printf("eightteen");
      break;
    case 9:
      printf("nineteen");
      break;
    }
  } else {
    switch (d1) {
    case 2:
      printf("twenty");
      break;
    case 3:
      printf("thirty");
      break;
    case 4:
      printf("fourty");
      break;
    case 5:
      printf("fifty");
      break;
    case 6:
      printf("sixty");
      break;
    case 7:
      printf("seventy");
      break;
    case 8:
      printf("eighty");
      break;
    case 9:
      printf("ninety");
      break;
    }
    switch (d2) {
    case 1:
      printf("-one");
      break;
    case 2:
      printf("-two");
      break;
    case 3:
      printf("-three");
      break;
    case 4:
      printf("-four");
      break;
    case 5:
      printf("-five");
      break;
    case 6:
      printf("-six");
      break;
    case 7:
      printf("-seven");
      break;
    case 8:
      printf("-eight");
      break;
    case 9:
      printf("-nine");
      break;
    }
  }
  printf(".\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf36(%rip),%rdi
call   1030 <printf@plt>
lea    0xf45(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
lea    0xf38(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1234 <main+0x114>
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x9,%rax
ja     122f <main+0x10f>
mov    -0x18(%rbp),%rax
lea    0xec3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf15(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xf08(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    13a2 <main+0x282>
mov    -0x8(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x7,%eax
ja     12e0 <main+0x1c0>
mov    -0x20(%rbp),%rax
lea    0xdac(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
jmp    12e0 <main+0x1c0>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    12e0 <main+0x1c0>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
jmp    12e0 <main+0x1c0>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    12e0 <main+0x1c0>
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
jmp    12e0 <main+0x1c0>
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
jmp    12e0 <main+0x1c0>
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
jmp    12e0 <main+0x1c0>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x8,%eax
ja     139d <main+0x27d>
mov    -0x28(%rbp),%rax
lea    0xd20(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe1f(%rip),%rdi
call   1030 <printf@plt>
jmp    139d <main+0x27d>
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
jmp    139d <main+0x27d>
lea    0xe07(%rip),%rdi
call   1030 <printf@plt>
jmp    139d <main+0x27d>
lea    0xdfd(%rip),%rdi
call   1030 <printf@plt>
jmp    139d <main+0x27d>
lea    0xdf2(%rip),%rdi
call   1030 <printf@plt>
jmp    139d <main+0x27d>
lea    0xde7(%rip),%rdi
call   1030 <printf@plt>
jmp    139d <main+0x27d>
lea    0xddb(%rip),%rdi
call   1030 <printf@plt>
jmp    139d <main+0x27d>
lea    0xdd1(%rip),%rdi
call   1030 <printf@plt>
jmp    139d <main+0x27d>
lea    0xdc7(%rip),%rdi
call   1030 <printf@plt>
jmp    13a2 <main+0x282>
lea    0xdbc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
call   1040 <printf@plt>
lea    0xefb(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
lea    0xeee(%rip),%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x8,%eax
ja     11d5 <main+0xa5>
lea    0xf40(%rip),%rdi
lea    0xe89(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movslq (%rsp),%rax
cmp    $0xa,%rax
jae    11f5 <main+0xc5>
lea    0x2bf7(%rip),%rcx
jmp    11e9 <main+0xb9>
lea    0xf1d(%rip),%rdi
jmp    11d0 <main+0xa0>
lea    0xf1b(%rip),%rdi
jmp    11d0 <main+0xa0>
lea    0xf19(%rip),%rdi
jmp    11d0 <main+0xa0>
lea    0xf24(%rip),%rdi
jmp    11d0 <main+0xa0>
lea    0xf0d(%rip),%rdi
jmp    11d0 <main+0xa0>
lea    0xf0a(%rip),%rdi
jmp    11d0 <main+0xa0>
lea    0xf10(%rip),%rdi
call   1040 <printf@plt>
mov    (%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x9,%eax
jae    11f5 <main+0xc5>
cltq
lea    0x2bef(%rip),%rcx
lea    (%rcx,%rax,8),%rax
mov    (%rax),%rdi
call   1040 <printf@plt>
lea    0xf21(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter a two-digit number: \00"
@.str.1 = [7 x i8] c"%1d%1d\00"
@.str.2 = [24 x i8] c"You entered the number \00"
@.str.3 = [4 x i8] c"ten\00"
@.str.4 = [7 x i8] c"eleven\00"
@.str.5 = [7 x i8] c"twelve\00"
@.str.6 = [9 x i8] c"thirteen\00"
@.str.7 = [9 x i8] c"fourteen\00"
@.str.8 = [9 x i8] c"fiveteen\00"
@.str.9 = [8 x i8] c"sixteen\00"
@.str.10 = [10 x i8] c"seventeen\00"
@.str.11 = [10 x i8] c"eightteen\00"
@.str.12 = [9 x i8] c"nineteen\00"
@.str.13 = [7 x i8] c"twenty\00"
@.str.14 = [7 x i8] c"thirty\00"
@.str.15 = [7 x i8] c"fourty\00"
@.str.16 = [6 x i8] c"fifty\00"
@.str.17 = [6 x i8] c"sixty\00"
@.str.18 = [8 x i8] c"seventy\00"
@.str.19 = [7 x i8] c"eighty\00"
@.str.20 = [7 x i8] c"ninety\00"
@.str.21 = [5 x i8] c"-one\00"
@.str.22 = [5 x i8] c"-two\00"
@.str.23 = [7 x i8] c"-three\00"
@.str.24 = [6 x i8] c"-four\00"
@.str.25 = [6 x i8] c"-five\00"
@.str.26 = [5 x i8] c"-six\00"
@.str.27 = [7 x i8] c"-seven\00"
@.str.28 = [7 x i8] c"-eight\00"
@.str.29 = [6 x i8] c"-nine\00"
@.str.30 = [3 x i8] c".\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %32
9: ; preds = %0
%10 = load i32, i32* %3
switch i32 %10, label %31 [
i32 0, label %11
i32 1, label %13
i32 2, label %15
i32 3, label %17
i32 4, label %19
i32 5, label %21
i32 6, label %23
i32 7, label %25
i32 8, label %27
i32 9, label %29
]
11: ; preds = %9
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %31
13: ; preds = %9
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %31
15: ; preds = %9
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %31
17: ; preds = %9
%18 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %31
19: ; preds = %9
%20 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %31
21: ; preds = %9
%22 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %31
23: ; preds = %9
%24 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %31
25: ; preds = %9
%26 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
br label %31
27: ; preds = %9
%28 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
br label %31
29: ; preds = %9
%30 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
br label %31
31: ; preds = %9, %29, %27, %25, %23, %21, %19, %17, %15, %13, %11
br label %71
32: ; preds = %0
%33 = load i32, i32* %2
switch i32 %33, label %50 [
i32 2, label %34
i32 3, label %36
i32 4, label %38
i32 5, label %40
i32 6, label %42
i32 7, label %44
i32 8, label %46
i32 9, label %48
]
34: ; preds = %32
%35 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
br label %50
36: ; preds = %32
%37 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
br label %50
38: ; preds = %32
%39 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
br label %50
40: ; preds = %32
%41 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
br label %50
42: ; preds = %32
%43 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
br label %50
44: ; preds = %32
%45 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0))
br label %50
46: ; preds = %32
%47 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0))
br label %50
48: ; preds = %32
%49 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0))
br label %50
50: ; preds = %32, %48, %46, %44, %42, %40, %38, %36, %34
%51 = load i32, i32* %3
switch i32 %51, label %70 [
i32 1, label %52
i32 2, label %54
i32 3, label %56
i32 4, label %58
i32 5, label %60
i32 6, label %62
i32 7, label %64
i32 8, label %66
i32 9, label %68
]
52: ; preds = %50
%53 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
br label %70
54: ; preds = %50
%55 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0))
br label %70
56: ; preds = %50
%57 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0))
br label %70
58: ; preds = %50
%59 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0))
br label %70
60: ; preds = %50
%61 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0))
br label %70
62: ; preds = %50
%63 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i64 0, i64 0))
br label %70
64: ; preds = %50
%65 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0))
br label %70
66: ; preds = %50
%67 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.28, i64 0, i64 0))
br label %70
68: ; preds = %50
%69 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.29, i64 0, i64 0))
br label %70
70: ; preds = %50, %68, %66, %64, %62, %60, %58, %56, %54, %52
br label %71
71: ; preds = %70, %31
%72 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter a two-digit number: \00"
@.str.1 = [7 x i8] c"%1d%1d\00"
@.str.2 = [24 x i8] c"You entered the number \00"
@.str.3 = [4 x i8] c"ten\00"
@.str.4 = [7 x i8] c"eleven\00"
@.str.5 = [7 x i8] c"twelve\00"
@.str.6 = [9 x i8] c"thirteen\00"
@.str.7 = [9 x i8] c"fourteen\00"
@.str.8 = [9 x i8] c"fiveteen\00"
@.str.9 = [8 x i8] c"sixteen\00"
@.str.10 = [10 x i8] c"seventeen\00"
@.str.11 = [10 x i8] c"eightteen\00"
@.str.12 = [9 x i8] c"nineteen\00"
@.str.13 = [7 x i8] c"twenty\00"
@.str.14 = [7 x i8] c"thirty\00"
@.str.15 = [7 x i8] c"fourty\00"
@.str.16 = [6 x i8] c"fifty\00"
@.str.17 = [6 x i8] c"sixty\00"
@.str.18 = [8 x i8] c"seventy\00"
@.str.19 = [7 x i8] c"eighty\00"
@.str.20 = [7 x i8] c"ninety\00"
@.str.21 = [5 x i8] c"-one\00"
@.str.22 = [5 x i8] c"-two\00"
@.str.23 = [7 x i8] c"-three\00"
@.str.24 = [6 x i8] c"-four\00"
@.str.25 = [6 x i8] c"-five\00"
@.str.26 = [5 x i8] c"-six\00"
@.str.27 = [7 x i8] c"-seven\00"
@.str.28 = [7 x i8] c"-eight\00"
@.str.29 = [6 x i8] c"-nine\00"
@str = [2 x i8] c".\00"
@switch.table.main = [10 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0)]
@switch.table.main.31 = [9 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.28, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.29, i64 0, i64 0)]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* %1
switch i32 %8, label %22 [
i32 1, label %9
i32 2, label %19
i32 3, label %12
i32 4, label %13
i32 5, label %14
i32 6, label %15
i32 7, label %16
i32 8, label %17
i32 9, label %18
]
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp ult i32 %10, 10
br i1 %11, label %26, label %36
12: ; preds = %0
br label %19
13: ; preds = %0
br label %19
14: ; preds = %0
br label %19
15: ; preds = %0
br label %19
16: ; preds = %0
br label %19
17: ; preds = %0
br label %19
18: ; preds = %0
br label %19
19: ; preds = %0, %12, %13, %14, %15, %16, %17, %18
%20 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), %18 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), %17 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0), %16 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0), %15 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), %14 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), %13 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), %12 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), %0 ]
%21 = call i32 @printf(i8* dereferenceable(1) %20)
br label %22
22: ; preds = %19, %0
%23 = load i32, i32* %2
%24 = add i32 %23, -1
%25 = icmp ult i32 %24, 9
br i1 %25, label %29, label %36
26: ; preds = %9
%27 = sext i32 %10 to i64
%28 = getelementptr inbounds [10 x i8*], [10 x i8*]* @switch.table.main, i64 0, i64 %27
br label %32
29: ; preds = %22
%30 = sext i32 %24 to i64
%31 = getelementptr inbounds [9 x i8*], [9 x i8*]* @switch.table.main.31, i64 0, i64 %30
br label %32
32: ; preds = %29, %26
%33 = phi i8** [ %31, %29 ], [ %28, %26 ]
%34 = load i8*, i8** %33
%35 = call i32 @printf(i8* dereferenceable(1) %34)
br label %36
36: ; preds = %22, %9, %32
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}