#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*/ scanf(char *, int *);
int main() {
  int n, temp, count = 1;
  double powe;
  printf("Enter n: ");
  scanf("%d", &n);
  printf("The output is: ");
  if (n >= 100) {
    if (n / 100 == 9) {
      printf("CM");
    } else if (n / 100 >= 5) {
      printf("D");
      if (n / 100 > 5 && n / 100 < 9) {
        temp = n / 100 - 5;
        for (count = 1; count <= temp; count++) {
          printf("C");
        }
      }
    } else if (n / 100 == 4) {
      printf("CD");
    } else if (n / 100 >= 1) {
      temp = n / 100;
      for (count = 1; count <= temp; count++) {
        printf("C");
      }
    }
    n = n % 100;
  }
  if (n >= 10) {
    if (n / 10 == 9) {
      printf("XC");
    } else if (n / 10 >= 5) {
      printf("L");
      if (n / 10 > 5 && n / 10 < 9) {
        temp = n / 10 - 5;
        for (count = 1; count <= temp; count++) {
          printf("X");
        }
      }
    } else if (n / 10 == 4) {
      printf("XL");
    } else if (n / 10 >= 1) {
      temp = n / 10;
      for (count = 1; count <= temp; count++) {
        printf("X");
      }
    }
    n = n % 10;
  }
  if (n >= 1) {
    if (n == 9) {
      printf("IX");
    } else if (n >= 5) {
      printf("V");
      if (n > 5 && n < 9) {
        temp = n - 5;
        for (count = 1; count <= temp; count++) {
          printf("I");
        }
      }
    } else if (n == 4) {
      printf("IV");
    } else if (n >= 1) {
      temp = n;
      for (count = 1; count <= temp; count++) {
        printf("I");
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x64,-0x8(%rbp)
jl     12b3 <main+0x193>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x9,%eax
jne    118d <main+0x6d>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    12a5 <main+0x185>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x5,%eax
jl     121d <main+0xfd>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x5,%eax
jle    1218 <main+0xf8>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x9,%eax
jge    1218 <main+0xf8>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
sub    $0x5,%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1213 <main+0xf3>
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ed <main+0xcd>
jmp    1218 <main+0xf8>
jmp    12a0 <main+0x180>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x4,%eax
jne    1242 <main+0x122>
lea    0xde8(%rip),%rdi
call   1030 <printf@plt>
jmp    129b <main+0x17b>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x1,%eax
jl     1296 <main+0x176>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1291 <main+0x171>
lea    0xda6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    126b <main+0x14b>
jmp    1296 <main+0x176>
jmp    129b <main+0x17b>
jmp    12a0 <main+0x180>
jmp    12a5 <main+0x185>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     1408 <main+0x2e8>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%eax
jne    12e2 <main+0x1c2>
lea    0xd4b(%rip),%rdi
call   1030 <printf@plt>
jmp    13fa <main+0x2da>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x5,%eax
jl     1372 <main+0x252>
lea    0xd2a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x5,%eax
jle    136d <main+0x24d>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%eax
jge    136d <main+0x24d>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
sub    $0x5,%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1368 <main+0x248>
lea    0xcd5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1342 <main+0x222>
jmp    136d <main+0x24d>
jmp    13f5 <main+0x2d5>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x4,%eax
jne    1397 <main+0x277>
lea    0xc99(%rip),%rdi
call   1030 <printf@plt>
jmp    13f0 <main+0x2d0>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x1,%eax
jl     13eb <main+0x2cb>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     13e6 <main+0x2c6>
lea    0xc57(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    13c0 <main+0x2a0>
jmp    13eb <main+0x2cb>
jmp    13f0 <main+0x2d0>
jmp    13f5 <main+0x2d5>
jmp    13fa <main+0x2da>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     1508 <main+0x3e8>
cmpl   $0x9,-0x8(%rbp)
jne    142d <main+0x30d>
lea    0xc06(%rip),%rdi
call   1030 <printf@plt>
jmp    1503 <main+0x3e3>
cmpl   $0x5,-0x8(%rbp)
jl     1497 <main+0x377>
lea    0xbf1(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x5,-0x8(%rbp)
jle    1492 <main+0x372>
cmpl   $0x9,-0x8(%rbp)
jge    1492 <main+0x372>
mov    -0x8(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     148d <main+0x36d>
lea    0xbb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1467 <main+0x347>
jmp    1492 <main+0x372>
jmp    14fe <main+0x3de>
cmpl   $0x4,-0x8(%rbp)
jne    14b2 <main+0x392>
lea    0xb86(%rip),%rdi
call   1030 <printf@plt>
jmp    14f9 <main+0x3d9>
cmpl   $0x1,-0x8(%rbp)
jl     14f4 <main+0x3d4>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     14ef <main+0x3cf>
lea    0xb50(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    14c9 <main+0x3a9>
jmp    14f4 <main+0x3d4>
jmp    14f9 <main+0x3d9>
jmp    14fe <main+0x3de>
jmp    1503 <main+0x3e3>
jmp    1508 <main+0x3e8>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    0xc(%rsp),%ebx
cmp    $0x64,%ebx
jge    117d <main+0x4d>
cmp    $0xa,%ebx
jge    124a <main+0x11a>
test   %ebx,%ebx
jg     1307 <main+0x1d7>
jmp    1318 <main+0x1e8>
lea    -0x384(%rbx),%eax
cmp    $0x64,%eax
jae    1199 <main+0x69>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
jmp    121f <main+0xef>
cmp    $0x1f4,%ebx
jb     11e1 <main+0xb1>
mov    $0x44,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
lea    -0x258(%rax),%ecx
cmp    $0x12b,%ecx
ja     121f <main+0xef>
movzwl %ax,%eax
shr    $0x2,%eax
imul   $0x147b,%eax,%ebx
shr    $0x11,%ebx
add    $0xfffffffb,%ebx
nop
mov    $0x43,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11d0 <main+0xa0>
jmp    121f <main+0xef>
lea    -0x190(%rbx),%eax
cmp    $0x64,%eax
jae    11fa <main+0xca>
lea    0xe2d(%rip),%rdi
call   1040 <printf@plt>
jmp    121f <main+0xef>
mov    %ebx,%eax
imul   $0x51eb851f,%rax,%rbx
shr    $0x25,%rbx
nopw   0x0(%rax,%rax,1)
mov    $0x43,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1210 <main+0xe0>
movslq 0xc(%rsp),%rbx
imul   $0x51eb851f,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%ebx
mov    %ebx,0xc(%rsp)
cmp    $0xa,%ebx
jl     1170 <main+0x40>
lea    -0x5a(%rbx),%eax
cmp    $0xa,%eax
jae    1263 <main+0x133>
lea    0xdca(%rip),%rdi
call   1040 <printf@plt>
jmp    12df <main+0x1af>
cmp    $0x32,%ebx
jb     12a1 <main+0x171>
mov    $0x4c,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
lea    -0x3c(%rax),%ecx
cmp    $0x1d,%ecx
ja     12df <main+0x1af>
movzbl %al,%eax
imul   $0xcd,%eax,%ebx
shr    $0xb,%ebx
add    $0xfffffffb,%ebx
nopl   (%rax)
mov    $0x58,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1290 <main+0x160>
jmp    12df <main+0x1af>
lea    -0x28(%rbx),%eax
cmp    $0xa,%eax
jae    12b7 <main+0x187>
lea    0xd76(%rip),%rdi
call   1040 <printf@plt>
jmp    12df <main+0x1af>
movzbl %bl,%eax
imul   $0xcd,%eax,%eax
shr    $0xb,%eax
add    $0x1,%al
movzbl %al,%ebx
add    $0xffffffff,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x58,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    12d0 <main+0x1a0>
movslq 0xc(%rsp),%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
mov    %ebx,0xc(%rsp)
test   %ebx,%ebx
jle    1318 <main+0x1e8>
cmp    $0x9,%ebx
jne    1320 <main+0x1f0>
lea    0xd16(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
cmp    $0x5,%ebx
jb     1351 <main+0x221>
mov    $0x56,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%ebx
lea    -0x6(%rbx),%eax
cmp    $0x2,%eax
ja     1318 <main+0x1e8>
add    $0xfffffffb,%ebx
xchg   %ax,%ax
mov    $0x49,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1340 <main+0x210>
jmp    1318 <main+0x1e8>
cmp    $0x4,%ebx
jne    1360 <main+0x230>
lea    0xccf(%rip),%rdi
jmp    1313 <main+0x1e3>
nop
mov    $0x49,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1360 <main+0x230>
jmp    1318 <main+0x1e8>

LLVM IR (-O0):
@.str = [10 x i8] c"Enter n: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"The output is: \00"
@.str.3 = [3 x i8] c"CM\00"
@.str.4 = [2 x i8] c"D\00"
@.str.5 = [2 x i8] c"C\00"
@.str.6 = [3 x i8] c"CD\00"
@.str.7 = [3 x i8] c"XC\00"
@.str.8 = [2 x i8] c"L\00"
@.str.9 = [2 x i8] c"X\00"
@.str.10 = [3 x i8] c"XL\00"
@.str.11 = [3 x i8] c"IX\00"
@.str.12 = [2 x i8] c"V\00"
@.str.13 = [2 x i8] c"I\00"
@.str.14 = [3 x i8] c"IV\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 0, i32* %1
store i32 1, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 100
br i1 %10, label %11, label %74
11: ; preds = %0
%12 = load i32, i32* %2
%13 = sdiv i32 %12, 100
%14 = icmp eq i32 %13, 9
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %71
17: ; preds = %11
%18 = load i32, i32* %2
%19 = sdiv i32 %18, 100
%20 = icmp sge i32 %19, 5
br i1 %20, label %21, label %45
21: ; preds = %17
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%23 = load i32, i32* %2
%24 = sdiv i32 %23, 100
%25 = icmp sgt i32 %24, 5
br i1 %25, label %26, label %44
26: ; preds = %21
%27 = load i32, i32* %2
%28 = sdiv i32 %27, 100
%29 = icmp slt i32 %28, 9
br i1 %29, label %30, label %44
30: ; preds = %26
%31 = load i32, i32* %2
%32 = sdiv i32 %31, 100
%33 = sub nsw i32 %32, 5
store i32 %33, i32* %3
store i32 1, i32* %4
br label %34
34: ; preds = %40, %30
%35 = load i32, i32* %4
%36 = load i32, i32* %3
%37 = icmp sle i32 %35, %36
br i1 %37, label %38, label %43
38: ; preds = %34
%39 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %40
40: ; preds = %38
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %34
43: ; preds = %34
br label %44
44: ; preds = %43, %26, %21
br label %70
45: ; preds = %17
%46 = load i32, i32* %2
%47 = sdiv i32 %46, 100
%48 = icmp eq i32 %47, 4
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %69
51: ; preds = %45
%52 = load i32, i32* %2
%53 = sdiv i32 %52, 100
%54 = icmp sge i32 %53, 1
br i1 %54, label %55, label %68
55: ; preds = %51
%56 = load i32, i32* %2
%57 = sdiv i32 %56, 100
store i32 %57, i32* %3
store i32 1, i32* %4
br label %58
58: ; preds = %64, %55
%59 = load i32, i32* %4
%60 = load i32, i32* %3
%61 = icmp sle i32 %59, %60
br i1 %61, label %62, label %67
62: ; preds = %58
%63 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %64
64: ; preds = %62
%65 = load i32, i32* %4
%66 = add nsw i32 %65, 1
store i32 %66, i32* %4
br label %58
67: ; preds = %58
br label %68
68: ; preds = %67, %51
br label %69
69: ; preds = %68, %49
br label %70
70: ; preds = %69, %44
br label %71
71: ; preds = %70, %15
%72 = load i32, i32* %2
%73 = srem i32 %72, 100
store i32 %73, i32* %2
br label %74
74: ; preds = %71, %0
%75 = load i32, i32* %2
%76 = icmp sge i32 %75, 10
br i1 %76, label %77, label %140
77: ; preds = %74
%78 = load i32, i32* %2
%79 = sdiv i32 %78, 10
%80 = icmp eq i32 %79, 9
br i1 %80, label %81, label %83
81: ; preds = %77
%82 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %137
83: ; preds = %77
%84 = load i32, i32* %2
%85 = sdiv i32 %84, 10
%86 = icmp sge i32 %85, 5
br i1 %86, label %87, label %111
87: ; preds = %83
%88 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%89 = load i32, i32* %2
%90 = sdiv i32 %89, 10
%91 = icmp sgt i32 %90, 5
br i1 %91, label %92, label %110
92: ; preds = %87
%93 = load i32, i32* %2
%94 = sdiv i32 %93, 10
%95 = icmp slt i32 %94, 9
br i1 %95, label %96, label %110
96: ; preds = %92
%97 = load i32, i32* %2
%98 = sdiv i32 %97, 10
%99 = sub nsw i32 %98, 5
store i32 %99, i32* %3
store i32 1, i32* %4
br label %100
100: ; preds = %106, %96
%101 = load i32, i32* %4
%102 = load i32, i32* %3
%103 = icmp sle i32 %101, %102
br i1 %103, label %104, label %109
104: ; preds = %100
%105 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %106
106: ; preds = %104
%107 = load i32, i32* %4
%108 = add nsw i32 %107, 1
store i32 %108, i32* %4
br label %100
109: ; preds = %100
br label %110
110: ; preds = %109, %92, %87
br label %136
111: ; preds = %83
%112 = load i32, i32* %2
%113 = sdiv i32 %112, 10
%114 = icmp eq i32 %113, 4
br i1 %114, label %115, label %117
115: ; preds = %111
%116 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %135
117: ; preds = %111
%118 = load i32, i32* %2
%119 = sdiv i32 %118, 10
%120 = icmp sge i32 %119, 1
br i1 %120, label %121, label %134
121: ; preds = %117
%122 = load i32, i32* %2
%123 = sdiv i32 %122, 10
store i32 %123, i32* %3
store i32 1, i32* %4
br label %124
124: ; preds = %130, %121
%125 = load i32, i32* %4
%126 = load i32, i32* %3
%127 = icmp sle i32 %125, %126
br i1 %127, label %128, label %133
128: ; preds = %124
%129 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %130
130: ; preds = %128
%131 = load i32, i32* %4
%132 = add nsw i32 %131, 1
store i32 %132, i32* %4
br label %124
133: ; preds = %124
br label %134
134: ; preds = %133, %117
br label %135
135: ; preds = %134, %115
br label %136
136: ; preds = %135, %110
br label %137
137: ; preds = %136, %81
%138 = load i32, i32* %2
%139 = srem i32 %138, 10
store i32 %139, i32* %2
br label %140
140: ; preds = %137, %74
%141 = load i32, i32* %2
%142 = icmp sge i32 %141, 1
br i1 %142, label %143, label %196
143: ; preds = %140
%144 = load i32, i32* %2
%145 = icmp eq i32 %144, 9
br i1 %145, label %146, label %148
146: ; preds = %143
%147 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %195
148: ; preds = %143
%149 = load i32, i32* %2
%150 = icmp sge i32 %149, 5
br i1 %150, label %151, label %172
151: ; preds = %148
%152 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%153 = load i32, i32* %2
%154 = icmp sgt i32 %153, 5
br i1 %154, label %155, label %171
155: ; preds = %151
%156 = load i32, i32* %2
%157 = icmp slt i32 %156, 9
br i1 %157, label %158, label %171
158: ; preds = %155
%159 = load i32, i32* %2
%160 = sub nsw i32 %159, 5
store i32 %160, i32* %3
store i32 1, i32* %4
br label %161
161: ; preds = %167, %158
%162 = load i32, i32* %4
%163 = load i32, i32* %3
%164 = icmp sle i32 %162, %163
br i1 %164, label %165, label %170
165: ; preds = %161
%166 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %167
167: ; preds = %165
%168 = load i32, i32* %4
%169 = add nsw i32 %168, 1
store i32 %169, i32* %4
br label %161
170: ; preds = %161
br label %171
171: ; preds = %170, %155, %151
br label %194
172: ; preds = %148
%173 = load i32, i32* %2
%174 = icmp eq i32 %173, 4
br i1 %174, label %175, label %177
175: ; preds = %172
%176 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
br label %193
177: ; preds = %172
%178 = load i32, i32* %2
%179 = icmp sge i32 %178, 1
br i1 %179, label %180, label %192
180: ; preds = %177
%181 = load i32, i32* %2
store i32 %181, i32* %3
store i32 1, i32* %4
br label %182
182: ; preds = %188, %180
%183 = load i32, i32* %4
%184 = load i32, i32* %3
%185 = icmp sle i32 %183, %184
br i1 %185, label %186, label %191
186: ; preds = %182
%187 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %188
188: ; preds = %186
%189 = load i32, i32* %4
%190 = add nsw i32 %189, 1
store i32 %190, i32* %4
br label %182
191: ; preds = %182
br label %192
192: ; preds = %191, %177
br label %193
193: ; preds = %192, %175
br label %194
194: ; preds = %193, %171
br label %195
195: ; preds = %194, %146
br label %196
196: ; preds = %195, %140
%197 = load i32, i32* %1
ret i32 %197
}

LLVM IR (-O2):
@.str = [10 x i8] c"Enter n: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"The output is: \00"
@.str.3 = [3 x i8] c"CM\00"
@.str.6 = [3 x i8] c"CD\00"
@.str.7 = [3 x i8] c"XC\00"
@.str.10 = [3 x i8] c"XL\00"
@.str.11 = [3 x i8] c"IX\00"
@.str.14 = [3 x i8] c"IV\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 99
br i1 %7, label %8, label %43
8: ; preds = %0
%9 = udiv i32 %6, 100
%10 = add nsw i32 %6, -900
%11 = icmp ult i32 %10, 100
br i1 %11, label %37, label %12
12: ; preds = %8
%13 = icmp ugt i32 %6, 499
br i1 %13, label %14, label %29
14: ; preds = %12
%15 = call i32 @putchar(i32 68)
%16 = load i32, i32* %1
%17 = add i32 %16, -600
%18 = icmp ult i32 %17, 300
br i1 %18, label %19, label %40
19: ; preds = %14
%20 = trunc i32 %16 to i16
%21 = udiv i16 %20, 100
%22 = zext i16 %21 to i32
%23 = add nsw i32 %22, -4
br label %24
24: ; preds = %19, %24
%25 = phi i32 [ %27, %24 ], [ 1, %19 ]
%26 = call i32 @putchar(i32 67)
%27 = add nuw nsw i32 %25, 1
%28 = icmp eq i32 %27, %23
br i1 %28, label %40, label %24
29: ; preds = %12
%30 = add nsw i32 %6, -400
%31 = icmp ult i32 %30, 100
br i1 %31, label %37, label %32
32: ; preds = %29, %32
%33 = phi i32 [ %35, %32 ], [ 1, %29 ]
%34 = call i32 @putchar(i32 67)
%35 = add nuw nsw i32 %33, 1
%36 = icmp eq i32 %33, %9
br i1 %36, label %40, label %32
37: ; preds = %29, %8
%38 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %8 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), %29 ]
%39 = call i32 @printf(i8* dereferenceable(1) %38)
br label %40
40: ; preds = %32, %24, %37, %14
%41 = load i32, i32* %1
%42 = srem i32 %41, 100
store i32 %42, i32* %1
br label %43
43: ; preds = %40, %0
%44 = phi i32 [ %42, %40 ], [ %6, %0 ]
%45 = icmp sgt i32 %44, 9
br i1 %45, label %46, label %85
46: ; preds = %43
%47 = trunc i32 %44 to i8
%48 = udiv i8 %47, 10
%49 = add nsw i32 %44, -90
%50 = icmp ult i32 %49, 10
br i1 %50, label %79, label %51
51: ; preds = %46
%52 = icmp ugt i32 %44, 49
br i1 %52, label %53, label %68
53: ; preds = %51
%54 = call i32 @putchar(i32 76)
%55 = load i32, i32* %1
%56 = add i32 %55, -60
%57 = icmp ult i32 %56, 30
br i1 %57, label %58, label %82
58: ; preds = %53
%59 = trunc i32 %55 to i8
%60 = udiv i8 %59, 10
%61 = zext i8 %60 to i32
%62 = add nsw i32 %61, -4
br label %63
63: ; preds = %58, %63
%64 = phi i32 [ %66, %63 ], [ 1, %58 ]
%65 = call i32 @putchar(i32 88)
%66 = add nuw nsw i32 %64, 1
%67 = icmp eq i32 %66, %62
br i1 %67, label %82, label %63
68: ; preds = %51
%69 = add nsw i32 %44, -40
%70 = icmp ult i32 %69, 10
br i1 %70, label %79, label %71
71: ; preds = %68
%72 = add nuw nsw i8 %48, 1
%73 = zext i8 %72 to i32
br label %74
74: ; preds = %71, %74
%75 = phi i32 [ %77, %74 ], [ 1, %71 ]
%76 = call i32 @putchar(i32 88)
%77 = add nuw nsw i32 %75, 1
%78 = icmp eq i32 %77, %73
br i1 %78, label %82, label %74
79: ; preds = %68, %46
%80 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), %46 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), %68 ]
%81 = call i32 @printf(i8* dereferenceable(1) %80)
br label %82
82: ; preds = %74, %63, %79, %53
%83 = load i32, i32* %1
%84 = srem i32 %83, 10
store i32 %84, i32* %1
br label %85
85: ; preds = %43, %82
%86 = phi i32 [ %84, %82 ], [ %44, %43 ]
%87 = icmp sgt i32 %86, 0
br i1 %87, label %88, label %114
88: ; preds = %85
%89 = icmp eq i32 %86, 9
br i1 %89, label %111, label %90
90: ; preds = %88
%91 = icmp ugt i32 %86, 4
br i1 %91, label %92, label %104
92: ; preds = %90
%93 = call i32 @putchar(i32 86)
%94 = load i32, i32* %1
%95 = add i32 %94, -6
%96 = icmp ult i32 %95, 3
br i1 %96, label %97, label %114
97: ; preds = %92
%98 = add nsw i32 %94, -4
br label %99
99: ; preds = %97, %99
%100 = phi i32 [ %102, %99 ], [ 1, %97 ]
%101 = call i32 @putchar(i32 73)
%102 = add nuw i32 %100, 1
%103 = icmp eq i32 %102, %98
br i1 %103, label %114, label %99
104: ; preds = %90
%105 = icmp eq i32 %86, 4
br i1 %105, label %111, label %106
106: ; preds = %104, %106
%107 = phi i32 [ %109, %106 ], [ 1, %104 ]
%108 = call i32 @putchar(i32 73)
%109 = add nuw i32 %107, 1
%110 = icmp eq i32 %107, %86
br i1 %110, label %114, label %106
111: ; preds = %104, %88
%112 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), %88 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), %104 ]
%113 = call i32 @printf(i8* dereferenceable(1) %112)
br label %114
114: ; preds = %106, %99, %111, %92, %85
ret i32 0
}