#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 */
struct timeval {
  long long tv_usec;
};

/* Variables and functions */
scalar_t__ getlength(char *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, long long);
int main(void) {
  struct timeval stop, start;
  gettimeofday(&start, NULL);
  char *numbers[90] = {"one",       "two",      "three",   "four",
                       "five",      "six",      "seven",   "eight",
                       "nine",      "ten",      "eleven",  "twelve",
                       "thirteen",  "fourteen", "fifteen", "sixteen",
                       "seventeen", "eighteen", "nineteen"};
  numbers[20 - 1] = "twenty";
  numbers[30 - 1] = "thirty";
  numbers[40 - 1] = "forty";
  numbers[50 - 1] = "fifty";
  numbers[60 - 1] = "sixty";
  numbers[70 - 1] = "seventy";
  numbers[80 - 1] = "eighty";
  numbers[90 - 1] = "ninety";
  int i, aux;
  long long sum = 0;
  for (i = 1; i <= 1000; i++) {
    if (i <= 90 && numbers[i - 1] != 0) {
      sum += getlength(numbers[i - 1]);
    } else {
      aux = i;
      if (aux / 1000) {
        sum += getlength(numbers[aux / 1000 - 1]);
        sum += getlength("thousand");
      }
      if (aux % 1000) {
        aux %= 1000;
        if (aux / 100) {
          sum += getlength(numbers[aux / 100 - 1]);
          sum += getlength("hundred");
          if (aux % 100) {
            sum += getlength("and");
          }
        }
        if (aux % 100) {
          aux %= 100;
          if (aux <= 20) {
            sum += getlength(numbers[aux - 1]);
          } else {
            sum += getlength(numbers[(aux / 10) * 10 - 1]);
            if (aux % 10) {
              sum += getlength(numbers[aux % 10 - 1]);
            }
          }
        }
      }
    }
  }
  printf("%lld\n", sum);
  gettimeofday(&stop, NULL);
  printf("\ntook %lu usec\n", stop.tv_usec - start.tv_usec);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x300,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
lea    -0x2f0(%rbp),%rdi
lea    0x29e3(%rip),%rsi
mov    $0x2d0,%edx
call   1060 <memcpy@plt>
lea    0xeff(%rip),%rax
mov    %rax,-0x258(%rbp)
lea    0xef8(%rip),%rax
mov    %rax,-0x208(%rbp)
lea    0xef1(%rip),%rax
mov    %rax,-0x1b8(%rbp)
lea    0xee9(%rip),%rax
mov    %rax,-0x168(%rbp)
lea    0xee1(%rip),%rax
mov    %rax,-0x118(%rbp)
lea    0xed9(%rip),%rax
mov    %rax,-0xc8(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x78(%rbp)
lea    0xecf(%rip),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x300(%rbp)
movl   $0x1,-0x2f4(%rbp)
cmpl   $0x3e8,-0x2f4(%rbp)
jg     148a <main+0x34a>
cmpl   $0x5a,-0x2f4(%rbp)
jg     1258 <main+0x118>
mov    -0x2f4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpq   $0x0,-0x2f0(%rbp,%rax,8)
je     1258 <main+0x118>
mov    -0x2f4(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x2f0(%rbp,%rax,8),%rdi
ff
call   1050 <getlength@plt>
add    -0x300(%rbp),%rax
mov    %rax,-0x300(%rbp)
jmp    1471 <main+0x331>
mov    -0x2f4(%rbp),%eax
mov    %eax,-0x2f8(%rbp)
mov    -0x2f8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     12c3 <main+0x183>
mov    -0x2f8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
cltq
mov    -0x2f0(%rbp,%rax,8),%rdi
ff
call   1050 <getlength@plt>
add    -0x300(%rbp),%rax
mov    %rax,-0x300(%rbp)
lea    0xe03(%rip),%rdi
call   1050 <getlength@plt>
add    -0x300(%rbp),%rax
mov    %rax,-0x300(%rbp)
mov    -0x2f8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     146c <main+0x32c>
mov    -0x2f8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x2f8(%rbp)
mov    -0x2f8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     1383 <main+0x243>
mov    -0x2f8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
cltq
mov    -0x2f0(%rbp,%rax,8),%rdi
ff
call   1050 <getlength@plt>
add    -0x300(%rbp),%rax
mov    %rax,-0x300(%rbp)
lea    0xd82(%rip),%rdi
call   1050 <getlength@plt>
add    -0x300(%rbp),%rax
mov    %rax,-0x300(%rbp)
mov    -0x2f8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     137e <main+0x23e>
lea    0xd4d(%rip),%rdi
call   1050 <getlength@plt>
add    -0x300(%rbp),%rax
mov    %rax,-0x300(%rbp)
jmp    1383 <main+0x243>
mov    -0x2f8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1467 <main+0x327>
mov    -0x2f8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x2f8(%rbp)
cmpl   $0x14,-0x2f8(%rbp)
jg     13e6 <main+0x2a6>
mov    -0x2f8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x2f0(%rbp,%rax,8),%rdi
ff
call   1050 <getlength@plt>
add    -0x300(%rbp),%rax
mov    %rax,-0x300(%rbp)
jmp    1462 <main+0x322>
mov    -0x2f8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
imul   $0xa,%eax,%eax
sub    $0x1,%eax
cltq
mov    -0x2f0(%rbp,%rax,8),%rdi
ff
call   1050 <getlength@plt>
add    -0x300(%rbp),%rax
mov    %rax,-0x300(%rbp)
mov    -0x2f8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     145d <main+0x31d>
mov    -0x2f8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
sub    $0x1,%edx
movslq %edx,%rax
mov    -0x2f0(%rbp,%rax,8),%rdi
ff
call   1050 <getlength@plt>
add    -0x300(%rbp),%rax
mov    %rax,-0x300(%rbp)
jmp    1462 <main+0x322>
jmp    1467 <main+0x327>
jmp    146c <main+0x32c>
jmp    1471 <main+0x331>
jmp    1476 <main+0x336>
mov    -0x2f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2f4(%rbp)
jmp    11f6 <main+0xb6>
mov    -0x300(%rbp),%rsi
lea    0xc2c(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x10(%rbp),%rsi
sub    -0x18(%rbp),%rsi
lea    0xc11(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x300,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2e8,%rsp
xor    %r13d,%r13d
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
lea    0x29eb(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    $0x2d0,%edx
call   1060 <memcpy@plt>
lea    0xf02(%rip),%rax
mov    %rax,0xa8(%rsp)
lea    0xefa(%rip),%rax
mov    %rax,0xf8(%rsp)
lea    0xef2(%rip),%rax
mov    %rax,0x148(%rsp)
lea    0xee9(%rip),%rax
mov    %rax,0x198(%rsp)
lea    0xee0(%rip),%rax
mov    %rax,0x1e8(%rsp)
lea    0xed7(%rip),%rax
mov    %rax,0x238(%rsp)
lea    0xed0(%rip),%rax
mov    %rax,0x288(%rsp)
lea    0xec8(%rip),%rax
mov    %rax,0x2d8(%rsp)
mov    $0x1,%r15d
mov    $0x1,%r14w
jmp    1227 <main+0xe7>
nopl   0x0(%rax)
mov    0x8(%rsp,%r15,8),%rdi
test   %rdi,%rdi
je     1236 <main+0xf6>
call   1050 <getlength@plt>
add    %rax,%r13
add    $0x1,%r15
add    $0x1,%r14d
cmp    $0x3e9,%r15
je     139c <main+0x25c>
cmp    $0x5a,%r15
jbe    1200 <main+0xc0>
cmp    $0x3e8,%r15
jae    1290 <main+0x150>
movzwl %r14w,%ecx
mov    %ecx,%eax
shr    $0x3,%eax
imul   $0x20c5,%eax,%edx
shr    $0x14,%edx
imul   $0xfffffc18,%edx,%eax
movzwl %ax,%r12d
lea    (%r15,%r12,1),%rax
test   %ax,%ax
je     1212 <main+0xd2>
cmp    $0x63,%ax
ja     12ce <main+0x18e>
shl    $0x3,%edx
lea    (%rdx,%rdx,2),%eax
movzbl %al,%ecx
add    %r14d,%eax
movzbl %al,%eax
lea    (%rax,%rax,4),%edx
lea    (%rax,%rdx,8),%eax
shr    $0xc,%eax
imul   $0xffffff9c,%eax,%eax
movzbl %al,%eax
add    %r15d,%eax
add    %eax,%ecx
movzbl %cl,%ebp
jmp    1347 <main+0x207>
nopl   0x0(%rax)
movzwl %r15w,%eax
shr    $0x3,%eax
imul   $0x20c5,%eax,%eax
shr    $0x14,%eax
mov    $0xffffffff,%ecx
add    %ecx,%eax
mov    0x10(%rsp,%rax,8),%rdi
call   1050 <getlength@plt>
mov    %rax,%rbx
add    %r13,%rbx
lea    0xdf5(%rip),%rdi
call   1050 <getlength@plt>
mov    %rax,%r13
add    %rbx,%r13
jmp    1212 <main+0xd2>
imul   $0x3e8,%edx,%edx
sub    %edx,%ecx
movzwl %cx,%ecx
shr    $0x2,%ecx
imul   $0x147b,%ecx,%ecx
shr    $0x11,%ecx
imul   $0xffffff9c,%ecx,%ecx
movzwl %cx,%ebp
movzwl %ax,%eax
shr    $0x2,%eax
imul   $0x147b,%eax,%eax
shr    $0x11,%eax
mov    $0xffffffff,%ecx
add    %ecx,%eax
mov    0x10(%rsp,%rax,8),%rdi
call   1050 <getlength@plt>
mov    %rax,%rbx
add    %r13,%rbx
lea    0xda4(%rip),%rdi
call   1050 <getlength@plt>
mov    %rax,%r13
add    %rbx,%r13
lea    (%r15,%r12,1),%eax
mov    %ebp,%ecx
add    %ax,%cx
je     1212 <main+0xd2>
add    %r15,%rbp
add    %r12,%rbp
lea    0xd79(%rip),%rdi
call   1050 <getlength@plt>
add    %rax,%r13
movzwl %bp,%eax
cmp    $0x14,%ax
ja     135d <main+0x21d>
add    $0xffffffff,%eax
mov    0x10(%rsp,%rax,8),%rdi
jmp    120a <main+0xca>
movzbl %al,%ecx
imul   $0xcd,%ecx,%edx
shr    $0xa,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%cl
movzbl %cl,%ebx
mov    %ebx,%ecx
not    %ecx
add    %eax,%ecx
mov    0x10(%rsp,%rcx,8),%rdi
call   1050 <getlength@plt>
add    %rax,%r13
test   %bl,%bl
je     1212 <main+0xd2>
add    $0xffffffff,%ebx
mov    0x10(%rsp,%rbx,8),%rdi
jmp    120a <main+0xca>
lea    0xd21(%rip),%rdi
mov    %r13,%rsi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    0x8(%rsp),%rsi
sub    (%rsp),%rsi
lea    0xd03(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x2e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
@.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"
@.str.9 = [4 x i8] c"ten\00"
@.str.10 = [7 x i8] c"eleven\00"
@.str.11 = [7 x i8] c"twelve\00"
@.str.12 = [9 x i8] c"thirteen\00"
@.str.13 = [9 x i8] c"fourteen\00"
@.str.14 = [8 x i8] c"fifteen\00"
@.str.15 = [8 x i8] c"sixteen\00"
@.str.16 = [10 x i8] c"seventeen\00"
@.str.17 = [9 x i8] c"eighteen\00"
@.str.18 = [9 x i8] c"nineteen\00"
@__const.main.numbers = <{ [19 x i8*], [71 x i8*] }> <{ [19 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), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 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 ([9 x i8], [9 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 ([8 x i8], [8 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 ([10 x i8], [10 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i32 0, i32 0)], [71 x i8*] zeroinitializer }>
@.str.19 = [7 x i8] c"twenty\00"
@.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"
@.str.27 = [9 x i8] c"thousand\00"
@.str.28 = [8 x i8] c"hundred\00"
@.str.29 = [4 x i8] c"and\00"
@.str.30 = [6 x i8] c"%lld\0A\00"
@.str.31 = [16 x i8] c"\0Atook %lu usec\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = alloca %struct.timeval
%4 = alloca [90 x i8*]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32 0, i32* %1
%8 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%9 = bitcast [90 x i8*]* %4 to i8*
%10 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 19
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 29
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 39
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 49
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 59
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 69
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8** %15
%16 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 79
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0), i8** %16
%17 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 89
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.26, i64 0, i64 0), i8** %17
store i64 0, i64* %7
store i32 1, i32* %5
br label %18
18: ; preds = %136, %0
%19 = load i32, i32* %5
%20 = icmp sle i32 %19, 1000
br i1 %20, label %21, label %139
21: ; preds = %18
%22 = load i32, i32* %5
%23 = icmp sle i32 %22, 90
br i1 %23, label %24, label %40
24: ; preds = %21
%25 = load i32, i32* %5
%26 = sub nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 %27
%29 = load i8*, i8** %28
%30 = icmp ne i8* %29, null
br i1 %30, label %31, label %40
31: ; preds = %24
%32 = load i32, i32* %5
%33 = sub nsw i32 %32, 1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 %34
%36 = load i8*, i8** %35
%37 = call i64 @getlength(i8* %36)
%38 = load i64, i64* %7
%39 = add nsw i64 %38, %37
store i64 %39, i64* %7
br label %135
40: ; preds = %24, %21
%41 = load i32, i32* %5
store i32 %41, i32* %6
%42 = load i32, i32* %6
%43 = sdiv i32 %42, 1000
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %58
45: ; preds = %40
%46 = load i32, i32* %6
%47 = sdiv i32 %46, 1000
%48 = sub nsw i32 %47, 1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 %49
%51 = load i8*, i8** %50
%52 = call i64 @getlength(i8* %51)
%53 = load i64, i64* %7
%54 = add nsw i64 %53, %52
store i64 %54, i64* %7
%55 = call i64 @getlength(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i64 0, i64 0))
%56 = load i64, i64* %7
%57 = add nsw i64 %56, %55
store i64 %57, i64* %7
br label %58
58: ; preds = %45, %40
%59 = load i32, i32* %6
%60 = srem i32 %59, 1000
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %134
62: ; preds = %58
%63 = load i32, i32* %6
%64 = srem i32 %63, 1000
store i32 %64, i32* %6
%65 = load i32, i32* %6
%66 = sdiv i32 %65, 100
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %89
68: ; preds = %62
%69 = load i32, i32* %6
%70 = sdiv i32 %69, 100
%71 = sub nsw i32 %70, 1
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 %72
%74 = load i8*, i8** %73
%75 = call i64 @getlength(i8* %74)
%76 = load i64, i64* %7
%77 = add nsw i64 %76, %75
store i64 %77, i64* %7
%78 = call i64 @getlength(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.28, i64 0, i64 0))
%79 = load i64, i64* %7
%80 = add nsw i64 %79, %78
store i64 %80, i64* %7
%81 = load i32, i32* %6
%82 = srem i32 %81, 100
%83 = icmp ne i32 %82, 0
br i1 %83, label %84, label %88
84: ; preds = %68
%85 = call i64 @getlength(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0))
%86 = load i64, i64* %7
%87 = add nsw i64 %86, %85
store i64 %87, i64* %7
br label %88
88: ; preds = %84, %68
br label %89
89: ; preds = %88, %62
%90 = load i32, i32* %6
%91 = srem i32 %90, 100
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %133
93: ; preds = %89
%94 = load i32, i32* %6
%95 = srem i32 %94, 100
store i32 %95, i32* %6
%96 = load i32, i32* %6
%97 = icmp sle i32 %96, 20
br i1 %97, label %98, label %107
98: ; preds = %93
%99 = load i32, i32* %6
%100 = sub nsw i32 %99, 1
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 %101
%103 = load i8*, i8** %102
%104 = call i64 @getlength(i8* %103)
%105 = load i64, i64* %7
%106 = add nsw i64 %105, %104
store i64 %106, i64* %7
br label %132
107: ; preds = %93
%108 = load i32, i32* %6
%109 = sdiv i32 %108, 10
%110 = mul nsw i32 %109, 10
%111 = sub nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 %112
%114 = load i8*, i8** %113
%115 = call i64 @getlength(i8* %114)
%116 = load i64, i64* %7
%117 = add nsw i64 %116, %115
store i64 %117, i64* %7
%118 = load i32, i32* %6
%119 = srem i32 %118, 10
%120 = icmp ne i32 %119, 0
br i1 %120, label %121, label %131
121: ; preds = %107
%122 = load i32, i32* %6
%123 = srem i32 %122, 10
%124 = sub nsw i32 %123, 1
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [90 x i8*], [90 x i8*]* %4, i64 0, i64 %125
%127 = load i8*, i8** %126
%128 = call i64 @getlength(i8* %127)
%129 = load i64, i64* %7
%130 = add nsw i64 %129, %128
store i64 %130, i64* %7
br label %131
131: ; preds = %121, %107
br label %132
132: ; preds = %131, %98
br label %133
133: ; preds = %132, %89
br label %134
134: ; preds = %133, %58
br label %135
135: ; preds = %134, %31
br label %136
136: ; preds = %135
%137 = load i32, i32* %5
%138 = add nsw i32 %137, 1
store i32 %138, i32* %5
br label %18
139: ; preds = %18
%140 = load i64, i64* %7
%141 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i64 0, i64 0), i64 %140)
%142 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%143 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%144 = load i64, i64* %143
%145 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%146 = load i64, i64* %145
%147 = sub nsw i64 %144, %146
%148 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.31, i64 0, i64 0), i64 %147)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
@.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"
@.str.9 = [4 x i8] c"ten\00"
@.str.10 = [7 x i8] c"eleven\00"
@.str.11 = [7 x i8] c"twelve\00"
@.str.12 = [9 x i8] c"thirteen\00"
@.str.13 = [9 x i8] c"fourteen\00"
@.str.14 = [8 x i8] c"fifteen\00"
@.str.15 = [8 x i8] c"sixteen\00"
@.str.16 = [10 x i8] c"seventeen\00"
@.str.17 = [9 x i8] c"eighteen\00"
@.str.18 = [9 x i8] c"nineteen\00"
@__const.main.numbers = <{ [19 x i8*], [71 x i8*] }> <{ [19 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), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 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 ([9 x i8], [9 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 ([8 x i8], [8 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 ([10 x i8], [10 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i32 0, i32 0)], [71 x i8*] zeroinitializer }>
@.str.19 = [7 x i8] c"twenty\00"
@.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"
@.str.27 = [9 x i8] c"thousand\00"
@.str.28 = [8 x i8] c"hundred\00"
@.str.29 = [4 x i8] c"and\00"
@.str.30 = [6 x i8] c"%lld\0A\00"
@.str.31 = [16 x i8] c"\0Atook %lu usec\0A\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timeval
%3 = alloca [90 x i8*]
%4 = bitcast %struct.timeval* %1 to i8*
%5 = bitcast %struct.timeval* %2 to i8*
%6 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%7 = bitcast [90 x i8*]* %3 to i8*
%8 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 19
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 29
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 39
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 49
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 59
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 69
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 79
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 89
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.26, i64 0, i64 0), i8** %15
br label %16
16: ; preds = %0, %99
%17 = phi i64 [ 1, %0 ], [ %101, %99 ]
%18 = phi i64 [ 0, %0 ], [ %100, %99 ]
%19 = icmp ult i64 %17, 91
br i1 %19, label %20, label %28
20: ; preds = %16
%21 = add nsw i64 %17, -1
%22 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 %21
%23 = load i8*, i8** %22
%24 = icmp eq i8* %23, null
br i1 %24, label %42, label %25
25: ; preds = %20
%26 = tail call i64 @getlength(i8* %23)
%27 = add nsw i64 %26, %18
br label %99
28: ; preds = %16
%29 = icmp ult i64 %17, 1000
br i1 %29, label %42, label %30
30: ; preds = %28
%31 = trunc i64 %17 to i16
%32 = udiv i16 %31, 1000
%33 = zext i16 %32 to i64
%34 = add nuw nsw i64 %33, 4294967295
%35 = and i64 %34, 4294967295
%36 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 %35
%37 = load i8*, i8** %36
%38 = tail call i64 @getlength(i8* %37)
%39 = add nsw i64 %38, %18
%40 = tail call i64 @getlength(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i64 0, i64 0))
%41 = add nsw i64 %39, %40
br label %99
42: ; preds = %20, %28
%43 = trunc i64 %17 to i16
%44 = urem i16 %43, 1000
%45 = icmp eq i16 %44, 0
br i1 %45, label %99, label %46
46: ; preds = %42
%47 = icmp ult i16 %44, 100
br i1 %47, label %48, label %52
48: ; preds = %46
%49 = trunc i16 %44 to i8
%50 = urem i8 %49, 100
%51 = zext i8 %50 to i16
br label %68
52: ; preds = %46
%53 = udiv i16 %44, 100
%54 = zext i16 %53 to i64
%55 = add nuw nsw i64 %54, 4294967295
%56 = and i64 %55, 4294967295
%57 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 %56
%58 = load i8*, i8** %57
%59 = tail call i64 @getlength(i8* %58)
%60 = add nsw i64 %59, %18
%61 = tail call i64 @getlength(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.28, i64 0, i64 0))
%62 = add nsw i64 %60, %61
%63 = urem i16 %44, 100
%64 = icmp eq i16 %63, 0
br i1 %64, label %99, label %65
65: ; preds = %52
%66 = tail call i64 @getlength(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0))
%67 = add nsw i64 %66, %62
br label %68
68: ; preds = %48, %65
%69 = phi i16 [ %63, %65 ], [ %51, %48 ]
%70 = phi i64 [ %67, %65 ], [ %18, %48 ]
%71 = zext i16 %69 to i32
%72 = icmp ult i16 %69, 21
br i1 %72, label %73, label %80
73: ; preds = %68
%74 = add nsw i32 %71, -1
%75 = zext i32 %74 to i64
%76 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 %75
%77 = load i8*, i8** %76
%78 = tail call i64 @getlength(i8* %77)
%79 = add nsw i64 %78, %70
br label %99
80: ; preds = %68
%81 = trunc i16 %69 to i8
%82 = urem i8 %81, 10
%83 = zext i8 %82 to i32
%84 = xor i32 %83, -1
%85 = add nsw i32 %84, %71
%86 = zext i32 %85 to i64
%87 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 %86
%88 = load i8*, i8** %87
%89 = tail call i64 @getlength(i8* %88)
%90 = add nsw i64 %89, %70
%91 = icmp eq i8 %82, 0
br i1 %91, label %99, label %92
92: ; preds = %80
%93 = add nsw i32 %83, -1
%94 = zext i32 %93 to i64
%95 = getelementptr inbounds [90 x i8*], [90 x i8*]* %3, i64 0, i64 %94
%96 = load i8*, i8** %95
%97 = tail call i64 @getlength(i8* %96)
%98 = add nsw i64 %97, %90
br label %99
99: ; preds = %52, %30, %25, %80, %92, %73, %42
%100 = phi i64 [ %27, %25 ], [ %79, %73 ], [ %98, %92 ], [ %90, %80 ], [ %18, %42 ], [ %41, %30 ], [ %62, %52 ]
%101 = add nuw nsw i64 %17, 1
%102 = icmp eq i64 %101, 1001
br i1 %102, label %103, label %16
103: ; preds = %99
%104 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i64 0, i64 0), i64 %100)
%105 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%106 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%107 = load i64, i64* %106
%108 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%109 = load i64, i64* %108
%110 = sub nsw i64 %107, %109
%111 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.31, i64 0, i64 0), i64 %110)
ret i32 0
}