#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 */
char *malloc(int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *ArabicToRoman(int arabic) {
  int unidades;
  int decenas;
  int centenas;
  char *roman;
  roman = malloc(sizeof(char) * 100);
  strcpy(roman, "");
  unidades = arabic % 10;
  decenas = ((arabic % 100) - unidades) / 10;
  centenas = (arabic - decenas * 10 - unidades) / 100;
  switch (centenas) {
  case 0:
    break;
  case 1:
    strcat(roman, "C");
    break;
  case 2:
    strcat(roman, "CC");
    break;
  case 3:
    strcat(roman, "CCC");
    break;
  }
  switch (decenas) {
  case 0:
    break;
  case 1:
    strcat(roman, "X");
    break;
  case 2:
    strcat(roman, "XX");
    break;
  case 3:
    strcat(roman, "XXX");
    break;
  case 4:
    strcat(roman, "XL");
    break;
  case 5:
    strcat(roman, "L");
    break;
  case 6:
    strcat(roman, "LX");
    break;
  case 7:
    strcat(roman, "LXX");
    break;
  case 8:
    strcat(roman, "LXXX");
    break;
  case 9:
    strcat(roman, "XC");
    break;
  }
  switch (unidades) {
  case 0:
    break;
  case 1:
    strcat(roman, "I");
    break;
  case 2:
    strcat(roman, "II");
    break;
  case 3:
    strcat(roman, "III");
    break;
  case 4:
    strcat(roman, "IV");
    break;
  case 5:
    strcat(roman, "V");
    break;
  case 6:
    strcat(roman, "VI");
    break;
  case 7:
    strcat(roman, "VII");
    break;
  case 8:
    strcat(roman, "VIII");
    break;
  case 9:
    strcat(roman, "IX");
    break;
  }
  return roman;
}


x86 assembly (clang, -O0):
<ArabicToRoman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xf0f(%rip),%rsi
call   1030 <strcpy@plt>
movslq -0x4(%rbp),%rcx
mov    %ecx,%eax
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rdx
add    %ecx,%edx
add    %edx,%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rcx
mov    %ecx,%eax
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    -0x8(%rbp),%ecx
sub    %ecx,%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%edx
add    %edx,%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    -0x8(%rbp),%ecx
sub    %ecx,%eax
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x3,%rax
ja     124d <ArabicToRoman+0x11d>
mov    -0x20(%rbp),%rax
lea    0xdfb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    124d <ArabicToRoman+0x11d>
mov    -0x18(%rbp),%rdi
lea    0xe44(%rip),%rsi
call   1050 <strcat@plt>
jmp    124d <ArabicToRoman+0x11d>
mov    -0x18(%rbp),%rdi
lea    0xe2e(%rip),%rsi
call   1050 <strcat@plt>
jmp    124d <ArabicToRoman+0x11d>
mov    -0x18(%rbp),%rdi
lea    0xe18(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%eax
mov    %rax,-0x28(%rbp)
sub    $0x9,%rax
ja     132f <ArabicToRoman+0x1ff>
mov    -0x28(%rbp),%rax
lea    0xda7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    132f <ArabicToRoman+0x1ff>
mov    -0x18(%rbp),%rdi
lea    0xe04(%rip),%rsi
call   1050 <strcat@plt>
jmp    132f <ArabicToRoman+0x1ff>
mov    -0x18(%rbp),%rdi
lea    0xdd4(%rip),%rsi
call   1050 <strcat@plt>
jmp    132f <ArabicToRoman+0x1ff>
mov    -0x18(%rbp),%rdi
lea    0xdc3(%rip),%rsi
call   1050 <strcat@plt>
jmp    132f <ArabicToRoman+0x1ff>
mov    -0x18(%rbp),%rdi
lea    0xda3(%rip),%rsi
call   1050 <strcat@plt>
jmp    132f <ArabicToRoman+0x1ff>
mov    -0x18(%rbp),%rdi
lea    0xd8f(%rip),%rsi
call   1050 <strcat@plt>
jmp    132f <ArabicToRoman+0x1ff>
mov    -0x18(%rbp),%rdi
lea    0xd7c(%rip),%rsi
call   1050 <strcat@plt>
jmp    132f <ArabicToRoman+0x1ff>
mov    -0x18(%rbp),%rdi
lea    0xd6a(%rip),%rsi
call   1050 <strcat@plt>
jmp    132f <ArabicToRoman+0x1ff>
mov    -0x18(%rbp),%rdi
lea    0xd59(%rip),%rsi
call   1050 <strcat@plt>
jmp    132f <ArabicToRoman+0x1ff>
mov    -0x18(%rbp),%rdi
lea    0xd49(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%eax
mov    %rax,-0x30(%rbp)
sub    $0x9,%rax
ja     1411 <ArabicToRoman+0x2e1>
mov    -0x30(%rbp),%rax
lea    0xced(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1411 <ArabicToRoman+0x2e1>
mov    -0x18(%rbp),%rdi
lea    0xd1f(%rip),%rsi
call   1050 <strcat@plt>
jmp    1411 <ArabicToRoman+0x2e1>
mov    -0x18(%rbp),%rdi
lea    0xd09(%rip),%rsi
call   1050 <strcat@plt>
jmp    1411 <ArabicToRoman+0x2e1>
mov    -0x18(%rbp),%rdi
lea    0xcf3(%rip),%rsi
call   1050 <strcat@plt>
jmp    1411 <ArabicToRoman+0x2e1>
mov    -0x18(%rbp),%rdi
lea    0xcd3(%rip),%rsi
call   1050 <strcat@plt>
jmp    1411 <ArabicToRoman+0x2e1>
mov    -0x18(%rbp),%rdi
lea    0xcbf(%rip),%rsi
call   1050 <strcat@plt>
jmp    1411 <ArabicToRoman+0x2e1>
mov    -0x18(%rbp),%rdi
lea    0xcac(%rip),%rsi
call   1050 <strcat@plt>
jmp    1411 <ArabicToRoman+0x2e1>
mov    -0x18(%rbp),%rdi
lea    0xc9a(%rip),%rsi
call   1050 <strcat@plt>
jmp    1411 <ArabicToRoman+0x2e1>
mov    -0x18(%rbp),%rdi
lea    0xc89(%rip),%rsi
call   1050 <strcat@plt>
jmp    1411 <ArabicToRoman+0x2e1>
mov    -0x18(%rbp),%rdi
lea    0xc79(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ArabicToRoman>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
lea    0xeb9(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
movslq %ebp,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %ecx,%ebp
sub    %eax,%ebp
imul   $0x51eb851f,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x25,%rdx
add    %esi,%edx
imul   $0x64,%edx,%edx
sub    %edx,%ecx
sub    %ebp,%ecx
movsbl %cl,%ecx
imul   $0x67,%ecx,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
shr    $0xa,%edx
add    %cl,%dl
movsbl %dl,%ebx
lea    (%rbx,%rbx,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
sar    $0x25,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0xffffffff,%eax
cmp    $0x2,%eax
ja     11e2 <ArabicToRoman+0xb2>
cltq
lea    0xe55(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
mov    %r14,%rdi
call   1050 <strcat@plt>
add    $0xffffffff,%ebx
cmp    $0x8,%ebx
ja     1203 <ArabicToRoman+0xd3>
movslq %ebx,%rax
lea    0xe40(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
mov    %r14,%rdi
call   1050 <strcat@plt>
add    $0xffffffff,%ebp
cmp    $0x8,%ebp
ja     1224 <ArabicToRoman+0xf4>
movslq %ebp,%rax
lea    0xe43(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
mov    %r14,%rdi
call   1050 <strcat@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
@.str.2 = [3 x i8] c"CC\00"
@.str.3 = [4 x i8] c"CCC\00"
@.str.4 = [2 x i8] c"X\00"
@.str.5 = [3 x i8] c"XX\00"
@.str.6 = [4 x i8] c"XXX\00"
@.str.7 = [3 x i8] c"XL\00"
@.str.8 = [2 x i8] c"L\00"
@.str.9 = [3 x i8] c"LX\00"
@.str.10 = [4 x i8] c"LXX\00"
@.str.11 = [5 x i8] c"LXXX\00"
@.str.12 = [3 x i8] c"XC\00"
@.str.13 = [2 x i8] c"I\00"
@.str.14 = [3 x i8] c"II\00"
@.str.15 = [4 x i8] c"III\00"
@.str.16 = [3 x i8] c"IV\00"
@.str.17 = [2 x i8] c"V\00"
@.str.18 = [3 x i8] c"VI\00"
@.str.19 = [4 x i8] c"VII\00"
@.str.20 = [5 x i8] c"VIII\00"
@.str.21 = [3 x i8] c"IX\00"
define i8* @ArabicToRoman(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %2
%7 = call i8* @malloc(i32 100)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = srem i32 %12, 100
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
%16 = sdiv i32 %15, 10
store i32 %16, i32* %4
%17 = load i32, i32* %2
%18 = load i32, i32* %4
%19 = mul nsw i32 %18, 10
%20 = sub nsw i32 %17, %19
%21 = load i32, i32* %3
%22 = sub nsw i32 %20, %21
%23 = sdiv i32 %22, 100
store i32 %23, i32* %5
%24 = load i32, i32* %5
switch i32 %24, label %35 [
i32 0, label %25
i32 1, label %26
i32 2, label %29
i32 3, label %32
]
25: ; preds = %1
br label %35
26: ; preds = %1
%27 = load i8*, i8** %6
%28 = call i32 @strcat(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %35
29: ; preds = %1
%30 = load i8*, i8** %6
%31 = call i32 @strcat(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %35
32: ; preds = %1
%33 = load i8*, i8** %6
%34 = call i32 @strcat(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %35
35: ; preds = %1, %32, %29, %26, %25
%36 = load i32, i32* %4
switch i32 %36, label %65 [
i32 0, label %37
i32 1, label %38
i32 2, label %41
i32 3, label %44
i32 4, label %47
i32 5, label %50
i32 6, label %53
i32 7, label %56
i32 8, label %59
i32 9, label %62
]
37: ; preds = %35
br label %65
38: ; preds = %35
%39 = load i8*, i8** %6
%40 = call i32 @strcat(i8* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %65
41: ; preds = %35
%42 = load i8*, i8** %6
%43 = call i32 @strcat(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %65
44: ; preds = %35
%45 = load i8*, i8** %6
%46 = call i32 @strcat(i8* %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %65
47: ; preds = %35
%48 = load i8*, i8** %6
%49 = call i32 @strcat(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %65
50: ; preds = %35
%51 = load i8*, i8** %6
%52 = call i32 @strcat(i8* %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %65
53: ; preds = %35
%54 = load i8*, i8** %6
%55 = call i32 @strcat(i8* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %65
56: ; preds = %35
%57 = load i8*, i8** %6
%58 = call i32 @strcat(i8* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %65
59: ; preds = %35
%60 = load i8*, i8** %6
%61 = call i32 @strcat(i8* %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
br label %65
62: ; preds = %35
%63 = load i8*, i8** %6
%64 = call i32 @strcat(i8* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %65
65: ; preds = %35, %62, %59, %56, %53, %50, %47, %44, %41, %38, %37
%66 = load i32, i32* %3
switch i32 %66, label %95 [
i32 0, label %67
i32 1, label %68
i32 2, label %71
i32 3, label %74
i32 4, label %77
i32 5, label %80
i32 6, label %83
i32 7, label %86
i32 8, label %89
i32 9, label %92
]
67: ; preds = %65
br label %95
68: ; preds = %65
%69 = load i8*, i8** %6
%70 = call i32 @strcat(i8* %69, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %95
71: ; preds = %65
%72 = load i8*, i8** %6
%73 = call i32 @strcat(i8* %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
br label %95
74: ; preds = %65
%75 = load i8*, i8** %6
%76 = call i32 @strcat(i8* %75, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
br label %95
77: ; preds = %65
%78 = load i8*, i8** %6
%79 = call i32 @strcat(i8* %78, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
br label %95
80: ; preds = %65
%81 = load i8*, i8** %6
%82 = call i32 @strcat(i8* %81, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
br label %95
83: ; preds = %65
%84 = load i8*, i8** %6
%85 = call i32 @strcat(i8* %84, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
br label %95
86: ; preds = %65
%87 = load i8*, i8** %6
%88 = call i32 @strcat(i8* %87, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0))
br label %95
89: ; preds = %65
%90 = load i8*, i8** %6
%91 = call i32 @strcat(i8* %90, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
br label %95
92: ; preds = %65
%93 = load i8*, i8** %6
%94 = call i32 @strcat(i8* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0))
br label %95
95: ; preds = %65, %92, %89, %86, %83, %80, %77, %74, %71, %68, %67
%96 = load i8*, i8** %6
ret i8* %96
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
@.str.2 = [3 x i8] c"CC\00"
@.str.3 = [4 x i8] c"CCC\00"
@.str.4 = [2 x i8] c"X\00"
@.str.5 = [3 x i8] c"XX\00"
@.str.6 = [4 x i8] c"XXX\00"
@.str.7 = [3 x i8] c"XL\00"
@.str.8 = [2 x i8] c"L\00"
@.str.9 = [3 x i8] c"LX\00"
@.str.10 = [4 x i8] c"LXX\00"
@.str.11 = [5 x i8] c"LXXX\00"
@.str.12 = [3 x i8] c"XC\00"
@.str.13 = [2 x i8] c"I\00"
@.str.14 = [3 x i8] c"II\00"
@.str.15 = [4 x i8] c"III\00"
@.str.16 = [3 x i8] c"IV\00"
@.str.17 = [2 x i8] c"V\00"
@.str.18 = [3 x i8] c"VI\00"
@.str.19 = [4 x i8] c"VII\00"
@.str.20 = [5 x i8] c"VIII\00"
@.str.21 = [3 x i8] c"IX\00"
@reltable.ArabicToRoman = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.ArabicToRoman to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.ArabicToRoman to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([3 x i32]* @reltable.ArabicToRoman to i64)) to i32)]
@reltable.ArabicToRoman.24 = [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.4 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.5 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.7 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.8 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.9 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.11 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.24 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.12 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.24 to i64)) to i32)]
@reltable.ArabicToRoman.25 = [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.13 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.25 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.14 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.25 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.15 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.25 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.16 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.25 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.17 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.25 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.18 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.25 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.19 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.25 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.20 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.25 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.21 to i64), i64 ptrtoint ([9 x i32]* @reltable.ArabicToRoman.25 to i64)) to i32)]
define i8* @ArabicToRoman(i32 %0) {
%2 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = srem i32 %0, 10
%5 = srem i32 %0, 100
%6 = sub nsw i32 %5, %4
%7 = trunc i32 %6 to i8
%8 = sdiv i8 %7, 10
%9 = sext i8 %8 to i32
%10 = mul nsw i32 %9, -10
%11 = sub i32 %0, %4
%12 = add i32 %11, %10
%13 = sdiv i32 %12, 100
%14 = add nsw i32 %13, -1
%15 = icmp ult i32 %14, 3
br i1 %15, label %16, label %21
16: ; preds = %1
%17 = sext i32 %14 to i64
%18 = shl i64 %17, 2
%19 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.ArabicToRoman to i8*), i64 %18)
%20 = tail call i32 @strcat(i8* %2, i8* %19)
br label %21
21: ; preds = %1, %16
%22 = add nsw i32 %9, -1
%23 = icmp ult i32 %22, 9
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = sext i32 %22 to i64
%26 = shl i64 %25, 2
%27 = call i8* @llvm.load.relative.i64(i8* bitcast ([9 x i32]* @reltable.ArabicToRoman.24 to i8*), i64 %26)
%28 = tail call i32 @strcat(i8* %2, i8* %27)
br label %29
29: ; preds = %21, %24
%30 = add nsw i32 %4, -1
%31 = icmp ult i32 %30, 9
br i1 %31, label %32, label %37
32: ; preds = %29
%33 = sext i32 %30 to i64
%34 = shl i64 %33, 2
%35 = call i8* @llvm.load.relative.i64(i8* bitcast ([9 x i32]* @reltable.ArabicToRoman.25 to i8*), i64 %34)
%36 = tail call i32 @strcat(i8* %2, i8* %35)
br label %37
37: ; preds = %29, %32
ret i8* %2
}