#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 test7DigitNumbers() {
  assertEquals("ten lakh", getNumberInWords(1000000));
  assertEquals("ten lakh one", getNumberInWords(1000001));
  assertEquals("eleven lakh eleven thousand one hundred eleven",
               getNumberInWords(1111111));
  assertEquals("twenty two lakh twenty two thousand two hundred twenty two",
               getNumberInWords(2222222));
  assertEquals(
      "thirty three lakh thirty three thousand three hundred thirty three",
      getNumberInWords(3333333));
  assertEquals("forty four lakh forty four thousand four hundred forty four",
               getNumberInWords(4444444));
  assertEquals("fifty five lakh fifty five thousand five hundred fifty five",
               getNumberInWords(5555555));
  assertEquals("sixty six lakh sixty six thousand six hundred sixty six",
               getNumberInWords(6666666));
  assertEquals(
      "seventy seven lakh seventy seven thousand seven hundred seventy seven",
      getNumberInWords(7777777));
  assertEquals(
      "eighty eight lakh eighty eight thousand eight hundred eighty eight",
      getNumberInWords(8888888));
  assertEquals("ninety nine lakh ninety nine thousand nine hundred ninety nine",
               getNumberInWords(9999999));
}


x86 assembly (clang, -O0):
<test7DigitNumbers>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf4240,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0xf4241,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x10f447,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x21e88e,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xec6(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x32dcd5,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xee9(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x43d11c,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf14(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x54c563,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf38(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x65b9aa,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf5c(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x76adf1,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xf7c(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x87a238,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xfaa(%rip),%rdi
call   1030 <assertEquals@plt>
mov    $0x98967f,%edi
call   1040 <getNumberInWords@plt>
mov    %eax,%esi
lea    0xfd5(%rip),%rdi
call   1030 <assertEquals@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test7DigitNumbers>:
push   %rax
mov    $0xf4240,%edi
call   1040 <getNumberInWords@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0xf4241,%edi
call   1040 <getNumberInWords@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x10f447,%edi
call   1040 <getNumberInWords@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x21e88e,%edi
call   1040 <getNumberInWords@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x32dcd5,%edi
call   1040 <getNumberInWords@plt>
lea    0xeee(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x43d11c,%edi
call   1040 <getNumberInWords@plt>
lea    0xf19(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x54c563,%edi
call   1040 <getNumberInWords@plt>
lea    0xf3d(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x65b9aa,%edi
call   1040 <getNumberInWords@plt>
lea    0xf61(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x76adf1,%edi
call   1040 <getNumberInWords@plt>
lea    0xf81(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x87a238,%edi
call   1040 <getNumberInWords@plt>
lea    0xfaf(%rip),%rdi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x98967f,%edi
call   1040 <getNumberInWords@plt>
lea    0xfda(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <assertEquals@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ten lakh\00"
@.str.1 = [13 x i8] c"ten lakh one\00"
@.str.2 = [47 x i8] c"eleven lakh eleven thousand one hundred eleven\00"
@.str.3 = [59 x i8] c"twenty two lakh twenty two thousand two hundred twenty two\00"
@.str.4 = [67 x i8] c"thirty three lakh thirty three thousand three hundred thirty three\00"
@.str.5 = [60 x i8] c"forty four lakh forty four thousand four hundred forty four\00"
@.str.6 = [60 x i8] c"fifty five lakh fifty five thousand five hundred fifty five\00"
@.str.7 = [56 x i8] c"sixty six lakh sixty six thousand six hundred sixty six\00"
@.str.8 = [70 x i8] c"seventy seven lakh seventy seven thousand seven hundred seventy seven\00"
@.str.9 = [67 x i8] c"eighty eight lakh eighty eight thousand eight hundred eighty eight\00"
@.str.10 = [63 x i8] c"ninety nine lakh ninety nine thousand nine hundred ninety nine\00"
define void @test7DigitNumbers() {
%1 = call i32 @getNumberInWords(i32 1000000)
%2 = call i32 @assertEquals(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @getNumberInWords(i32 1000001)
%4 = call i32 @assertEquals(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @getNumberInWords(i32 1111111)
%6 = call i32 @assertEquals(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 @getNumberInWords(i32 2222222)
%8 = call i32 @assertEquals(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = call i32 @getNumberInWords(i32 3333333)
%10 = call i32 @assertEquals(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = call i32 @getNumberInWords(i32 4444444)
%12 = call i32 @assertEquals(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = call i32 @getNumberInWords(i32 5555555)
%14 = call i32 @assertEquals(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = call i32 @getNumberInWords(i32 6666666)
%16 = call i32 @assertEquals(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0), i32 %15)
%17 = call i32 @getNumberInWords(i32 7777777)
%18 = call i32 @assertEquals(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.8, i64 0, i64 0), i32 %17)
%19 = call i32 @getNumberInWords(i32 8888888)
%20 = call i32 @assertEquals(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.9, i64 0, i64 0), i32 %19)
%21 = call i32 @getNumberInWords(i32 9999999)
%22 = call i32 @assertEquals(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.10, i64 0, i64 0), i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ten lakh\00"
@.str.1 = [13 x i8] c"ten lakh one\00"
@.str.2 = [47 x i8] c"eleven lakh eleven thousand one hundred eleven\00"
@.str.3 = [59 x i8] c"twenty two lakh twenty two thousand two hundred twenty two\00"
@.str.4 = [67 x i8] c"thirty three lakh thirty three thousand three hundred thirty three\00"
@.str.5 = [60 x i8] c"forty four lakh forty four thousand four hundred forty four\00"
@.str.6 = [60 x i8] c"fifty five lakh fifty five thousand five hundred fifty five\00"
@.str.7 = [56 x i8] c"sixty six lakh sixty six thousand six hundred sixty six\00"
@.str.8 = [70 x i8] c"seventy seven lakh seventy seven thousand seven hundred seventy seven\00"
@.str.9 = [67 x i8] c"eighty eight lakh eighty eight thousand eight hundred eighty eight\00"
@.str.10 = [63 x i8] c"ninety nine lakh ninety nine thousand nine hundred ninety nine\00"
define void @test7DigitNumbers() {
%1 = tail call i32 @getNumberInWords(i32 1000000)
%2 = tail call i32 @assertEquals(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @getNumberInWords(i32 1000001)
%4 = tail call i32 @assertEquals(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @getNumberInWords(i32 1111111)
%6 = tail call i32 @assertEquals(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @getNumberInWords(i32 2222222)
%8 = tail call i32 @assertEquals(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = tail call i32 @getNumberInWords(i32 3333333)
%10 = tail call i32 @assertEquals(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = tail call i32 @getNumberInWords(i32 4444444)
%12 = tail call i32 @assertEquals(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = tail call i32 @getNumberInWords(i32 5555555)
%14 = tail call i32 @assertEquals(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = tail call i32 @getNumberInWords(i32 6666666)
%16 = tail call i32 @assertEquals(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0), i32 %15)
%17 = tail call i32 @getNumberInWords(i32 7777777)
%18 = tail call i32 @assertEquals(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.8, i64 0, i64 0), i32 %17)
%19 = tail call i32 @getNumberInWords(i32 8888888)
%20 = tail call i32 @assertEquals(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.9, i64 0, i64 0), i32 %19)
%21 = tail call i32 @getNumberInWords(i32 9999999)
%22 = tail call i32 @assertEquals(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.10, i64 0, i64 0), i32 %21)
ret void
}