#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 */
const char *arabic_to_roman(int arabic) {
  switch (arabic) {
  case 1:
    return "I";
  case 4:
    return "IV";
  case 5:
    return "V";
  case 9:
    return "IX";
  case 10:
    return "X";
  case 40:
    return "XL";
  case 50:
    return "L";
  case 90:
    return "XC";
  case 100:
    return "C";
  case 400:
    return "CD";
  case 500:
    return "D";
  case 900:
    return "CM";
  case 1000:
    return "M";
  default:
    return NULL;
  }
}


x86 assembly (clang, -O0):
<arabic_to_roman>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     11ef <arabic_to_roman+0xef>
jmp    111b <arabic_to_roman+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     11ff <arabic_to_roman+0xff>
jmp    112c <arabic_to_roman+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x5,%eax
je     120f <arabic_to_roman+0x10f>
jmp    113d <arabic_to_roman+0x3d>
mov    -0x10(%rbp),%eax
sub    $0x9,%eax
je     121f <arabic_to_roman+0x11f>
jmp    114e <arabic_to_roman+0x4e>
mov    -0x10(%rbp),%eax
sub    $0xa,%eax
je     122f <arabic_to_roman+0x12f>
jmp    115f <arabic_to_roman+0x5f>
mov    -0x10(%rbp),%eax
sub    $0x28,%eax
je     123f <arabic_to_roman+0x13f>
jmp    1170 <arabic_to_roman+0x70>
mov    -0x10(%rbp),%eax
sub    $0x32,%eax
je     124f <arabic_to_roman+0x14f>
jmp    1181 <arabic_to_roman+0x81>
mov    -0x10(%rbp),%eax
sub    $0x5a,%eax
je     125f <arabic_to_roman+0x15f>
jmp    1192 <arabic_to_roman+0x92>
mov    -0x10(%rbp),%eax
sub    $0x64,%eax
je     126f <arabic_to_roman+0x16f>
jmp    11a3 <arabic_to_roman+0xa3>
mov    -0x10(%rbp),%eax
sub    $0x190,%eax
je     127f <arabic_to_roman+0x17f>
jmp    11b6 <arabic_to_roman+0xb6>
mov    -0x10(%rbp),%eax
sub    $0x1f4,%eax
je     128f <arabic_to_roman+0x18f>
jmp    11c9 <arabic_to_roman+0xc9>
mov    -0x10(%rbp),%eax
sub    $0x384,%eax
je     129f <arabic_to_roman+0x19f>
jmp    11dc <arabic_to_roman+0xdc>
mov    -0x10(%rbp),%eax
sub    $0x3e8,%eax
je     12af <arabic_to_roman+0x1af>
jmp    12bf <arabic_to_roman+0x1bf>
lea    0xe0a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12c7 <arabic_to_roman+0x1c7>
lea    0xdfc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12c7 <arabic_to_roman+0x1c7>
lea    0xded(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12c7 <arabic_to_roman+0x1c7>
lea    0xddf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12c7 <arabic_to_roman+0x1c7>
lea    0xdd0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12c7 <arabic_to_roman+0x1c7>
lea    0xdc2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12c7 <arabic_to_roman+0x1c7>
lea    0xdb3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12c7 <arabic_to_roman+0x1c7>
lea    0xda5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12c7 <arabic_to_roman+0x1c7>
lea    0xd96(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12c7 <arabic_to_roman+0x1c7>
lea    0xd88(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12c7 <arabic_to_roman+0x1c7>
lea    0xd79(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12c7 <arabic_to_roman+0x1c7>
lea    0xd6b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12c7 <arabic_to_roman+0x1c7>
lea    0xd5c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12c7 <arabic_to_roman+0x1c7>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arabic_to_roman>:
cmp    $0x59,%edi
jg     1130 <arabic_to_roman+0x30>
add    $0xffffffff,%edi
cmp    $0x31,%edi
ja     11ba <arabic_to_roman+0xba>
lea    0xfb0(%rip),%rax
lea    0xee1(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0xf9b(%rip),%rax
ret
cmp    $0x1f3,%edi
jg     1152 <arabic_to_roman+0x52>
cmp    $0x5a,%edi
je     119a <arabic_to_roman+0x9a>
cmp    $0x64,%edi
je     11a2 <arabic_to_roman+0xa2>
cmp    $0x190,%edi
jne    11ba <arabic_to_roman+0xba>
lea    0xf85(%rip),%rax
ret
cmp    $0x1f4,%edi
je     11aa <arabic_to_roman+0xaa>
cmp    $0x384,%edi
je     11b2 <arabic_to_roman+0xb2>
cmp    $0x3e8,%edi
jne    11ba <arabic_to_roman+0xba>
lea    0xf69(%rip),%rax
ret
lea    0xf52(%rip),%rax
ret
lea    0xf4c(%rip),%rax
ret
lea    0xf45(%rip),%rax
ret
lea    0xf3f(%rip),%rax
ret
lea    0xf38(%rip),%rax
ret
lea    0xf32(%rip),%rax
ret
lea    0xf2b(%rip),%rax
ret
lea    0xf26(%rip),%rax
ret
lea    0xf20(%rip),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"I\00"
@.str.1 = [3 x i8] c"IV\00"
@.str.2 = [2 x i8] c"V\00"
@.str.3 = [3 x i8] c"IX\00"
@.str.4 = [2 x i8] c"X\00"
@.str.5 = [3 x i8] c"XL\00"
@.str.6 = [2 x i8] c"L\00"
@.str.7 = [3 x i8] c"XC\00"
@.str.8 = [2 x i8] c"C\00"
@.str.9 = [3 x i8] c"CD\00"
@.str.10 = [2 x i8] c"D\00"
@.str.11 = [3 x i8] c"CM\00"
@.str.12 = [2 x i8] c"M\00"
define i8* @arabic_to_roman(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %18 [
i32 1, label %5
i32 4, label %6
i32 5, label %7
i32 9, label %8
i32 10, label %9
i32 40, label %10
i32 50, label %11
i32 90, label %12
i32 100, label %13
i32 400, label %14
i32 500, label %15
i32 900, label %16
i32 1000, label %17
]
5: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %19
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %19
7: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %19
8: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %19
9: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %19
10: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %19
11: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %19
12: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %19
13: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %19
14: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %19
15: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %19
16: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %19
17: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %19
18: ; preds = %1
store i8* null, i8** %2
br label %19
19: ; preds = %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
@.str = [2 x i8] c"I\00"
@.str.1 = [3 x i8] c"IV\00"
@.str.2 = [2 x i8] c"V\00"
@.str.3 = [3 x i8] c"IX\00"
@.str.4 = [2 x i8] c"X\00"
@.str.5 = [3 x i8] c"XL\00"
@.str.6 = [2 x i8] c"L\00"
@.str.7 = [3 x i8] c"XC\00"
@.str.8 = [2 x i8] c"C\00"
@.str.9 = [3 x i8] c"CD\00"
@.str.10 = [2 x i8] c"D\00"
@.str.11 = [3 x i8] c"CM\00"
@.str.12 = [2 x i8] c"M\00"
define i8* @arabic_to_roman(i32 %0) {
switch i32 %0, label %14 [
i32 1, label %15
i32 4, label %2
i32 5, label %3
i32 9, label %4
i32 10, label %5
i32 40, label %6
i32 50, label %7
i32 90, label %8
i32 100, label %9
i32 400, label %10
i32 500, label %11
i32 900, label %12
i32 1000, label %13
]
2: ; preds = %1
br label %15
3: ; preds = %1
br label %15
4: ; preds = %1
br label %15
5: ; preds = %1
br label %15
6: ; preds = %1
br label %15
7: ; preds = %1
br label %15
8: ; preds = %1
br label %15
9: ; preds = %1
br label %15
10: ; preds = %1
br label %15
11: ; preds = %1
br label %15
12: ; preds = %1
br label %15
13: ; preds = %1
br label %15
14: ; preds = %1
br label %15
15: ; preds = %1, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%16 = phi i8* [ null, %14 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %16
}