#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 */
typedef int uint;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ check_intInput(int *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ number_as_word(int);
int /*<<< orphan*/ printf(char *);
int main() {
  uint number;
  check_intInput(&number);
  if (number == 0) {
    printf("Zero");
    exit(EXIT_SUCCESS);
  } else if (number < 0 || number > 999) {
    printf("Incorrect input.");
    exit(EXIT_FAILURE);
  }
  number_as_word(number);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <check_intInput@plt>
cmpl   $0x0,-0x8(%rbp)
jne    117c <main+0x3c>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
cmpl   $0x0,-0x8(%rbp)
jl     1193 <main+0x53>
cmpl   $0x3e7,-0x8(%rbp)
jle    11ad <main+0x6d>
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
jmp    11b2 <main+0x72>
mov    -0x8(%rbp),%edi
call   1050 <number_as_word@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <check_intInput@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
je     116b <main+0x2b>
cmp    $0x3e8,%edi
jae    1185 <main+0x45>
call   1050 <number_as_word@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"Zero\00"
@EXIT_SUCCESS = global i32 0
@.str.1 = [17 x i8] c"Incorrect input.\00"
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @check_intInput(i32* %2)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_SUCCESS
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 999
br i1 %15, label %16, label %20
16: ; preds = %13, %10
%17 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %13
br label %21
21: ; preds = %20
%22 = load i32, i32* %2
%23 = call i32 @number_as_word(i32 %22)
%24 = load i32, i32* @EXIT_SUCCESS
ret i32 %24
}

LLVM IR (-O2):
@.str = [5 x i8] c"Zero\00"
@EXIT_SUCCESS = global i32 0
@.str.1 = [17 x i8] c"Incorrect input.\00"
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @check_intInput(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_SUCCESS
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %0
%11 = icmp ugt i32 %4, 999
br i1 %11, label %12, label %16
12: ; preds = %10
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %10
%17 = call i32 @number_as_word(i32 %4)
%18 = load i32, i32* @EXIT_SUCCESS
ret i32 %18
}