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


x86 assembly (clang, -O0):
<StatetypeIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     11d3 <StatetypeIndex+0xc3>
jmp    112f <StatetypeIndex+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11eb <StatetypeIndex+0xdb>
jmp    1140 <StatetypeIndex+0x30>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     11f7 <StatetypeIndex+0xe7>
jmp    1151 <StatetypeIndex+0x41>
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
je     1203 <StatetypeIndex+0xf3>
jmp    1162 <StatetypeIndex+0x52>
mov    -0xc(%rbp),%eax
sub    $0x10,%eax
je     121b <StatetypeIndex+0x10b>
jmp    1173 <StatetypeIndex+0x63>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     120f <StatetypeIndex+0xff>
jmp    1184 <StatetypeIndex+0x74>
mov    -0xc(%rbp),%eax
sub    $0x40,%eax
je     11bb <StatetypeIndex+0xab>
jmp    1195 <StatetypeIndex+0x85>
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
je     11df <StatetypeIndex+0xcf>
jmp    11a8 <StatetypeIndex+0x98>
mov    -0xc(%rbp),%eax
sub    $0x100,%eax
je     11c7 <StatetypeIndex+0xb7>
jmp    1227 <StatetypeIndex+0x117>
movl   $0x0,-0x4(%rbp)
jmp    123d <StatetypeIndex+0x12d>
movl   $0x0,-0x4(%rbp)
jmp    123d <StatetypeIndex+0x12d>
movl   $0x0,-0x4(%rbp)
jmp    123d <StatetypeIndex+0x12d>
movl   $0x0,-0x4(%rbp)
jmp    123d <StatetypeIndex+0x12d>
movl   $0x1,-0x4(%rbp)
jmp    123d <StatetypeIndex+0x12d>
movl   $0x2,-0x4(%rbp)
jmp    123d <StatetypeIndex+0x12d>
movl   $0x3,-0x4(%rbp)
jmp    123d <StatetypeIndex+0x12d>
movl   $0x5,-0x4(%rbp)
jmp    123d <StatetypeIndex+0x12d>
movl   $0x4,-0x4(%rbp)
jmp    123d <StatetypeIndex+0x12d>
mov    -0x8(%rbp),%esi
lea    0xdcf(%rip),%rdi
call   1030 <Die@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StatetypeIndex>:
push   %rbx
mov    %edi,%esi
xor    %ebx,%ebx
lea    -0x1(%rsi),%eax
cmp    $0x3f,%eax
ja     1134 <StatetypeIndex+0x24>
lea    0xedc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1,%ebx
jmp    116c <StatetypeIndex+0x5c>
cmp    $0x80,%esi
je     116c <StatetypeIndex+0x5c>
cmp    $0x100,%esi
je     116c <StatetypeIndex+0x5c>
lea    0xfb5(%rip),%rdi
call   1030 <Die@plt>
jmp    116c <StatetypeIndex+0x5c>
mov    $0x2,%ebx
jmp    116c <StatetypeIndex+0x5c>
mov    $0x3,%ebx
jmp    116c <StatetypeIndex+0x5c>
mov    $0x4,%ebx
jmp    116c <StatetypeIndex+0x5c>
mov    $0x5,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"no such state, %d\00"
define i32 @StatetypeIndex(i32 %0) {
switch i32 %0, label %7 [
i32 64, label %9
i32 256, label %9
i32 1, label %9
i32 128, label %9
i32 2, label %2
i32 4, label %3
i32 8, label %4
i32 32, label %5
i32 16, label %6
]
2: ; preds = %1
br label %9
3: ; preds = %1
br label %9
4: ; preds = %1
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = tail call i32 @Die(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %9
9: ; preds = %1, %1, %1, %1, %7, %6, %5, %4, %3, %2
%10 = phi i32 [ 0, %7 ], [ 4, %6 ], [ 5, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %10
}