#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 *, int *);
int main() {
  int onluk_tabanda_sayi = 0;
  printf("Programdan cikmak icin -1 giriniz.\n");
  while (onluk_tabanda_sayi != -1) {
    printf("1-100 arasi bir sayi giriniz: ");
    scanf("%d", &onluk_tabanda_sayi);
    if (onluk_tabanda_sayi == -1) {
      break;
    }
    if (onluk_tabanda_sayi <= 100 && onluk_tabanda_sayi > 0) {
      int hesaplanan_deger;
      hesaplanan_deger = onluk_tabanda_sayi;
      printf("Onluk Tabandaki Sayi %7sRoma Rakami Karsiligi\n");
      printf("%d%-28s", onluk_tabanda_sayi);
      while (hesaplanan_deger != 0) {
        if (hesaplanan_deger >= 100) {
          printf("C");
          hesaplanan_deger = hesaplanan_deger - 100;
        } else if (hesaplanan_deger >= 90) {
          printf("XC");
          hesaplanan_deger = hesaplanan_deger - 90;
        } else if (hesaplanan_deger >= 50) {
          printf("L");
          hesaplanan_deger = hesaplanan_deger - 50;
        } else if (hesaplanan_deger >= 40) {
          printf("XL");
          hesaplanan_deger = hesaplanan_deger - 40;
        } else if (hesaplanan_deger >= 10) {
          printf("X");
          hesaplanan_deger = hesaplanan_deger - 10;
        } else if (hesaplanan_deger == 9) {
          printf("IV");
          hesaplanan_deger = hesaplanan_deger - 9;
        } else if (hesaplanan_deger >= 5) {
          printf("V");
          hesaplanan_deger = hesaplanan_deger - 5;
        } else if (hesaplanan_deger == 4) {
          printf("IV");
          hesaplanan_deger = hesaplanan_deger - 4;
        } else if (hesaplanan_deger >= 1) {
          printf("I");
          hesaplanan_deger = hesaplanan_deger - 1;
        }
      }
    } else {
      printf("1 ile 100 arasinda bir sayi girmediniz!!");
    }
    printf("\n");
  }
  printf("Programdan ciktiniz :)");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xffffffff,-0x8(%rbp)
je     1362 <main+0x242>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0x8(%rbp)
jne    117b <main+0x5b>
jmp    1362 <main+0x242>
cmpl   $0x64,-0x8(%rbp)
jg     1341 <main+0x221>
cmpl   $0x0,-0x8(%rbp)
jle    1341 <main+0x221>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     133c <main+0x21c>
cmpl   $0x64,-0xc(%rbp)
jl     11e4 <main+0xc4>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x64,%eax
mov    %eax,-0xc(%rbp)
jmp    1337 <main+0x217>
cmpl   $0x5a,-0xc(%rbp)
jl     120a <main+0xea>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x5a,%eax
mov    %eax,-0xc(%rbp)
jmp    1332 <main+0x212>
cmpl   $0x32,-0xc(%rbp)
jl     1230 <main+0x110>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x32,%eax
mov    %eax,-0xc(%rbp)
jmp    132d <main+0x20d>
cmpl   $0x28,-0xc(%rbp)
jl     1256 <main+0x136>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x28,%eax
mov    %eax,-0xc(%rbp)
jmp    1328 <main+0x208>
cmpl   $0xa,-0xc(%rbp)
jl     127c <main+0x15c>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    1323 <main+0x203>
cmpl   $0x9,-0xc(%rbp)
jne    12a2 <main+0x182>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x9,%eax
mov    %eax,-0xc(%rbp)
jmp    131e <main+0x1fe>
cmpl   $0x5,-0xc(%rbp)
jl     12c8 <main+0x1a8>
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0xc(%rbp)
jmp    1319 <main+0x1f9>
cmpl   $0x4,-0xc(%rbp)
jne    12ee <main+0x1ce>
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    1314 <main+0x1f4>
cmpl   $0x1,-0xc(%rbp)
jl     130f <main+0x1ef>
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1314 <main+0x1f4>
jmp    1319 <main+0x1f9>
jmp    131e <main+0x1fe>
jmp    1323 <main+0x203>
jmp    1328 <main+0x208>
jmp    132d <main+0x20d>
jmp    1332 <main+0x212>
jmp    1337 <main+0x217>
jmp    11b4 <main+0x94>
jmp    134f <main+0x22f>
lea    0xd42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xccc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1144 <main+0x24>
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xf48(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9a(%rip),%r14
lea    0xeb2(%rip),%r15
lea    0x4(%rsp),%rbx
lea    0xee9(%rip),%r13
lea    0xed9(%rip),%rbp
jmp    11ac <main+0x6c>
lea    0xed6(%rip),%rdi
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0xffffffff,0x4(%rsp)
je     12cb <main+0x18b>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%r12d
cmp    $0xffffffff,%r12d
je     12cb <main+0x18b>
lea    -0x1(%r12),%eax
mov    %r13,%rdi
cmp    $0x63,%eax
ja     1190 <main+0x50>
lea    0xe3e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xe5b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1214 <main+0xd4>
nop
mov    $0x43,%edi
call   1030 <putchar@plt>
mov    $0xffffff9c,%eax
add    %eax,%r12d
je     1197 <main+0x57>
cmp    $0x64,%r12d
jge    1200 <main+0xc0>
cmp    $0x5a,%r12d
jl     1240 <main+0x100>
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffa6,%eax
jmp    120f <main+0xcf>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x32,%r12d
jl     1257 <main+0x117>
mov    $0x4c,%edi
call   1030 <putchar@plt>
mov    $0xffffffce,%eax
jmp    120f <main+0xcf>
cmp    $0x28,%r12d
jl     1272 <main+0x132>
lea    0xdf8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffd8,%eax
jmp    120f <main+0xcf>
cmp    $0xa,%r12d
jl     1289 <main+0x149>
mov    $0x58,%edi
call   1030 <putchar@plt>
mov    $0xfffffff6,%eax
jmp    120f <main+0xcf>
cmp    $0x9,%r12d
je     1182 <main+0x42>
cmp    $0x5,%r12d
jl     12ad <main+0x16d>
mov    $0x56,%edi
call   1030 <putchar@plt>
mov    $0xfffffffb,%eax
jmp    120f <main+0xcf>
cmp    $0x4,%r12d
je     1182 <main+0x42>
mov    $0x49,%edi
call   1030 <putchar@plt>
mov    $0xffffffff,%eax
jmp    120f <main+0xcf>
lea    0xdb9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Programdan cikmak icin -1 giriniz.\0A\00"
@.str.1 = [31 x i8] c"1-100 arasi bir sayi giriniz: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [47 x i8] c"Onluk Tabandaki Sayi %7sRoma Rakami Karsiligi\0A\00"
@.str.4 = [8 x i8] c"%d%-28s\00"
@.str.5 = [2 x i8] c"C\00"
@.str.6 = [3 x i8] c"XC\00"
@.str.7 = [2 x i8] c"L\00"
@.str.8 = [3 x i8] c"XL\00"
@.str.9 = [2 x i8] c"X\00"
@.str.10 = [3 x i8] c"IV\00"
@.str.11 = [2 x i8] c"V\00"
@.str.12 = [2 x i8] c"I\00"
@.str.13 = [41 x i8] c"1 ile 100 arasinda bir sayi girmediniz!!\00"
@.str.14 = [2 x i8] c"\0A\00"
@.str.15 = [23 x i8] c"Programdan ciktiniz :)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %103, %0
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %105
8: ; preds = %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %14
13: ; preds = %8
br label %105
14: ; preds = %8
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 100
br i1 %16, label %17, label %101
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %101
20: ; preds = %17
%21 = load i32, i32* %2
store i32 %21, i32* %3
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%23 = load i32, i32* %2
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %99, %20
%26 = load i32, i32* %3
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %100
28: ; preds = %25
%29 = load i32, i32* %3
%30 = icmp sge i32 %29, 100
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%33 = load i32, i32* %3
%34 = sub nsw i32 %33, 100
store i32 %34, i32* %3
br label %99
35: ; preds = %28
%36 = load i32, i32* %3
%37 = icmp sge i32 %36, 90
br i1 %37, label %38, label %42
38: ; preds = %35
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%40 = load i32, i32* %3
%41 = sub nsw i32 %40, 90
store i32 %41, i32* %3
br label %98
42: ; preds = %35
%43 = load i32, i32* %3
%44 = icmp sge i32 %43, 50
br i1 %44, label %45, label %49
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%47 = load i32, i32* %3
%48 = sub nsw i32 %47, 50
store i32 %48, i32* %3
br label %97
49: ; preds = %42
%50 = load i32, i32* %3
%51 = icmp sge i32 %50, 40
br i1 %51, label %52, label %56
52: ; preds = %49
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%54 = load i32, i32* %3
%55 = sub nsw i32 %54, 40
store i32 %55, i32* %3
br label %96
56: ; preds = %49
%57 = load i32, i32* %3
%58 = icmp sge i32 %57, 10
br i1 %58, label %59, label %63
59: ; preds = %56
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%61 = load i32, i32* %3
%62 = sub nsw i32 %61, 10
store i32 %62, i32* %3
br label %95
63: ; preds = %56
%64 = load i32, i32* %3
%65 = icmp eq i32 %64, 9
br i1 %65, label %66, label %70
66: ; preds = %63
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%68 = load i32, i32* %3
%69 = sub nsw i32 %68, 9
store i32 %69, i32* %3
br label %94
70: ; preds = %63
%71 = load i32, i32* %3
%72 = icmp sge i32 %71, 5
br i1 %72, label %73, label %77
73: ; preds = %70
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%75 = load i32, i32* %3
%76 = sub nsw i32 %75, 5
store i32 %76, i32* %3
br label %93
77: ; preds = %70
%78 = load i32, i32* %3
%79 = icmp eq i32 %78, 4
br i1 %79, label %80, label %84
80: ; preds = %77
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%82 = load i32, i32* %3
%83 = sub nsw i32 %82, 4
store i32 %83, i32* %3
br label %92
84: ; preds = %77
%85 = load i32, i32* %3
%86 = icmp sge i32 %85, 1
br i1 %86, label %87, label %91
87: ; preds = %84
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%89 = load i32, i32* %3
%90 = sub nsw i32 %89, 1
store i32 %90, i32* %3
br label %91
91: ; preds = %87, %84
br label %92
92: ; preds = %91, %80
br label %93
93: ; preds = %92, %73
br label %94
94: ; preds = %93, %66
br label %95
95: ; preds = %94, %59
br label %96
96: ; preds = %95, %52
br label %97
97: ; preds = %96, %45
br label %98
98: ; preds = %97, %38
br label %99
99: ; preds = %98, %31
br label %25
100: ; preds = %25
br label %103
101: ; preds = %17, %14
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.13, i64 0, i64 0))
br label %103
103: ; preds = %101, %100
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
br label %5
105: ; preds = %13, %5
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [31 x i8] c"1-100 arasi bir sayi giriniz: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [47 x i8] c"Onluk Tabandaki Sayi %7sRoma Rakami Karsiligi\0A\00"
@.str.4 = [8 x i8] c"%d%-28s\00"
@.str.6 = [3 x i8] c"XC\00"
@.str.8 = [3 x i8] c"XL\00"
@.str.10 = [3 x i8] c"IV\00"
@.str.13 = [41 x i8] c"1 ile 100 arasinda bir sayi girmediniz!!\00"
@.str.15 = [23 x i8] c"Programdan ciktiniz :)\00"
@str = [35 x i8] c"Programdan cikmak icin -1 giriniz.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %0, %54
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, -1
br i1 %8, label %58, label %9
9: ; preds = %4
%10 = add i32 %7, -1
%11 = icmp ult i32 %10, 100
br i1 %11, label %12, label %51
12: ; preds = %9
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32, i32* %1
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %12, %47
%17 = phi i32 [ %49, %47 ], [ %7, %12 ]
%18 = icmp sgt i32 %17, 99
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @putchar(i32 67)
br label %47
21: ; preds = %16
%22 = icmp sgt i32 %17, 89
br i1 %22, label %23, label %25
23: ; preds = %21
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %47
25: ; preds = %21
%26 = icmp sgt i32 %17, 49
br i1 %26, label %27, label %29
27: ; preds = %25
%28 = call i32 @putchar(i32 76)
br label %47
29: ; preds = %25
%30 = icmp sgt i32 %17, 39
br i1 %30, label %31, label %33
31: ; preds = %29
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %47
33: ; preds = %29
%34 = icmp sgt i32 %17, 9
br i1 %34, label %35, label %37
35: ; preds = %33
%36 = call i32 @putchar(i32 88)
br label %47
37: ; preds = %33
%38 = icmp eq i32 %17, 9
br i1 %38, label %51, label %39
39: ; preds = %37
%40 = icmp sgt i32 %17, 4
br i1 %40, label %41, label %43
41: ; preds = %39
%42 = call i32 @putchar(i32 86)
br label %47
43: ; preds = %39
%44 = icmp eq i32 %17, 4
br i1 %44, label %51, label %45
45: ; preds = %43
%46 = call i32 @putchar(i32 73)
br label %47
47: ; preds = %23, %31, %45, %41, %35, %27, %19
%48 = phi i32 [ -90, %23 ], [ -40, %31 ], [ -1, %45 ], [ -5, %41 ], [ -10, %35 ], [ -50, %27 ], [ -100, %19 ]
%49 = add nsw i32 %17, %48
%50 = icmp eq i32 %49, 0
br i1 %50, label %54, label %16
51: ; preds = %43, %37, %9
%52 = phi i8* [ getelementptr inbounds ([41 x i8], [41 x i8]* @.str.13, i64 0, i64 0), %9 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), %37 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), %43 ]
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %52)
br label %54
54: ; preds = %47, %51
%55 = call i32 @putchar(i32 10)
%56 = load i32, i32* %1
%57 = icmp eq i32 %56, -1
br i1 %57, label %58, label %4
58: ; preds = %54, %4
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0))
ret i32 0
}