int main(void) {
  char rn[] = {'I', 'V', 'X', 'L', 'C', 'M'};
  char *r;
  int x;
  r = rn;
  for (x = 0; x < 6; x++) {
    printf("%i.) %u = %c\n", x + 1, r, rn[x]);
    r++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jge    1187 <main+0x77>
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%rdx
movslq -0x1c(%rbp),%rax
movsbl -0xa(%rbp,%rax,1),%ecx
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1142 <main+0x32>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movw   $0x4d43,0x4(%rsp)
movl   $0x4c585649,(%rsp)
lea    0x4(%rsp),%r14
lea    0xed8(%rip),%rbx
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x49,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1(%rsp),%rdx
movsbl 0x1(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x2(%rsp),%rdx
movsbl 0x2(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x3(%rsp),%rdx
movsbl 0x3(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x4(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x5(%rsp),%rdx
movsbl 0x5(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.rn = [6 x i8] c"IVXLCM"
@.str = [14 x i8] c"%i.) %u = %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [6 x i8]* %2 to i8*
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
store i8* %6, i8** %3
store i32 0, i32* %4
br label %7
7: ; preds = %22, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 6
br i1 %9, label %10, label %25
10: ; preds = %7
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %13, i32 %18)
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
br label %22
22: ; preds = %10
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %7
25: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@__const.main.rn = [6 x i8] c"IVXLCM"
@.str = [14 x i8] c"%i.) %u = %c\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i8* %2, i32 73)
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 1
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2, i8* %4, i32 %7)
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 2
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3, i8* %9, i32 %12)
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 3
%15 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4, i8* %14, i32 %17)
%19 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 4
%20 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 4
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i8* %19, i32 %22)
%24 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 5
%25 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 5
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 6, i8* %24, i32 %27)
ret i32 0
}