#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 test8DigitNumbers() {
  assertEquals("one crore", getNumberInWords(10000000));
  assertEquals("one crore one", getNumberInWords(10000001));
  assertEquals(
      "one crore nine lakh eighty seven thousand six hundred fifty four",
      getNumberInWords(10987654));
  assertEquals(
      "two crore ten lakh ninety eight thousand seven hundred sixty five",
      getNumberInWords(21098765));
  assertEquals(
      "three crore twenty one lakh nine thousand eight hundred seventy six",
      getNumberInWords(32109876));
  assertEquals(
      "four crore thirty two lakh ten thousand nine hundred eighty seven",
      getNumberInWords(43210987));
  assertEquals("five crore forty three lakh twenty one thousand ninety eight",
               getNumberInWords(54321098));
  assertEquals("six crore fifty four lakh thirty two thousand one hundred nine",
               getNumberInWords(65432109));
  assertEquals(
      "seven crore sixty five lakh forty three thousand two hundred ten",
      getNumberInWords(76543210));
  assertEquals("eight crore seventy six lakh fifty four thousand three hundred "
               "twenty one",
               getNumberInWords(87654321));
  assertEquals("nine crore eighty seven lakh sixty five thousand four hundred "
               "thirty two",
               getNumberInWords(98765432));
  assertEquals("nine crore ninety nine lakh ninety nine thousand nine hundred "
               "ninety nine",
               getNumberInWords(99999999));
}


