#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*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ isspace(int);
int /*<<< orphan*/ stderr;
char *strchr(char *, char);
int strlen(char *);
int /*<<< orphan*/ *strstr(char *, char *);
int gen_is_include_line(char *l) {
  char *temp = strchr(l, '#');
  if (NULL != strchr(l, '#')) {
    if (strlen(l) >= 12 && l[0] == '#' && NULL != strstr(l, "#include") &&
        0 != isspace((int)l[8])) {
      temp = NULL;
      int counter, times_found = 0, first_quote_flag = 0;
      for (counter = 8; counter < strlen(l) - 1; ++counter) {
        temp = l + counter;
        if (*temp == '\"')
          first_quote_flag = 1;
        if (first_quote_flag == 0 && isspace((int)*temp) == 0) {
          fprintf(stderr, "INVALID INCLUDE, TERMINATING 2\n");
          abort();
        } else if (first_quote_flag == 1) {
          temp = strchr(l + counter + 1, '\"');
          if (temp == NULL) {
            fprintf(stderr, "INVALID INCLUDE, TERMINATING 3\n");
            abort();
          } else
            return 1;
        }
      }
      return 0;
    } else {
      fprintf(stderr, "INVALID INCLUDE, TERMINATING 1\n");
      abort();
    }
  } else
    return 0;
}


