#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*/ VOICE_SayAnd();
int /*<<< orphan*/ VOICE_SayNumber(int);
void VOICE_Say(int number) {
  int n_ones, n_tens, n_hundreds;
  if (number > 100) {
    n_hundreds = number / 100;
    if (n_hundreds > 1) {
      VOICE_SayNumber(n_hundreds);
    }
    VOICE_SayNumber(100);
    number %= 100;
  }
  if (number < 20) {
    VOICE_SayNumber(number);
  } else {
    n_ones = number % 10;
    n_tens = (number / 10) * 10;
    if (n_ones > 0) {
      VOICE_SayNumber(n_ones);
      VOICE_SayAnd();
    }
    VOICE_SayNumber(n_tens);
  }
}


x86 assembly (clang, -O0):
<VOICE_Say>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jle    116d <VOICE_Say+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jle    1155 <VOICE_Say+0x35>
mov    -0x10(%rbp),%edi
call   1030 <VOICE_SayNumber@plt>
mov    $0x64,%edi
call   1030 <VOICE_SayNumber@plt>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    1184 <VOICE_Say+0x64>
mov    -0x4(%rbp),%edi
call   1030 <VOICE_SayNumber@plt>
jmp    11c4 <VOICE_Say+0xa4>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
imul   $0xa,%eax,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    11bc <VOICE_Say+0x9c>
mov    -0x8(%rbp),%edi
call   1030 <VOICE_SayNumber@plt>
mov    $0x0,%al
call   1040 <VOICE_SayAnd@plt>
mov    -0xc(%rbp),%edi
call   1030 <VOICE_SayNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VOICE_Say>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x65,%edi
jl     1160 <VOICE_Say+0x40>
mov    %ebx,%r14d
cmp    $0xc8,%ebx
jb     1146 <VOICE_Say+0x26>
imul   $0x51eb851f,%r14,%rdi
shr    $0x25,%rdi
call   1030 <VOICE_SayNumber@plt>
mov    $0x64,%edi
call   1030 <VOICE_SayNumber@plt>
imul   $0x51eb851f,%r14,%rax
shr    $0x25,%rax
imul   $0x64,%eax,%eax
sub    %eax,%ebx
cmp    $0x14,%ebx
jl     118f <VOICE_Say+0x6f>
movzbl %bl,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
and    $0xfffffffe,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
movzbl %al,%edi
sub    %edi,%ebx
test   %dil,%dil
je     118f <VOICE_Say+0x6f>
call   1030 <VOICE_SayNumber@plt>
xor    %eax,%eax
call   1040 <VOICE_SayAnd@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <VOICE_SayNumber@plt>

LLVM IR (-O0):
define void @VOICE_Say(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 100
br i1 %7, label %8, label %20
8: ; preds = %1
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 100
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32, i32* %5
%15 = call i32 @VOICE_SayNumber(i32 %14)
br label %16
16: ; preds = %13, %8
%17 = call i32 @VOICE_SayNumber(i32 100)
%18 = load i32, i32* %2
%19 = srem i32 %18, 100
store i32 %19, i32* %2
br label %20
20: ; preds = %16, %1
%21 = load i32, i32* %2
%22 = icmp slt i32 %21, 20
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = call i32 @VOICE_SayNumber(i32 %24)
br label %41
26: ; preds = %20
%27 = load i32, i32* %2
%28 = srem i32 %27, 10
store i32 %28, i32* %3
%29 = load i32, i32* %2
%30 = sdiv i32 %29, 10
%31 = mul nsw i32 %30, 10
store i32 %31, i32* %4
%32 = load i32, i32* %3
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %26
%35 = load i32, i32* %3
%36 = call i32 @VOICE_SayNumber(i32 %35)
%37 = call i32 (...) @VOICE_SayAnd()
br label %38
38: ; preds = %34, %26
%39 = load i32, i32* %4
%40 = call i32 @VOICE_SayNumber(i32 %39)
br label %41
41: ; preds = %38, %23
ret void
}

LLVM IR (-O2):
define void @VOICE_Say(i32 %0) {
%2 = icmp sgt i32 %0, 100
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = icmp ugt i32 %0, 199
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = udiv i32 %0, 100
%7 = tail call i32 @VOICE_SayNumber(i32 %6)
br label %8
8: ; preds = %5, %3
%9 = tail call i32 @VOICE_SayNumber(i32 100)
%10 = urem i32 %0, 100
br label %11
11: ; preds = %8, %1
%12 = phi i32 [ %10, %8 ], [ %0, %1 ]
%13 = icmp slt i32 %12, 20
br i1 %13, label %23, label %14
14: ; preds = %11
%15 = trunc i32 %12 to i8
%16 = urem i8 %15, 10
%17 = zext i8 %16 to i32
%18 = sub nuw nsw i32 %12, %17
%19 = icmp eq i8 %16, 0
br i1 %19, label %23, label %20
20: ; preds = %14
%21 = tail call i32 @VOICE_SayNumber(i32 %17)
%22 = tail call i32 (...) @VOICE_SayAnd()
br label %23
23: ; preds = %14, %20, %11
%24 = phi i32 [ %12, %11 ], [ %18, %20 ], [ %18, %14 ]
%25 = tail call i32 @VOICE_SayNumber(i32 %24)
ret void
}