#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*/ assertEquals(char *, int /*<<< orphan*/);
int /*<<< orphan*/ getNumberInWords(int);
void test5DigitNumbers() {
  assertEquals("ten thousand", getNumberInWords(10000));
  assertEquals("ten thousand one", getNumberInWords(10001));
  assertEquals("twelve thousand three hundred forty five",
               getNumberInWords(12345));
  assertEquals("twenty three thousand four hundred fifty six",
               getNumberInWords(23456));
  assertEquals("thirty four thousand five hundred sixty seven",
               getNumberInWords(34567));
  assertEquals("forty five thousand six hundred seventy eight",
               getNumberInWords(45678));
  assertEquals("fifty six thousand seven hundred eighty nine",
               getNumberInWords(56789));
  assertEquals("sixty seven thousand eight hundred ninety",
               getNumberInWords(67890));
  assertEquals("seventy eight thousand nine hundred one",
               getNumberInWords(78901));
  assertEquals("eighty nine thousand twelve", getNumberInWords(89012));
  assertEquals("ninety thousand one hundred twenty three",
               getNumberInWords(90123));
  assertEquals("ninety nine thousand nine hundred ninety nine",
               getNumberInWords(99999));
}


x86 assembly (clang, -O0):
<test5DigitNumbers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2710,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x2711,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x3039,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x5ba0,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xec8(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x8707,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xedd(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0xb26e,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xef3(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0xddd5,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf09(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x10932,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf1e(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x13435,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf30(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x15bb4,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf40(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x1600b,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf44(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x1869f,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf55(%rip),%rdi
call   1030 <assertEquals@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5DigitNumbers>:
push   %rax
mov    $0x2710,%edi
call   1040 <getNumberInWords@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x2711,%edi
call   1040 <getNumberInWords@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x3039,%edi
call   1040 <getNumberInWords@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x5ba0,%edi
call   1040 <getNumberInWords@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x8707,%edi
call   1040 <getNumberInWords@plt>
lea    0xee2(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0xb26e,%edi
call   1040 <getNumberInWords@plt>
lea    0xef8(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0xddd5,%edi
call   1040 <getNumberInWords@plt>
lea    0xf0e(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x10932,%edi
call   1040 <getNumberInWords@plt>
lea    0xf23(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x13435,%edi
call   1040 <getNumberInWords@plt>
lea    0xf35(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x15bb4,%edi
call   1040 <getNumberInWords@plt>
lea    0xf45(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x1600b,%edi
call   1040 <getNumberInWords@plt>
lea    0xf49(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x1869f,%edi
call   1040 <getNumberInWords@plt>
lea    0xf5a(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <assertEquals@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"ten thousand\00"
@.str.1 = [17 x i8] c"ten thousand one\00"
@.str.2 = [41 x i8] c"twelve thousand three hundred forty five\00"
@.str.3 = [45 x i8] c"twenty three thousand four hundred fifty six\00"
@.str.4 = [46 x i8] c"thirty four thousand five hundred sixty seven\00"
@.str.5 = [46 x i8] c"forty five thousand six hundred seventy eight\00"
@.str.6 = [45 x i8] c"fifty six thousand seven hundred eighty nine\00"
@.str.7 = [42 x i8] c"sixty seven thousand eight hundred ninety\00"
@.str.8 = [40 x i8] c"seventy eight thousand nine hundred one\00"
@.str.9 = [28 x i8] c"eighty nine thousand twelve\00"
@.str.10 = [41 x i8] c"ninety thousand one hundred twenty three\00"
@.str.11 = [46 x i8] c"ninety nine thousand nine hundred ninety nine\00"
define void @test5DigitNumbers() {
%1 = call i32 @getNumberInWords(i32 10000)
%2 = call i32 @assertEquals(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @getNumberInWords(i32 10001)
%4 = call i32 @assertEquals(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @getNumberInWords(i32 12345)
%6 = call i32 @assertEquals(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 @getNumberInWords(i32 23456)
%8 = call i32 @assertEquals(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = call i32 @getNumberInWords(i32 34567)
%10 = call i32 @assertEquals(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = call i32 @getNumberInWords(i32 45678)
%12 = call i32 @assertEquals(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = call i32 @getNumberInWords(i32 56789)
%14 = call i32 @assertEquals(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = call i32 @getNumberInWords(i32 67890)
%16 = call i32 @assertEquals(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0), i32 %15)
%17 = call i32 @getNumberInWords(i32 78901)
%18 = call i32 @assertEquals(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i32 %17)
%19 = call i32 @getNumberInWords(i32 89012)
%20 = call i32 @assertEquals(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i32 %19)
%21 = call i32 @getNumberInWords(i32 90123)
%22 = call i32 @assertEquals(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0), i32 %21)
%23 = call i32 @getNumberInWords(i32 99999)
%24 = call i32 @assertEquals(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.11, i64 0, i64 0), i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"ten thousand\00"
@.str.1 = [17 x i8] c"ten thousand one\00"
@.str.2 = [41 x i8] c"twelve thousand three hundred forty five\00"
@.str.3 = [45 x i8] c"twenty three thousand four hundred fifty six\00"
@.str.4 = [46 x i8] c"thirty four thousand five hundred sixty seven\00"
@.str.5 = [46 x i8] c"forty five thousand six hundred seventy eight\00"
@.str.6 = [45 x i8] c"fifty six thousand seven hundred eighty nine\00"
@.str.7 = [42 x i8] c"sixty seven thousand eight hundred ninety\00"
@.str.8 = [40 x i8] c"seventy eight thousand nine hundred one\00"
@.str.9 = [28 x i8] c"eighty nine thousand twelve\00"
@.str.10 = [41 x i8] c"ninety thousand one hundred twenty three\00"
@.str.11 = [46 x i8] c"ninety nine thousand nine hundred ninety nine\00"
define void @test5DigitNumbers() {
%1 = tail call i32 @getNumberInWords(i32 10000)
%2 = tail call i32 @assertEquals(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @getNumberInWords(i32 10001)
%4 = tail call i32 @assertEquals(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @getNumberInWords(i32 12345)
%6 = tail call i32 @assertEquals(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @getNumberInWords(i32 23456)
%8 = tail call i32 @assertEquals(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = tail call i32 @getNumberInWords(i32 34567)
%10 = tail call i32 @assertEquals(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = tail call i32 @getNumberInWords(i32 45678)
%12 = tail call i32 @assertEquals(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = tail call i32 @getNumberInWords(i32 56789)
%14 = tail call i32 @assertEquals(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = tail call i32 @getNumberInWords(i32 67890)
%16 = tail call i32 @assertEquals(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0), i32 %15)
%17 = tail call i32 @getNumberInWords(i32 78901)
%18 = tail call i32 @assertEquals(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i32 %17)
%19 = tail call i32 @getNumberInWords(i32 89012)
%20 = tail call i32 @assertEquals(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i32 %19)
%21 = tail call i32 @getNumberInWords(i32 90123)
%22 = tail call i32 @assertEquals(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0), i32 %21)
%23 = tail call i32 @getNumberInWords(i32 99999)
%24 = tail call i32 @assertEquals(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.11, i64 0, i64 0), i32 %23)
ret void
}