int main(void) {
  char rn[] = {'I', 'V', 'X', 'L', 'C', 'M'};
  char *r;
  int x;
  for (x = 0; x < 6; x++) {
    r = &rn[x];
    printf("%i.) %u = %c\n", x + 1, r, rn[x]);
  }
  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)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jge    1182 <main+0x72>
movslq -0x1c(%rbp),%rcx
lea    -0xa(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%rdx
movslq -0x1c(%rbp),%rax
movsbl -0xa(%rbp,%rax,1),%ecx
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113a <main+0x2a>
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*
store i32 0, i32* %4
br label %6
6: ; preds = %22, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 6
br i1 %8, label %9, label %25
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 %11
store i8* %12, i8** %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %14, i8* %15, i32 %20)
br label %22
22: ; preds = %9
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %6
25: ; preds = %6
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 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = 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 %6)
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3, i8* %8, i32 %10)
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4, i8* %12, i32 %14)
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i8* %16, i32 %18)
%20 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 5
%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 6, i8* %20, i32 %22)
ret i32 0
}