#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 *);
void Problem10() {
  int n, temp, count = 1;
  double powe;
  printf(
      "Problem 10: Given n, print its resulting roman numeral equivalence.\n");
  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");
      }
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<Problem10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x64,-0x4(%rbp)
jl     12b8 <Problem10+0x198>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x9,%eax
jne    1192 <Problem10+0x72>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    12aa <Problem10+0x18a>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x5,%eax
jl     1222 <Problem10+0x102>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x5,%eax
jle    121d <Problem10+0xfd>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x9,%eax
jge    121d <Problem10+0xfd>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
sub    $0x5,%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1218 <Problem10+0xf8>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11f2 <Problem10+0xd2>
jmp    121d <Problem10+0xfd>
jmp    12a5 <Problem10+0x185>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x4,%eax
jne    1247 <Problem10+0x127>
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
jmp    12a0 <Problem10+0x180>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x1,%eax
jl     129b <Problem10+0x17b>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1296 <Problem10+0x176>
lea    0xde6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1270 <Problem10+0x150>
jmp    129b <Problem10+0x17b>
jmp    12a0 <Problem10+0x180>
jmp    12a5 <Problem10+0x185>
jmp    12aa <Problem10+0x18a>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     140d <Problem10+0x2ed>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%eax
jne    12e7 <Problem10+0x1c7>
lea    0xd8b(%rip),%rdi
call   1030 <printf@plt>
jmp    13ff <Problem10+0x2df>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x5,%eax
jl     1377 <Problem10+0x257>
lea    0xd6a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x5,%eax
jle    1372 <Problem10+0x252>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%eax
jge    1372 <Problem10+0x252>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
sub    $0x5,%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     136d <Problem10+0x24d>
lea    0xd15(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1347 <Problem10+0x227>
jmp    1372 <Problem10+0x252>
jmp    13fa <Problem10+0x2da>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x4,%eax
jne    139c <Problem10+0x27c>
lea    0xcd9(%rip),%rdi
call   1030 <printf@plt>
jmp    13f5 <Problem10+0x2d5>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x1,%eax
jl     13f0 <Problem10+0x2d0>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     13eb <Problem10+0x2cb>
lea    0xc97(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13c5 <Problem10+0x2a5>
jmp    13f0 <Problem10+0x2d0>
jmp    13f5 <Problem10+0x2d5>
jmp    13fa <Problem10+0x2da>
jmp    13ff <Problem10+0x2df>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     150d <Problem10+0x3ed>
cmpl   $0x9,-0x4(%rbp)
jne    1432 <Problem10+0x312>
lea    0xc46(%rip),%rdi
call   1030 <printf@plt>
jmp    1508 <Problem10+0x3e8>
cmpl   $0x5,-0x4(%rbp)
jl     149c <Problem10+0x37c>
lea    0xc31(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x5,-0x4(%rbp)
jle    1497 <Problem10+0x377>
cmpl   $0x9,-0x4(%rbp)
jge    1497 <Problem10+0x377>
mov    -0x4(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1492 <Problem10+0x372>
lea    0xbf2(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    146c <Problem10+0x34c>
jmp    1497 <Problem10+0x377>
jmp    1503 <Problem10+0x3e3>
cmpl   $0x4,-0x4(%rbp)
jne    14b7 <Problem10+0x397>
lea    0xbc6(%rip),%rdi
call   1030 <printf@plt>
jmp    14fe <Problem10+0x3de>
cmpl   $0x1,-0x4(%rbp)
jl     14f9 <Problem10+0x3d9>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     14f4 <Problem10+0x3d4>
lea    0xb90(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    14ce <Problem10+0x3ae>
jmp    14f9 <Problem10+0x3d9>
jmp    14fe <Problem10+0x3de>
jmp    1503 <Problem10+0x3e3>
jmp    1508 <Problem10+0x3e8>
jmp    150d <Problem10+0x3ed>
lea    0xb2f(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Problem10>:
push   %rbx
sub    $0x10,%rsp
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
lea    0xea8(%rip),%rdi
call   1050 <printf@plt>
lea    0xea6(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xe98(%rip),%rdi
call   1050 <printf@plt>
mov    0xc(%rsp),%ebx
cmp    $0x64,%ebx
jge    1199 <Problem10+0x59>
cmp    $0xa,%ebx
jge    126a <Problem10+0x12a>
test   %ebx,%ebx
jg     1327 <Problem10+0x1e7>
jmp    1338 <Problem10+0x1f8>
lea    -0x384(%rbx),%eax
cmp    $0x64,%eax
jae    11b5 <Problem10+0x75>
lea    0xe72(%rip),%rdi
call   1050 <printf@plt>
jmp    123f <Problem10+0xff>
cmp    $0x1f4,%ebx
jb     1201 <Problem10+0xc1>
mov    $0x44,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
lea    -0x258(%rax),%ecx
cmp    $0x12b,%ecx
ja     123f <Problem10+0xff>
movzwl %ax,%eax
shr    $0x2,%eax
imul   $0x147b,%eax,%ebx
shr    $0x11,%ebx
add    $0xfffffffb,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x43,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11f0 <Problem10+0xb0>
jmp    123f <Problem10+0xff>
lea    -0x190(%rbx),%eax
cmp    $0x64,%eax
jae    121a <Problem10+0xda>
lea    0xe0d(%rip),%rdi
call   1050 <printf@plt>
jmp    123f <Problem10+0xff>
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    1230 <Problem10+0xf0>
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     118c <Problem10+0x4c>
lea    -0x5a(%rbx),%eax
cmp    $0xa,%eax
jae    1283 <Problem10+0x143>
lea    0xdaa(%rip),%rdi
call   1050 <printf@plt>
jmp    12ff <Problem10+0x1bf>
cmp    $0x32,%ebx
jb     12c1 <Problem10+0x181>
mov    $0x4c,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
lea    -0x3c(%rax),%ecx
cmp    $0x1d,%ecx
ja     12ff <Problem10+0x1bf>
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    12b0 <Problem10+0x170>
jmp    12ff <Problem10+0x1bf>
lea    -0x28(%rbx),%eax
cmp    $0xa,%eax
jae    12d7 <Problem10+0x197>
lea    0xd56(%rip),%rdi
call   1050 <printf@plt>
jmp    12ff <Problem10+0x1bf>
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    12f0 <Problem10+0x1b0>
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    1338 <Problem10+0x1f8>
cmp    $0x9,%ebx
jne    1348 <Problem10+0x208>
lea    0xcf6(%rip),%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
ret
cmp    $0x5,%ebx
jb     1381 <Problem10+0x241>
mov    $0x56,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%ebx
lea    -0x6(%rbx),%eax
cmp    $0x2,%eax
ja     1338 <Problem10+0x1f8>
add    $0xfffffffb,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x49,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1370 <Problem10+0x230>
jmp    1338 <Problem10+0x1f8>
cmp    $0x4,%ebx
jne    1390 <Problem10+0x250>
lea    0xc9f(%rip),%rdi
jmp    1333 <Problem10+0x1f3>
nop
mov    $0x49,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1390 <Problem10+0x250>
jmp    1338 <Problem10+0x1f8>

LLVM IR (-O0):
@.str = [69 x i8] c"Problem 10: Given n, print its resulting roman numeral equivalence.\0A\00"
@.str.1 = [10 x i8] c"Enter n: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [16 x i8] c"The output is: \00"
@.str.4 = [3 x i8] c"CM\00"
@.str.5 = [2 x i8] c"D\00"
@.str.6 = [2 x i8] c"C\00"
@.str.7 = [3 x i8] c"CD\00"
@.str.8 = [3 x i8] c"XC\00"
@.str.9 = [2 x i8] c"L\00"
@.str.10 = [2 x i8] c"X\00"
@.str.11 = [3 x i8] c"XL\00"
@.str.12 = [3 x i8] c"IX\00"
@.str.13 = [2 x i8] c"V\00"
@.str.14 = [2 x i8] c"I\00"
@.str.15 = [3 x i8] c"IV\00"
@.str.16 = [2 x i8] c"\0A\00"
define void @Problem10() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 1, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%9 = load i32, i32* %1
%10 = icmp sge i32 %9, 100
br i1 %10, label %11, label %74
11: ; preds = %0
%12 = load i32, i32* %1
%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.4, i64 0, i64 0))
br label %71
17: ; preds = %11
%18 = load i32, i32* %1
%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.5, i64 0, i64 0))
%23 = load i32, i32* %1
%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* %1
%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* %1
%32 = sdiv i32 %31, 100
%33 = sub nsw i32 %32, 5
store i32 %33, i32* %2
store i32 1, i32* %3
br label %34
34: ; preds = %40, %30
%35 = load i32, i32* %3
%36 = load i32, i32* %2
%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.6, i64 0, i64 0))
br label %40
40: ; preds = %38
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %34
43: ; preds = %34
br label %44
44: ; preds = %43, %26, %21
br label %70
45: ; preds = %17
%46 = load i32, i32* %1
%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.7, i64 0, i64 0))
br label %69
51: ; preds = %45
%52 = load i32, i32* %1
%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* %1
%57 = sdiv i32 %56, 100
store i32 %57, i32* %2
store i32 1, i32* %3
br label %58
58: ; preds = %64, %55
%59 = load i32, i32* %3
%60 = load i32, i32* %2
%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.6, i64 0, i64 0))
br label %64
64: ; preds = %62
%65 = load i32, i32* %3
%66 = add nsw i32 %65, 1
store i32 %66, i32* %3
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* %1
%73 = srem i32 %72, 100
store i32 %73, i32* %1
br label %74
74: ; preds = %71, %0
%75 = load i32, i32* %1
%76 = icmp sge i32 %75, 10
br i1 %76, label %77, label %140
77: ; preds = %74
%78 = load i32, i32* %1
%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.8, i64 0, i64 0))
br label %137
83: ; preds = %77
%84 = load i32, i32* %1
%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.9, i64 0, i64 0))
%89 = load i32, i32* %1
%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* %1
%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* %1
%98 = sdiv i32 %97, 10
%99 = sub nsw i32 %98, 5
store i32 %99, i32* %2
store i32 1, i32* %3
br label %100
100: ; preds = %106, %96
%101 = load i32, i32* %3
%102 = load i32, i32* %2
%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.10, i64 0, i64 0))
br label %106
106: ; preds = %104
%107 = load i32, i32* %3
%108 = add nsw i32 %107, 1
store i32 %108, i32* %3
br label %100
109: ; preds = %100
br label %110
110: ; preds = %109, %92, %87
br label %136
111: ; preds = %83
%112 = load i32, i32* %1
%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.11, i64 0, i64 0))
br label %135
117: ; preds = %111
%118 = load i32, i32* %1
%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* %1
%123 = sdiv i32 %122, 10
store i32 %123, i32* %2
store i32 1, i32* %3
br label %124
124: ; preds = %130, %121
%125 = load i32, i32* %3
%126 = load i32, i32* %2
%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.10, i64 0, i64 0))
br label %130
130: ; preds = %128
%131 = load i32, i32* %3
%132 = add nsw i32 %131, 1
store i32 %132, i32* %3
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* %1
%139 = srem i32 %138, 10
store i32 %139, i32* %1
br label %140
140: ; preds = %137, %74
%141 = load i32, i32* %1
%142 = icmp sge i32 %141, 1
br i1 %142, label %143, label %196
143: ; preds = %140
%144 = load i32, i32* %1
%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.12, i64 0, i64 0))
br label %195
148: ; preds = %143
%149 = load i32, i32* %1
%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.13, i64 0, i64 0))
%153 = load i32, i32* %1
%154 = icmp sgt i32 %153, 5
br i1 %154, label %155, label %171
155: ; preds = %151
%156 = load i32, i32* %1
%157 = icmp slt i32 %156, 9
br i1 %157, label %158, label %171
158: ; preds = %155
%159 = load i32, i32* %1
%160 = sub nsw i32 %159, 5
store i32 %160, i32* %2
store i32 1, i32* %3
br label %161
161: ; preds = %167, %158
%162 = load i32, i32* %3
%163 = load i32, i32* %2
%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.14, i64 0, i64 0))
br label %167
167: ; preds = %165
%168 = load i32, i32* %3
%169 = add nsw i32 %168, 1
store i32 %169, i32* %3
br label %161
170: ; preds = %161
br label %171
171: ; preds = %170, %155, %151
br label %194
172: ; preds = %148
%173 = load i32, i32* %1
%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.15, i64 0, i64 0))
br label %193
177: ; preds = %172
%178 = load i32, i32* %1
%179 = icmp sge i32 %178, 1
br i1 %179, label %180, label %192
180: ; preds = %177
%181 = load i32, i32* %1
store i32 %181, i32* %2
store i32 1, i32* %3
br label %182
182: ; preds = %188, %180
%183 = load i32, i32* %3
%184 = load i32, i32* %2
%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.14, i64 0, i64 0))
br label %188
188: ; preds = %186
%189 = load i32, i32* %3
%190 = add nsw i32 %189, 1
store i32 %190, i32* %3
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 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
ret void
}

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