#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 */
typedef int /*<<< orphan*/ keywds;

/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int is_basic_type(char *s) {
  static char *keywds[] = {
      "char", "double", "enum",  "extern", "float",
      "int",  "long",   "short", "static",
  };
  int j, s0 = s[0], k0;
  char *k;
  for (j = 0; j < sizeof(keywds) / sizeof(char *); ++j) {
    k = keywds[j];
    k0 = k[0];
    if (k0 > s0)
      return 0;
    if (k0 < s0)
      continue;
    if (strcmp(s, k) == 0)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_basic_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x9,%rax
jae    11b7 <is_basic_type+0xa7>
movslq -0x14(%rbp),%rcx
lea    0x2eea(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1170 <is_basic_type+0x60>
movl   $0x0,-0x4(%rbp)
jmp    11be <is_basic_type+0xae>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1181 <is_basic_type+0x71>
jmp    11a9 <is_basic_type+0x99>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11a4 <is_basic_type+0x94>
movl   $0x1,-0x4(%rbp)
jmp    11be <is_basic_type+0xae>
jmp    11a9 <is_basic_type+0x99>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <is_basic_type+0x1d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_basic_type>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
cmp    $0x63,%al
jge    111d <is_basic_type+0xd>
xor    %ebp,%ebp
jmp    118f <is_basic_type+0x7f>
mov    %rdi,%rbx
lea    -0x63(%rax),%ecx
cmp    $0x3,%cl
ja     1144 <is_basic_type+0x34>
movzbl %cl,%eax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xece(%rip),%rsi
jmp    1180 <is_basic_type+0x70>
cmp    $0x69,%al
jb     1119 <is_basic_type+0x9>
jne    119f <is_basic_type+0x8f>
lea    0xedd(%rip),%rsi
jmp    1180 <is_basic_type+0x70>
lea    0xebb(%rip),%rsi
jmp    1180 <is_basic_type+0x70>
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     119a <is_basic_type+0x8a>
lea    0xeaa(%rip),%rsi
jmp    1180 <is_basic_type+0x70>
lea    0xea8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %bpl
movzbl %bpl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x1,%bpl
jmp    118f <is_basic_type+0x7f>
cmp    $0x6c,%al
jb     1119 <is_basic_type+0x9>
jne    11b2 <is_basic_type+0xa2>
lea    0xe82(%rip),%rsi
jmp    1180 <is_basic_type+0x70>
cmp    $0x73,%al
jb     1119 <is_basic_type+0x9>
jne    1119 <is_basic_type+0x9>
lea    0xe70(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    $0x1,%bpl
test   %rax,%rax
je     118f <is_basic_type+0x7f>
lea    0xe5f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1119 <is_basic_type+0x9>
jmp    118f <is_basic_type+0x7f>

LLVM IR (-O0):
@is_basic_type.keywds = internal global [9 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i32 0, i32 0)]
@.str = [5 x i8] c"char\00"
@.str.1 = [7 x i8] c"double\00"
@.str.2 = [5 x i8] c"enum\00"
@.str.3 = [7 x i8] c"extern\00"
@.str.4 = [6 x i8] c"float\00"
@.str.5 = [4 x i8] c"int\00"
@.str.6 = [5 x i8] c"long\00"
@.str.7 = [6 x i8] c"short\00"
@.str.8 = [7 x i8] c"static\00"
define i32 @is_basic_type(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %3
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
store i32 %11, i32* %5
store i32 0, i32* %4
br label %12
12: ; preds = %41, %1
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = icmp ult i64 %14, 9
br i1 %15, label %16, label %44
16: ; preds = %12
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [9 x i8*], [9 x i8*]* @is_basic_type.keywds, i64 0, i64 %18
%20 = load i8*, i8** %19
store i8* %20, i8** %7
%21 = load i8*, i8** %7
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = load i32, i32* %5
%27 = icmp sgt i32 %25, %26
br i1 %27, label %28, label %29
28: ; preds = %16
store i32 0, i32* %2
br label %45
29: ; preds = %16
%30 = load i32, i32* %6
%31 = load i32, i32* %5
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %34
33: ; preds = %29
br label %41
34: ; preds = %29
%35 = load i8*, i8** %3
%36 = load i8*, i8** %7
%37 = call i64 @strcmp(i8* %35, i8* %36)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %34
store i32 1, i32* %2
br label %45
40: ; preds = %34
br label %41
41: ; preds = %40, %33
%42 = load i32, i32* %4
%43 = add nsw i32 %42, 1
store i32 %43, i32* %4
br label %12
44: ; preds = %12
store i32 0, i32* %2
br label %45
45: ; preds = %44, %39, %28
%46 = load i32, i32* %2
ret i32 %46
}

LLVM IR (-O2):
@.str = [5 x i8] c"char\00"
@.str.1 = [7 x i8] c"double\00"
@.str.2 = [5 x i8] c"enum\00"
@.str.3 = [7 x i8] c"extern\00"
@.str.4 = [6 x i8] c"float\00"
@.str.5 = [4 x i8] c"int\00"
@.str.6 = [5 x i8] c"long\00"
@.str.7 = [6 x i8] c"short\00"
@.str.8 = [7 x i8] c"static\00"
define i32 @is_basic_type(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp slt i8 %2, 99
br i1 %3, label %45, label %4
4: ; preds = %1
switch i8 %2, label %20 [
i8 99, label %5
i8 100, label %8
i8 101, label %11
i8 102, label %17
]
5: ; preds = %4
%6 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br label %45
8: ; preds = %4
%9 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br label %45
11: ; preds = %4
%12 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %45, label %14
14: ; preds = %11
%15 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br label %45
17: ; preds = %4
%18 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br label %45
20: ; preds = %4
%21 = icmp ult i8 %2, 105
br i1 %21, label %45, label %22
22: ; preds = %20
%23 = icmp eq i8 %2, 105
br i1 %23, label %24, label %27
24: ; preds = %22
%25 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br label %45
27: ; preds = %22
%28 = icmp ult i8 %2, 108
br i1 %28, label %45, label %29
29: ; preds = %27
%30 = icmp eq i8 %2, 108
br i1 %30, label %31, label %34
31: ; preds = %29
%32 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br label %45
34: ; preds = %29
%35 = icmp ult i8 %2, 115
br i1 %35, label %45, label %36
36: ; preds = %34
%37 = icmp eq i8 %2, 115
br i1 %37, label %38, label %44
38: ; preds = %36
%39 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %45, label %41
41: ; preds = %38
%42 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %45, label %44
44: ; preds = %36, %41
br label %45
45: ; preds = %31, %24, %17, %14, %8, %5, %44, %41, %38, %34, %27, %20, %11, %1
%46 = phi i1 [ false, %1 ], [ true, %11 ], [ false, %20 ], [ false, %27 ], [ false, %34 ], [ true, %38 ], [ true, %41 ], [ false, %44 ], [ %7, %5 ], [ %10, %8 ], [ %16, %14 ], [ %19, %17 ], [ %26, %24 ], [ %33, %31 ]
%47 = zext i1 %46 to i32
ret i32 %47
}