#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*/ printf(char *);
int /*<<< orphan*/ printout_number_under100(int);
void printout_number_under1000(int N, int separator) {
  if (N < 100)
    printout_number_under100(N);
  else {
    printout_number_under100(N / 100);
    printf(" hundert");
    if (N % 100) {
      if (separator)
        printf(" and ");
      else
        printf(" ");
      printout_number_under100(N % 100);
    }
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1145 <printout_number_under1000+0x25>
mov    -0x4(%rbp),%edi
call   1030 <printout_number_under100@plt>
jmp    11b5 <printout_number_under1000+0x95>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <printout_number_under100@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11b0 <printout_number_under1000+0x90>
cmpl   $0x0,-0x8(%rbp)
je     1192 <printout_number_under1000+0x72>
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
jmp    119e <printout_number_under1000+0x7e>
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <printout_number_under100@plt>
jmp    11b5 <printout_number_under1000+0x95>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
cmp    $0x64,%edi
jl     1187 <printout_number_under1000+0x57>
mov    %esi,%r14d
mov    %ebx,%eax
imul   $0x51eb851f,%rax,%rbp
shr    $0x25,%rbp
mov    %ebp,%edi
call   1040 <printout_number_under100@plt>
lea    0xea7(%rip),%rdi
call   1050 <printf@plt>
imul   $0x64,%ebp,%eax
sub    %eax,%ebx
je     1178 <printout_number_under1000+0x48>
test   %r14d,%r14d
je     117d <printout_number_under1000+0x4d>
lea    0xe98(%rip),%rdi
call   1050 <printf@plt>
jmp    1187 <printout_number_under1000+0x57>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printout_number_under100@plt>

LLVM IR (-O0):
@.str = [9 x i8] c" hundert\00"
@.str.1 = [6 x i8] c" and \00"
@.str.2 = [2 x i8] c" \00"
define void @printout_number_under1000(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @printout_number_under100(i32 %8)
br label %30
10: ; preds = %2
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 100
%13 = call i32 @printout_number_under100(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %3
%16 = srem i32 %15, 100
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %29
18: ; preds = %10
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %25
23: ; preds = %18
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
%26 = load i32, i32* %3
%27 = srem i32 %26, 100
%28 = call i32 @printout_number_under100(i32 %27)
br label %29
29: ; preds = %25, %10
br label %30
30: ; preds = %29, %7
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c" hundert\00"
@.str.1 = [6 x i8] c" and \00"
define void @printout_number_under1000(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 100
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = udiv i32 %0, 100
%6 = tail call i32 @printout_number_under100(i32 %5)
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = urem i32 %0, 100
%9 = icmp eq i32 %8, 0
br i1 %9, label %19, label %10
10: ; preds = %4
%11 = icmp eq i32 %1, 0
br i1 %11, label %14, label %12
12: ; preds = %10
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %16
14: ; preds = %10
%15 = tail call i32 @putchar(i32 32)
br label %16
16: ; preds = %12, %14, %2
%17 = phi i32 [ %0, %2 ], [ %8, %14 ], [ %8, %12 ]
%18 = tail call i32 @printout_number_under100(i32 %17)
br label %19
19: ; preds = %16, %4
ret void
}