#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__ isalnum(char);
scalar_t__ isalpha(char);
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
int identifier(char *str) {
  int i;
  if (!strcmp(str, "int") || !strcmp(str, "float") || !strcmp(str, "long") ||
      !strcmp(str, "double"))
    return 0;
  else if (!(isalpha(str[0]) || str[0] == '_'))
    return 0;
  else {
    for (i = 1; i < strlen(str); i++)
      if (!(isalnum(str[i]) || str[i] == '_'))
        return 0;
    return 1;
  }
}


x86 assembly (clang, -O0):
<identifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     11b0 <identifier+0x70>
mov    -0x10(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     11b0 <identifier+0x70>
mov    -0x10(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     11b0 <identifier+0x70>
mov    -0x10(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11bc <identifier+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    1267 <identifier+0x127>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1060 <isalpha@plt>
cmp    $0x0,%rax
jne    11ee <identifier+0xae>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
je     11ee <identifier+0xae>
movl   $0x0,-0x4(%rbp)
jmp    1267 <identifier+0x127>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1260 <identifier+0x120>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <isalnum@plt>
cmp    $0x0,%rax
jne    124d <identifier+0x10d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5f,%eax
je     124d <identifier+0x10d>
movl   $0x0,-0x4(%rbp)
jmp    1267 <identifier+0x127>
jmp    1252 <identifier+0x112>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11f5 <identifier+0xb5>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<identifier>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xeb2(%rip),%rsi
call   1050 <strcmp@plt>
xor    %r14d,%r14d
test   %eax,%eax
je     11ff <identifier+0xbf>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11ff <identifier+0xbf>
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11ff <identifier+0xbf>
lea    0xe80(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11ff <identifier+0xbf>
movsbl (%rbx),%edi
call   1060 <isalpha@plt>
test   %rax,%rax
jne    11ad <identifier+0x6d>
cmpb   $0x5f,(%rbx)
jne    11ff <identifier+0xbf>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     11f9 <identifier+0xb9>
mov    $0x1,%ebp
jmp    11e3 <identifier+0xa3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jge    11f9 <identifier+0xb9>
movsbl (%rbx,%rbp,1),%edi
call   1040 <isalnum@plt>
test   %rax,%rax
jne    11d0 <identifier+0x90>
cmpb   $0x5f,(%rbx,%rbp,1)
je     11d0 <identifier+0x90>
jmp    11ff <identifier+0xbf>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"int\00"
@.str.1 = [6 x i8] c"float\00"
@.str.2 = [5 x i8] c"long\00"
@.str.3 = [7 x i8] c"double\00"
define i32 @identifier(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strcmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %16, %12, %8, %1
store i32 0, i32* %2
br label %62
21: ; preds = %16
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = call i64 @isalpha(i8 signext %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %34, label %27
27: ; preds = %21
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 95
br i1 %32, label %34, label %33
33: ; preds = %27
store i32 0, i32* %2
br label %62
34: ; preds = %27, %21
store i32 1, i32* %4
br label %35
35: ; preds = %58, %34
%36 = load i32, i32* %4
%37 = load i8*, i8** %3
%38 = call i32 @strlen(i8* %37)
%39 = icmp slt i32 %36, %38
br i1 %39, label %40, label %61
40: ; preds = %35
%41 = load i8*, i8** %3
%42 = load i32, i32* %4
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %41, i64 %43
%45 = load i8, i8* %44
%46 = call i64 @isalnum(i8 signext %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %57, label %48
48: ; preds = %40
%49 = load i8*, i8** %3
%50 = load i32, i32* %4
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8, i8* %49, i64 %51
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 95
br i1 %55, label %57, label %56
56: ; preds = %48
store i32 0, i32* %2
br label %62
57: ; preds = %48, %40
br label %58
58: ; preds = %57
%59 = load i32, i32* %4
%60 = add nsw i32 %59, 1
store i32 %60, i32* %4
br label %35
61: ; preds = %35
store i32 1, i32* %2
br label %62
62: ; preds = %61, %56, %33, %20
%63 = load i32, i32* %2
ret i32 %63
}

LLVM IR (-O2):
@.str = [4 x i8] c"int\00"
@.str.1 = [6 x i8] c"float\00"
@.str.2 = [5 x i8] c"long\00"
@.str.3 = [7 x i8] c"double\00"
define i32 @identifier(i8* %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %37, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %37, label %7
7: ; preds = %4
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %37, label %10
10: ; preds = %7
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %37, label %13
13: ; preds = %10
%14 = load i8, i8* %0
%15 = tail call i64 @isalpha(i8 signext %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i8, i8* %0
%19 = icmp eq i8 %18, 95
br i1 %19, label %20, label %37
20: ; preds = %17, %13
%21 = tail call i32 @strlen(i8* %0)
%22 = icmp sgt i32 %21, 1
br i1 %22, label %23, label %37
23: ; preds = %20, %32
%24 = phi i64 [ %33, %32 ], [ 1, %20 ]
%25 = getelementptr inbounds i8, i8* %0, i64 %24
%26 = load i8, i8* %25
%27 = tail call i64 @isalnum(i8 signext %26)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %23
%30 = load i8, i8* %25
%31 = icmp eq i8 %30, 95
br i1 %31, label %32, label %37
32: ; preds = %23, %29
%33 = add nuw nsw i64 %24, 1
%34 = tail call i32 @strlen(i8* %0)
%35 = sext i32 %34 to i64
%36 = icmp slt i64 %33, %35
br i1 %36, label %23, label %37
37: ; preds = %29, %32, %20, %17, %1, %4, %7, %10
%38 = phi i32 [ 0, %10 ], [ 0, %7 ], [ 0, %4 ], [ 0, %1 ], [ 0, %17 ], [ 1, %20 ], [ 0, %29 ], [ 1, %32 ]
ret i32 %38
}