#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 *, char *);
int strlen(char *);
int main() {
  char roman[20];
  int i, c = 0, l = 0, x = 0, v = 0, j = 0;
  int arabic;
  scanf("%s", roman);
  for (i = 0; i < strlen(roman); i++) {
    if (roman[i] == 'C')
      c++;
    if (roman[i] == 'L')
      l++;
    if (roman[i] == 'X')
      x++;
    if (roman[i] == 'V')
      v++;
    if (roman[i] == 'I')
      j++;
  }
  arabic = 100 * c + 50 * l + 10 * x + 5 * v + j;
  if (arabic > 256) {
    printf("You have entered to big number");
  } else
    printf("%d", arabic);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x40(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
cmp    %ecx,%eax
jge    122f <main+0xff>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x43,%eax
jne    11b0 <main+0x80>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x4c,%eax
jne    11cb <main+0x9b>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x58,%eax
jne    11e6 <main+0xb6>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x56,%eax
jne    1201 <main+0xd1>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x49,%eax
jne    121c <main+0xec>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1221 <main+0xf1>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1179 <main+0x49>
imul   $0x64,-0x28(%rbp),%eax
imul   $0x32,-0x2c(%rbp),%ecx
add    %ecx,%eax
imul   $0xa,-0x30(%rbp),%ecx
add    %ecx,%eax
imul   $0x5,-0x34(%rbp),%ecx
add    %ecx,%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x3c(%rbp)
cmpl   $0x100,-0x3c(%rbp)
jle    126b <main+0x13b>
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    127c <main+0x14c>
mov    -0x3c(%rbp),%esi
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xf01(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1218 <main+0xe8>
pxor   %xmm1,%xmm1
xor    %ebx,%ebx
mov    %rsp,%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsp,%rbx,1),%eax
movd   %eax,%xmm0
punpcklbw %xmm0,%xmm0
pshuflw $0x0,%xmm0,%xmm0
pcmpeqb 0xe77(%rip),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
pand   0xe77(%rip),%xmm0
paddd  %xmm0,%xmm1
movdqa %xmm1,0x20(%rsp)
xor    %ecx,%ecx
cmp    $0x49,%al
sete   %cl
add    %ecx,%ebp
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
movdqa 0x20(%rsp),%xmm1
cltq
cmp    %rax,%rbx
jl     1170 <main+0x40>
pshufd $0xf5,%xmm1,%xmm0
pmuludq 0xe4e(%rip),%xmm1
pshufd $0xe8,%xmm1,%xmm1
pmuludq 0xe51(%rip),%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%esi
add    %ebp,%esi
cmp    $0x101,%esi
jl     121a <main+0xea>
lea    0xe34(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1228 <main+0xf8>
xor    %esi,%esi
lea    0xe41(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [31 x i8] c"You have entered to big number\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 0, i32* %3
br label %12
12: ; preds = %68, %0
%13 = load i32, i32* %3
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %71
17: ; preds = %12
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 67
br i1 %23, label %24, label %27
24: ; preds = %17
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %27
27: ; preds = %24, %17
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 76
br i1 %33, label %34, label %37
34: ; preds = %27
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %37
37: ; preds = %34, %27
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 88
br i1 %43, label %44, label %47
44: ; preds = %37
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
br label %47
47: ; preds = %44, %37
%48 = load i32, i32* %3
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 86
br i1 %53, label %54, label %57
54: ; preds = %47
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 1
store i32 %56, i32* %7
br label %57
57: ; preds = %54, %47
%58 = load i32, i32* %3
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %62, 73
br i1 %63, label %64, label %67
64: ; preds = %57
%65 = load i32, i32* %8
%66 = add nsw i32 %65, 1
store i32 %66, i32* %8
br label %67
67: ; preds = %64, %57
br label %68
68: ; preds = %67
%69 = load i32, i32* %3
%70 = add nsw i32 %69, 1
store i32 %70, i32* %3
br label %12
71: ; preds = %12
%72 = load i32, i32* %4
%73 = mul nsw i32 100, %72
%74 = load i32, i32* %5
%75 = mul nsw i32 50, %74
%76 = add nsw i32 %73, %75
%77 = load i32, i32* %6
%78 = mul nsw i32 10, %77
%79 = add nsw i32 %76, %78
%80 = load i32, i32* %7
%81 = mul nsw i32 5, %80
%82 = add nsw i32 %79, %81
%83 = load i32, i32* %8
%84 = add nsw i32 %82, %83
store i32 %84, i32* %9
%85 = load i32, i32* %9
%86 = icmp sgt i32 %85, 256
br i1 %86, label %87, label %89
87: ; preds = %71
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %92
89: ; preds = %71
%90 = load i32, i32* %9
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %90)
br label %92
92: ; preds = %89, %87
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [31 x i8] c"You have entered to big number\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %31
6: ; preds = %0, %6
%7 = phi i64 [ %20, %6 ], [ 0, %0 ]
%8 = phi i32 [ %19, %6 ], [ 0, %0 ]
%9 = phi <4 x i32> [ %16, %6 ], [ zeroinitializer, %0 ]
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %7
%11 = load i8, i8* %10
%12 = insertelement <4 x i8> poison, i8 %11, i64 0
%13 = shufflevector <4 x i8> %12, <4 x i8> poison, <4 x i32> zeroinitializer
%14 = icmp eq <4 x i8> %13, <i8 76, i8 67, i8 88, i8 86>
%15 = zext <4 x i1> %14 to <4 x i32>
%16 = add nuw nsw <4 x i32> %9, %15
%17 = icmp eq i8 %11, 73
%18 = zext i1 %17 to i32
%19 = add nuw nsw i32 %8, %18
%20 = add nuw nsw i64 %7, 1
%21 = call i32 @strlen(i8* %2)
%22 = sext i32 %21 to i64
%23 = icmp slt i64 %20, %22
br i1 %23, label %6, label %24
24: ; preds = %6
%25 = mul <4 x i32> %16, <i32 50, i32 100, i32 10, i32 5>
%26 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %25)
%27 = add nuw nsw i32 %26, %19
%28 = icmp sgt i32 %27, 256
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %34
31: ; preds = %0, %24
%32 = phi i32 [ %27, %24 ], [ 0, %0 ]
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %31, %29
ret i32 0
}