#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 inputNumber();
int /*<<< orphan*/ printHundreds(int);
int /*<<< orphan*/ printOnes(int);
int /*<<< orphan*/ printTens(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int normalNum = 0;
  normalNum = inputNumber();
  printf("\nDecimal number %d in Roman Numerals is: ", normalNum);
  if (normalNum == 1000)
    printf("M");
  else if (normalNum > 99)
    printHundreds(normalNum);
  else if (normalNum > 9)
    printTens(normalNum);
  else
    printOnes(normalNum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <inputNumber@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x3e8,-0x8(%rbp)
jne    11a1 <main+0x51>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11e1 <main+0x91>
cmpl   $0x63,-0x8(%rbp)
jle    11b8 <main+0x68>
mov    -0x8(%rbp),%edi
call   1060 <printHundreds@plt>
jmp    11dc <main+0x8c>
cmpl   $0x9,-0x8(%rbp)
jle    11cf <main+0x7f>
mov    -0x8(%rbp),%edi
call   1040 <printTens@plt>
jmp    11d7 <main+0x87>
mov    -0x8(%rbp),%edi
call   1070 <printOnes@plt>
jmp    11dc <main+0x8c>
jmp    11e1 <main+0x91>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <inputNumber@plt>
mov    %eax,%ebx
lea    0xe8f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x3e8,%ebx
jne    118e <main+0x2e>
mov    $0x4d,%edi
call   1040 <putchar@plt>
jmp    11af <main+0x4f>
cmp    $0x64,%ebx
jl     119c <main+0x3c>
mov    %ebx,%edi
call   1070 <printHundreds@plt>
jmp    11af <main+0x4f>
mov    %ebx,%edi
cmp    $0xa,%ebx
jl     11aa <main+0x4a>
call   1050 <printTens@plt>
jmp    11af <main+0x4f>
call   1080 <printOnes@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"\0ADecimal number %d in Roman Numerals is: \00"
@.str.1 = [2 x i8] c"M\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @inputNumber()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1000
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %27
10: ; preds = %0
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 99
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %2
%15 = call i32 @printHundreds(i32 %14)
br label %26
16: ; preds = %10
%17 = load i32, i32* %2
%18 = icmp sgt i32 %17, 9
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* %2
%21 = call i32 @printTens(i32 %20)
br label %25
22: ; preds = %16
%23 = load i32, i32* %2
%24 = call i32 @printOnes(i32 %23)
br label %25
25: ; preds = %22, %19
br label %26
26: ; preds = %25, %13
br label %27
27: ; preds = %26, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"\0ADecimal number %d in Roman Numerals is: \00"
define i32 @main() {
%1 = tail call i32 (...) @inputNumber()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %1, 1000
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @putchar(i32 77)
br label %16
6: ; preds = %0
%7 = icmp sgt i32 %1, 99
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @printHundreds(i32 %1)
br label %16
10: ; preds = %6
%11 = icmp sgt i32 %1, 9
br i1 %11, label %12, label %14
12: ; preds = %10
%13 = tail call i32 @printTens(i32 %1)
br label %16
14: ; preds = %10
%15 = tail call i32 @printOnes(i32 %1)
br label %16
16: ; preds = %8, %14, %12, %4
ret i32 0
}