#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() {
  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 0;
}


x86 assembly (clang, -O0):
<get_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x8,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     118d <get_type+0x7d>
lea    0xecf(%rip),%rdi
mov    $0x4,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     115a <get_type+0x4a>
movl   $0x4,-0x4(%rbp)
jmp    12dc <get_type+0x1cc>
lea    0xead(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     1181 <get_type+0x71>
movl   $0x8,-0x4(%rbp)
jmp    12dc <get_type+0x1cc>
movl   $0x8,-0x4(%rbp)
jmp    12dc <get_type+0x1cc>
lea    0xe7e(%rip),%rdi
mov    $0x8,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     1200 <get_type+0xf0>
lea    0xe5a(%rip),%rdi
mov    $0x4,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     11cf <get_type+0xbf>
movl   $0x5,-0x4(%rbp)
jmp    12dc <get_type+0x1cc>
lea    0xe38(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     11f6 <get_type+0xe6>
movl   $0x9,-0x4(%rbp)
jmp    12dc <get_type+0x1cc>
jmp    11fb <get_type+0xeb>
jmp    12d0 <get_type+0x1c0>
lea    0xe0d(%rip),%rdi
mov    $0x8,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     1273 <get_type+0x163>
lea    0xde7(%rip),%rdi
mov    $0x4,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     1242 <get_type+0x132>
movl   $0x4,-0x4(%rbp)
jmp    12dc <get_type+0x1cc>
lea    0xdc5(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     1269 <get_type+0x159>
movl   $0x8,-0x4(%rbp)
jmp    12dc <get_type+0x1cc>
jmp    126e <get_type+0x15e>
jmp    12cb <get_type+0x1bb>
lea    0xd8f(%rip),%rdi
mov    $0x4,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     129a <get_type+0x18a>
movl   $0x4,-0x4(%rbp)
jmp    12dc <get_type+0x1cc>
lea    0xd6d(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
cmp    $0x0,%rax
je     12c1 <get_type+0x1b1>
movl   $0x8,-0x4(%rbp)
jmp    12dc <get_type+0x1cc>
jmp    12c6 <get_type+0x1b6>
jmp    12cb <get_type+0x1bb>
jmp    12d0 <get_type+0x1c0>
jmp    12d5 <get_type+0x1c5>
movl   $0x0,-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    $0x8,%esi
call   1030 <amatch@plt>
test   %rax,%rax
je     1164 <get_type+0x54>
lea    0xed8(%rip),%rdi
mov    $0x4,%ebx
mov    $0x4,%esi
call   1030 <amatch@plt>
test   %rax,%rax
jne    1201 <get_type+0xf1>
lea    0xebe(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
mov    $0x8,%ebx
jmp    1201 <get_type+0xf1>
lea    0xea7(%rip),%rdi
mov    $0x8,%esi
call   1030 <amatch@plt>
test   %rax,%rax
je     11b2 <get_type+0xa2>
lea    0xe88(%rip),%rdi
mov    $0x4,%esi
call   1030 <amatch@plt>
mov    $0x5,%ebx
test   %rax,%rax
jne    1201 <get_type+0xf1>
lea    0xe72(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
mov    $0x9,%ebx
test   %rax,%rax
jne    1201 <get_type+0xf1>
jmp    11ff <get_type+0xef>
lea    0xe5b(%rip),%rdi
mov    $0x8,%esi
call   1030 <amatch@plt>
mov    %rax,%r14
lea    0xe3c(%rip),%rdi
mov    $0x4,%ebx
mov    $0x4,%esi
call   1030 <amatch@plt>
test   %r14,%r14
test   %rax,%rax
jne    1201 <get_type+0xf1>
lea    0xe23(%rip),%rdi
mov    $0x3,%esi
call   1030 <amatch@plt>
mov    $0x8,%ebx
test   %rax,%rax
jne    1201 <get_type+0xf1>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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