#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*/ sprintf(char *, char *, int);
char *rpn_type_to_string(int type) {
  char *_str_type;
  static char _err_mesg[32];
  switch (type) {
  case (-2):
    _str_type = "ANY_TYPE";
    break;
  case (-1):
    _str_type = "UNUSED";
    break;
  case (0):
    _str_type = "UNDEFINED";
    break;
  case (1):
    _str_type = "NIL";
    break;
  case (2):
    _str_type = "INT";
    break;
  case (4):
    _str_type = "DOUBLE";
    break;
  case (5):
    _str_type = "STRING";
    break;
  case (6):
    _str_type = "VECTOR_3";
    break;
  case (7):
    _str_type = "MATRIX";
    break;
  case (8):
    _str_type = "LITTERAL";
    break;
  case (9):
    _str_type = "START_MARKER";
    break;
  case (10):
    _str_type = "NEURAL_MLP";
    break;
  case (11):
    _str_type = "FILENAME";
    break;
  case (12):
    _str_type = "TRAINING_ELT";
    break;
  case (13):
    _str_type = "TRAINING_SET";
    break;
  case (14):
    _str_type = "TEST_ELT";
    break;
  case (15):
    _str_type = "TEST_SET";
    break;
  case (16):
    _str_type = "TEXT_FILE";
    break;
  case (17):
    _str_type = "LIST";
    break;
  case (18):
    _str_type = "TUPLE";
    break;
  case (19):
    _str_type = "OPAIR";
    break;
  default:
    sprintf(_err_mesg, "??? (%d)", type);
    _str_type = _err_mesg;
    break;
  }
  return _str_type;
}


