#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*/ cloneStr(char *, int, char *);
char *nameOnes(char);
int /*<<< orphan*/ nameTens(char *, char, char);
int /*<<< orphan*/ strMerge(char *, int, char *, int, char *, int);
void nameHundreds(char *hundredsName, char hundreds, char tens, char ones) {
  char tensName[14];
  nameTens(tensName, tens, ones);
  if (hundreds == '0') {
    cloneStr(tensName, 14, hundredsName);
    return;
  }
  strMerge(nameOnes(hundreds), 6, " hundred and ", 14, hundredsName, 32);
  strMerge(hundredsName, 32, tensName, 14, hundredsName, 32);
}


x86 assembly (clang, -O0):
<nameHundreds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
lea    -0x19(%rbp),%rdi
mov    -0xa(%rbp),%al
movsbl %al,%esi
movsbl -0xb(%rbp),%edx
call   1040 <nameTens@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x30,%eax
jne    1193 <nameHundreds+0x53>
lea    -0x19(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0xe,%esi
call   1060 <cloneStr@plt>
jmp    11de <nameHundreds+0x9e>
movsbl -0x9(%rbp),%edi
call   1050 <nameOnes@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%r8
mov    $0x6,%esi
lea    0xe51(%rip),%rdx
mov    $0xe,%ecx
mov    $0x20,%r9d
call   1030 <strMerge@plt>
mov    -0x8(%rbp),%rdi
lea    -0x19(%rbp),%rdx
mov    -0x8(%rbp),%r8
mov    $0x20,%r9d
mov    $0xe,%ecx
mov    %r9d,%esi
call   1030 <strMerge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nameHundreds>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xa(%rsp),%rdi
mov    %edx,%esi
mov    %ecx,%edx
call   1040 <nameTens@plt>
cmp    $0x30,%bpl
jne    1173 <nameHundreds+0x33>
lea    0xa(%rsp),%rdi
mov    $0xe,%esi
mov    %rbx,%rdx
call   1060 <cloneStr@plt>
jmp    11be <nameHundreds+0x7e>
movsbl %bpl,%edi
call   1050 <nameOnes@plt>
lea    0xe7d(%rip),%rdx
mov    %rax,%rdi
mov    $0x6,%esi
mov    $0xe,%ecx
mov    %rbx,%r8
mov    $0x20,%r9d
call   1030 <strMerge@plt>
lea    0xa(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    $0xe,%ecx
mov    %rbx,%r8
mov    $0x20,%r9d
call   1030 <strMerge@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c" hundred and \00"
define void @nameHundreds(i8* %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca [14 x i8]
store i8* %0, i8** %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = getelementptr inbounds [14 x i8], [14 x i8]* %9, i64 0, i64 0
%11 = load i8, i8* %7
%12 = load i8, i8* %8
%13 = call i32 @nameTens(i8* %10, i8 signext %11, i8 signext %12)
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 48
br i1 %16, label %17, label %21
17: ; preds = %4
%18 = getelementptr inbounds [14 x i8], [14 x i8]* %9, i64 0, i64 0
%19 = load i8*, i8** %5
%20 = call i32 @cloneStr(i8* %18, i32 14, i8* %19)
br label %30
21: ; preds = %4
%22 = load i8, i8* %6
%23 = call i8* @nameOnes(i8 signext %22)
%24 = load i8*, i8** %5
%25 = call i32 @strMerge(i8* %23, i32 6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 14, i8* %24, i32 32)
%26 = load i8*, i8** %5
%27 = getelementptr inbounds [14 x i8], [14 x i8]* %9, i64 0, i64 0
%28 = load i8*, i8** %5
%29 = call i32 @strMerge(i8* %26, i32 32, i8* %27, i32 14, i8* %28, i32 32)
br label %30
30: ; preds = %21, %17
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c" hundred and \00"
define void @nameHundreds(i8* %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca [14 x i8]
%6 = getelementptr inbounds [14 x i8], [14 x i8]* %5, i64 0, i64 0
%7 = call i32 @nameTens(i8* %6, i8 signext %2, i8 signext %3)
%8 = icmp eq i8 %1, 48
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = call i32 @cloneStr(i8* %6, i32 14, i8* %0)
br label %15
11: ; preds = %4
%12 = call i8* @nameOnes(i8 signext %1)
%13 = call i32 @strMerge(i8* %12, i32 6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 14, i8* %0, i32 32)
%14 = call i32 @strMerge(i8* %0, i32 32, i8* %6, i32 14, i8* %0, i32 32)
br label %15
15: ; preds = %11, %9
ret void
}