#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 atoi(char *);
char *intToRoman(int);
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv) {
  int i;
  printf("%d to %s\n", 3000, intToRoman(3000));
  printf("%d to %s\n", 3300, intToRoman(3300));
  printf("%d to %s\n", 3333, intToRoman(3333));
  printf("%d to %s\n", 99, intToRoman(99));
  if (argc > 1) {
    for (i = 1; i < argc; i++) {
      printf("%d to %s\n", atoi(argv[i]), intToRoman(atoi(argv[i])));
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xbb8,%edi
call   1030 <intToRoman@plt>
mov    %rax,%rdx
lea    0xea6(%rip),%rdi
mov    $0xbb8,%esi
call   1040 <printf@plt>
mov    $0xce4,%edi
call   1030 <intToRoman@plt>
mov    %rax,%rdx
lea    0xe88(%rip),%rdi
mov    $0xce4,%esi
call   1040 <printf@plt>
mov    $0xd05,%edi
call   1030 <intToRoman@plt>
mov    %rax,%rdx
lea    0xe6a(%rip),%rdi
mov    $0xd05,%esi
call   1040 <printf@plt>
mov    $0x63,%edi
call   1030 <intToRoman@plt>
mov    %rax,%rdx
lea    0xe4c(%rip),%rdi
mov    $0x63,%esi
call   1040 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jle    122c <main+0xfc>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1227 <main+0xf7>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <intToRoman@plt>
mov    -0x18(%rbp),%esi
mov    %rax,%rdx
lea    0xdec(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11cf <main+0x9f>
jmp    122c <main+0xfc>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %edi,%r14d
mov    $0xbb8,%edi
call   1030 <intToRoman@plt>
lea    0xeb1(%rip),%rbp
mov    %rbp,%rdi
mov    $0xbb8,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    $0xce4,%edi
call   1030 <intToRoman@plt>
mov    %rbp,%rdi
mov    $0xce4,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    $0xd05,%edi
call   1030 <intToRoman@plt>
mov    %rbp,%rdi
mov    $0xd05,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    $0x63,%edi
call   1030 <intToRoman@plt>
mov    %rbp,%rdi
mov    $0x63,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
cmp    $0x2,%r14d
jl     11f8 <main+0xc8>
mov    %r14d,%r12d
mov    $0x1,%ebp
lea    0xe3e(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbp,8),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <intToRoman@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    11d0 <main+0xa0>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d to %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @intToRoman(i32 3000)
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3000, i8* %7)
%9 = call i8* @intToRoman(i32 3300)
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3300, i8* %9)
%11 = call i8* @intToRoman(i32 3333)
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3333, i8* %11)
%13 = call i8* @intToRoman(i32 99)
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 99, i8* %13)
%15 = load i32, i32* %4
%16 = icmp sgt i32 %15, 1
br i1 %16, label %17, label %41
17: ; preds = %2
store i32 1, i32* %6
br label %18
18: ; preds = %37, %17
%19 = load i32, i32* %6
%20 = load i32, i32* %4
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %40
22: ; preds = %18
%23 = load i8**, i8*** %5
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = call i32 @atoi(i8* %27)
%29 = load i8**, i8*** %5
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i32 @atoi(i8* %33)
%35 = call i8* @intToRoman(i32 %34)
%36 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %28, i8* %35)
br label %37
37: ; preds = %22
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %18
40: ; preds = %18
br label %41
41: ; preds = %40, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d to %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i8* @intToRoman(i32 3000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3000, i8* %3)
%5 = tail call i8* @intToRoman(i32 3300)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3300, i8* %5)
%7 = tail call i8* @intToRoman(i32 3333)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3333, i8* %7)
%9 = tail call i8* @intToRoman(i32 99)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 99, i8* %9)
%11 = icmp sgt i32 %0, 1
br i1 %11, label %12, label %23
12: ; preds = %2
%13 = zext i32 %0 to i64
br label %14
14: ; preds = %12, %14
%15 = phi i64 [ 1, %12 ], [ %21, %14 ]
%16 = getelementptr inbounds i8*, i8** %1, i64 %15
%17 = load i8*, i8** %16
%18 = tail call i32 @atoi(i8* %17)
%19 = tail call i8* @intToRoman(i32 %18)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %18, i8* %19)
%21 = add nuw nsw i64 %15, 1
%22 = icmp eq i64 %21, %13
br i1 %22, label %23, label %14
23: ; preds = %14, %2
ret i32 0
}