x86 assembly (clang, -O0):
<rpn_type_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x15,%eax
ja     1294 <rpn_type_to_string+0x184>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf0d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xf06(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xefd(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xef7(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xeeb(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xedf(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xed6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xec6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xebd(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xeb6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xeb3(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xeae(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xea7(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xea4(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xea1(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xe9a(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xe93(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xe8d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xe82(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
lea    0xe78(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12b5 <rpn_type_to_string+0x1a5>
mov    -0x4(%rbp),%edx
lea    0x2da2(%rip),%rdi
lea    0xe64(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2d8f(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpn_type_to_string>:
push   %rbx
mov    %edi,%edx
lea    0x2(%rdx),%eax
cmp    $0x16,%eax
jae    1125 <rpn_type_to_string+0x15>
mov    $0x3fffdf,%ecx
bt     %eax,%ecx
jb     113d <rpn_type_to_string+0x2d>
lea    0x2f14(%rip),%rbx
lea    0xf7e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
jmp    114d <rpn_type_to_string+0x3d>
cltq
lea    0xf76(%rip),%rcx
movslq (%rcx,%rax,4),%rbx
add    %rcx,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@rpn_type_to_string._err_mesg = internal global [32 x i8] zeroinitializer
@.str = [9 x i8] c"ANY_TYPE\00"
@.str.1 = [7 x i8] c"UNUSED\00"
@.str.2 = [10 x i8] c"UNDEFINED\00"
@.str.3 = [4 x i8] c"NIL\00"
@.str.4 = [4 x i8] c"INT\00"
@.str.5 = [7 x i8] c"DOUBLE\00"
@.str.6 = [7 x i8] c"STRING\00"
@.str.7 = [9 x i8] c"VECTOR_3\00"
@.str.8 = [7 x i8] c"MATRIX\00"
@.str.9 = [9 x i8] c"LITTERAL\00"
@.str.10 = [13 x i8] c"START_MARKER\00"
@.str.11 = [11 x i8] c"NEURAL_MLP\00"
@.str.12 = [9 x i8] c"FILENAME\00"
@.str.13 = [13 x i8] c"TRAINING_ELT\00"
@.str.14 = [13 x i8] c"TRAINING_SET\00"
@.str.15 = [9 x i8] c"TEST_ELT\00"
@.str.16 = [9 x i8] c"TEST_SET\00"
@.str.17 = [10 x i8] c"TEXT_FILE\00"
@.str.18 = [5 x i8] c"LIST\00"
@.str.19 = [6 x i8] c"TUPLE\00"
@.str.20 = [6 x i8] c"OPAIR\00"
@.str.21 = [9 x i8] c"??? (%d)\00"
define i8* @rpn_type_to_string(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %26 [
i32 -2, label %5
i32 -1, label %6
i32 0, label %7
i32 1, label %8
i32 2, label %9
i32 4, label %10
i32 5, label %11
i32 6, label %12
i32 7, label %13
i32 8, label %14
i32 9, label %15
i32 10, label %16
i32 11, label %17
i32 12, label %18
i32 13, label %19
i32 14, label %20
i32 15, label %21
i32 16, label %22
i32 17, label %23
i32 18, label %24
i32 19, label %25
]
5: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3
br label %29
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %29
7: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %29
8: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %29
9: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %29
10: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %29
11: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %29
12: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %29
13: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %29
14: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %29
15: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %29
16: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %29
17: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8** %3
br label %29
18: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i8** %3
br label %29
19: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i8** %3
br label %29
20: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8** %3
br label %29
21: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8** %3
br label %29
22: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i8** %3
br label %29
23: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8** %3
br label %29
24: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8** %3
br label %29
25: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i8** %3
br label %29
26: ; preds = %1
%27 = load i32, i32* %2
%28 = call i32 @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rpn_type_to_string._err_mesg, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), i32 %27)
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rpn_type_to_string._err_mesg, i64 0, i64 0), i8** %3
br label %29
29: ; preds = %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%30 = load i8*, i8** %3
ret i8* %30
}

LLVM IR (-O2):
@rpn_type_to_string._err_mesg = internal global [32 x i8] zeroinitializer
@.str = [9 x i8] c"ANY_TYPE\00"
@.str.1 = [7 x i8] c"UNUSED\00"
@.str.2 = [10 x i8] c"UNDEFINED\00"
@.str.3 = [4 x i8] c"NIL\00"
@.str.4 = [4 x i8] c"INT\00"
@.str.5 = [7 x i8] c"DOUBLE\00"
@.str.6 = [7 x i8] c"STRING\00"
@.str.7 = [9 x i8] c"VECTOR_3\00"
@.str.8 = [7 x i8] c"MATRIX\00"
@.str.9 = [9 x i8] c"LITTERAL\00"
@.str.10 = [13 x i8] c"START_MARKER\00"
@.str.11 = [11 x i8] c"NEURAL_MLP\00"
@.str.12 = [9 x i8] c"FILENAME\00"
@.str.13 = [13 x i8] c"TRAINING_ELT\00"
@.str.14 = [13 x i8] c"TRAINING_SET\00"
@.str.15 = [9 x i8] c"TEST_ELT\00"
@.str.16 = [9 x i8] c"TEST_SET\00"
@.str.17 = [10 x i8] c"TEXT_FILE\00"
@.str.18 = [5 x i8] c"LIST\00"
@.str.19 = [6 x i8] c"TUPLE\00"
@.str.20 = [6 x i8] c"OPAIR\00"
@.str.21 = [9 x i8] c"??? (%d)\00"
@reltable.rpn_type_to_string = [22 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.2 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.5 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.6 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.7 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.8 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.9 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.10 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.11 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.12 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.13 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.14 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.15 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.16 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.17 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.18 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.19 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.20 to i64), i64 ptrtoint ([22 x i32]* @reltable.rpn_type_to_string to i64)) to i32)]
define i8* @rpn_type_to_string(i32 %0) {
%2 = add i32 %0, 2
%3 = icmp ult i32 %2, 22
br i1 %3, label %6, label %4
4: ; preds = %6, %1
%5 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @rpn_type_to_string._err_mesg, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), i32 %0)
br label %14
6: ; preds = %1
%7 = lshr i32 4194271, %2
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %4, label %10
10: ; preds = %6
%11 = sext i32 %2 to i64
%12 = shl i64 %11, 2
%13 = call i8* @llvm.load.relative.i64(i8* bitcast ([22 x i32]* @reltable.rpn_type_to_string to i8*), i64 %12)
br label %14
14: ; preds = %10, %4
%15 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @rpn_type_to_string._err_mesg, i64 0, i64 0), %4 ], [ %13, %10 ]
ret i8* %15
}