#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 /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
int main(int argc, char *argv[]) {
  FILE *DependFile;
  int DependFileSize;
  char *DependFileData;
  char *NewDependFileData;
  int CurIdx;
  int CurIdx2;
  int RuleDependencySplit = 0;
  if (argc < 2) {
    printf("Usage: deptool srcfile.d\n");
    return 1;
  }
  DependFile = fopen(argv[1], "r+t");
  if (DependFile == NULL) {
    printf("deptool: No such dependency file: %s\n", argv[1]);
    return 2;
  }
  fseek(DependFile, 0, SEEK_END);
  DependFileSize = ftell(DependFile);
  rewind(DependFile);
  DependFileData = (char *)malloc(DependFileSize);
  NewDependFileData = (char *)malloc(DependFileSize * 3);
  if (!DependFileData || !NewDependFileData) {
    printf("deptool: Out of memory!\n");
    if (DependFileData != NULL)
      free(DependFileData);
    if (NewDependFileData != NULL)
      free(NewDependFileData);
    fclose(DependFile);
    return 3;
  }
  memset(DependFileData, 0, DependFileSize);
  memset(NewDependFileData, 0, DependFileSize * 3);
  fread(DependFileData, 1, DependFileSize, DependFile);
  if (ferror(DependFile)) {
    printf("deptool: Dependency file read error.\n");
    free(DependFileData);
    free(NewDependFileData);
    fclose(DependFile);
    return 4;
  }
  for (CurIdx = 0, CurIdx2 = 0; DependFileData[CurIdx]; CurIdx++, CurIdx2++) {
    if (DependFileData[CurIdx] == ':') {
      NewDependFileData[CurIdx2] = ' ';
      CurIdx2++;
      strcat(&NewDependFileData[CurIdx2], argv[1]);
      CurIdx2 += strlen(argv[1]);
      NewDependFileData[CurIdx2] = ' ';
      CurIdx2++;
      strcat(NewDependFileData, &DependFileData[CurIdx]);
      CurIdx2 += 2;
      RuleDependencySplit = CurIdx + 2;
      break;
    } else {
      NewDependFileData[CurIdx2] = DependFileData[CurIdx];
    }
  }
  strcat(NewDependFileData, "\n\n");
  CurIdx = RuleDependencySplit;
  CurIdx2 = strlen(NewDependFileData);
  for (; DependFileData[CurIdx]; CurIdx++, CurIdx2++) {
    if (DependFileData[CurIdx] == '\\') {
      CurIdx2--;
      continue;
    }
    if (DependFileData[CurIdx] == '\n') {
      NewDependFileData[CurIdx2] = ':';
      CurIdx2++;
    }
    NewDependFileData[CurIdx2] = DependFileData[CurIdx];
  }
  rewind(DependFile);
  fwrite(NewDependFileData, 1, strlen(NewDependFileData), DependFile);
  if (ferror(DependFile)) {
    printf("deptool: Dependency file write error.\n");
    fclose(DependFile);
    free(DependFileData);
    free(NewDependFileData);
    return 5;
  }
  fclose(DependFile);
  free(DependFileData);
  free(NewDependFileData);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1221 <main+0x41>
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15b0 <main+0x3d0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdea(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1266 <main+0x86>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    15b0 <main+0x3d0>
mov    -0x18(%rbp),%rdi
mov    0x2d77(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   10b0 <ftell@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <rewind@plt>
mov    -0x1c(%rbp),%edi
call   10c0 <malloc@plt>
mov    %rax,-0x28(%rbp)
imul   $0x3,-0x1c(%rbp),%edi
call   10c0 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     12be <main+0xde>
cmpq   $0x0,-0x30(%rbp)
jne    1309 <main+0x129>
lea    0xd7f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpq   $0x0,-0x28(%rbp)
je     12e0 <main+0x100>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x30(%rbp)
je     12f4 <main+0x114>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x3,-0x4(%rbp)
jmp    15b0 <main+0x3d0>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%edx
xor    %esi,%esi
call   10a0 <memset@plt>
mov    -0x30(%rbp),%rdi
imul   $0x3,-0x1c(%rbp),%edx
xor    %esi,%esi
call   10a0 <memset@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fread@plt>
mov    -0x18(%rbp),%rdi
call   1040 <ferror@plt>
cmp    $0x0,%rax
je     1383 <main+0x1a3>
lea    0xd08(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x4,-0x4(%rbp)
jmp    15b0 <main+0x3d0>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     146a <main+0x28a>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1438 <main+0x258>
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
movslq -0x38(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   10f0 <strcat@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <strlen@plt>
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
movslq -0x34(%rbp),%rax
add    %rax,%rsi
call   10f0 <strcat@plt>
mov    -0x38(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x3c(%rbp)
jmp    146a <main+0x28a>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1453 <main+0x273>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1391 <main+0x1b1>
mov    -0x30(%rbp),%rdi
lea    0xc0e(%rip),%rsi
call   10f0 <strcat@plt>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1518 <main+0x338>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    14c1 <main+0x2e1>
mov    -0x38(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x38(%rbp)
jmp    1501 <main+0x321>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    14eb <main+0x30b>
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
movb   $0x3a,(%rax,%rcx,1)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    148c <main+0x2ac>
mov    -0x18(%rbp),%rdi
call   1090 <rewind@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1100 <fwrite@plt>
mov    -0x18(%rbp),%rdi
call   1040 <ferror@plt>
cmp    $0x0,%rax
je     158e <main+0x3ae>
lea    0xb26(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
movl   $0x5,-0x4(%rbp)
jmp    15b0 <main+0x3d0>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x1,%edi
jg     1216 <main+0x26>
lea    0xe89(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
jmp    133c <main+0x14c>
mov    %rsi,%r12
mov    0x8(%rsi),%rdi
lea    0xddc(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     12ef <main+0xff>
mov    %rax,%r14
mov    0x2dac(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10e0 <fseek@plt>
mov    %r14,%rdi
call   10c0 <ftell@plt>
mov    %eax,%r13d
mov    %r14,%rdi
call   10a0 <rewind@plt>
mov    %r13d,%edi
call   10d0 <malloc@plt>
mov    %rax,%r15
lea    0x0(%r13,%r13,2),%ebp
mov    %ebp,%edi
call   10d0 <malloc@plt>
mov    %rax,%rbx
test   %r15,%r15
je     1309 <main+0x119>
test   %rbx,%rbx
je     1309 <main+0x119>
mov    %r15,%rdi
xor    %esi,%esi
mov    %r13d,%edx
call   10b0 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   10b0 <memset@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r13d,%edx
mov    %r14,%rcx
call   1060 <fread@plt>
mov    %r14,%rdi
call   1050 <ferror@plt>
test   %rax,%rax
je     134b <main+0x15b>
lea    0xda0(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1070 <fclose@plt>
mov    $0x4,%eax
jmp    133c <main+0x14c>
mov    0x8(%r12),%rsi
lea    0xd09(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x2,%eax
jmp    133c <main+0x14c>
lea    0xd1d(%rip),%rdi
call   1040 <puts@plt>
test   %r15,%r15
je     1322 <main+0x132>
mov    %r15,%rdi
call   1030 <free@plt>
test   %rbx,%rbx
je     132f <main+0x13f>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1070 <fclose@plt>
mov    $0x3,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movabs $0x200000000,%rbp
xor    %r13d,%r13d
movabs $0x100000000,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r15,%r13,1),%ecx
test   %cl,%cl
je     138b <main+0x19b>
cmp    $0x3a,%cl
je     138f <main+0x19f>
mov    %cl,(%rbx,%r13,1)
add    $0x1,%r13
add    %rax,%rbp
jmp    1370 <main+0x180>
xor    %ebp,%ebp
jmp    13d8 <main+0x1e8>
mov    %r13d,%eax
lea    (%r15,%rax,1),%rcx
mov    %rcx,(%rsp)
movb   $0x20,(%rbx,%rax,1)
lea    0x1(%r13),%eax
mov    %rbx,%rdi
add    %rax,%rdi
mov    0x8(%r12),%rsi
call   1100 <strcat@plt>
mov    0x8(%r12),%rdi
call   1080 <strlen@plt>
add    %r13d,%eax
add    $0x1,%eax
cltq
movb   $0x20,(%rbx,%rax,1)
mov    %rbx,%rdi
mov    (%rsp),%rsi
call   1100 <strcat@plt>
sar    $0x20,%rbp
lea    0xc4b(%rip),%rsi
mov    %rbx,%rdi
call   1100 <strcat@plt>
mov    %rbx,%rdi
call   1080 <strlen@plt>
mov    %r15,%rcx
add    %rbp,%rcx
jmp    1411 <main+0x221>
nopw   0x0(%rax,%rax,1)
test   %dl,%dl
je     143e <main+0x24e>
movslq %eax,%rsi
mov    %dl,(%rbx,%rsi,1)
add    $0x1,%eax
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0xa,%dl
je     1430 <main+0x240>
cmp    $0x5c,%dl
jne    1400 <main+0x210>
add    $0xffffffff,%eax
jmp    140a <main+0x21a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cltq
movb   $0x3a,(%rbx,%rax,1)
add    $0x1,%eax
movzbl (%rcx),%edx
jmp    1404 <main+0x214>
mov    %r14,%rdi
call   10a0 <rewind@plt>
mov    %rbx,%rdi
call   1080 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
mov    %r14,%rdi
call   1050 <ferror@plt>
test   %rax,%rax
je     149b <main+0x2ab>
lea    0xbd1(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1070 <fclose@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x5,%eax
jmp    133c <main+0x14c>
mov    %r14,%rdi
call   1070 <fclose@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
jmp    133c <main+0x14c>

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: deptool srcfile.d\0A\00"
@.str.1 = [4 x i8] c"r+t\00"
@.str.2 = [38 x i8] c"deptool: No such dependency file: %s\0A\00"
@SEEK_END = global i32 0
@.str.3 = [25 x i8] c"deptool: Out of memory!\0A\00"
@.str.4 = [38 x i8] c"deptool: Dependency file read error.\0A\00"
@.str.5 = [3 x i8] c"\0A\0A\00"
@.str.6 = [39 x i8] c"deptool: Dependency file write error.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %12
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 2
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %237
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32* @fopen(i8* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32* %21, i32** %6
%22 = load i32*, i32** %6
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %29
24: ; preds = %17
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i8* %27)
store i32 2, i32* %3
br label %237
29: ; preds = %17
%30 = load i32*, i32** %6
%31 = load i32, i32* @SEEK_END
%32 = call i32 @fseek(i32* %30, i32 0, i32 %31)
%33 = load i32*, i32** %6
%34 = call i32 @ftell(i32* %33)
store i32 %34, i32* %7
%35 = load i32*, i32** %6
%36 = call i32 @rewind(i32* %35)
%37 = load i32, i32* %7
%38 = call i64 @malloc(i32 %37)
%39 = inttoptr i64 %38 to i8*
store i8* %39, i8** %8
%40 = load i32, i32* %7
%41 = mul nsw i32 %40, 3
%42 = call i64 @malloc(i32 %41)
%43 = inttoptr i64 %42 to i8*
store i8* %43, i8** %9
%44 = load i8*, i8** %8
%45 = icmp ne i8* %44, null
br i1 %45, label %46, label %49
46: ; preds = %29
%47 = load i8*, i8** %9
%48 = icmp ne i8* %47, null
br i1 %48, label %65, label %49
49: ; preds = %46, %29
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%51 = load i8*, i8** %8
%52 = icmp ne i8* %51, null
br i1 %52, label %53, label %56
53: ; preds = %49
%54 = load i8*, i8** %8
%55 = call i32 @free(i8* %54)
br label %56
56: ; preds = %53, %49
%57 = load i8*, i8** %9
%58 = icmp ne i8* %57, null
br i1 %58, label %59, label %62
59: ; preds = %56
%60 = load i8*, i8** %9
%61 = call i32 @free(i8* %60)
br label %62
62: ; preds = %59, %56
%63 = load i32*, i32** %6
%64 = call i32 @fclose(i32* %63)
store i32 3, i32* %3
br label %237
65: ; preds = %46
%66 = load i8*, i8** %8
%67 = load i32, i32* %7
%68 = call i32 @memset(i8* %66, i32 0, i32 %67)
%69 = load i8*, i8** %9
%70 = load i32, i32* %7
%71 = mul nsw i32 %70, 3
%72 = call i32 @memset(i8* %69, i32 0, i32 %71)
%73 = load i8*, i8** %8
%74 = load i32, i32* %7
%75 = load i32*, i32** %6
%76 = call i32 @fread(i8* %73, i32 1, i32 %74, i32* %75)
%77 = load i32*, i32** %6
%78 = call i64 @ferror(i32* %77)
%79 = icmp ne i64 %78, 0
br i1 %79, label %80, label %88
80: ; preds = %65
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%82 = load i8*, i8** %8
%83 = call i32 @free(i8* %82)
%84 = load i8*, i8** %9
%85 = call i32 @free(i8* %84)
%86 = load i32*, i32** %6
%87 = call i32 @fclose(i32* %86)
store i32 4, i32* %3
br label %237
88: ; preds = %65
store i32 0, i32* %10
store i32 0, i32* %11
br label %89
89: ; preds = %152, %88
%90 = load i8*, i8** %8
%91 = load i32, i32* %10
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8, i8* %90, i64 %92
%94 = load i8, i8* %93
%95 = icmp ne i8 %94, 0
br i1 %95, label %96, label %157
96: ; preds = %89
%97 = load i8*, i8** %8
%98 = load i32, i32* %10
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8, i8* %97, i64 %99
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
%103 = icmp eq i32 %102, 58
br i1 %103, label %104, label %141
104: ; preds = %96
%105 = load i8*, i8** %9
%106 = load i32, i32* %11
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i8, i8* %105, i64 %107
store i8 32, i8* %108
%109 = load i32, i32* %11
%110 = add nsw i32 %109, 1
store i32 %110, i32* %11
%111 = load i8*, i8** %9
%112 = load i32, i32* %11
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8, i8* %111, i64 %113
%115 = load i8**, i8*** %5
%116 = getelementptr inbounds i8*, i8** %115, i64 1
%117 = load i8*, i8** %116
%118 = call i32 @strcat(i8* %114, i8* %117)
%119 = load i8**, i8*** %5
%120 = getelementptr inbounds i8*, i8** %119, i64 1
%121 = load i8*, i8** %120
%122 = call i32 @strlen(i8* %121)
%123 = load i32, i32* %11
%124 = add nsw i32 %123, %122
store i32 %124, i32* %11
%125 = load i8*, i8** %9
%126 = load i32, i32* %11
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i8, i8* %125, i64 %127
store i8 32, i8* %128
%129 = load i32, i32* %11
%130 = add nsw i32 %129, 1
store i32 %130, i32* %11
%131 = load i8*, i8** %9
%132 = load i8*, i8** %8
%133 = load i32, i32* %10
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds i8, i8* %132, i64 %134
%136 = call i32 @strcat(i8* %131, i8* %135)
%137 = load i32, i32* %11
%138 = add nsw i32 %137, 2
store i32 %138, i32* %11
%139 = load i32, i32* %10
%140 = add nsw i32 %139, 2
store i32 %140, i32* %12
br label %157
141: ; preds = %96
%142 = load i8*, i8** %8
%143 = load i32, i32* %10
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds i8, i8* %142, i64 %144
%146 = load i8, i8* %145
%147 = load i8*, i8** %9
%148 = load i32, i32* %11
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i8, i8* %147, i64 %149
store i8 %146, i8* %150
br label %151
151: ; preds = %141
br label %152
152: ; preds = %151
%153 = load i32, i32* %10
%154 = add nsw i32 %153, 1
store i32 %154, i32* %10
%155 = load i32, i32* %11
%156 = add nsw i32 %155, 1
store i32 %156, i32* %11
br label %89
157: ; preds = %104, %89
%158 = load i8*, i8** %9
%159 = call i32 @strcat(i8* %158, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%160 = load i32, i32* %12
store i32 %160, i32* %10
%161 = load i8*, i8** %9
%162 = call i32 @strlen(i8* %161)
store i32 %162, i32* %11
br label %163
163: ; preds = %206, %157
%164 = load i8*, i8** %8
%165 = load i32, i32* %10
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds i8, i8* %164, i64 %166
%168 = load i8, i8* %167
%169 = icmp ne i8 %168, 0
br i1 %169, label %170, label %211
170: ; preds = %163
%171 = load i8*, i8** %8
%172 = load i32, i32* %10
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i8, i8* %171, i64 %173
%175 = load i8, i8* %174
%176 = sext i8 %175 to i32
%177 = icmp eq i32 %176, 92
br i1 %177, label %178, label %181
178: ; preds = %170
%179 = load i32, i32* %11
%180 = add nsw i32 %179, -1
store i32 %180, i32* %11
br label %206
181: ; preds = %170
%182 = load i8*, i8** %8
%183 = load i32, i32* %10
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds i8, i8* %182, i64 %184
%186 = load i8, i8* %185
%187 = sext i8 %186 to i32
%188 = icmp eq i32 %187, 10
br i1 %188, label %189, label %196
189: ; preds = %181
%190 = load i8*, i8** %9
%191 = load i32, i32* %11
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds i8, i8* %190, i64 %192
store i8 58, i8* %193
%194 = load i32, i32* %11
%195 = add nsw i32 %194, 1
store i32 %195, i32* %11
br label %196
196: ; preds = %189, %181
%197 = load i8*, i8** %8
%198 = load i32, i32* %10
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds i8, i8* %197, i64 %199
%201 = load i8, i8* %200
%202 = load i8*, i8** %9
%203 = load i32, i32* %11
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds i8, i8* %202, i64 %204
store i8 %201, i8* %205
br label %206
206: ; preds = %196, %178
%207 = load i32, i32* %10
%208 = add nsw i32 %207, 1
store i32 %208, i32* %10
%209 = load i32, i32* %11
%210 = add nsw i32 %209, 1
store i32 %210, i32* %11
br label %163
211: ; preds = %163
%212 = load i32*, i32** %6
%213 = call i32 @rewind(i32* %212)
%214 = load i8*, i8** %9
%215 = load i8*, i8** %9
%216 = call i32 @strlen(i8* %215)
%217 = load i32*, i32** %6
%218 = call i32 @fwrite(i8* %214, i32 1, i32 %216, i32* %217)
%219 = load i32*, i32** %6
%220 = call i64 @ferror(i32* %219)
%221 = icmp ne i64 %220, 0
br i1 %221, label %222, label %230
222: ; preds = %211
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%224 = load i32*, i32** %6
%225 = call i32 @fclose(i32* %224)
%226 = load i8*, i8** %8
%227 = call i32 @free(i8* %226)
%228 = load i8*, i8** %9
%229 = call i32 @free(i8* %228)
store i32 5, i32* %3
br label %237
230: ; preds = %211
%231 = load i32*, i32** %6
%232 = call i32 @fclose(i32* %231)
%233 = load i8*, i8** %8
%234 = call i32 @free(i8* %233)
%235 = load i8*, i8** %9
%236 = call i32 @free(i8* %235)
store i32 0, i32* %3
br label %237
237: ; preds = %230, %222, %80, %62, %24, %15
%238 = load i32, i32* %3
ret i32 %238
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"r+t\00"
@.str.2 = [38 x i8] c"deptool: No such dependency file: %s\0A\00"
@SEEK_END = global i32 0
@.str.5 = [3 x i8] c"\0A\0A\00"
@str = [24 x i8] c"deptool: Out of memory!\00"
@str.7 = [38 x i8] c"deptool: Dependency file write error.\00"
@str.8 = [37 x i8] c"deptool: Dependency file read error.\00"
@str.9 = [25 x i8] c"Usage: deptool srcfile.d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.9, i64 0, i64 0))
br label %113
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32* @fopen(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i8*, i8** %7
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i8* %12)
br label %113
14: ; preds = %6
%15 = load i32, i32* @SEEK_END
%16 = tail call i32 @fseek(i32* %9, i32 0, i32 %15)
%17 = tail call i32 @ftell(i32* %9)
%18 = tail call i32 @rewind(i32* %9)
%19 = tail call i64 @malloc(i32 %17)
%20 = inttoptr i64 %19 to i8*
%21 = mul nsw i32 %17, 3
%22 = tail call i64 @malloc(i32 %21)
%23 = inttoptr i64 %22 to i8*
%24 = icmp ne i64 %19, 0
%25 = icmp ne i64 %22, 0
%26 = select i1 %24, i1 %25, i1 false
br i1 %26, label %36, label %27
27: ; preds = %14
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br i1 %24, label %29, label %31
29: ; preds = %27
%30 = tail call i32 @free(i8* %20)
br label %31
31: ; preds = %29, %27
br i1 %25, label %32, label %34
32: ; preds = %31
%33 = tail call i32 @free(i8* %23)
br label %34
34: ; preds = %32, %31
%35 = tail call i32 @fclose(i32* %9)
br label %113
36: ; preds = %14
%37 = tail call i32 @memset(i8* %20, i32 0, i32 %17)
%38 = tail call i32 @memset(i8* %23, i32 0, i32 %21)
%39 = tail call i32 @fread(i8* %20, i32 1, i32 %17, i32* %9)
%40 = tail call i64 @ferror(i32* %9)
%41 = icmp eq i64 %40, 0
br i1 %41, label %47, label %42
42: ; preds = %36
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.8, i64 0, i64 0))
%44 = tail call i32 @free(i8* %20)
%45 = tail call i32 @free(i8* %23)
%46 = tail call i32 @fclose(i32* %9)
br label %113
47: ; preds = %36, %70
%48 = phi i64 [ %72, %70 ], [ 0, %36 ]
%49 = getelementptr inbounds i8, i8* %20, i64 %48
%50 = load i8, i8* %49
switch i8 %50, label %70 [
i8 0, label %73
i8 58, label %51
]
51: ; preds = %47
%52 = trunc i64 %48 to i32
%53 = and i64 %48, 4294967295
%54 = getelementptr inbounds i8, i8* %20, i64 %53
%55 = getelementptr inbounds i8, i8* %23, i64 %53
store i8 32, i8* %55
%56 = add nuw nsw i32 %52, 1
%57 = zext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %23, i64 %57
%59 = load i8*, i8** %7
%60 = tail call i32 @strcat(i8* %58, i8* %59)
%61 = load i8*, i8** %7
%62 = tail call i32 @strlen(i8* %61)
%63 = add nsw i32 %62, %56
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %23, i64 %64
store i8 32, i8* %65
%66 = tail call i32 @strcat(i8* %23, i8* %54)
%67 = shl i64 %48, 32
%68 = add i64 %67, 8589934592
%69 = ashr exact i64 %68, 32
br label %73
70: ; preds = %47
%71 = getelementptr inbounds i8, i8* %23, i64 %48
store i8 %50, i8* %71
%72 = add nuw i64 %48, 1
br label %47
73: ; preds = %47, %51
%74 = phi i64 [ %69, %51 ], [ 0, %47 ]
%75 = tail call i32 @strcat(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%76 = tail call i32 @strlen(i8* %23)
br label %77
77: ; preds = %94, %73
%78 = phi i64 [ %96, %94 ], [ %74, %73 ]
%79 = phi i32 [ %97, %94 ], [ %76, %73 ]
%80 = getelementptr inbounds i8, i8* %20, i64 %78
%81 = load i8, i8* %80
switch i8 %81, label %89 [
i8 0, label %98
i8 92, label %82
i8 10, label %84
]
82: ; preds = %77
%83 = add nsw i32 %79, -1
br label %94
84: ; preds = %77
%85 = sext i32 %79 to i64
%86 = getelementptr inbounds i8, i8* %23, i64 %85
store i8 58, i8* %86
%87 = add nsw i32 %79, 1
%88 = load i8, i8* %80
br label %89
89: ; preds = %77, %84
%90 = phi i8 [ %88, %84 ], [ %81, %77 ]
%91 = phi i32 [ %87, %84 ], [ %79, %77 ]
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8, i8* %23, i64 %92
store i8 %90, i8* %93
br label %94
94: ; preds = %89, %82
%95 = phi i32 [ %83, %82 ], [ %91, %89 ]
%96 = add i64 %78, 1
%97 = add nsw i32 %95, 1
br label %77
98: ; preds = %77
%99 = tail call i32 @rewind(i32* %9)
%100 = tail call i32 @strlen(i8* %23)
%101 = tail call i32 @fwrite(i8* %23, i32 1, i32 %100, i32* %9)
%102 = tail call i64 @ferror(i32* %9)
%103 = icmp eq i64 %102, 0
br i1 %103, label %109, label %104
104: ; preds = %98
%105 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.7, i64 0, i64 0))
%106 = tail call i32 @fclose(i32* %9)
%107 = tail call i32 @free(i8* %20)
%108 = tail call i32 @free(i8* %23)
br label %113
109: ; preds = %98
%110 = tail call i32 @fclose(i32* %9)
%111 = tail call i32 @free(i8* %20)
%112 = tail call i32 @free(i8* %23)
br label %113
113: ; preds = %109, %104, %42, %34, %11, %4
%114 = phi i32 [ 1, %4 ], [ 2, %11 ], [ 4, %42 ], [ 5, %104 ], [ 0, %109 ], [ 3, %34 ]
ret i32 %114
}