x86 assembly (clang, -O0):
<test8DigitNumbers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x989680,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x989681,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0xa7a886,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x141f10d,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xeda(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x1e9f534,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf04(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x29358eb,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf30(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x33cdfca,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf5a(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x3e66a2d,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf7f(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x48ff4ea,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xfa6(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x5397fb1,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xfcf(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x5e30a78,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0x1001(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x5f5e0ff,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0x1032(%rip),%rdi
call   1030 <assertEquals@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test8DigitNumbers>:
push   %rax
mov    $0x989680,%edi
call   1040 <getNumberInWords@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x989681,%edi
call   1040 <getNumberInWords@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0xa7a886,%edi
call   1040 <getNumberInWords@plt>
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x141f10d,%edi
call   1040 <getNumberInWords@plt>
lea    0xedf(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x1e9f534,%edi
call   1040 <getNumberInWords@plt>
lea    0xf09(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x29358eb,%edi
call   1040 <getNumberInWords@plt>
lea    0xf35(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x33cdfca,%edi
call   1040 <getNumberInWords@plt>
lea    0xf5f(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x3e66a2d,%edi
call   1040 <getNumberInWords@plt>
lea    0xf84(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x48ff4ea,%edi
call   1040 <getNumberInWords@plt>
lea    0xfab(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x5397fb1,%edi
call   1040 <getNumberInWords@plt>
lea    0xfd4(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x5e30a78,%edi
call   1040 <getNumberInWords@plt>
lea    0x1006(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x5f5e0ff,%edi
call   1040 <getNumberInWords@plt>
lea    0x1037(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <assertEquals@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"one crore\00"
@.str.1 = [14 x i8] c"one crore one\00"
@.str.2 = [65 x i8] c"one crore nine lakh eighty seven thousand six hundred fifty four\00"
@.str.3 = [66 x i8] c"two crore ten lakh ninety eight thousand seven hundred sixty five\00"
@.str.4 = [68 x i8] c"three crore twenty one lakh nine thousand eight hundred seventy six\00"
@.str.5 = [66 x i8] c"four crore thirty two lakh ten thousand nine hundred eighty seven\00"
@.str.6 = [61 x i8] c"five crore forty three lakh twenty one thousand ninety eight\00"
@.str.7 = [63 x i8] c"six crore fifty four lakh thirty two thousand one hundred nine\00"
@.str.8 = [65 x i8] c"seven crore sixty five lakh forty three thousand two hundred ten\00"
@.str.9 = [74 x i8] c"eight crore seventy six lakh fifty four thousand three hundred twenty one\00"
@.str.10 = [73 x i8] c"nine crore eighty seven lakh sixty five thousand four hundred thirty two\00"
@.str.11 = [74 x i8] c"nine crore ninety nine lakh ninety nine thousand nine hundred ninety nine\00"
define void @test8DigitNumbers() {
%1 = call i32 @getNumberInWords(i32 10000000)
%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 10000001)
%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 10987654)
%6 = call i32 @assertEquals(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 @getNumberInWords(i32 21098765)
%8 = call i32 @assertEquals(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = call i32 @getNumberInWords(i32 32109876)
%10 = call i32 @assertEquals(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = call i32 @getNumberInWords(i32 43210987)
%12 = call i32 @assertEquals(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = call i32 @getNumberInWords(i32 54321098)
%14 = call i32 @assertEquals(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = call i32 @getNumberInWords(i32 65432109)
%16 = call i32 @assertEquals(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0), i32 %15)
%17 = call i32 @getNumberInWords(i32 76543210)
%18 = call i32 @assertEquals(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.8, i64 0, i64 0), i32 %17)
%19 = call i32 @getNumberInWords(i32 87654321)
%20 = call i32 @assertEquals(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.9, i64 0, i64 0), i32 %19)
%21 = call i32 @getNumberInWords(i32 98765432)
%22 = call i32 @assertEquals(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.10, i64 0, i64 0), i32 %21)
%23 = call i32 @getNumberInWords(i32 99999999)
%24 = call i32 @assertEquals(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.11, i64 0, i64 0), i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"one crore\00"
@.str.1 = [14 x i8] c"one crore one\00"
@.str.2 = [65 x i8] c"one crore nine lakh eighty seven thousand six hundred fifty four\00"
@.str.3 = [66 x i8] c"two crore ten lakh ninety eight thousand seven hundred sixty five\00"
@.str.4 = [68 x i8] c"three crore twenty one lakh nine thousand eight hundred seventy six\00"
@.str.5 = [66 x i8] c"four crore thirty two lakh ten thousand nine hundred eighty seven\00"
@.str.6 = [61 x i8] c"five crore forty three lakh twenty one thousand ninety eight\00"
@.str.7 = [63 x i8] c"six crore fifty four lakh thirty two thousand one hundred nine\00"
@.str.8 = [65 x i8] c"seven crore sixty five lakh forty three thousand two hundred ten\00"
@.str.9 = [74 x i8] c"eight crore seventy six lakh fifty four thousand three hundred twenty one\00"
@.str.10 = [73 x i8] c"nine crore eighty seven lakh sixty five thousand four hundred thirty two\00"
@.str.11 = [74 x i8] c"nine crore ninety nine lakh ninety nine thousand nine hundred ninety nine\00"
define void @test8DigitNumbers() {
%1 = tail call i32 @getNumberInWords(i32 10000000)
%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 10000001)
%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 10987654)
%6 = tail call i32 @assertEquals(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @getNumberInWords(i32 21098765)
%8 = tail call i32 @assertEquals(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = tail call i32 @getNumberInWords(i32 32109876)
%10 = tail call i32 @assertEquals(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = tail call i32 @getNumberInWords(i32 43210987)
%12 = tail call i32 @assertEquals(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = tail call i32 @getNumberInWords(i32 54321098)
%14 = tail call i32 @assertEquals(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = tail call i32 @getNumberInWords(i32 65432109)
%16 = tail call i32 @assertEquals(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0), i32 %15)
%17 = tail call i32 @getNumberInWords(i32 76543210)
%18 = tail call i32 @assertEquals(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.8, i64 0, i64 0), i32 %17)
%19 = tail call i32 @getNumberInWords(i32 87654321)
%20 = tail call i32 @assertEquals(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.9, i64 0, i64 0), i32 %19)
%21 = tail call i32 @getNumberInWords(i32 98765432)
%22 = tail call i32 @assertEquals(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.10, i64 0, i64 0), i32 %21)
%23 = tail call i32 @getNumberInWords(i32 99999999)
%24 = tail call i32 @assertEquals(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.11, i64 0, i64 0), i32 %23)
ret void
}