#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ is_ignored_file(char *, int);
int /*<<< orphan*/ parse_config_file(void *);
int /*<<< orphan*/ printf(char *, char const *, ...);
void *read_file(char *);
int /*<<< orphan*/ stderr;
void parse_dep_file(char *m, const char *target) {
  char *p;
  int is_last, is_target;
  int saw_any_target = 0;
  int is_first_dep = 0;
  void *buf;
  while (1) {
    while (*m == ' ' || *m == '\\' || *m == '\n')
      m++;
    if (!*m)
      break;
    p = m;
    while (*p && *p != ' ' && *p != '\\' && *p != '\n')
      p++;
    is_last = (*p == '\0');
    is_target = (*(p - 1) == ':');
    if (is_target) {
      is_first_dep = 1;
    } else if (!is_ignored_file(m, p - m)) {
      *p = '\0';
      if (is_first_dep) {
        if (!saw_any_target) {
          saw_any_target = 1;
          printf("source_%s := %s\n\n", target, m);
          printf("deps_%s := \\\n", target);
        }
        is_first_dep = 0;
      } else {
        printf("  %s \\\n", m);
      }
      buf = read_file(m);
      parse_config_file(buf);
      free(buf);
    }
    if (is_last)
      break;
    m = p + 1;
  }
  if (!saw_any_target) {
    fprintf(stderr, "fixdep: parse error; no targets found\n");
    exit(1);
  }
  printf("\n%s: $(deps_%s)\n\n", target, target);
  printf("$(deps_%s):\n", target);
}


