#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  char *set10[10] = {"zero", "one", "two",   "three", "four",
                     "five", "six", "seven", "eight", "nine"};
  char *set20[10] = {"ten",     "eleven",  "twelve",    "thirteen", "fourteen",
                     "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"};
  char *set30[10] = {"thirty",  "forty",  "fifty", "sixty",
                     "seventy", "eighty", "ninety"};
  int i = 0;
  int ones = 0;
  int tens = 0;
  scanf("%d", &i);
  if (i < 10) {
    printf("%s\n", set10[i]);
  } else if (i < 20) {
    i -= 10;
    printf("%s\n", set20[i]);
  } else {
    ones = i % 10;
    tens = i / 10;
    if (i == 100) {
      printf("one hundred\n");
    } else {
      tens -= 3;
      printf("%s ", set30[tens]);
      if (ones) {
        printf("%s\n", set10[ones]);
      } else {
        puts("");
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0x2bd3(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    0x2c0b(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0x100(%rbp),%rdi
lea    0x2c43(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x104(%rbp)
movl   $0x0,-0x108(%rbp)
movl   $0x0,-0x10c(%rbp)
lea    0xef5(%rip),%rdi
lea    -0x104(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0xa,-0x104(%rbp)
jge    11f4 <main+0xb4>
movslq -0x104(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rsi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12ed <main+0x1ad>
cmpl   $0x14,-0x104(%rbp)
jge    1232 <main+0xf2>
mov    -0x104(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x104(%rbp)
movslq -0x104(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rsi
ff
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12e8 <main+0x1a8>
mov    -0x104(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x108(%rbp)
mov    -0x104(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10c(%rbp)
cmpl   $0x64,-0x104(%rbp)
jne    127a <main+0x13a>
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12e3 <main+0x1a3>
mov    -0x10c(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x10c(%rbp)
movslq -0x10c(%rbp),%rax
mov    -0x100(%rbp,%rax,8),%rsi
ff
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x108(%rbp)
je     12d2 <main+0x192>
movslq -0x108(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rsi
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12de <main+0x19e>
lea    0xdeb(%rip),%rdi
call   1030 <puts@plt>
jmp    12e3 <main+0x1a3>
jmp    12e8 <main+0x1a8>
jmp    12ed <main+0x1ad>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xf5d(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
movslq 0xc(%rsp),%rbx
cmp    $0x9,%rbx
jg     117e <main+0x3e>
lea    0x2c10(%rip),%rax
mov    (%rax,%rbx,8),%rdi
call   1040 <puts@plt>
jmp    1207 <main+0xc7>
cmp    $0x13,%ebx
ja     119f <main+0x5f>
add    $0xfffffff6,%ebx
mov    %ebx,0xc(%rsp)
lea    0xf33(%rip),%rax
movslq (%rax,%rbx,4),%rdi
add    %rax,%rdi
call   1040 <puts@plt>
jmp    1207 <main+0xc7>
cmp    $0x64,%ebx
jne    11b2 <main+0x72>
lea    0xf0d(%rip),%rdi
call   1040 <puts@plt>
jmp    1207 <main+0xc7>
mov    %ebx,%eax
mov    $0xcccccccd,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
lea    (%rcx,%rcx,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
mov    %ecx,%eax
lea    0x2bfe(%rip),%rcx
mov    -0x18(%rcx,%rax,8),%rsi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
je     11fd <main+0xbd>
mov    %ebx,%eax
lea    0x2b8e(%rip),%rcx
mov    (%rcx,%rax,8),%rdi
call   1040 <puts@plt>
jmp    1207 <main+0xc7>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"zero\00"
@.str.1 = [4 x i8] c"one\00"
@.str.2 = [4 x i8] c"two\00"
@.str.3 = [6 x i8] c"three\00"
@.str.4 = [5 x i8] c"four\00"
@.str.5 = [5 x i8] c"five\00"
@.str.6 = [4 x i8] c"six\00"
@.str.7 = [6 x i8] c"seven\00"
@.str.8 = [6 x i8] c"eight\00"
@.str.9 = [5 x i8] c"nine\00"
@__const.main.set10 = [10 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0)]
@.str.10 = [4 x i8] c"ten\00"
@.str.11 = [7 x i8] c"eleven\00"
@.str.12 = [7 x i8] c"twelve\00"
@.str.13 = [9 x i8] c"thirteen\00"
@.str.14 = [9 x i8] c"fourteen\00"
@.str.15 = [8 x i8] c"fifteen\00"
@.str.16 = [8 x i8] c"sixteen\00"
@.str.17 = [10 x i8] c"seventeen\00"
@.str.18 = [9 x i8] c"eighteen\00"
@.str.19 = [9 x i8] c"nineteen\00"
@__const.main.set20 = [10 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i32 0, i32 0)]
@.str.20 = [7 x i8] c"thirty\00"
@.str.21 = [6 x i8] c"forty\00"
@.str.22 = [6 x i8] c"fifty\00"
@.str.23 = [6 x i8] c"sixty\00"
@.str.24 = [8 x i8] c"seventy\00"
@.str.25 = [7 x i8] c"eighty\00"
@.str.26 = [7 x i8] c"ninety\00"
@__const.main.set30 = [10 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.26, i32 0, i32 0), i8* null, i8* null, i8* null]
@.str.27 = [3 x i8] c"%d\00"
@.str.28 = [4 x i8] c"%s\0A\00"
@.str.29 = [13 x i8] c"one hundred\0A\00"
@.str.30 = [4 x i8] c"%s \00"
@.str.31 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8*]
%3 = alloca [10 x i8*]
%4 = alloca [10 x i8*]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [10 x i8*]* %2 to i8*
%9 = bitcast [10 x i8*]* %3 to i8*
%10 = bitcast [10 x i8*]* %4 to i8*
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0), i32* %5)
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 10
br i1 %13, label %14, label %20
14: ; preds = %0
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 %16
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i64 0, i64 0), i8* %18)
br label %61
20: ; preds = %0
%21 = load i32, i32* %5
%22 = icmp slt i32 %21, 20
br i1 %22, label %23, label %31
23: ; preds = %20
%24 = load i32, i32* %5
%25 = sub nsw i32 %24, 10
store i32 %25, i32* %5
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 %27
%29 = load i8*, i8** %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i64 0, i64 0), i8* %29)
br label %60
31: ; preds = %20
%32 = load i32, i32* %5
%33 = srem i32 %32, 10
store i32 %33, i32* %6
%34 = load i32, i32* %5
%35 = sdiv i32 %34, 10
store i32 %35, i32* %7
%36 = load i32, i32* %5
%37 = icmp eq i32 %36, 100
br i1 %37, label %38, label %40
38: ; preds = %31
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.29, i64 0, i64 0))
br label %59
40: ; preds = %31
%41 = load i32, i32* %7
%42 = sub nsw i32 %41, 3
store i32 %42, i32* %7
%43 = load i32, i32* %7
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [10 x i8*], [10 x i8*]* %4, i64 0, i64 %44
%46 = load i8*, i8** %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i64 0, i64 0), i8* %46)
%48 = load i32, i32* %6
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %56
50: ; preds = %40
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 %52
%54 = load i8*, i8** %53
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i64 0, i64 0), i8* %54)
br label %58
56: ; preds = %40
%57 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.31, i64 0, i64 0))
br label %58
58: ; preds = %56, %50
br label %59
59: ; preds = %58, %38
br label %60
60: ; preds = %59, %23
br label %61
61: ; preds = %60, %14
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"zero\00"
@.str.1 = [4 x i8] c"one\00"
@.str.2 = [4 x i8] c"two\00"
@.str.3 = [6 x i8] c"three\00"
@.str.4 = [5 x i8] c"four\00"
@.str.5 = [5 x i8] c"five\00"
@.str.6 = [4 x i8] c"six\00"
@.str.7 = [6 x i8] c"seven\00"
@.str.8 = [6 x i8] c"eight\00"
@.str.9 = [5 x i8] c"nine\00"
@__const.main.set10 = [10 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0)]
@.str.10 = [4 x i8] c"ten\00"
@.str.11 = [7 x i8] c"eleven\00"
@.str.12 = [7 x i8] c"twelve\00"
@.str.13 = [9 x i8] c"thirteen\00"
@.str.14 = [9 x i8] c"fourteen\00"
@.str.15 = [8 x i8] c"fifteen\00"
@.str.16 = [8 x i8] c"sixteen\00"
@.str.17 = [10 x i8] c"seventeen\00"
@.str.18 = [9 x i8] c"eighteen\00"
@.str.19 = [9 x i8] c"nineteen\00"
@reltable.main = [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.11 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.12 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.13 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.14 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.15 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.16 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.17 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.18 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.19 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32)]
@.str.20 = [7 x i8] c"thirty\00"
@.str.21 = [6 x i8] c"forty\00"
@.str.22 = [6 x i8] c"fifty\00"
@.str.23 = [6 x i8] c"sixty\00"
@.str.24 = [8 x i8] c"seventy\00"
@.str.25 = [7 x i8] c"eighty\00"
@.str.26 = [7 x i8] c"ninety\00"
@__const.main.set30 = [10 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.26, i32 0, i32 0), i8* null, i8* null, i8* null]
@.str.27 = [3 x i8] c"%d\00"
@.str.30 = [4 x i8] c"%s \00"
@str = [12 x i8] c"one hundred\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds [10 x i8*], [10 x i8*]* @__const.main.set10, i64 0, i64 %7
%9 = load i8*, i8** %8
%10 = call i32 @puts(i8* dereferenceable(1) %9)
br label %39
11: ; preds = %0
%12 = icmp ult i32 %4, 20
br i1 %12, label %13, label %19
13: ; preds = %11
%14 = add nsw i32 %4, -10
store i32 %14, i32* %1
%15 = zext i32 %14 to i64
%16 = shl i64 %15, 2
%17 = call i8* @llvm.load.relative.i64(i8* bitcast ([10 x i32]* @reltable.main to i8*), i64 %16)
%18 = call i32 @puts(i8* dereferenceable(1) %17)
br label %39
19: ; preds = %11
%20 = urem i32 %4, 10
%21 = udiv i32 %4, 10
%22 = icmp eq i32 %4, 100
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %39
25: ; preds = %19
%26 = add nsw i32 %21, -3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x i8*], [10 x i8*]* @__const.main.set30, i64 0, i64 %27
%29 = load i8*, i8** %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i64 0, i64 0), i8* %29)
%31 = icmp eq i32 %20, 0
br i1 %31, label %37, label %32
32: ; preds = %25
%33 = zext i32 %20 to i64
%34 = getelementptr inbounds [10 x i8*], [10 x i8*]* @__const.main.set10, i64 0, i64 %33
%35 = load i8*, i8** %34
%36 = call i32 @puts(i8* dereferenceable(1) %35)
br label %39
37: ; preds = %25
%38 = call i32 @putchar(i32 10)
br label %39
39: ; preds = %13, %32, %37, %23, %6
ret i32 0
}