#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 test9DigitNumbers() {
  assertEquals("ten crore", getNumberInWords(100000000));
  assertEquals("ten crore one", getNumberInWords(100000001));
  assertEquals("twelve crore thirty one lakh twenty three thousand one hundred "
               "twenty three",
               getNumberInWords(123123123));
  assertEquals("twenty three crore forty two lakh thirty four thousand two "
               "hundred thirty four",
               getNumberInWords(234234234));
  assertEquals("thirty four crore fifty three lakh forty five thousand three "
               "hundred forty five",
               getNumberInWords(345345345));
  assertEquals("forty five crore sixty four lakh fifty six thousand four "
               "hundred fifty six",
               getNumberInWords(456456456));
  assertEquals("fifty six crore seventy five lakh sixty seven thousand five "
               "hundred sixty seven",
               getNumberInWords(567567567));
  assertEquals("sixty seven crore eighty six lakh seventy eight thousand six "
               "hundred seventy eight",
               getNumberInWords(678678678));
  assertEquals("seventy eight crore ninety seven lakh eighty nine thousand "
               "seven hundred eighty nine",
               getNumberInWords(789789789));
  assertEquals(
      "eighty nine crore eight lakh ninety thousand eight hundred ninety",
      getNumberInWords(890890890));
  assertEquals("ninety crore nineteen lakh one thousand nine hundred one",
               getNumberInWords(901901901));
  assertEquals("ninety nine crore ninety nine lakh ninety nine thousand nine "
               "hundred ninety nine",
               getNumberInWords(999999999));
}


