#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*/ get_numeral(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcat(char *, int /*<<< orphan*/);
char *get_roman_num(int number) {
  int x = number;
  char myString[255] = "";
  do {
    strcat(myString, get_numeral(x));
    printf("%d\n", x);
    printf("%s\n", myString);
    x = number - x;
  } while (x > 0);
  return myString;
}


x86 assembly (clang, -O0):
<get_roman_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1040 <memset@plt>
lea    -0x110(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <get_numeral@plt>
mov    -0x118(%rbp),%rdi
mov    %eax,%esi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%esi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x110(%rbp),%rsi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1167 <get_roman_num+0x27>
lea    -0x110(%rbp),%rax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_roman_num>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %edi,%ebx
xorps  %xmm0,%xmm0
movups %xmm0,0xef(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1060 <get_numeral@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <strcat@plt>
lea    0xe31(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r14,%rax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i8* @get_roman_num(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [255 x i8]
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
%6 = bitcast [255 x i8]* %4 to i8*
br label %7
7: ; preds = %19, %1
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @get_numeral(i32 %9)
%11 = call i32 @strcat(i8* %8, i32 %10)
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = sub nsw i32 %16, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %7
%20 = load i32, i32* %3
%21 = icmp sgt i32 %20, 0
br i1 %21, label %7, label %22
22: ; preds = %19
%23 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
ret i8* %23
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i8* @get_roman_num(i32 %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = call i32 @get_numeral(i32 %0)
%5 = call i32 @strcat(i8* %3, i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 @puts(i8* %3)
ret i8* %3
}