#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 main() {
  int i, current;
  for (i = 1; i <= 100; i++) {
    current = i;
    if (current == 100) {
      printf("C");
      current = 0;
    }
    if (current >= 50) {
      printf("L");
      current -= 50;
    }
    while (current >= 10) {
      printf("X");
      current -= 10;
    }
    if (current >= 5) {
      if (current % 10 == 9) {
        printf("IX");
        current -= 9;
      } else {
        printf("V");
        current -= 5;
      }
    }
    while (current > 0) {
      if (current % 10 == 4) {
        printf("IV");
        current -= 4;
      } else {
        printf("I");
        current -= 1;
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     125e <main+0x14e>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jne    1153 <main+0x43>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jl     1172 <main+0x62>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x32,%eax
mov    %eax,-0xc(%rbp)
jmp    1177 <main+0x67>
cmpl   $0xa,-0xc(%rbp)
jl     119b <main+0x8b>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    1177 <main+0x67>
cmpl   $0x5,-0xc(%rbp)
jl     11ed <main+0xdd>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%edx
jne    11d3 <main+0xc3>
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x9,%eax
mov    %eax,-0xc(%rbp)
jmp    11e8 <main+0xd8>
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0xc(%rbp)
jmp    11ed <main+0xdd>
jmp    11f2 <main+0xe2>
cmpl   $0x0,-0xc(%rbp)
jle    1244 <main+0x134>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x4,%edx
jne    122a <main+0x11a>
lea    0xdf0(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    123f <main+0x12f>
lea    0xdd9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11f2 <main+0xe2>
lea    0xdc1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xecd(%rip),%r14
lea    0xec9(%rip),%r15
jmp    115e <main+0x3e>
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
je     1215 <main+0xf5>
cmp    $0x64,%ebx
je     1201 <main+0xe1>
mov    %ebx,%ebp
cmp    $0x32,%ebx
jb     117b <main+0x5b>
mov    $0x4c,%edi
call   1030 <putchar@plt>
lea    -0x32(%rbx),%ebp
cmp    $0xa,%ebp
jb     1192 <main+0x72>
mov    $0x58,%edi
call   1030 <putchar@plt>
add    $0xfffffff6,%ebp
cmp    $0x9,%ebp
ja     1180 <main+0x60>
cmp    $0x5,%ebp
jb     11af <main+0x8f>
imul   $0xffffffcd,%ebp,%eax
add    $0xcb,%al
ror    %al
cmp    $0x18,%al
jbe    1140 <main+0x20>
mov    $0x56,%edi
call   1030 <putchar@plt>
add    $0xfffffffb,%ebp
test   %ebp,%ebp
jne    11d7 <main+0xb7>
jmp    1148 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x49,%edi
call   1030 <putchar@plt>
mov    $0xffffffff,%eax
add    %eax,%ebp
jle    1148 <main+0x28>
imul   $0xcccccccd,%ebp,%eax
add    $0xcccccccc,%eax
ror    %eax
cmp    $0x19999999,%eax
ja     11c0 <main+0xa0>
mov    %r15,%rdi
call   1040 <printf@plt>
mov    $0xfffffffc,%eax
add    %eax,%ebp
jg     11d7 <main+0xb7>
jmp    1148 <main+0x28>
mov    $0x43,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"C\00"
@.str.1 = [2 x i8] c"L\00"
@.str.2 = [2 x i8] c"X\00"
@.str.3 = [3 x i8] c"IX\00"
@.str.4 = [2 x i8] c"V\00"
@.str.5 = [3 x i8] c"IV\00"
@.str.6 = [2 x i8] c"I\00"
@.str.7 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %4
4: ; preds = %63, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %66
7: ; preds = %4
%8 = load i32, i32* %2
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 100
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 50
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* %3
%19 = sub nsw i32 %18, 50
store i32 %19, i32* %3
br label %20
20: ; preds = %16, %13
br label %21
21: ; preds = %24, %20
%22 = load i32, i32* %3
%23 = icmp sge i32 %22, 10
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* %3
%27 = sub nsw i32 %26, 10
store i32 %27, i32* %3
br label %21
28: ; preds = %21
%29 = load i32, i32* %3
%30 = icmp sge i32 %29, 5
br i1 %30, label %31, label %44
31: ; preds = %28
%32 = load i32, i32* %3
%33 = srem i32 %32, 10
%34 = icmp eq i32 %33, 9
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%37 = load i32, i32* %3
%38 = sub nsw i32 %37, 9
store i32 %38, i32* %3
br label %43
39: ; preds = %31
%40 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%41 = load i32, i32* %3
%42 = sub nsw i32 %41, 5
store i32 %42, i32* %3
br label %43
43: ; preds = %39, %35
br label %44
44: ; preds = %43, %28
br label %45
45: ; preds = %60, %44
%46 = load i32, i32* %3
%47 = icmp sgt i32 %46, 0
br i1 %47, label %48, label %61
48: ; preds = %45
%49 = load i32, i32* %3
%50 = srem i32 %49, 10
%51 = icmp eq i32 %50, 4
br i1 %51, label %52, label %56
52: ; preds = %48
%53 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%54 = load i32, i32* %3
%55 = sub nsw i32 %54, 4
store i32 %55, i32* %3
br label %60
56: ; preds = %48
%57 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%58 = load i32, i32* %3
%59 = sub nsw i32 %58, 1
store i32 %59, i32* %3
br label %60
60: ; preds = %56, %52
br label %45
61: ; preds = %45
%62 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %63
63: ; preds = %61
%64 = load i32, i32* %2
%65 = add nsw i32 %64, 1
store i32 %65, i32* %2
br label %4
66: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"IX\00"
@.str.5 = [3 x i8] c"IV\00"
define i32 @main() {
br label %1
1: ; preds = %0, %47
%2 = phi i32 [ 1, %0 ], [ %49, %47 ]
%3 = icmp eq i32 %2, 100
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @putchar(i32 67)
%6 = tail call i32 @putchar(i32 10)
br label %51
7: ; preds = %1
%8 = icmp ugt i32 %2, 49
br i1 %8, label %9, label %12
9: ; preds = %7
%10 = tail call i32 @putchar(i32 76)
%11 = add nsw i32 %2, -50
br label %12
12: ; preds = %9, %7
%13 = phi i32 [ %11, %9 ], [ %2, %7 ]
%14 = icmp ugt i32 %13, 9
br i1 %14, label %15, label %20
15: ; preds = %12, %15
%16 = phi i32 [ %18, %15 ], [ %13, %12 ]
%17 = tail call i32 @putchar(i32 88)
%18 = add nsw i32 %16, -10
%19 = icmp ugt i32 %18, 9
br i1 %19, label %15, label %20
20: ; preds = %15, %12
%21 = phi i32 [ %13, %12 ], [ %18, %15 ]
%22 = icmp ugt i32 %21, 4
br i1 %22, label %23, label %32
23: ; preds = %20
%24 = trunc i32 %21 to i8
%25 = urem i8 %24, 10
%26 = icmp eq i8 %25, 9
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %47
29: ; preds = %23
%30 = tail call i32 @putchar(i32 86)
%31 = add nsw i32 %21, -5
br label %32
32: ; preds = %29, %20
%33 = phi i32 [ %31, %29 ], [ %21, %20 ]
%34 = icmp eq i32 %33, 0
br i1 %34, label %47, label %35
35: ; preds = %32, %43
%36 = phi i32 [ %45, %43 ], [ %33, %32 ]
%37 = urem i32 %36, 10
%38 = icmp eq i32 %37, 4
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %43
41: ; preds = %35
%42 = tail call i32 @putchar(i32 73)
br label %43
43: ; preds = %41, %39
%44 = phi i32 [ -1, %41 ], [ -4, %39 ]
%45 = add nsw i32 %36, %44
%46 = icmp sgt i32 %45, 0
br i1 %46, label %35, label %47
47: ; preds = %43, %27, %32
%48 = tail call i32 @putchar(i32 10)
%49 = add nuw nsw i32 %2, 1
%50 = icmp eq i32 %49, 101
br i1 %50, label %51, label %1
51: ; preds = %47, %4
ret i32 0
}