x86 assembly (clang, -O0):
<test9DigitNumbers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5f5e100,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x5f5e101,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x756b5b3,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0xdf6217a,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xee5(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x14958d41,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf1c(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x1b34f908,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf54(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x21d464cf,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf87(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x2873d096,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xfbf(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x2f133c5d,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xffa(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x3519ea8a,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0x1037(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x35c1ee4d,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0x1061(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x3b9ac9ff,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0x1082(%rip),%rdi
call   1030 <assertEquals@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9DigitNumbers>:
push   %rax
mov    $0x5f5e100,%edi
call   1040 <getNumberInWords@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x5f5e101,%edi
call   1040 <getNumberInWords@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x756b5b3,%edi
call   1040 <getNumberInWords@plt>
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0xdf6217a,%edi
call   1040 <getNumberInWords@plt>
lea    0xeea(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x14958d41,%edi
call   1040 <getNumberInWords@plt>
lea    0xf21(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x1b34f908,%edi
call   1040 <getNumberInWords@plt>
lea    0xf59(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x21d464cf,%edi
call   1040 <getNumberInWords@plt>
lea    0xf8c(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x2873d096,%edi
call   1040 <getNumberInWords@plt>
lea    0xfc4(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x2f133c5d,%edi
call   1040 <getNumberInWords@plt>
lea    0xfff(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x3519ea8a,%edi
call   1040 <getNumberInWords@plt>
lea    0x103c(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x35c1ee4d,%edi
call   1040 <getNumberInWords@plt>
lea    0x1066(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x3b9ac9ff,%edi
call   1040 <getNumberInWords@plt>
lea    0x1087(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <assertEquals@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"ten crore\00"
@.str.1 = [14 x i8] c"ten crore one\00"
@.str.2 = [76 x i8] c"twelve crore thirty one lakh twenty three thousand one hundred twenty three\00"
@.str.3 = [79 x i8] c"twenty three crore forty two lakh thirty four thousand two hundred thirty four\00"
@.str.4 = [80 x i8] c"thirty four crore fifty three lakh forty five thousand three hundred forty five\00"
@.str.5 = [75 x i8] c"forty five crore sixty four lakh fifty six thousand four hundred fifty six\00"
@.str.6 = [80 x i8] c"fifty six crore seventy five lakh sixty seven thousand five hundred sixty seven\00"
@.str.7 = [83 x i8] c"sixty seven crore eighty six lakh seventy eight thousand six hundred seventy eight\00"
@.str.8 = [85 x i8] c"seventy eight crore ninety seven lakh eighty nine thousand seven hundred eighty nine\00"
@.str.9 = [66 x i8] c"eighty nine crore eight lakh ninety thousand eight hundred ninety\00"
@.str.10 = [57 x i8] c"ninety crore nineteen lakh one thousand nine hundred one\00"
@.str.11 = [81 x i8] c"ninety nine crore ninety nine lakh ninety nine thousand nine hundred ninety nine\00"
define void @test9DigitNumbers() {
%1 = call i32 @getNumberInWords(i32 100000000)
%2 = call i32 @assertEquals(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @getNumberInWords(i32 100000001)
%4 = call i32 @assertEquals(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @getNumberInWords(i32 123123123)
%6 = call i32 @assertEquals(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 @getNumberInWords(i32 234234234)
%8 = call i32 @assertEquals(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = call i32 @getNumberInWords(i32 345345345)
%10 = call i32 @assertEquals(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = call i32 @getNumberInWords(i32 456456456)
%12 = call i32 @assertEquals(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = call i32 @getNumberInWords(i32 567567567)
%14 = call i32 @assertEquals(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = call i32 @getNumberInWords(i32 678678678)
%16 = call i32 @assertEquals(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.7, i64 0, i64 0), i32 %15)
%17 = call i32 @getNumberInWords(i32 789789789)
%18 = call i32 @assertEquals(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.8, i64 0, i64 0), i32 %17)
%19 = call i32 @getNumberInWords(i32 890890890)
%20 = call i32 @assertEquals(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.9, i64 0, i64 0), i32 %19)
%21 = call i32 @getNumberInWords(i32 901901901)
%22 = call i32 @assertEquals(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.10, i64 0, i64 0), i32 %21)
%23 = call i32 @getNumberInWords(i32 999999999)
%24 = call i32 @assertEquals(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.11, i64 0, i64 0), i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"ten crore\00"
@.str.1 = [14 x i8] c"ten crore one\00"
@.str.2 = [76 x i8] c"twelve crore thirty one lakh twenty three thousand one hundred twenty three\00"
@.str.3 = [79 x i8] c"twenty three crore forty two lakh thirty four thousand two hundred thirty four\00"
@.str.4 = [80 x i8] c"thirty four crore fifty three lakh forty five thousand three hundred forty five\00"
@.str.5 = [75 x i8] c"forty five crore sixty four lakh fifty six thousand four hundred fifty six\00"
@.str.6 = [80 x i8] c"fifty six crore seventy five lakh sixty seven thousand five hundred sixty seven\00"
@.str.7 = [83 x i8] c"sixty seven crore eighty six lakh seventy eight thousand six hundred seventy eight\00"
@.str.8 = [85 x i8] c"seventy eight crore ninety seven lakh eighty nine thousand seven hundred eighty nine\00"
@.str.9 = [66 x i8] c"eighty nine crore eight lakh ninety thousand eight hundred ninety\00"
@.str.10 = [57 x i8] c"ninety crore nineteen lakh one thousand nine hundred one\00"
@.str.11 = [81 x i8] c"ninety nine crore ninety nine lakh ninety nine thousand nine hundred ninety nine\00"
define void @test9DigitNumbers() {
%1 = tail call i32 @getNumberInWords(i32 100000000)
%2 = tail call i32 @assertEquals(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @getNumberInWords(i32 100000001)
%4 = tail call i32 @assertEquals(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @getNumberInWords(i32 123123123)
%6 = tail call i32 @assertEquals(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @getNumberInWords(i32 234234234)
%8 = tail call i32 @assertEquals(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = tail call i32 @getNumberInWords(i32 345345345)
%10 = tail call i32 @assertEquals(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = tail call i32 @getNumberInWords(i32 456456456)
%12 = tail call i32 @assertEquals(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = tail call i32 @getNumberInWords(i32 567567567)
%14 = tail call i32 @assertEquals(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = tail call i32 @getNumberInWords(i32 678678678)
%16 = tail call i32 @assertEquals(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.7, i64 0, i64 0), i32 %15)
%17 = tail call i32 @getNumberInWords(i32 789789789)
%18 = tail call i32 @assertEquals(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.8, i64 0, i64 0), i32 %17)
%19 = tail call i32 @getNumberInWords(i32 890890890)
%20 = tail call i32 @assertEquals(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.9, i64 0, i64 0), i32 %19)
%21 = tail call i32 @getNumberInWords(i32 901901901)
%22 = tail call i32 @assertEquals(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.10, i64 0, i64 0), i32 %21)
%23 = tail call i32 @getNumberInWords(i32 999999999)
%24 = tail call i32 @assertEquals(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.11, i64 0, i64 0), i32 %23)
ret void
}