x86 assembly (clang, -O0):
<parse_dep_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
jmp    1193 <parse_dep_file+0x23>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x31(%rbp)
je     11cd <parse_dep_file+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x5c,%ecx
mov    %al,-0x31(%rbp)
je     11cd <parse_dep_file+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    11dd <parse_dep_file+0x6d>
jmp    11ee <parse_dep_file+0x7e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1193 <parse_dep_file+0x23>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1200 <parse_dep_file+0x90>
jmp    1384 <parse_dep_file+0x214>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x32(%rbp)
je     1257 <parse_dep_file+0xe7>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x32(%rbp)
je     1257 <parse_dep_file+0xe7>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5c,%ecx
mov    %al,-0x32(%rbp)
je     1257 <parse_dep_file+0xe7>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x32(%rbp)
mov    -0x32(%rbp),%al
test   $0x1,%al
jne    1267 <parse_dep_file+0xf7>
jmp    1278 <parse_dep_file+0x108>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1208 <parse_dep_file+0x98>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x3a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     12b9 <parse_dep_file+0x149>
movl   $0x1,-0x28(%rbp)
jmp    1364 <parse_dep_file+0x1f4>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
call   1080 <is_ignored_file@plt>
cmp    $0x0,%eax
jne    135f <parse_dep_file+0x1ef>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0x28(%rbp)
je     132e <parse_dep_file+0x1be>
cmpl   $0x0,-0x24(%rbp)
jne    1322 <parse_dep_file+0x1b2>
movl   $0x1,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xcf7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xcf7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x28(%rbp)
jmp    1340 <parse_dep_file+0x1d0>
mov    -0x8(%rbp),%rsi
lea    0xce7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <read_file@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1090 <parse_config_file@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
jmp    1364 <parse_dep_file+0x1f4>
cmpl   $0x0,-0x1c(%rbp)
je     1373 <parse_dep_file+0x203>
jmp    1384 <parse_dep_file+0x214>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    118e <parse_dep_file+0x1e>
cmpl   $0x0,-0x24(%rbp)
jne    13ad <parse_dep_file+0x23d>
mov    0x2c4b(%rip),%rax
mov    (%rax),%edi
lea    0xc8a(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xc93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xc93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_dep_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
mov    %rdi,%rbx
movabs $0x100000401,%rcx
xor    %r14d,%r14d
xor    %r15d,%r15d
mov    %rbx,%rax
add    $0x1,%rbx
mov    %rax,%rbp
jmp    11b2 <parse_dep_file+0x42>
nopl   (%rax)
cmp    $0xa,%r12b
jne    11d0 <parse_dep_file+0x60>
add    $0x1,%rbp
add    $0x1,%rax
add    $0x1,%rbx
movzbl 0x0(%rbp),%r12d
cmp    $0x1f,%r12b
jle    11a0 <parse_dep_file+0x30>
cmp    $0x20,%r12b
je     11a6 <parse_dep_file+0x36>
cmp    $0x5c,%r12b
je     11a6 <parse_dep_file+0x36>
jmp    11d9 <parse_dep_file+0x69>
nopl   0x0(%rax,%rax,1)
test   %r12b,%r12b
je     12c5 <parse_dep_file+0x155>
xor    %esi,%esi
cmp    $0x20,%r12b
ja     11fa <parse_dep_file+0x8a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %r12b,%eax
bt     %rax,%rcx
jb     1220 <parse_dep_file+0xb0>
cmp    $0x5c,%r12b
je     1220 <parse_dep_file+0xb0>
movzbl (%rbx),%r12d
add    $0x1,%rbx
add    $0x1,%esi
cmp    $0x20,%r12b
jbe    11f0 <parse_dep_file+0x80>
jmp    11fa <parse_dep_file+0x8a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%eax
cmpb   $0x3a,-0x2(%rbx)
je     12b9 <parse_dep_file+0x149>
mov    %rbp,%rdi
call   1080 <is_ignored_file@plt>
test   %eax,%eax
je     1240 <parse_dep_file+0xd0>
mov    %r15d,%eax
jmp    12af <parse_dep_file+0x13f>
movb   $0x0,-0x1(%rbx)
test   %r15d,%r15d
je     127b <parse_dep_file+0x10b>
mov    $0x1,%r15d
test   %r14d,%r14d
jne    128f <parse_dep_file+0x11f>
lea    0xda5(%rip),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xda3(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    128f <parse_dep_file+0x11f>
lea    0xd9e(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14d,%r15d
mov    %rbp,%rdi
call   1060 <read_file@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   1090 <parse_config_file@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
xor    %eax,%eax
mov    %r15d,%r14d
movabs $0x100000401,%rcx
mov    %eax,%r15d
test   %r12b,%r12b
jne    1191 <parse_dep_file+0x21>
test   %r14d,%r14d
je     12fd <parse_dep_file+0x18d>
lea    0xd7e(%rip),%rdi
mov    %r13,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd7c(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
mov    0x2cdc(%rip),%rax
mov    (%rax),%edi
lea    0xd1b(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"source_%s := %s\0A\0A\00"
@.str.1 = [14 x i8] c"deps_%s := \\\0A\00"
@.str.2 = [8 x i8] c" %s \\\0A\00"
@stderr = global i32 0
@.str.3 = [39 x i8] c"fixdep: parse error; no targets found\0A\00"
@.str.4 = [18 x i8] c"\0A%s: $(deps_%s)\0A\0A\00"
@.str.5 = [13 x i8] c"$(deps_%s):\0A\00"
define void @parse_dep_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %8
store i32 0, i32* %9
br label %11
11: ; preds = %2, %118
br label %12
12: ; preds = %29, %11
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 32
br i1 %16, label %27, label %17
17: ; preds = %12
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 92
br i1 %21, label %27, label %22
22: ; preds = %17
%23 = load i8*, i8** %3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 10
br label %27
27: ; preds = %22, %17, %12
%28 = phi i1 [ true, %17 ], [ true, %12 ], [ %26, %22 ]
br i1 %28, label %29, label %32
29: ; preds = %27
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %3
br label %12
32: ; preds = %27
%33 = load i8*, i8** %3
%34 = load i8, i8* %33
%35 = icmp ne i8 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %32
br label %121
37: ; preds = %32
%38 = load i8*, i8** %3
store i8* %38, i8** %5
br label %39
39: ; preds = %61, %37
%40 = load i8*, i8** %5
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %59
44: ; preds = %39
%45 = load i8*, i8** %5
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %47, 32
br i1 %48, label %49, label %59
49: ; preds = %44
%50 = load i8*, i8** %5
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp ne i32 %52, 92
br i1 %53, label %54, label %59
54: ; preds = %49
%55 = load i8*, i8** %5
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp ne i32 %57, 10
br label %59
59: ; preds = %54, %49, %44, %39
%60 = phi i1 [ false, %49 ], [ false, %44 ], [ false, %39 ], [ %58, %54 ]
br i1 %60, label %61, label %64
61: ; preds = %59
%62 = load i8*, i8** %5
%63 = getelementptr inbounds i8, i8* %62, i32 1
store i8* %63, i8** %5
br label %39
64: ; preds = %59
%65 = load i8*, i8** %5
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 0
%69 = zext i1 %68 to i32
store i32 %69, i32* %6
%70 = load i8*, i8** %5
%71 = getelementptr inbounds i8, i8* %70, i64 -1
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp eq i32 %73, 58
%75 = zext i1 %74 to i32
store i32 %75, i32* %7
%76 = load i32, i32* %7
%77 = icmp ne i32 %76, 0
br i1 %77, label %78, label %79
78: ; preds = %64
store i32 1, i32* %9
br label %114
79: ; preds = %64
%80 = load i8*, i8** %3
%81 = load i8*, i8** %5
%82 = load i8*, i8** %3
%83 = ptrtoint i8* %81 to i64
%84 = ptrtoint i8* %82 to i64
%85 = sub i64 %83, %84
%86 = trunc i64 %85 to i32
%87 = call i32 @is_ignored_file(i8* %80, i32 %86)
%88 = icmp ne i32 %87, 0
br i1 %88, label %113, label %89
89: ; preds = %79
%90 = load i8*, i8** %5
store i8 0, i8* %90
%91 = load i32, i32* %9
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %103
93: ; preds = %89
%94 = load i32, i32* %8
%95 = icmp ne i32 %94, 0
br i1 %95, label %102, label %96
96: ; preds = %93
store i32 1, i32* %8
%97 = load i8*, i8** %4
%98 = load i8*, i8** %3
%99 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %97, i8* %98)
%100 = load i8*, i8** %4
%101 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %100)
br label %102
102: ; preds = %96, %93
store i32 0, i32* %9
br label %106
103: ; preds = %89
%104 = load i8*, i8** %3
%105 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %104)
br label %106
106: ; preds = %103, %102
%107 = load i8*, i8** %3
%108 = call i8* @read_file(i8* %107)
store i8* %108, i8** %10
%109 = load i8*, i8** %10
%110 = call i32 @parse_config_file(i8* %109)
%111 = load i8*, i8** %10
%112 = call i32 @free(i8* %111)
br label %113
113: ; preds = %106, %79
br label %114
114: ; preds = %113, %78
%115 = load i32, i32* %6
%116 = icmp ne i32 %115, 0
br i1 %116, label %117, label %118
117: ; preds = %114
br label %121
118: ; preds = %114
%119 = load i8*, i8** %5
%120 = getelementptr inbounds i8, i8* %119, i64 1
store i8* %120, i8** %3
br label %11
121: ; preds = %117, %36
%122 = load i32, i32* %8
%123 = icmp ne i32 %122, 0
br i1 %123, label %128, label %124
124: ; preds = %121
%125 = load i32, i32* @stderr
%126 = call i32 @fprintf(i32 %125, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%127 = call i32 @exit(i32 1)
unreachable
128: ; preds = %121
%129 = load i8*, i8** %4
%130 = load i8*, i8** %4
%131 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %129, i8* %130)
%132 = load i8*, i8** %4
%133 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %132)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"source_%s := %s\0A\0A\00"
@.str.1 = [14 x i8] c"deps_%s := \\\0A\00"
@.str.2 = [8 x i8] c" %s \\\0A\00"
@stderr = global i32 0
@.str.3 = [39 x i8] c"fixdep: parse error; no targets found\0A\00"
@.str.4 = [18 x i8] c"\0A%s: $(deps_%s)\0A\0A\00"
@.str.5 = [13 x i8] c"$(deps_%s):\0A\00"
define void @parse_dep_file(i8* %0, i8* %1) {
br label %3
3: ; preds = %44, %2
%4 = phi i32 [ 0, %2 ], [ %45, %44 ]
%5 = phi i32 [ 0, %2 ], [ %46, %44 ]
%6 = phi i8* [ %0, %2 ], [ %47, %44 ]
br label %7
7: ; preds = %10, %3
%8 = phi i8* [ %6, %3 ], [ %11, %10 ]
%9 = load i8, i8* %8
switch i8 %9, label %12 [
i8 32, label %10
i8 92, label %10
i8 10, label %10
i8 0, label %48
]
10: ; preds = %7, %7, %7
%11 = getelementptr inbounds i8, i8* %8, i64 1
br label %7
12: ; preds = %7, %15
%13 = phi i8 [ %17, %15 ], [ %9, %7 ]
%14 = phi i8* [ %16, %15 ], [ %8, %7 ]
switch i8 %13, label %15 [
i8 0, label %18
i8 32, label %18
i8 92, label %18
i8 10, label %18
]
15: ; preds = %12
%16 = getelementptr inbounds i8, i8* %14, i64 1
%17 = load i8, i8* %16
br label %12
18: ; preds = %12, %12, %12, %12
%19 = icmp eq i8 %13, 0
%20 = getelementptr inbounds i8, i8* %14, i64 -1
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 58
br i1 %22, label %44, label %23
23: ; preds = %18
%24 = ptrtoint i8* %14 to i64
%25 = ptrtoint i8* %8 to i64
%26 = sub i64 %24, %25
%27 = trunc i64 %26 to i32
%28 = tail call i32 @is_ignored_file(i8* %8, i32 %27)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %44
30: ; preds = %23
store i8 0, i8* %14
%31 = icmp eq i32 %5, 0
br i1 %31, label %37, label %32
32: ; preds = %30
%33 = icmp eq i32 %4, 0
br i1 %33, label %34, label %39
34: ; preds = %32
%35 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %8)
%36 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %39
37: ; preds = %30
%38 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %8)
br label %39
39: ; preds = %32, %34, %37
%40 = phi i32 [ %4, %37 ], [ 1, %34 ], [ 1, %32 ]
%41 = tail call i8* @read_file(i8* %8)
%42 = tail call i32 @parse_config_file(i8* %41)
%43 = tail call i32 @free(i8* %41)
br label %44
44: ; preds = %18, %23, %39
%45 = phi i32 [ %4, %23 ], [ %40, %39 ], [ %4, %18 ]
%46 = phi i32 [ %5, %23 ], [ 0, %39 ], [ 1, %18 ]
%47 = getelementptr inbounds i8, i8* %14, i64 1
br i1 %19, label %48, label %3
48: ; preds = %44, %7
%49 = phi i32 [ %4, %7 ], [ %45, %44 ]
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %48
%52 = load i32, i32* @stderr
%53 = tail call i32 @fprintf(i32 %52, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%54 = tail call i32 @exit(i32 1)
unreachable
55: ; preds = %48
%56 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %1, i8* %1)
%57 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %1)
ret void
}