#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 */
scalar_t__ amatch(char *, int);
int get_type(void) {
  if (amatch("void", 4)) {
    return (0 << 2);
  }
  if (amatch("register", 8)) {
    if (amatch("char", 4))
      return (1 << 2);
    else if (amatch("int", 3))
      return (2 << 2);
    else
      return (2 << 2);
  } else if (amatch("unsigned", 8)) {
    if (amatch("char", 4)) {
      return ((1 << 2) + 1);
    } else if (amatch("int", 3)) {
      return ((2 << 2) + 1);
    }
  } else if (amatch("signed", 8)) {
    if (amatch("char", 4)) {
      return (1 << 2);
    } else if (amatch("int", 3)) {
      return (2 << 2);
    }
  } else if (amatch("char", 4)) {
    return (1 << 2);
  } else if (amatch("int", 3)) {
    return (2 << 2);
  }
  return -1;
}


x86 assembly (clang, -O0):
<get_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x4,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     113f <get_type+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1303 <get_type+0x1f3>
lea    0xebf(%rip),%rdi
mov    $0x8,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     11b4 <get_type+0xa4>
lea    0xead(%rip),%rdi
mov    $0x4,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     1181 <get_type+0x71>
movl   $0x4,-0x4(%rbp)
jmp    1303 <get_type+0x1f3>
lea    0xe8b(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     11a8 <get_type+0x98>
movl   $0x8,-0x4(%rbp)
jmp    1303 <get_type+0x1f3>
movl   $0x8,-0x4(%rbp)
jmp    1303 <get_type+0x1f3>
lea    0xe5c(%rip),%rdi
mov    $0x8,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     1227 <get_type+0x117>
lea    0xe38(%rip),%rdi
mov    $0x4,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     11f6 <get_type+0xe6>
movl   $0x5,-0x4(%rbp)
jmp    1303 <get_type+0x1f3>
lea    0xe16(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     121d <get_type+0x10d>
movl   $0x9,-0x4(%rbp)
jmp    1303 <get_type+0x1f3>
jmp    1222 <get_type+0x112>
jmp    12f7 <get_type+0x1e7>
lea    0xdeb(%rip),%rdi
mov    $0x8,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     129a <get_type+0x18a>
lea    0xdc5(%rip),%rdi
mov    $0x4,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     1269 <get_type+0x159>
movl   $0x4,-0x4(%rbp)
jmp    1303 <get_type+0x1f3>
lea    0xda3(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     1290 <get_type+0x180>
movl   $0x8,-0x4(%rbp)
jmp    1303 <get_type+0x1f3>
jmp    1295 <get_type+0x185>
jmp    12f2 <get_type+0x1e2>
lea    0xd6d(%rip),%rdi
mov    $0x4,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     12c1 <get_type+0x1b1>
movl   $0x4,-0x4(%rbp)
jmp    1303 <get_type+0x1f3>
lea    0xd4b(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     12e8 <get_type+0x1d8>
movl   $0x8,-0x4(%rbp)
jmp    1303 <get_type+0x1f3>
jmp    12ed <get_type+0x1dd>
jmp    12f2 <get_type+0x1e2>
jmp    12f7 <get_type+0x1e7>
jmp    12fc <get_type+0x1ec>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_type>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <amatch@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1136 <get_type+0x26>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xec8(%rip),%rdi
mov    $0x8,%esi
call   1030 <amatch@plt>
test   %rax,%rax
je     117f <get_type+0x6f>
lea    0xebb(%rip),%rdi
mov    $0x4,%ebx
mov    $0x4,%esi
call   1030 <amatch@plt>
test   %rax,%rax
jne    112c <get_type+0x1c>
lea    0xea5(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
mov    $0x8,%ebx
jmp    112c <get_type+0x1c>
lea    0xe91(%rip),%rdi
mov    $0x8,%esi
call   1030 <amatch@plt>
test   %rax,%rax
je     11d5 <get_type+0xc5>
lea    0xe72(%rip),%rdi
mov    $0x4,%esi
call   1030 <amatch@plt>
mov    $0x5,%ebx
test   %rax,%rax
jne    112c <get_type+0x1c>
lea    0xe58(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
mov    $0x9,%ebx
test   %rax,%rax
jne    112c <get_type+0x1c>
jmp    122a <get_type+0x11a>
lea    0xe3d(%rip),%rdi
mov    $0x8,%esi
call   1030 <amatch@plt>
mov    %rax,%r14
lea    0xe1e(%rip),%rdi
mov    $0x4,%ebx
mov    $0x4,%esi
call   1030 <amatch@plt>
test   %r14,%r14
test   %rax,%rax
jne    112c <get_type+0x1c>
lea    0xe01(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
mov    $0x8,%ebx
test   %rax,%rax
jne    112c <get_type+0x1c>
mov    $0xffffffff,%ebx
jmp    112c <get_type+0x1c>

LLVM IR (-O0):
@.str = [5 x i8] c"void\00"
@.str.1 = [9 x i8] c"register\00"
@.str.2 = [5 x i8] c"char\00"
@.str.3 = [4 x i8] c"int\00"
@.str.4 = [9 x i8] c"unsigned\00"
@.str.5 = [7 x i8] c"signed\00"
define i32 @get_type() {
%1 = alloca i32
%2 = call i64 @amatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %56
5: ; preds = %0
%6 = call i64 @amatch(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = call i64 @amatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 4, i32* %1
br label %56
12: ; preds = %8
%13 = call i64 @amatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 8, i32* %1
br label %56
16: ; preds = %12
store i32 8, i32* %1
br label %56
17: ; preds = %5
%18 = call i64 @amatch(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 8)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %30
20: ; preds = %17
%21 = call i64 @amatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 5, i32* %1
br label %56
24: ; preds = %20
%25 = call i64 @amatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 9, i32* %1
br label %56
28: ; preds = %24
br label %29
29: ; preds = %28
br label %54
30: ; preds = %17
%31 = call i64 @amatch(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 8)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %43
33: ; preds = %30
%34 = call i64 @amatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %33
store i32 4, i32* %1
br label %56
37: ; preds = %33
%38 = call i64 @amatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %37
store i32 8, i32* %1
br label %56
41: ; preds = %37
br label %42
42: ; preds = %41
br label %53
43: ; preds = %30
%44 = call i64 @amatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%45 = icmp ne i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %43
store i32 4, i32* %1
br label %56
47: ; preds = %43
%48 = call i64 @amatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%49 = icmp ne i64 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %47
store i32 8, i32* %1
br label %56
51: ; preds = %47
br label %52
52: ; preds = %51
br label %53
53: ; preds = %52, %42
br label %54
54: ; preds = %53, %29
br label %55
55: ; preds = %54
store i32 -1, i32* %1
br label %56
56: ; preds = %55, %50, %46, %40, %36, %27, %23, %16, %15, %11, %4
%57 = load i32, i32* %1
ret i32 %57
}

LLVM IR (-O2):
@.str = [5 x i8] c"void\00"
@.str.1 = [9 x i8] c"register\00"
@.str.2 = [5 x i8] c"char\00"
@.str.3 = [4 x i8] c"int\00"
@.str.4 = [9 x i8] c"unsigned\00"
@.str.5 = [7 x i8] c"signed\00"
define i32 @get_type() {
%1 = tail call i64 @amatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %34
3: ; preds = %0
%4 = tail call i64 @amatch(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i64 @amatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %34
9: ; preds = %6
%10 = tail call i64 @amatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
br label %34
11: ; preds = %3
%12 = tail call i64 @amatch(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 8)
%13 = icmp eq i64 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = tail call i64 @amatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %34
17: ; preds = %14
%18 = tail call i64 @amatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%19 = icmp eq i64 %18, 0
br i1 %19, label %33, label %34
20: ; preds = %11
%21 = tail call i64 @amatch(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 8)
%22 = icmp eq i64 %21, 0
%23 = tail call i64 @amatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%24 = icmp eq i64 %23, 0
br i1 %22, label %29, label %25
25: ; preds = %20
br i1 %24, label %26, label %34
26: ; preds = %25
%27 = tail call i64 @amatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%28 = icmp eq i64 %27, 0
br i1 %28, label %33, label %34
29: ; preds = %20
br i1 %24, label %30, label %34
30: ; preds = %29
%31 = tail call i64 @amatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %17, %30, %26
br label %34
34: ; preds = %30, %29, %26, %25, %17, %14, %9, %6, %0, %33
%35 = phi i32 [ -1, %33 ], [ 0, %0 ], [ 4, %6 ], [ 8, %9 ], [ 5, %14 ], [ 9, %17 ], [ 4, %25 ], [ 8, %26 ], [ 4, %29 ], [ 8, %30 ]
ret i32 %35
}