#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 */
scalar_t__ EOF;
int /*<<< orphan*/ countRomanDigit(int, int *, int *, int *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int);
scalar_t__ scanf(char *, int *);
int main() {
  int n;
  int num_i, num_v, num_x, num_l, num_c;
  int i;
  while (scanf("%d\n", &n) != EOF && n != 0) {
    num_i = num_v = num_x = num_l = num_c = 0;
    for (i = 1; i <= n; i++) {
      countRomanDigit(i, &num_i, &num_v, &num_x, &num_l, &num_c);
    }
    printf("%d: %d i, %d v, %d x, %d l, %d c\n", n, num_i, num_v, num_x, num_l,
           num_c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
mov    0x2e8d(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x21(%rbp)
je     1171 <main+0x41>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1181 <main+0x51>
jmp    1209 <main+0xd9>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11e1 <main+0xb1>
mov    -0x20(%rbp),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
lea    -0x1c(%rbp),%r9
call   1040 <countRomanDigit@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11ab <main+0x7b>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%eax
lea    0xe08(%rip),%rdi
mov    %eax,(%rsp)
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xebb(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
je     1244 <main+0x114>
mov    0x10(%rsp),%esi
test   %esi,%esi
je     1244 <main+0x114>
lea    0x24(%rsp),%r13
lea    0x20(%rsp),%rbx
lea    0x1c(%rsp),%rbp
lea    0x18(%rsp),%r14
lea    0x14(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movl   $0x0,0x14(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x24(%rsp)
test   %esi,%esi
jle    1200 <main+0xd0>
xor    %r12d,%r12d
nop
add    $0x1,%r12d
mov    %r12d,%edi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
mov    %r14,%r8
mov    %r15,%r9
call   1040 <countRomanDigit@plt>
mov    0x10(%rsp),%esi
cmp    %esi,%r12d
jl     11c0 <main+0x90>
mov    0x24(%rsp),%edx
mov    0x20(%rsp),%ecx
mov    0x1c(%rsp),%r8d
mov    0x18(%rsp),%r9d
mov    0x14(%rsp),%eax
jmp    120c <main+0xdc>
nopl   0x0(%rax)
xor    %eax,%eax
xor    %r9d,%r9d
xor    %r8d,%r8d
xor    %ecx,%ecx
xor    %edx,%edx
mov    %eax,(%rsp)
lea    0xdee(%rip),%rdi
call   1030 <printf@plt>
lea    0xdde(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2db5(%rip),%rcx
cmp    (%rcx),%rax
je     1244 <main+0x114>
mov    0x10(%rsp),%esi
test   %esi,%esi
jne    1190 <main+0x60>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
@.str.1 = [34 x i8] c"%d: %d i, %d v, %d x, %d l, %d c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
br label %9
9: ; preds = %29, %0
%10 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = load i64, i64* @EOF
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %13, %9
%17 = phi i1 [ false, %9 ], [ %15, %13 ]
br i1 %17, label %18, label %37
18: ; preds = %16
store i32 0, i32* %7
store i32 0, i32* %6
store i32 0, i32* %5
store i32 0, i32* %4
store i32 0, i32* %3
store i32 1, i32* %8
br label %19
19: ; preds = %26, %18
%20 = load i32, i32* %8
%21 = load i32, i32* %2
%22 = icmp sle i32 %20, %21
br i1 %22, label %23, label %29
23: ; preds = %19
%24 = load i32, i32* %8
%25 = call i32 @countRomanDigit(i32 %24, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7)
br label %26
26: ; preds = %23
%27 = load i32, i32* %8
%28 = add nsw i32 %27, 1
store i32 %28, i32* %8
br label %19
29: ; preds = %19
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = load i32, i32* %5
%34 = load i32, i32* %6
%35 = load i32, i32* %7
%36 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %30, i32 %31, i32 %32, i32 %33, i32 %34, i32 %35)
br label %9
37: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
@.str.1 = [34 x i8] c"%d: %d i, %d v, %d x, %d l, %d c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%14 = load i64, i64* @EOF
%15 = icmp ne i64 %13, %14
%16 = load i32, i32* %1
%17 = icmp ne i32 %16, 0
%18 = select i1 %15, i1 %17, i1 false
br i1 %18, label %19, label %48
19: ; preds = %0, %34
%20 = phi i32 [ %45, %34 ], [ %16, %0 ]
store i32 0, i32* %6
store i32 0, i32* %5
store i32 0, i32* %4
store i32 0, i32* %3
store i32 0, i32* %2
%21 = icmp slt i32 %20, 1
br i1 %21, label %34, label %22
22: ; preds = %19, %22
%23 = phi i32 [ %25, %22 ], [ 1, %19 ]
%24 = call i32 @countRomanDigit(i32 %23, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%25 = add nuw nsw i32 %23, 1
%26 = load i32, i32* %1
%27 = icmp slt i32 %23, %26
br i1 %27, label %22, label %28
28: ; preds = %22
%29 = load i32, i32* %2
%30 = load i32, i32* %3
%31 = load i32, i32* %4
%32 = load i32, i32* %5
%33 = load i32, i32* %6
br label %34
34: ; preds = %28, %19
%35 = phi i32 [ 0, %19 ], [ %33, %28 ]
%36 = phi i32 [ 0, %19 ], [ %32, %28 ]
%37 = phi i32 [ 0, %19 ], [ %31, %28 ]
%38 = phi i32 [ 0, %19 ], [ %30, %28 ]
%39 = phi i32 [ 0, %19 ], [ %29, %28 ]
%40 = phi i32 [ %20, %19 ], [ %26, %28 ]
%41 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %40, i32 %39, i32 %38, i32 %37, i32 %36, i32 %35)
%42 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%43 = load i64, i64* @EOF
%44 = icmp ne i64 %42, %43
%45 = load i32, i32* %1
%46 = icmp ne i32 %45, 0
%47 = select i1 %44, i1 %46, i1 false
br i1 %47, label %19, label %48
48: ; preds = %34, %0
ret i32 0
}