#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 */
typedef int uint;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
char tolower(char);
char toupper(char);
void number_as_word(uint num) {
  char *ones[] = {"one", "two",   "three", "four", "five",
                  "six", "seven", "eight", "nine"};
  char *onesToUpper[] = {"One", "Two",   "Three", "Four", "Five",
                         "Six", "Seven", "Eight", "Nine"};
  char *tenToNineteen[] = {"Ten",      "Eleven",  "Twelve",  "Thirteen",
                           "Fourteen", "Fifteen", "Sixteen", "Seventeen",
                           "Eighteen", "Nineteen"};
  char *tens[] = {"twenty", "thirty",  "forty",  "fifty",
                  "sixty",  "seventy", "eighty", "ninety"};
  char *hundreds[] = {"One hundred",   "Two hundred",   "Three hundred",
                      "Four hundred",  "Five hundred",  "Six hundred",
                      "Seven hundred", "Eight hundred", "Nine hundred"};
  int hundredsDigit = num / 100;
  int tensDigit = (num / 10) % 10;
  int onesDigit = num % 10;
  if (hundredsDigit) {
    printf("%s ", hundreds[hundredsDigit - 1]);
    if (tensDigit != 0 || onesDigit != 0) {
      printf("and ");
    }
  }
  if (tensDigit) {
    if (hundredsDigit > 0 && tensDigit == 1 && onesDigit > 0) {
      char c = tolower(tenToNineteen[onesDigit][0]);
      printf("%c%s ", c, (tenToNineteen[onesDigit] + 1));
      return;
    } else if (tensDigit == 1 && onesDigit == 0) {
      printf("%s", tenToNineteen[0]);
      return;
    } else if (tensDigit == 1 && onesDigit > 0) {
      printf("%s ", tenToNineteen[onesDigit]);
      return;
    } else if (tensDigit > 1 && hundredsDigit == 0) {
      char c = toupper(tens[tensDigit - 2][0]);
      printf("%c%s ", c, (tens[tensDigit - 2] + 1));
    } else if (tensDigit > 1) {
      printf("%s ", tens[tensDigit - 2]);
    }
  }
  if (onesDigit && (hundredsDigit == 0 && tensDigit == 0)) {
    printf("%s", onesToUpper[onesDigit - 1]);
  } else if (onesDigit) {
    printf("%s", ones[onesDigit - 1]);
  }
}


