#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*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ skip_white_space(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
char *strdup(char *);
char *include_directive(FILE *file) {
  char tmp[256];
  int n = 0;
  int i;
  skip_white_space(file);
  if ((i = getc(file)) == EOF)
    return 0;
  if (i != 'i')
    return 0;
  while ((i = getc(file)) != EOF) {
    if (i == '"' || i == '<')
      break;
    if (i == '\n')
      return 0;
  }
  if (i == EOF)
    return 0;
  while ((i = getc(file)) != EOF) {
    if (i == '\n')
      return 0;
    else if (i == '"')
      break;
    if (n >= (256 - 1)) {
      fprintf(stderr, "dependencies: include file name too long\n");
      exit(1);
    }
    tmp[n++] = i;
  }
  tmp[n] = 0;
  return strdup(tmp);
}


x86 assembly (clang, -O0):
<include_directive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x114(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <skip_white_space@plt>
mov    -0x10(%rbp),%rdi
call   1070 <getc@plt>
mov    %eax,-0x118(%rbp)
mov    0x2e60(%rip),%rcx
cmp    (%rcx),%eax
jne    119d <include_directive+0x4d>
movq   $0x0,-0x8(%rbp)
jmp    1303 <include_directive+0x1b3>
cmpl   $0x69,-0x118(%rbp)
je     11b7 <include_directive+0x67>
movq   $0x0,-0x8(%rbp)
jmp    1303 <include_directive+0x1b3>
jmp    11bc <include_directive+0x6c>
mov    -0x10(%rbp),%rdi
call   1070 <getc@plt>
mov    %eax,-0x118(%rbp)
mov    0x2e16(%rip),%rcx
cmp    (%rcx),%eax
je     1218 <include_directive+0xc8>
cmpl   $0x22,-0x118(%rbp)
je     11f4 <include_directive+0xa4>
cmpl   $0x3c,-0x118(%rbp)
jne    11f9 <include_directive+0xa9>
jmp    1218 <include_directive+0xc8>
cmpl   $0xa,-0x118(%rbp)
jne    1213 <include_directive+0xc3>
movq   $0x0,-0x8(%rbp)
jmp    1303 <include_directive+0x1b3>
jmp    11bc <include_directive+0x6c>
mov    -0x118(%rbp),%eax
mov    0x2dc3(%rip),%rcx
cmp    (%rcx),%eax
jne    123a <include_directive+0xea>
movq   $0x0,-0x8(%rbp)
jmp    1303 <include_directive+0x1b3>
jmp    123f <include_directive+0xef>
mov    -0x10(%rbp),%rdi
call   1070 <getc@plt>
mov    %eax,-0x118(%rbp)
mov    0x2d93(%rip),%rcx
cmp    (%rcx),%eax
je     12e4 <include_directive+0x194>
cmpl   $0xa,-0x118(%rbp)
jne    1277 <include_directive+0x127>
movq   $0x0,-0x8(%rbp)
jmp    1303 <include_directive+0x1b3>
cmpl   $0x22,-0x118(%rbp)
jne    1289 <include_directive+0x139>
jmp    12e4 <include_directive+0x194>
jmp    128e <include_directive+0x13e>
cmpl   $0xff,-0x114(%rbp)
jl     12bd <include_directive+0x16d>
mov    0x2d33(%rip),%rax
mov    (%rax),%edi
lea    0xd52(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x118(%rbp),%eax
mov    %al,%cl
mov    -0x114(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x114(%rbp)
cltq
mov    %cl,-0x110(%rbp,%rax,1)
jmp    123f <include_directive+0xef>
movslq -0x114(%rbp),%rax
movb   $0x0,-0x110(%rbp,%rax,1)
lea    -0x110(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<include_directive>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%r12
call   1040 <skip_white_space@plt>
mov    %r12,%rdi
call   1070 <getc@plt>
xor    %r14d,%r14d
cmp    $0x69,%eax
jne    11f8 <include_directive+0xa8>
mov    0x2e67(%rip),%r15
cmpl   $0x69,(%r15)
je     11f8 <include_directive+0xa8>
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1070 <getc@plt>
cmp    (%r15),%eax
je     11f8 <include_directive+0xa8>
cmp    $0xa,%eax
je     11f8 <include_directive+0xa8>
cmp    $0x3c,%eax
je     11ac <include_directive+0x5c>
cmp    $0x22,%eax
jne    1190 <include_directive+0x40>
mov    %r12,%rdi
call   1070 <getc@plt>
cmp    (%r15),%eax
jne    11bd <include_directive+0x6d>
xor    %eax,%eax
jmp    11e9 <include_directive+0x99>
xor    %ebx,%ebx
nop
cmp    $0xa,%eax
je     120a <include_directive+0xba>
cmp    $0x22,%eax
je     11e7 <include_directive+0x97>
cmp    $0xff,%rbx
je     120f <include_directive+0xbf>
mov    %al,(%rsp,%rbx,1)
add    $0x1,%rbx
mov    %r12,%rdi
call   1070 <getc@plt>
cmp    (%r15),%eax
jne    11c0 <include_directive+0x70>
mov    %ebx,%eax
movb   $0x0,(%rsp,%rax,1)
mov    %rsp,%rdi
call   1060 <strdup@plt>
mov    %rax,%r14
mov    %r14,%rax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
xor    %r14d,%r14d
jmp    11f8 <include_directive+0xa8>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
lea    0xde1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EOF = global i32 0
@stderr = global i32 0
@.str = [42 x i8] c"dependencies: include file name too long\0A\00"
define i8* @include_directive(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca [256 x i8]
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 0, i32* %5
%7 = load i32*, i32** %3
%8 = call i32 @skip_white_space(i32* %7)
%9 = load i32*, i32** %3
%10 = call i32 @getc(i32* %9)
store i32 %10, i32* %6
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %1
store i8* null, i8** %2
br label %76
14: ; preds = %1
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, 105
br i1 %16, label %17, label %18
17: ; preds = %14
store i8* null, i8** %2
br label %76
18: ; preds = %14
br label %19
19: ; preds = %35, %18
%20 = load i32*, i32** %3
%21 = call i32 @getc(i32* %20)
store i32 %21, i32* %6
%22 = load i32, i32* @EOF
%23 = icmp ne i32 %21, %22
br i1 %23, label %24, label %36
24: ; preds = %19
%25 = load i32, i32* %6
%26 = icmp eq i32 %25, 34
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load i32, i32* %6
%29 = icmp eq i32 %28, 60
br i1 %29, label %30, label %31
30: ; preds = %27, %24
br label %36
31: ; preds = %27
%32 = load i32, i32* %6
%33 = icmp eq i32 %32, 10
br i1 %33, label %34, label %35
34: ; preds = %31
store i8* null, i8** %2
br label %76
35: ; preds = %31
br label %19
36: ; preds = %30, %19
%37 = load i32, i32* %6
%38 = load i32, i32* @EOF
%39 = icmp eq i32 %37, %38
br i1 %39, label %40, label %41
40: ; preds = %36
store i8* null, i8** %2
br label %76
41: ; preds = %36
br label %42
42: ; preds = %63, %41
%43 = load i32*, i32** %3
%44 = call i32 @getc(i32* %43)
store i32 %44, i32* %6
%45 = load i32, i32* @EOF
%46 = icmp ne i32 %44, %45
br i1 %46, label %47, label %70
47: ; preds = %42
%48 = load i32, i32* %6
%49 = icmp eq i32 %48, 10
br i1 %49, label %50, label %51
50: ; preds = %47
store i8* null, i8** %2
br label %76
51: ; preds = %47
%52 = load i32, i32* %6
%53 = icmp eq i32 %52, 34
br i1 %53, label %54, label %55
54: ; preds = %51
br label %70
55: ; preds = %51
br label %56
56: ; preds = %55
%57 = load i32, i32* %5
%58 = icmp sge i32 %57, 255
br i1 %58, label %59, label %63
59: ; preds = %56
%60 = load i32, i32* @stderr
%61 = call i32 @fprintf(i32 %60, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%62 = call i32 @exit(i32 1)
unreachable
63: ; preds = %56
%64 = load i32, i32* %6
%65 = trunc i32 %64 to i8
%66 = load i32, i32* %5
%67 = add nsw i32 %66, 1
store i32 %67, i32* %5
%68 = sext i32 %66 to i64
%69 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %68
store i8 %65, i8* %69
br label %42
70: ; preds = %54, %42
%71 = load i32, i32* %5
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %72
store i8 0, i8* %73
%74 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%75 = call i8* @strdup(i8* %74)
store i8* %75, i8** %2
br label %76
76: ; preds = %70, %50, %40, %34, %17, %13
%77 = load i8*, i8** %2
ret i8* %77
}

LLVM IR (-O2):
@EOF = global i32 0
@stderr = global i32 0
@.str = [42 x i8] c"dependencies: include file name too long\0A\00"
define noalias i8* @include_directive(i32* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @skip_white_space(i32* %0)
%5 = tail call i32 @getc(i32* %0)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, 105
%8 = icmp ne i32 %6, 105
%9 = and i1 %7, %8
br i1 %9, label %10, label %42
10: ; preds = %1, %14
%11 = tail call i32 @getc(i32* %0)
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %42, label %14
14: ; preds = %10
switch i32 %11, label %10 [
i32 60, label %15
i32 34, label %15
i32 10, label %42
]
15: ; preds = %14, %14
%16 = tail call i32 @getc(i32* %0)
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %38, label %19
19: ; preds = %15, %28
%20 = phi i64 [ %30, %28 ], [ 0, %15 ]
%21 = phi i32 [ %32, %28 ], [ %16, %15 ]
switch i32 %21, label %22 [
i32 10, label %42
i32 34, label %35
]
22: ; preds = %19
%23 = icmp eq i64 %20, 255
br i1 %23, label %24, label %28
24: ; preds = %22
%25 = load i32, i32* @stderr
%26 = tail call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%27 = tail call i32 @exit(i32 1)
unreachable
28: ; preds = %22
%29 = trunc i32 %21 to i8
%30 = add nuw nsw i64 %20, 1
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %20
store i8 %29, i8* %31
%32 = tail call i32 @getc(i32* %0)
%33 = load i32, i32* @EOF
%34 = icmp eq i32 %32, %33
br i1 %34, label %35, label %19
35: ; preds = %19, %28
%36 = phi i64 [ %30, %28 ], [ %20, %19 ]
%37 = and i64 %36, 4294967295
br label %38
38: ; preds = %35, %15
%39 = phi i64 [ 0, %15 ], [ %37, %35 ]
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %39
store i8 0, i8* %40
%41 = call i8* @strdup(i8* %3)
br label %42
42: ; preds = %10, %14, %19, %1, %38
%43 = phi i8* [ %41, %38 ], [ null, %1 ], [ null, %19 ], [ null, %14 ], [ null, %10 ]
ret i8* %43
}