#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__ isdigit(unsigned char);
scalar_t__ strcmp(char *, char *);
int is_reserved(char *name) {
  char *s;
  if (strcmp(name, ".") == 0 || strcmp(name, "$accept") == 0 ||
      strcmp(name, "$end") == 0)
    return (1);
  if (name[0] == '$' && name[1] == '$' && isdigit((unsigned char)name[2])) {
    s = name + 3;
    while (isdigit((unsigned char)*s))
      ++s;
    if (*s == '\0')
      return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<is_reserved>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     117a <is_reserved+0x5a>
mov    -0x10(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     117a <is_reserved+0x5a>
mov    -0x10(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1186 <is_reserved+0x66>
movl   $0x1,-0x4(%rbp)
jmp    1219 <is_reserved+0xf9>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x24,%eax
jne    1212 <is_reserved+0xf2>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x24,%eax
jne    1212 <is_reserved+0xf2>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1212 <is_reserved+0xf2>
mov    -0x10(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11f1 <is_reserved+0xd1>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11ca <is_reserved+0xaa>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    120d <is_reserved+0xed>
movl   $0x1,-0x4(%rbp)
jmp    1219 <is_reserved+0xf9>
jmp    1212 <is_reserved+0xf2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_reserved>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed3(%rip),%rsi
call   1040 <strcmp@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     11a9 <is_reserved+0x89>
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11a9 <is_reserved+0x89>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11a9 <is_reserved+0x89>
cmpb   $0x24,(%rbx)
jne    11a7 <is_reserved+0x87>
cmpb   $0x24,0x1(%rbx)
jne    11a7 <is_reserved+0x87>
movzbl 0x2(%rbx),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     11a7 <is_reserved+0x87>
add    $0x3,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rbx),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1190 <is_reserved+0x70>
cmpb   $0x0,-0x1(%rbx)
je     11a9 <is_reserved+0x89>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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