x86 assembly (clang, -O0):
<number_as_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0x2b47(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
lea    -0xa0(%rbp),%rdi
lea    0x2b7f(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
lea    -0xf0(%rbp),%rdi
lea    0x2bb7(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0x130(%rbp),%rdi
lea    0x2bef(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
lea    -0x180(%rbp),%rdi
lea    0x2c17(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x184(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x188(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18c(%rbp)
cmpl   $0x0,-0x184(%rbp)
je     1259 <number_as_word+0x119>
mov    -0x184(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x180(%rbp,%rax,8),%rsi
ff
lea    0xf37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x188(%rbp)
jne    1246 <number_as_word+0x106>
cmpl   $0x0,-0x18c(%rbp)
je     1254 <number_as_word+0x114>
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1259 <number_as_word+0x119>
cmpl   $0x0,-0x188(%rbp)
je     13fa <number_as_word+0x2ba>
cmpl   $0x0,-0x184(%rbp)
jle    12d7 <number_as_word+0x197>
cmpl   $0x1,-0x188(%rbp)
jne    12d7 <number_as_word+0x197>
cmpl   $0x0,-0x18c(%rbp)
jle    12d7 <number_as_word+0x197>
movslq -0x18c(%rbp),%rax
mov    -0xf0(%rbp,%rax,8),%rax
ff
movsbl (%rax),%edi
call   1060 <tolower@plt>
mov    %al,-0x18d(%rbp)
movsbl -0x18d(%rbp),%esi
movslq -0x18c(%rbp),%rax
mov    -0xf0(%rbp,%rax,8),%rdx
ff
add    $0x1,%rdx
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1477 <number_as_word+0x337>
cmpl   $0x1,-0x188(%rbp)
jne    130b <number_as_word+0x1cb>
cmpl   $0x0,-0x18c(%rbp)
jne    130b <number_as_word+0x1cb>
mov    -0xf0(%rbp),%rsi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1477 <number_as_word+0x337>
cmpl   $0x1,-0x188(%rbp)
jne    1347 <number_as_word+0x207>
cmpl   $0x0,-0x18c(%rbp)
jle    1347 <number_as_word+0x207>
movslq -0x18c(%rbp),%rax
mov    -0xf0(%rbp,%rax,8),%rsi
ff
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1477 <number_as_word+0x337>
cmpl   $0x1,-0x188(%rbp)
jle    13b3 <number_as_word+0x273>
cmpl   $0x0,-0x184(%rbp)
jne    13b3 <number_as_word+0x273>
mov    -0x188(%rbp),%eax
sub    $0x2,%eax
cltq
mov    -0x130(%rbp,%rax,8),%rax
ff
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,-0x18e(%rbp)
movsbl -0x18e(%rbp),%esi
mov    -0x188(%rbp),%eax
sub    $0x2,%eax
cltq
mov    -0x130(%rbp,%rax,8),%rdx
ff
add    $0x1,%rdx
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13e6 <number_as_word+0x2a6>
cmpl   $0x1,-0x188(%rbp)
jle    13e1 <number_as_word+0x2a1>
mov    -0x188(%rbp),%eax
sub    $0x2,%eax
cltq
mov    -0x130(%rbp,%rax,8),%rsi
ff
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13e6 <number_as_word+0x2a6>
jmp    13eb <number_as_word+0x2ab>
jmp    13f0 <number_as_word+0x2b0>
jmp    13f5 <number_as_word+0x2b5>
jmp    13fa <number_as_word+0x2ba>
cmpl   $0x0,-0x18c(%rbp)
je     1447 <number_as_word+0x307>
cmpl   $0x0,-0x184(%rbp)
jne    1447 <number_as_word+0x307>
cmpl   $0x0,-0x188(%rbp)
jne    1447 <number_as_word+0x307>
mov    -0x18c(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xa0(%rbp,%rax,8),%rsi
ff
lea    0xd25(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1477 <number_as_word+0x337>
cmpl   $0x0,-0x18c(%rbp)
je     1472 <number_as_word+0x332>
mov    -0x18c(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x50(%rbp,%rax,8),%rsi
lea    0xcf5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1477 <number_as_word+0x337>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_as_word>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%ebx
sub    %edx,%ebx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %eax,%ebp
sub    %ecx,%ebp
lea    0x63(%rax),%r15d
cmp    $0xc7,%r15d
jb     11ce <number_as_word+0x9e>
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
cltq
lea    0x1008(%rip),%rcx
movslq -0x4(%rcx,%rax,4),%rsi
add    %rcx,%rsi
lea    0xfa9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
or     %ebp,%eax
je     11ce <number_as_word+0x9e>
lea    0xf8e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
je     1218 <number_as_word+0xe8>
test   %ebp,%ebp
jle    123c <number_as_word+0x10c>
cmp    $0x64,%r14d
jl     123c <number_as_word+0x10c>
cmp    $0x1,%ebx
jne    123c <number_as_word+0x10c>
mov    %ebp,%eax
lea    0x2ba6(%rip),%rcx
mov    (%rcx,%rax,8),%rbx
movsbl (%rbx),%edi
call   1050 <tolower@plt>
movsbl %al,%esi
add    $0x1,%rbx
lea    0xf56(%rip),%rdi
mov    %rbx,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
test   %ebp,%ebp
je     12d6 <number_as_word+0x1a6>
cmp    $0xc6,%r15d
ja     12d6 <number_as_word+0x1a6>
movslq %ebp,%rax
lea    0xf51(%rip),%rcx
jmp    12e4 <number_as_word+0x1b4>
test   %ebp,%ebp
jne    1258 <number_as_word+0x128>
cmp    $0x1,%ebx
jne    1258 <number_as_word+0x128>
lea    0xf14(%rip),%rdi
lea    0xe07(%rip),%rsi
jmp    12f3 <number_as_word+0x1c3>
test   %ebp,%ebp
jle    1277 <number_as_word+0x147>
cmp    $0x1,%ebx
jne    1277 <number_as_word+0x147>
mov    %ebp,%eax
lea    0x2b26(%rip),%rcx
mov    (%rcx,%rax,8),%rsi
lea    0xee7(%rip),%rdi
jmp    12f3 <number_as_word+0x1c3>
cmp    $0xc6,%r15d
ja     12b5 <number_as_word+0x185>
cmp    $0x2,%ebx
jl     12b5 <number_as_word+0x185>
add    $0xfffffffe,%ebx
lea    0x2b51(%rip),%rax
mov    (%rax,%rbx,8),%rbx
movsbl (%rbx),%edi
call   1030 <toupper@plt>
movsbl %al,%esi
add    $0x1,%rbx
lea    0xeb1(%rip),%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    12d6 <number_as_word+0x1a6>
cmp    $0x2,%ebx
jl     12d6 <number_as_word+0x1a6>
add    $0xfffffffe,%ebx
lea    0x2b1c(%rip),%rax
mov    (%rax,%rbx,8),%rsi
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
je     1304 <number_as_word+0x1d4>
movslq %ebp,%rax
lea    0xe80(%rip),%rcx
movslq -0x4(%rcx,%rax,4),%rsi
add    %rcx,%rsi
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"one\00"
@.str.1 = [4 x i8] c"two\00"
@.str.2 = [6 x i8] c"three\00"
@.str.3 = [5 x i8] c"four\00"
@.str.4 = [5 x i8] c"five\00"
@.str.5 = [4 x i8] c"six\00"
@.str.6 = [6 x i8] c"seven\00"
@.str.7 = [6 x i8] c"eight\00"
@.str.8 = [5 x i8] c"nine\00"
@__const.number_as_word.ones = [9 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 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 ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 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 ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 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 ([5 x i8], [5 x i8]* @.str.8, i32 0, i32 0)]
@.str.9 = [4 x i8] c"One\00"
@.str.10 = [4 x i8] c"Two\00"
@.str.11 = [6 x i8] c"Three\00"
@.str.12 = [5 x i8] c"Four\00"
@.str.13 = [5 x i8] c"Five\00"
@.str.14 = [4 x i8] c"Six\00"
@.str.15 = [6 x i8] c"Seven\00"
@.str.16 = [6 x i8] c"Eight\00"
@.str.17 = [5 x i8] c"Nine\00"
@__const.number_as_word.onesToUpper = [9 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i32 0, i32 0)]
@.str.18 = [4 x i8] c"Ten\00"
@.str.19 = [7 x i8] c"Eleven\00"
@.str.20 = [7 x i8] c"Twelve\00"
@.str.21 = [9 x i8] c"Thirteen\00"
@.str.22 = [9 x i8] c"Fourteen\00"
@.str.23 = [8 x i8] c"Fifteen\00"
@.str.24 = [8 x i8] c"Sixteen\00"
@.str.25 = [10 x i8] c"Seventeen\00"
@.str.26 = [9 x i8] c"Eighteen\00"
@.str.27 = [9 x i8] c"Nineteen\00"
@__const.number_as_word.tenToNineteen = [10 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 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 ([10 x i8], [10 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i32 0, i32 0)]
@.str.28 = [7 x i8] c"twenty\00"
@.str.29 = [7 x i8] c"thirty\00"
@.str.30 = [6 x i8] c"forty\00"
@.str.31 = [6 x i8] c"fifty\00"
@.str.32 = [6 x i8] c"sixty\00"
@.str.33 = [8 x i8] c"seventy\00"
@.str.34 = [7 x i8] c"eighty\00"
@.str.35 = [7 x i8] c"ninety\00"
@__const.number_as_word.tens = [8 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.35, i32 0, i32 0)]
@.str.36 = [12 x i8] c"One hundred\00"
@.str.37 = [12 x i8] c"Two hundred\00"
@.str.38 = [14 x i8] c"Three hundred\00"
@.str.39 = [13 x i8] c"Four hundred\00"
@.str.40 = [13 x i8] c"Five hundred\00"
@.str.41 = [12 x i8] c"Six hundred\00"
@.str.42 = [14 x i8] c"Seven hundred\00"
@.str.43 = [14 x i8] c"Eight hundred\00"
@.str.44 = [13 x i8] c"Nine hundred\00"
@__const.number_as_word.hundreds = [9 x i8*] [i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.36, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.37, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.38, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.39, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.40, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.41, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.42, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.43, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.44, i32 0, i32 0)]
@.str.45 = [4 x i8] c"%s \00"
@.str.46 = [5 x i8] c"and \00"
@.str.47 = [6 x i8] c"%c%s \00"
@.str.48 = [3 x i8] c"%s\00"
define void @number_as_word(i32 %0) {
%2 = alloca i32
%3 = alloca [9 x i8*]
%4 = alloca [9 x i8*]
%5 = alloca [10 x i8*]
%6 = alloca [8 x i8*]
%7 = alloca [9 x i8*]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
%12 = alloca i8
store i32 %0, i32* %2
%13 = bitcast [9 x i8*]* %3 to i8*
%14 = bitcast [9 x i8*]* %4 to i8*
%15 = bitcast [10 x i8*]* %5 to i8*
%16 = bitcast [8 x i8*]* %6 to i8*
%17 = bitcast [9 x i8*]* %7 to i8*
%18 = load i32, i32* %2
%19 = sdiv i32 %18, 100
store i32 %19, i32* %8
%20 = load i32, i32* %2
%21 = sdiv i32 %20, 10
%22 = srem i32 %21, 10
store i32 %22, i32* %9
%23 = load i32, i32* %2
%24 = srem i32 %23, 10
store i32 %24, i32* %10
%25 = load i32, i32* %8
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %42
27: ; preds = %1
%28 = load i32, i32* %8
%29 = sub nsw i32 %28, 1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [9 x i8*], [9 x i8*]* %7, i64 0, i64 %30
%32 = load i8*, i8** %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.45, i64 0, i64 0), i8* %32)
%34 = load i32, i32* %9
%35 = icmp ne i32 %34, 0
br i1 %35, label %39, label %36
36: ; preds = %27
%37 = load i32, i32* %10
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %36, %27
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.46, i64 0, i64 0))
br label %41
41: ; preds = %39, %36
br label %42
42: ; preds = %41, %1
%43 = load i32, i32* %9
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %131
45: ; preds = %42
%46 = load i32, i32* %8
%47 = icmp sgt i32 %46, 0
br i1 %47, label %48, label %70
48: ; preds = %45
%49 = load i32, i32* %9
%50 = icmp eq i32 %49, 1
br i1 %50, label %51, label %70
51: ; preds = %48
%52 = load i32, i32* %10
%53 = icmp sgt i32 %52, 0
br i1 %53, label %54, label %70
54: ; preds = %51
%55 = load i32, i32* %10
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 %56
%58 = load i8*, i8** %57
%59 = getelementptr inbounds i8, i8* %58, i64 0
%60 = load i8, i8* %59
%61 = call signext i8 @tolower(i8 signext %60)
store i8 %61, i8* %11
%62 = load i8, i8* %11
%63 = sext i8 %62 to i32
%64 = load i32, i32* %10
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 %65
%67 = load i8*, i8** %66
%68 = getelementptr inbounds i8, i8* %67, i64 1
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.47, i64 0, i64 0), i32 %63, i8* %68)
br label %158
70: ; preds = %51, %48, %45
%71 = load i32, i32* %9
%72 = icmp eq i32 %71, 1
br i1 %72, label %73, label %80
73: ; preds = %70
%74 = load i32, i32* %10
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %80
76: ; preds = %73
%77 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 0
%78 = load i8*, i8** %77
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.48, i64 0, i64 0), i8* %78)
br label %158
80: ; preds = %73, %70
%81 = load i32, i32* %9
%82 = icmp eq i32 %81, 1
br i1 %82, label %83, label %92
83: ; preds = %80
%84 = load i32, i32* %10
%85 = icmp sgt i32 %84, 0
br i1 %85, label %86, label %92
86: ; preds = %83
%87 = load i32, i32* %10
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 %88
%90 = load i8*, i8** %89
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.45, i64 0, i64 0), i8* %90)
br label %158
92: ; preds = %83, %80
%93 = load i32, i32* %9
%94 = icmp sgt i32 %93, 1
br i1 %94, label %95, label %116
95: ; preds = %92
%96 = load i32, i32* %8
%97 = icmp eq i32 %96, 0
br i1 %97, label %98, label %116
98: ; preds = %95
%99 = load i32, i32* %9
%100 = sub nsw i32 %99, 2
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [8 x i8*], [8 x i8*]* %6, i64 0, i64 %101
%103 = load i8*, i8** %102
%104 = getelementptr inbounds i8, i8* %103, i64 0
%105 = load i8, i8* %104
%106 = call signext i8 @toupper(i8 signext %105)
store i8 %106, i8* %12
%107 = load i8, i8* %12
%108 = sext i8 %107 to i32
%109 = load i32, i32* %9
%110 = sub nsw i32 %109, 2
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [8 x i8*], [8 x i8*]* %6, i64 0, i64 %111
%113 = load i8*, i8** %112
%114 = getelementptr inbounds i8, i8* %113, i64 1
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.47, i64 0, i64 0), i32 %108, i8* %114)
br label %127
116: ; preds = %95, %92
%117 = load i32, i32* %9
%118 = icmp sgt i32 %117, 1
br i1 %118, label %119, label %126
119: ; preds = %116
%120 = load i32, i32* %9
%121 = sub nsw i32 %120, 2
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [8 x i8*], [8 x i8*]* %6, i64 0, i64 %122
%124 = load i8*, i8** %123
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.45, i64 0, i64 0), i8* %124)
br label %126
126: ; preds = %119, %116
br label %127
127: ; preds = %126, %98
br label %128
128: ; preds = %127
br label %129
129: ; preds = %128
br label %130
130: ; preds = %129
br label %131
131: ; preds = %130, %42
%132 = load i32, i32* %10
%133 = icmp ne i32 %132, 0
br i1 %133, label %134, label %147
134: ; preds = %131
%135 = load i32, i32* %8
%136 = icmp eq i32 %135, 0
br i1 %136, label %137, label %147
137: ; preds = %134
%138 = load i32, i32* %9
%139 = icmp eq i32 %138, 0
br i1 %139, label %140, label %147
140: ; preds = %137
%141 = load i32, i32* %10
%142 = sub nsw i32 %141, 1
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds [9 x i8*], [9 x i8*]* %4, i64 0, i64 %143
%145 = load i8*, i8** %144
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.48, i64 0, i64 0), i8* %145)
br label %158
147: ; preds = %137, %134, %131
%148 = load i32, i32* %10
%149 = icmp ne i32 %148, 0
br i1 %149, label %150, label %157
150: ; preds = %147
%151 = load i32, i32* %10
%152 = sub nsw i32 %151, 1
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [9 x i8*], [9 x i8*]* %3, i64 0, i64 %153
%155 = load i8*, i8** %154
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.48, i64 0, i64 0), i8* %155)
br label %157
157: ; preds = %150, %147
br label %158
158: ; preds = %54, %76, %86, %157, %140
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"one\00"
@.str.1 = [4 x i8] c"two\00"
@.str.2 = [6 x i8] c"three\00"
@.str.3 = [5 x i8] c"four\00"
@.str.4 = [5 x i8] c"five\00"
@.str.5 = [4 x i8] c"six\00"
@.str.6 = [6 x i8] c"seven\00"
@.str.7 = [6 x i8] c"eight\00"
@.str.8 = [5 x i8] c"nine\00"
@reltable.number_as_word = [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.3 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.4 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.5 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.7 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.8 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word to i64)) to i32)]
@.str.9 = [4 x i8] c"One\00"
@.str.10 = [4 x i8] c"Two\00"
@.str.11 = [6 x i8] c"Three\00"
@.str.12 = [5 x i8] c"Four\00"
@.str.13 = [5 x i8] c"Five\00"
@.str.14 = [4 x i8] c"Six\00"
@.str.15 = [6 x i8] c"Seven\00"
@.str.16 = [6 x i8] c"Eight\00"
@.str.17 = [5 x i8] c"Nine\00"
@reltable.number_as_word.49 = [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.9 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.49 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.49 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.11 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.49 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.12 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.49 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.13 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.49 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.14 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.49 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.15 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.49 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.16 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.49 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.17 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.49 to i64)) to i32)]
@.str.18 = [4 x i8] c"Ten\00"
@.str.19 = [7 x i8] c"Eleven\00"
@.str.20 = [7 x i8] c"Twelve\00"
@.str.21 = [9 x i8] c"Thirteen\00"
@.str.22 = [9 x i8] c"Fourteen\00"
@.str.23 = [8 x i8] c"Fifteen\00"
@.str.24 = [8 x i8] c"Sixteen\00"
@.str.25 = [10 x i8] c"Seventeen\00"
@.str.26 = [9 x i8] c"Eighteen\00"
@.str.27 = [9 x i8] c"Nineteen\00"
@__const.number_as_word.tenToNineteen = [10 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 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 ([10 x i8], [10 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i32 0, i32 0)]
@.str.28 = [7 x i8] c"twenty\00"
@.str.29 = [7 x i8] c"thirty\00"
@.str.30 = [6 x i8] c"forty\00"
@.str.31 = [6 x i8] c"fifty\00"
@.str.32 = [6 x i8] c"sixty\00"
@.str.33 = [8 x i8] c"seventy\00"
@.str.34 = [7 x i8] c"eighty\00"
@.str.35 = [7 x i8] c"ninety\00"
@__const.number_as_word.tens = [8 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.35, i32 0, i32 0)]
@.str.36 = [12 x i8] c"One hundred\00"
@.str.37 = [12 x i8] c"Two hundred\00"
@.str.38 = [14 x i8] c"Three hundred\00"
@.str.39 = [13 x i8] c"Four hundred\00"
@.str.40 = [13 x i8] c"Five hundred\00"
@.str.41 = [12 x i8] c"Six hundred\00"
@.str.42 = [14 x i8] c"Seven hundred\00"
@.str.43 = [14 x i8] c"Eight hundred\00"
@.str.44 = [13 x i8] c"Nine hundred\00"
@reltable.number_as_word.50 = [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.36 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.50 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.37 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.50 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.38 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.50 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.39 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.50 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.40 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.50 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.41 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.50 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.42 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.50 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.43 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.50 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.44 to i64), i64 ptrtoint ([9 x i32]* @reltable.number_as_word.50 to i64)) to i32)]
@.str.45 = [4 x i8] c"%s \00"
@.str.46 = [5 x i8] c"and \00"
@.str.47 = [6 x i8] c"%c%s \00"
@.str.48 = [3 x i8] c"%s\00"
define void @number_as_word(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = srem i32 %2, 10
%4 = srem i32 %0, 10
%5 = add i32 %0, 99
%6 = icmp ult i32 %5, 199
br i1 %6, label %18, label %7
7: ; preds = %1
%8 = sdiv i32 %0, 100
%9 = add nsw i32 %8, -1
%10 = sext i32 %9 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([9 x i32]* @reltable.number_as_word.50 to i8*), i64 %11)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.45, i64 0, i64 0), i8* %12)
%14 = or i32 %3, %4
%15 = icmp eq i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %7
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.46, i64 0, i64 0))
br label %18
18: ; preds = %16, %7, %1
%19 = icmp eq i32 %3, 0
br i1 %19, label %68, label %20
20: ; preds = %18
%21 = icmp sgt i32 %0, 99
%22 = icmp eq i32 %3, 1
%23 = and i1 %21, %22
%24 = icmp sgt i32 %4, 0
%25 = and i1 %24, %23
br i1 %25, label %26, label %35
26: ; preds = %20
%27 = zext i32 %4 to i64
%28 = getelementptr inbounds [10 x i8*], [10 x i8*]* @__const.number_as_word.tenToNineteen, i64 0, i64 %27
%29 = load i8*, i8** %28
%30 = load i8, i8* %29
%31 = tail call signext i8 @tolower(i8 signext %30)
%32 = sext i8 %31 to i32
%33 = getelementptr inbounds i8, i8* %29, i64 1
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.47, i64 0, i64 0), i32 %32, i8* %33)
br label %84
35: ; preds = %20
%36 = icmp eq i32 %4, 0
%37 = and i1 %36, %22
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.48, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
br label %84
40: ; preds = %35
%41 = and i1 %24, %22
br i1 %41, label %42, label %47
42: ; preds = %40
%43 = zext i32 %4 to i64
%44 = getelementptr inbounds [10 x i8*], [10 x i8*]* @__const.number_as_word.tenToNineteen, i64 0, i64 %43
%45 = load i8*, i8** %44
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.45, i64 0, i64 0), i8* %45)
br label %84
47: ; preds = %40
%48 = icmp sgt i32 %3, 1
%49 = and i1 %6, %48
br i1 %49, label %50, label %60
50: ; preds = %47
%51 = add nsw i32 %3, -2
%52 = zext i32 %51 to i64
%53 = getelementptr inbounds [8 x i8*], [8 x i8*]* @__const.number_as_word.tens, i64 0, i64 %52
%54 = load i8*, i8** %53
%55 = load i8, i8* %54
%56 = tail call signext i8 @toupper(i8 signext %55)
%57 = sext i8 %56 to i32
%58 = getelementptr inbounds i8, i8* %54, i64 1
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.47, i64 0, i64 0), i32 %57, i8* %58)
br label %67
60: ; preds = %47
br i1 %48, label %61, label %67
61: ; preds = %60
%62 = add nsw i32 %3, -2
%63 = zext i32 %62 to i64
%64 = getelementptr inbounds [8 x i8*], [8 x i8*]* @__const.number_as_word.tens, i64 0, i64 %63
%65 = load i8*, i8** %64
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.45, i64 0, i64 0), i8* %65)
br label %67
67: ; preds = %60, %61, %50
br i1 %36, label %84, label %78
68: ; preds = %18
%69 = icmp ne i32 %4, 0
%70 = and i1 %69, %6
br i1 %70, label %71, label %77
71: ; preds = %68
%72 = add nsw i32 %4, -1
%73 = sext i32 %72 to i64
%74 = shl i64 %73, 2
%75 = call i8* @llvm.load.relative.i64(i8* bitcast ([9 x i32]* @reltable.number_as_word.49 to i8*), i64 %74)
%76 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.48, i64 0, i64 0), i8* %75)
br label %84
77: ; preds = %68
br i1 %69, label %78, label %84
78: ; preds = %67, %77
%79 = add nsw i32 %4, -1
%80 = sext i32 %79 to i64
%81 = shl i64 %80, 2
%82 = call i8* @llvm.load.relative.i64(i8* bitcast ([9 x i32]* @reltable.number_as_word to i8*), i64 %81)
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.48, i64 0, i64 0), i8* %82)
br label %84
84: ; preds = %67, %71, %78, %77, %42, %38, %26
ret void
}