#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 */
int /*<<< orphan*/ isBlank(char);
int /*<<< orphan*/ isSharp(int /*<<< orphan*/);
char *skipBlank(char *);
scalar_t__ strncmp(char *, char *, int);
int isInclude(char *p) {
  p = skipBlank(p);
  if (!isSharp(*p++))
    return 0;
  p = skipBlank(p);
  if (strncmp(p, "include", 7) != 0)
    return 0;
  p += 7;
  p = skipBlank(p);
  if (*p != '"' && *p != '<')
    return 0;
  int isSystemInclude = (*p == '<');
  char terminator = (isSystemInclude) ? '>' : '"';
  char *lastTerminatorP = NULL;
  while (*++p != '\0') {
    if (*p == terminator)
      lastTerminatorP = p;
  }
  if (lastTerminatorP == NULL)
    return 0;
  p = lastTerminatorP;
  while (*++p != '\0') {
    if (!isBlank(*p))
      return 0;
  }
  return (isSystemInclude) ? 1 : 2;
}


x86 assembly (clang, -O0):
<isInclude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <skipBlank@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1050 <isSharp@plt>
cmp    $0x0,%eax
jne    1185 <isInclude+0x45>
movl   $0x0,-0x4(%rbp)
jmp    12e8 <isInclude+0x1a8>
mov    -0x10(%rbp),%rdi
call   1060 <skipBlank@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe63(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     11bd <isInclude+0x7d>
movl   $0x0,-0x4(%rbp)
jmp    12e8 <isInclude+0x1a8>
mov    -0x10(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <skipBlank@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     1202 <isInclude+0xc2>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3c,%eax
je     1202 <isInclude+0xc2>
movl   $0x0,-0x4(%rbp)
jmp    12e8 <isInclude+0x1a8>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x22,%eax
mov    $0x3e,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x15(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1271 <isInclude+0x131>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    126c <isInclude+0x12c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1235 <isInclude+0xf5>
cmpq   $0x0,-0x20(%rbp)
jne    1288 <isInclude+0x148>
movl   $0x0,-0x4(%rbp)
jmp    12e8 <isInclude+0x1a8>
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     12d2 <isInclude+0x192>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isBlank@plt>
cmp    $0x0,%eax
jne    12cd <isInclude+0x18d>
movl   $0x0,-0x4(%rbp)
jmp    12e8 <isInclude+0x1a8>
jmp    1290 <isInclude+0x150>
mov    -0x14(%rbp),%edx
mov    $0x2,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInclude>:
push   %rbp
push   %r14
push   %rbx
call   1060 <skipBlank@plt>
mov    %rax,%rbx
movsbl (%rax),%edi
call   1050 <isSharp@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     1182 <isInclude+0x42>
add    $0x1,%rbx
mov    %rbx,%rdi
call   1060 <skipBlank@plt>
mov    %rax,%rbx
lea    0xe90(%rip),%rsi
mov    %rax,%rdi
mov    $0x7,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1189 <isInclude+0x49>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
add    $0x7,%rbx
mov    %rbx,%rdi
call   1060 <skipBlank@plt>
mov    (%rax),%r14b
cmp    $0x3c,%r14b
je     11a4 <isInclude+0x64>
cmp    $0x22,%r14b
jne    1182 <isInclude+0x42>
cmp    $0x3c,%r14b
mov    $0x3e,%edx
mov    $0x22,%ecx
cmove  %edx,%ecx
mov    0x1(%rax),%dl
test   %dl,%dl
je     1182 <isInclude+0x42>
add    $0x1,%rax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %dl,%edx
cmp    %edx,%ecx
cmove  %rax,%rbx
movzbl 0x1(%rax),%edx
add    $0x1,%rax
test   %dl,%dl
jne    11d0 <isInclude+0x90>
xor    %ebp,%ebp
test   %rbx,%rbx
je     1182 <isInclude+0x42>
add    $0x1,%rbx
movzbl (%rbx),%eax
test   %al,%al
je     120c <isInclude+0xcc>
movsbl %al,%edi
call   1040 <isBlank@plt>
add    $0x1,%rbx
test   %eax,%eax
jne    11f0 <isInclude+0xb0>
jmp    1182 <isInclude+0x42>
xor    %eax,%eax
cmp    $0x3c,%r14b
sete   %al
mov    $0x2,%ebp
sub    %eax,%ebp
jmp    1182 <isInclude+0x42>

LLVM IR (-O0):
@.str = [8 x i8] c"include\00"
define i32 @isInclude(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8*
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @skipBlank(i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 @isSharp(i32 %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %1
store i32 0, i32* %2
br label %89
16: ; preds = %1
%17 = load i8*, i8** %3
%18 = call i8* @skipBlank(i8* %17)
store i8* %18, i8** %3
%19 = load i8*, i8** %3
%20 = call i64 @strncmp(i8* %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %16
store i32 0, i32* %2
br label %89
23: ; preds = %16
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 7
store i8* %25, i8** %3
%26 = load i8*, i8** %3
%27 = call i8* @skipBlank(i8* %26)
store i8* %27, i8** %3
%28 = load i8*, i8** %3
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp ne i32 %30, 34
br i1 %31, label %32, label %38
32: ; preds = %23
%33 = load i8*, i8** %3
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp ne i32 %35, 60
br i1 %36, label %37, label %38
37: ; preds = %32
store i32 0, i32* %2
br label %89
38: ; preds = %32, %23
%39 = load i8*, i8** %3
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 60
%43 = zext i1 %42 to i32
store i32 %43, i32* %4
%44 = load i32, i32* %4
%45 = icmp ne i32 %44, 0
%46 = zext i1 %45 to i64
%47 = select i1 %45, i32 62, i32 34
%48 = trunc i32 %47 to i8
store i8 %48, i8* %5
store i8* null, i8** %6
br label %49
49: ; preds = %64, %38
%50 = load i8*, i8** %3
%51 = getelementptr inbounds i8, i8* %50, i32 1
store i8* %51, i8** %3
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %65
55: ; preds = %49
%56 = load i8*, i8** %3
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = load i8, i8* %5
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %58, %60
br i1 %61, label %62, label %64
62: ; preds = %55
%63 = load i8*, i8** %3
store i8* %63, i8** %6
br label %64
64: ; preds = %62, %55
br label %49
65: ; preds = %49
%66 = load i8*, i8** %6
%67 = icmp eq i8* %66, null
br i1 %67, label %68, label %69
68: ; preds = %65
store i32 0, i32* %2
br label %89
69: ; preds = %65
%70 = load i8*, i8** %6
store i8* %70, i8** %3
br label %71
71: ; preds = %83, %69
%72 = load i8*, i8** %3
%73 = getelementptr inbounds i8, i8* %72, i32 1
store i8* %73, i8** %3
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = icmp ne i32 %75, 0
br i1 %76, label %77, label %84
77: ; preds = %71
%78 = load i8*, i8** %3
%79 = load i8, i8* %78
%80 = call i32 @isBlank(i8 signext %79)
%81 = icmp ne i32 %80, 0
br i1 %81, label %83, label %82
82: ; preds = %77
store i32 0, i32* %2
br label %89
83: ; preds = %77
br label %71
84: ; preds = %71
%85 = load i32, i32* %4
%86 = icmp ne i32 %85, 0
%87 = zext i1 %86 to i64
%88 = select i1 %86, i32 1, i32 2
store i32 %88, i32* %2
br label %89
89: ; preds = %84, %82, %68, %37, %22, %15
%90 = load i32, i32* %2
ret i32 %90
}

LLVM IR (-O2):
@.str = [8 x i8] c"include\00"
define i32 @isInclude(i8* %0) {
%2 = tail call i8* @skipBlank(i8* %0)
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = tail call i32 @isSharp(i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %44, label %7
7: ; preds = %1
%8 = getelementptr inbounds i8, i8* %2, i64 1
%9 = tail call i8* @skipBlank(i8* %8)
%10 = tail call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %44
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %9, i64 7
%14 = tail call i8* @skipBlank(i8* %13)
%15 = load i8, i8* %14
switch i8 %15, label %44 [
i8 34, label %16
i8 60, label %16
]
16: ; preds = %12, %12
%17 = icmp eq i8 %15, 60
%18 = select i1 %17, i32 62, i32 34
%19 = getelementptr inbounds i8, i8* %14, i64 1
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 0
br i1 %21, label %44, label %22
22: ; preds = %16, %22
%23 = phi i8 [ %30, %22 ], [ %20, %16 ]
%24 = phi i8* [ %29, %22 ], [ %19, %16 ]
%25 = phi i8* [ %28, %22 ], [ null, %16 ]
%26 = sext i8 %23 to i32
%27 = icmp eq i32 %18, %26
%28 = select i1 %27, i8* %24, i8* %25
%29 = getelementptr inbounds i8, i8* %24, i64 1
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 0
br i1 %31, label %32, label %22
32: ; preds = %22
%33 = icmp eq i8* %28, null
br i1 %33, label %44, label %34
34: ; preds = %32, %39
%35 = phi i8* [ %36, %39 ], [ %28, %32 ]
%36 = getelementptr inbounds i8, i8* %35, i64 1
%37 = load i8, i8* %36
%38 = icmp eq i8 %37, 0
br i1 %38, label %42, label %39
39: ; preds = %34
%40 = tail call i32 @isBlank(i8 signext %37)
%41 = icmp eq i32 %40, 0
br i1 %41, label %44, label %34
42: ; preds = %34
%43 = select i1 %17, i32 1, i32 2
br label %44
44: ; preds = %39, %16, %42, %32, %12, %7, %1
%45 = phi i32 [ 0, %1 ], [ 0, %7 ], [ 0, %12 ], [ %43, %42 ], [ 0, %32 ], [ 0, %16 ], [ 0, %39 ]
ret i32 %45
}