#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 test4DigitNumbers() {
  assertEquals("one thousand", getNumberInWords(1000));
  assertEquals("one thousand one", getNumberInWords(1001));
  assertEquals("one thousand two hundred thirty four", getNumberInWords(1234));
  assertEquals("two thousand three hundred forty five", getNumberInWords(2345));
  assertEquals("three thousand four hundred fifty six", getNumberInWords(3456));
  assertEquals("four thousand five hundred sixty seven",
               getNumberInWords(4567));
  assertEquals("five thousand six hundred seventy eight",
               getNumberInWords(5678));
  assertEquals("six thousand seven hundred eighty nine",
               getNumberInWords(6789));
  assertEquals("seven thousand eight hundred ninety", getNumberInWords(7890));
  assertEquals("eight thousand nine hundred one", getNumberInWords(8901));
  assertEquals("nine thousand twelve", getNumberInWords(9012));
  assertEquals("nine thousand nine hundred ninety nine",
               getNumberInWords(9999));
}


x86 assembly (clang, -O0):
<test4DigitNumbers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e8,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x3e9,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x4d2,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x929,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0xd80,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xed2(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x11d7,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xee0(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x162e,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xeef(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x1a85,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xeff(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x1ed2,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf0e(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x22c5,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf1a(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x2334,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf22(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x270f,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf1f(%rip),%rdi
call   1030 <assertEquals@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4DigitNumbers>:
push   %rax
mov    $0x3e8,%edi
call   1040 <getNumberInWords@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x3e9,%edi
call   1040 <getNumberInWords@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x4d2,%edi
call   1040 <getNumberInWords@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x929,%edi
call   1040 <getNumberInWords@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0xd80,%edi
call   1040 <getNumberInWords@plt>
lea    0xed7(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x11d7,%edi
call   1040 <getNumberInWords@plt>
lea    0xee5(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x162e,%edi
call   1040 <getNumberInWords@plt>
lea    0xef4(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x1a85,%edi
call   1040 <getNumberInWords@plt>
lea    0xf04(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x1ed2,%edi
call   1040 <getNumberInWords@plt>
lea    0xf13(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x22c5,%edi
call   1040 <getNumberInWords@plt>
lea    0xf1f(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x2334,%edi
call   1040 <getNumberInWords@plt>
lea    0xf27(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x270f,%edi
call   1040 <getNumberInWords@plt>
lea    0xf24(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <assertEquals@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"one thousand\00"
@.str.1 = [17 x i8] c"one thousand one\00"
@.str.2 = [37 x i8] c"one thousand two hundred thirty four\00"
@.str.3 = [38 x i8] c"two thousand three hundred forty five\00"
@.str.4 = [38 x i8] c"three thousand four hundred fifty six\00"
@.str.5 = [39 x i8] c"four thousand five hundred sixty seven\00"
@.str.6 = [40 x i8] c"five thousand six hundred seventy eight\00"
@.str.7 = [39 x i8] c"six thousand seven hundred eighty nine\00"
@.str.8 = [36 x i8] c"seven thousand eight hundred ninety\00"
@.str.9 = [32 x i8] c"eight thousand nine hundred one\00"
@.str.10 = [21 x i8] c"nine thousand twelve\00"
@.str.11 = [39 x i8] c"nine thousand nine hundred ninety nine\00"
define void @test4DigitNumbers() {
%1 = call i32 @getNumberInWords(i32 1000)
%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 1001)
%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 1234)
%6 = call i32 @assertEquals(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 @getNumberInWords(i32 2345)
%8 = call i32 @assertEquals(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = call i32 @getNumberInWords(i32 3456)
%10 = call i32 @assertEquals(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = call i32 @getNumberInWords(i32 4567)
%12 = call i32 @assertEquals(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = call i32 @getNumberInWords(i32 5678)
%14 = call i32 @assertEquals(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = call i32 @getNumberInWords(i32 6789)
%16 = call i32 @assertEquals(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0), i32 %15)
%17 = call i32 @getNumberInWords(i32 7890)
%18 = call i32 @assertEquals(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), i32 %17)
%19 = call i32 @getNumberInWords(i32 8901)
%20 = call i32 @assertEquals(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i32 %19)
%21 = call i32 @getNumberInWords(i32 9012)
%22 = call i32 @assertEquals(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i32 %21)
%23 = call i32 @getNumberInWords(i32 9999)
%24 = call i32 @assertEquals(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"one thousand\00"
@.str.1 = [17 x i8] c"one thousand one\00"
@.str.2 = [37 x i8] c"one thousand two hundred thirty four\00"
@.str.3 = [38 x i8] c"two thousand three hundred forty five\00"
@.str.4 = [38 x i8] c"three thousand four hundred fifty six\00"
@.str.5 = [39 x i8] c"four thousand five hundred sixty seven\00"
@.str.6 = [40 x i8] c"five thousand six hundred seventy eight\00"
@.str.7 = [39 x i8] c"six thousand seven hundred eighty nine\00"
@.str.8 = [36 x i8] c"seven thousand eight hundred ninety\00"
@.str.9 = [32 x i8] c"eight thousand nine hundred one\00"
@.str.10 = [21 x i8] c"nine thousand twelve\00"
@.str.11 = [39 x i8] c"nine thousand nine hundred ninety nine\00"
define void @test4DigitNumbers() {
%1 = tail call i32 @getNumberInWords(i32 1000)
%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 1001)
%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 1234)
%6 = tail call i32 @assertEquals(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @getNumberInWords(i32 2345)
%8 = tail call i32 @assertEquals(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = tail call i32 @getNumberInWords(i32 3456)
%10 = tail call i32 @assertEquals(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = tail call i32 @getNumberInWords(i32 4567)
%12 = tail call i32 @assertEquals(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = tail call i32 @getNumberInWords(i32 5678)
%14 = tail call i32 @assertEquals(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = tail call i32 @getNumberInWords(i32 6789)
%16 = tail call i32 @assertEquals(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0), i32 %15)
%17 = tail call i32 @getNumberInWords(i32 7890)
%18 = tail call i32 @assertEquals(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), i32 %17)
%19 = tail call i32 @getNumberInWords(i32 8901)
%20 = tail call i32 @assertEquals(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i32 %19)
%21 = tail call i32 @getNumberInWords(i32 9012)
%22 = tail call i32 @assertEquals(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i32 %21)
%23 = tail call i32 @getNumberInWords(i32 9999)
%24 = tail call i32 @assertEquals(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i32 %23)
ret void
}