#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*/ Die(char *, int);
int UniqueStatetype(int nodetype, int stidx) {
  switch (stidx) {
  case 0:
    switch (nodetype) {
    case -1:
      return (1 << 7);
    case 0:
      return (1 << 8);
    case 4:
    case 5:
      return (1 << 6);
    default:
      return (1 << 0);
    }
  case 1:
    return (1 << 1);
  case 2:
    return (1 << 2);
  case 3:
    return (1 << 3);
  case 5:
    return (1 << 5);
  case 4:
    return (1 << 4);
  default:
    Die("no such state index %d", stidx);
  }
  return 0;
}


x86 assembly (clang, -O0):
<UniqueStatetype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x5,%rax
ja     11e7 <UniqueStatetype+0xd7>
mov    -0x18(%rbp),%rax
lea    0xec6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0xffffffff,%eax
je     117b <UniqueStatetype+0x6b>
jmp    1157 <UniqueStatetype+0x47>
mov    -0x1c(%rbp),%eax
test   %eax,%eax
je     1187 <UniqueStatetype+0x77>
jmp    1167 <UniqueStatetype+0x57>
mov    -0x1c(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x2,%eax
jb     1193 <UniqueStatetype+0x83>
jmp    119f <UniqueStatetype+0x8f>
movl   $0x80,-0x4(%rbp)
jmp    11fd <UniqueStatetype+0xed>
movl   $0x100,-0x4(%rbp)
jmp    11fd <UniqueStatetype+0xed>
movl   $0x40,-0x4(%rbp)
jmp    11fd <UniqueStatetype+0xed>
movl   $0x1,-0x4(%rbp)
jmp    11fd <UniqueStatetype+0xed>
movl   $0x2,-0x4(%rbp)
jmp    11fd <UniqueStatetype+0xed>
movl   $0x4,-0x4(%rbp)
jmp    11fd <UniqueStatetype+0xed>
movl   $0x8,-0x4(%rbp)
jmp    11fd <UniqueStatetype+0xed>
movl   $0x20,-0x4(%rbp)
jmp    11fd <UniqueStatetype+0xed>
movl   $0x10,-0x4(%rbp)
jmp    11fd <UniqueStatetype+0xed>
mov    -0xc(%rbp),%esi
lea    0xe27(%rip),%rdi
call   1030 <Die@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UniqueStatetype>:
push   %rax
cmp    $0x5,%esi
ja     115e <UniqueStatetype+0x4e>
mov    $0x2,%eax
mov    %esi,%ecx
lea    0xedc(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
add    $0x1,%edi
mov    $0x1,%eax
cmp    $0x7,%edi
jae    1147 <UniqueStatetype+0x37>
movslq %edi,%rax
lea    0xed4(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
mov    $0x4,%eax
pop    %rcx
ret
mov    $0x8,%eax
pop    %rcx
ret
mov    $0x10,%eax
pop    %rcx
ret
lea    0xecf(%rip),%rdi
call   1030 <Die@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"no such state index %d\00"
define i32 @UniqueStatetype(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %18 [
i32 0, label %7
i32 1, label %13
i32 2, label %14
i32 3, label %15
i32 5, label %16
i32 4, label %17
]
7: ; preds = %2
%8 = load i32, i32* %4
switch i32 %8, label %12 [
i32 -1, label %9
i32 0, label %10
i32 4, label %11
i32 5, label %11
]
9: ; preds = %7
store i32 128, i32* %3
br label %22
10: ; preds = %7
store i32 256, i32* %3
br label %22
11: ; preds = %7, %7
store i32 64, i32* %3
br label %22
12: ; preds = %7
store i32 1, i32* %3
br label %22
13: ; preds = %2
store i32 2, i32* %3
br label %22
14: ; preds = %2
store i32 4, i32* %3
br label %22
15: ; preds = %2
store i32 8, i32* %3
br label %22
16: ; preds = %2
store i32 32, i32* %3
br label %22
17: ; preds = %2
store i32 16, i32* %3
br label %22
18: ; preds = %2
%19 = load i32, i32* %5
%20 = call i32 @Die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %18
store i32 0, i32* %3
br label %22
22: ; preds = %21, %17, %16, %15, %14, %13, %12, %11, %10, %9
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [23 x i8] c"no such state index %d\00"
@switch.table.UniqueStatetype = [7 x i32] [i32 128, i32 256, i32 1, i32 1, i32 1, i32 64, i32 64]
define i32 @UniqueStatetype(i32 %0, i32 %1) {
switch i32 %1, label %10 [
i32 0, label %3
i32 1, label %16
i32 2, label %6
i32 3, label %7
i32 5, label %8
i32 4, label %9
]
3: ; preds = %2
%4 = add i32 %0, 1
%5 = icmp ult i32 %4, 7
br i1 %5, label %12, label %16
6: ; preds = %2
br label %16
7: ; preds = %2
br label %16
8: ; preds = %2
br label %16
9: ; preds = %2
br label %16
10: ; preds = %2
%11 = tail call i32 @Die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %16
12: ; preds = %3
%13 = sext i32 %4 to i64
%14 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.UniqueStatetype, i64 0, i64 %13
%15 = load i32, i32* %14
br label %16
16: ; preds = %3, %12, %2, %10, %9, %8, %7, %6
%17 = phi i32 [ 0, %10 ], [ 16, %9 ], [ 32, %8 ], [ 8, %7 ], [ 4, %6 ], [ 2, %2 ], [ %15, %12 ], [ 1, %3 ]
ret i32 %17
}