x86 assembly (clang, -O0):
<gen_is_include_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x23,%esi
call   1050 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x23,%esi
call   1050 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     132d <gen_is_include_line+0x1cd>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0xc,%eax
jl     1311 <gen_is_include_line+0x1b1>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1311 <gen_is_include_line+0x1b1>
mov    -0x10(%rbp),%rdi
lea    0xe39(%rip),%rsi
call   1080 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1311 <gen_is_include_line+0x1b1>
mov    -0x10(%rbp),%rax
movsbl 0x8(%rax),%edi
call   1060 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1311 <gen_is_include_line+0x1b1>
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x8,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1305 <gen_is_include_line+0x1a5>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1257 <gen_is_include_line+0xf7>
movl   $0x1,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    1293 <gen_is_include_line+0x133>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1060 <isspace@plt>
cmp    $0x0,%rax
jne    1293 <gen_is_include_line+0x133>
mov    0x2d62(%rip),%rax
mov    (%rax),%edi
lea    0xd82(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x1,-0x24(%rbp)
jne    12ed <gen_is_include_line+0x18d>
mov    -0x10(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
add    $0x1,%rdi
mov    $0x22,%esi
call   1050 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12e1 <gen_is_include_line+0x181>
mov    0x2d14(%rip),%rax
mov    (%rax),%edi
lea    0xd54(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x1,-0x4(%rbp)
jmp    1334 <gen_is_include_line+0x1d4>
jmp    12f2 <gen_is_include_line+0x192>
jmp    12f7 <gen_is_include_line+0x197>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1212 <gen_is_include_line+0xb2>
movl   $0x0,-0x4(%rbp)
jmp    1334 <gen_is_include_line+0x1d4>
mov    0x2cc8(%rip),%rax
mov    (%rax),%edi
lea    0xd28(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_is_include_line>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
mov    $0x23,%esi
call   1050 <strchr@plt>
xor    %r14d,%r14d
test   %rax,%rax
je     1227 <gen_is_include_line+0xc7>
mov    %r15,%rdi
call   1040 <strlen@plt>
cmp    $0xc,%eax
jl     1247 <gen_is_include_line+0xe7>
cmpb   $0x23,(%r15)
jne    1247 <gen_is_include_line+0xe7>
lea    0xe5e(%rip),%rsi
mov    %r15,%rdi
call   1080 <strstr@plt>
test   %rax,%rax
je     1247 <gen_is_include_line+0xe7>
movsbl 0x8(%r15),%edi
call   1060 <isspace@plt>
test   %rax,%rax
je     1247 <gen_is_include_line+0xe7>
mov    %r15,%rdi
call   1040 <strlen@plt>
cmp    $0xa,%eax
jl     1227 <gen_is_include_line+0xc7>
lea    0x9(%r15),%rbp
mov    $0x8,%ebx
nopl   0x0(%rax)
movsbl -0x1(%rbp),%edi
cmp    $0x22,%edi
je     120f <gen_is_include_line+0xaf>
call   1060 <isspace@plt>
test   %rax,%rax
je     1235 <gen_is_include_line+0xd5>
add    $0x1,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
add    $0xffffffff,%eax
cltq
add    $0x1,%rbp
cmp    %rax,%rbx
jl     11e0 <gen_is_include_line+0x80>
jmp    1227 <gen_is_include_line+0xc7>
mov    %rbp,%rdi
mov    $0x22,%esi
call   1050 <strchr@plt>
mov    $0x1,%r14d
test   %rax,%rax
je     1263 <gen_is_include_line+0x103>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2da4(%rip),%rax
mov    (%rax),%edi
lea    0xdc4(%rip),%rsi
jmp    1257 <gen_is_include_line+0xf7>
mov    0x2d92(%rip),%rax
mov    (%rax),%edi
lea    0xdf2(%rip),%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>
mov    0x2d76(%rip),%rax
mov    (%rax),%edi
lea    0xdb6(%rip),%rsi
jmp    1257 <gen_is_include_line+0xf7>

LLVM IR (-O0):
@.str = [9 x i8] c"#include\00"
@stderr = global i32 0
@.str.1 = [32 x i8] c"INVALID INCLUDE, TERMINATING 2\0A\00"
@.str.2 = [32 x i8] c"INVALID INCLUDE, TERMINATING 3\0A\00"
@.str.3 = [32 x i8] c"INVALID INCLUDE, TERMINATING 1\0A\00"
define i32 @gen_is_include_line(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
%8 = load i8*, i8** %3
%9 = call i8* @strchr(i8* %8, i8 signext 35)
store i8* %9, i8** %4
%10 = load i8*, i8** %3
%11 = call i8* @strchr(i8* %10, i8 signext 35)
%12 = icmp ne i8* null, %11
br i1 %12, label %13, label %91
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = call i32 @strlen(i8* %14)
%16 = icmp sge i32 %15, 12
br i1 %16, label %17, label %87
17: ; preds = %13
%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, 35
br i1 %22, label %23, label %87
23: ; preds = %17
%24 = load i8*, i8** %3
%25 = call i32* @strstr(i8* %24, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%26 = icmp ne i32* null, %25
br i1 %26, label %27, label %87
27: ; preds = %23
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 8
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = call i64 @isspace(i32 %31)
%33 = icmp ne i64 0, %32
br i1 %33, label %34, label %87
34: ; preds = %27
store i8* null, i8** %4
store i32 0, i32* %6
store i32 0, i32* %7
store i32 8, i32* %5
br label %35
35: ; preds = %83, %34
%36 = load i32, i32* %5
%37 = load i8*, i8** %3
%38 = call i32 @strlen(i8* %37)
%39 = sub nsw i32 %38, 1
%40 = icmp slt i32 %36, %39
br i1 %40, label %41, label %86
41: ; preds = %35
%42 = load i8*, i8** %3
%43 = load i32, i32* %5
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %42, i64 %44
store i8* %45, i8** %4
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 34
br i1 %49, label %50, label %51
50: ; preds = %41
store i32 1, i32* %7
br label %51
51: ; preds = %50, %41
%52 = load i32, i32* %7
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %64
54: ; preds = %51
%55 = load i8*, i8** %4
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = call i64 @isspace(i32 %57)
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %64
60: ; preds = %54
%61 = load i32, i32* @stderr
%62 = call i32 @fprintf(i32 %61, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%63 = call i32 (...) @abort()
unreachable
64: ; preds = %54, %51
%65 = load i32, i32* %7
%66 = icmp eq i32 %65, 1
br i1 %66, label %67, label %81
67: ; preds = %64
%68 = load i8*, i8** %3
%69 = load i32, i32* %5
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
%72 = getelementptr inbounds i8, i8* %71, i64 1
%73 = call i8* @strchr(i8* %72, i8 signext 34)
store i8* %73, i8** %4
%74 = load i8*, i8** %4
%75 = icmp eq i8* %74, null
br i1 %75, label %76, label %80
76: ; preds = %67
%77 = load i32, i32* @stderr
%78 = call i32 @fprintf(i32 %77, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%79 = call i32 (...) @abort()
unreachable
80: ; preds = %67
store i32 1, i32* %2
br label %92
81: ; preds = %64
br label %82
82: ; preds = %81
br label %83
83: ; preds = %82
%84 = load i32, i32* %5
%85 = add nsw i32 %84, 1
store i32 %85, i32* %5
br label %35
86: ; preds = %35
store i32 0, i32* %2
br label %92
87: ; preds = %27, %23, %17, %13
%88 = load i32, i32* @stderr
%89 = call i32 @fprintf(i32 %88, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%90 = call i32 (...) @abort()
unreachable
91: ; preds = %1
store i32 0, i32* %2
br label %92
92: ; preds = %91, %86, %80
%93 = load i32, i32* %2
ret i32 %93
}

LLVM IR (-O2):
@.str = [9 x i8] c"#include\00"
@stderr = global i32 0
@.str.1 = [32 x i8] c"INVALID INCLUDE, TERMINATING 2\0A\00"
@.str.2 = [32 x i8] c"INVALID INCLUDE, TERMINATING 3\0A\00"
@.str.3 = [32 x i8] c"INVALID INCLUDE, TERMINATING 1\0A\00"
define i32 @gen_is_include_line(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 35)
%3 = icmp eq i8* %2, null
br i1 %3, label %55, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = icmp sgt i32 %5, 11
br i1 %6, label %7, label %51
7: ; preds = %4
%8 = load i8, i8* %0
%9 = icmp eq i8 %8, 35
br i1 %9, label %10, label %51
10: ; preds = %7
%11 = tail call i32* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %51, label %13
13: ; preds = %10
%14 = getelementptr inbounds i8, i8* %0, i64 8
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = tail call i64 @isspace(i32 %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %51, label %19
19: ; preds = %13
%20 = tail call i32 @strlen(i8* %0)
%21 = icmp sgt i32 %20, 9
br i1 %21, label %22, label %55
22: ; preds = %19, %45
%23 = phi i64 [ %46, %45 ], [ 8, %19 ]
%24 = getelementptr inbounds i8, i8* %0, i64 %23
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 34
br i1 %26, label %35, label %27
27: ; preds = %22
%28 = sext i8 %25 to i32
%29 = tail call i64 @isspace(i32 %28)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %45
31: ; preds = %27
%32 = load i32, i32* @stderr
%33 = tail call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%34 = tail call i32 (...) @abort()
unreachable
35: ; preds = %22
%36 = and i64 %23, 4294967295
%37 = getelementptr inbounds i8, i8* %0, i64 %36
%38 = getelementptr inbounds i8, i8* %37, i64 1
%39 = tail call i8* @strchr(i8* %38, i8 signext 34)
%40 = icmp eq i8* %39, null
br i1 %40, label %41, label %55
41: ; preds = %35
%42 = load i32, i32* @stderr
%43 = tail call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%44 = tail call i32 (...) @abort()
unreachable
45: ; preds = %27
%46 = add nuw nsw i64 %23, 1
%47 = tail call i32 @strlen(i8* %0)
%48 = add nsw i32 %47, -1
%49 = sext i32 %48 to i64
%50 = icmp slt i64 %46, %49
br i1 %50, label %22, label %55
51: ; preds = %13, %10, %7, %4
%52 = load i32, i32* @stderr
%53 = tail call i32 @fprintf(i32 %52, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%54 = tail call i32 (...) @abort()
unreachable
55: ; preds = %45, %19, %1, %35
%56 = phi i32 [ 1, %35 ], [ 0, %1 ], [ 0, %19 ], [ 0, %45 ]
ret i32 %56
}