#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 *);
void main() {
  int num;
  int cont = 1;
  while (cont == 1) {
    printf("Please enter an integer [1,20]: ");
    scanf("%d", &num);
    switch (num) {
    case 1:
      printf("I\n");
      break;
    case 2:
      printf("II\n");
      break;
    case 3:
      printf("III\n");
      break;
    case 4:
      printf("IV\n");
      break;
    case 5:
      printf("V\n");
      break;
    case 6:
      printf("VI\n");
      break;
    case 7:
      printf("VII\n");
      break;
    case 8:
      printf("VIII\n");
      break;
    case 9:
      printf("IX\n");
      break;
    case 10:
      printf("X\n");
      break;
    case 11:
      printf("XI\n");
      break;
    case 12:
      printf("XII\n");
      break;
    case 13:
      printf("XIII\n");
      break;
    case 14:
      printf("XIV\n");
      break;
    case 15:
      printf("XV\n");
      break;
    case 16:
      printf("XVI\n");
      break;
    case 17:
      printf("XVII\n");
      break;
    case 18:
      printf("XVIII\n");
      break;
    case 19:
      printf("XIX\n");
      break;
    case 20:
      printf("XX\n");
      break;
    default:
      printf("The entered number is not in the range of [1,20].\n");
      break;
    }
    printf("Would you like to continue? (1 = yes, 0 = no): ");
    scanf("%d", &cont);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    12ff <main+0x1df>
lea    0xf10(%rip),%rdi
call   1030 <printf@plt>
lea    0xf25(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x13,%eax
ja     12d2 <main+0x1b2>
mov    -0x10(%rbp),%rax
lea    0xe8b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf16(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xf04(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xef2(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xe15(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xe08(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xdfc(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xdf1(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xde7(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xddb(%rip),%rdi
call   1030 <printf@plt>
jmp    12de <main+0x1be>
lea    0xdce(%rip),%rdi
call   1030 <printf@plt>
lea    0xdf5(%rip),%rdi
call   1030 <printf@plt>
lea    0xd80(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    112f <main+0xf>
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   $0x1,(%rsp)
lea    0xed8(%rip),%rbx
lea    0x4(%rsp),%r15
lea    0xf28(%rip),%rbp
lea    0xf54(%rip),%r14
lea    0xec1(%rip),%r12
mov    %rsp,%r13
jmp    118e <main+0x5e>
nopl   0x0(%rax,%rax,1)
call   1030 <puts@plt>
mov    %r12,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
cmpl   $0x1,(%rsp)
jne    11bf <main+0x8f>
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
mov    %rbp,%rdi
cmp    $0x13,%eax
ja     1170 <main+0x40>
cltq
movslq (%r14,%rax,4),%rdi
add    %r14,%rdi
jmp    1170 <main+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Please enter an integer [1,20]: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"I\0A\00"
@.str.3 = [4 x i8] c"II\0A\00"
@.str.4 = [5 x i8] c"III\0A\00"
@.str.5 = [4 x i8] c"IV\0A\00"
@.str.6 = [3 x i8] c"V\0A\00"
@.str.7 = [4 x i8] c"VI\0A\00"
@.str.8 = [5 x i8] c"VII\0A\00"
@.str.9 = [6 x i8] c"VIII\0A\00"
@.str.10 = [4 x i8] c"IX\0A\00"
@.str.11 = [3 x i8] c"X\0A\00"
@.str.12 = [4 x i8] c"XI\0A\00"
@.str.13 = [5 x i8] c"XII\0A\00"
@.str.14 = [6 x i8] c"XIII\0A\00"
@.str.15 = [5 x i8] c"XIV\0A\00"
@.str.16 = [4 x i8] c"XV\0A\00"
@.str.17 = [5 x i8] c"XVI\0A\00"
@.str.18 = [6 x i8] c"XVII\0A\00"
@.str.19 = [7 x i8] c"XVIII\0A\00"
@.str.20 = [5 x i8] c"XIX\0A\00"
@.str.21 = [4 x i8] c"XX\0A\00"
@.str.22 = [51 x i8] c"The entered number is not in the range of [1,20].\0A\00"
@.str.23 = [48 x i8] c"Would you like to continue? (1 = yes, 0 = no): \00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %2
br label %3
3: ; preds = %52, %0
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %55
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
switch i32 %9, label %50 [
i32 1, label %10
i32 2, label %12
i32 3, label %14
i32 4, label %16
i32 5, label %18
i32 6, label %20
i32 7, label %22
i32 8, label %24
i32 9, label %26
i32 10, label %28
i32 11, label %30
i32 12, label %32
i32 13, label %34
i32 14, label %36
i32 15, label %38
i32 16, label %40
i32 17, label %42
i32 18, label %44
i32 19, label %46
i32 20, label %48
]
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %52
12: ; preds = %6
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %52
14: ; preds = %6
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %52
16: ; preds = %6
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %52
18: ; preds = %6
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %52
20: ; preds = %6
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %52
22: ; preds = %6
%23 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %52
24: ; preds = %6
%25 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %52
26: ; preds = %6
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %52
28: ; preds = %6
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %52
30: ; preds = %6
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
br label %52
32: ; preds = %6
%33 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
br label %52
34: ; preds = %6
%35 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
br label %52
36: ; preds = %6
%37 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %52
38: ; preds = %6
%39 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
br label %52
40: ; preds = %6
%41 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0))
br label %52
42: ; preds = %6
%43 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
br label %52
44: ; preds = %6
%45 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0))
br label %52
46: ; preds = %6
%47 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
br label %52
48: ; preds = %6
%49 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0))
br label %52
50: ; preds = %6
%51 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.22, i64 0, i64 0))
br label %52
52: ; preds = %50, %48, %46, %44, %42, %40, %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10
%53 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.23, i64 0, i64 0))
%54 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %3
55: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Please enter an integer [1,20]: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.23 = [48 x i8] c"Would you like to continue? (1 = yes, 0 = no): \00"
@str = [3 x i8] c"XX\00"
@str.24 = [4 x i8] c"XIX\00"
@str.25 = [6 x i8] c"XVIII\00"
@str.26 = [5 x i8] c"XVII\00"
@str.27 = [4 x i8] c"XVI\00"
@str.28 = [3 x i8] c"XV\00"
@str.29 = [4 x i8] c"XIV\00"
@str.30 = [5 x i8] c"XIII\00"
@str.31 = [4 x i8] c"XII\00"
@str.32 = [3 x i8] c"XI\00"
@str.33 = [2 x i8] c"X\00"
@str.34 = [3 x i8] c"IX\00"
@str.35 = [5 x i8] c"VIII\00"
@str.36 = [4 x i8] c"VII\00"
@str.37 = [3 x i8] c"VI\00"
@str.38 = [2 x i8] c"V\00"
@str.39 = [3 x i8] c"IV\00"
@str.40 = [4 x i8] c"III\00"
@str.41 = [3 x i8] c"II\00"
@str.42 = [2 x i8] c"I\00"
@str.43 = [50 x i8] c"The entered number is not in the range of [1,20].\00"
@reltable.main = [20 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @str.42 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @str.41 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @str.40 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @str.39 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @str.38 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @str.37 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @str.36 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @str.35 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @str.34 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @str.33 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @str.32 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @str.31 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @str.30 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @str.29 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @str.28 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @str.27 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @str.26 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @str.25 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @str.24 to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @str to i64), i64 ptrtoint ([20 x i32]* @reltable.main to i64)) to i32)]
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 1, i32* %2
br label %5
5: ; preds = %0, %15
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = add i32 %8, -1
%10 = icmp ult i32 %9, 20
br i1 %10, label %11, label %15
11: ; preds = %5
%12 = sext i32 %9 to i64
%13 = shl i64 %12, 2
%14 = call i8* @llvm.load.relative.i64(i8* bitcast ([20 x i32]* @reltable.main to i8*), i64 %13)
br label %15
15: ; preds = %5, %11
%16 = phi i8* [ %14, %11 ], [ getelementptr inbounds ([50 x i8], [50 x i8]* @str.43, i64 0, i64 0), %5 ]
%17 = call i32 @puts(i8* dereferenceable(1) %16)
%18 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.23, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 1
br i1 %21, label %5, label %22
22: ; preds = %15
ret void
}