#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*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *CTypeToDPSType(int type) {
  switch (type) {
  case 101:
    return ("DPS_BOOL");
  case 106:
  case 108:
  case 109:
  case 107:
  case 110:
  case 111:
  case 112:
    return ("DPS_INT");
  case 102:
  case 103:
    return ("DPS_REAL");
  case 104:
  case 105:
    return ("DPS_STRING");
  default: {
    fprintf(stderr, "CantHappen");
    abort();
  };
  }
}


x86 assembly (clang, -O0):
<CTypeToDPSType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffff9b,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xb,%eax
ja     1194 <CTypeToDPSType+0x74>
mov    -0x18(%rbp),%rax
lea    0xeb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xed5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b0 <CTypeToDPSType+0x90>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b0 <CTypeToDPSType+0x90>
lea    0xec6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b0 <CTypeToDPSType+0x90>
lea    0xebf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b0 <CTypeToDPSType+0x90>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CTypeToDPSType>:
push   %rax
add    $0xffffff9b,%edi
cmp    $0xc,%edi
jae    113c <CTypeToDPSType+0x1c>
movslq %edi,%rax
lea    0xefd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
pop    %rcx
ret
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"DPS_BOOL\00"
@.str.1 = [8 x i8] c"DPS_INT\00"
@.str.2 = [9 x i8] c"DPS_REAL\00"
@.str.3 = [11 x i8] c"DPS_STRING\00"
@stderr = global i32 0
@.str.4 = [11 x i8] c"CantHappen\00"
define i8* @CTypeToDPSType(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 101, label %5
i32 106, label %6
i32 108, label %6
i32 109, label %6
i32 107, label %6
i32 110, label %6
i32 111, label %6
i32 112, label %6
i32 102, label %7
i32 103, label %7
i32 104, label %8
i32 105, label %8
]
5: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
br label %13
6: ; preds = %1, %1, %1, %1, %1, %1, %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %13
7: ; preds = %1, %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %13
8: ; preds = %1, %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %8, %7, %6, %5
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [9 x i8] c"DPS_BOOL\00"
@.str.1 = [8 x i8] c"DPS_INT\00"
@.str.2 = [9 x i8] c"DPS_REAL\00"
@.str.3 = [11 x i8] c"DPS_STRING\00"
@stderr = global i32 0
@.str.4 = [11 x i8] c"CantHappen\00"
@reltable.CTypeToDPSType = [12 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str to i64), i64 ptrtoint ([12 x i32]* @reltable.CTypeToDPSType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.2 to i64), i64 ptrtoint ([12 x i32]* @reltable.CTypeToDPSType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.2 to i64), i64 ptrtoint ([12 x i32]* @reltable.CTypeToDPSType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.3 to i64), i64 ptrtoint ([12 x i32]* @reltable.CTypeToDPSType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.3 to i64), i64 ptrtoint ([12 x i32]* @reltable.CTypeToDPSType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.CTypeToDPSType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.CTypeToDPSType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.CTypeToDPSType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.CTypeToDPSType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.CTypeToDPSType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.CTypeToDPSType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.CTypeToDPSType to i64)) to i32)]
define i8* @CTypeToDPSType(i32 %0) {
%2 = add i32 %0, -101
%3 = icmp ult i32 %2, 12
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = sext i32 %2 to i64
%10 = shl i64 %9, 2
%11 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.CTypeToDPSType to i8*), i64 %10)
ret i8* %11
}