#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*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fieldcpy(char *, char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ outputdeps(char *);
int /*<<< orphan*/ perror(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
scalar_t__ strncasecmp(char *, char *, int);
void dogetdeps(char *pkgsfile, char **in_pkgs, int pkgc) {
  char buf[1000];
  char cur_pkg[1000];
  char cur_deps[1000];
  char cur_predeps[1000];
  char prev_pkg[1000];
  char *pkgs[100];
  int i;
  int skip;
  FILE *f;
  int output_pkg = -1;
  cur_pkg[0] = cur_deps[0] = cur_predeps[0] = prev_pkg[0] = '\0';
  for (i = 0; i < pkgc; i++)
    pkgs[i] = in_pkgs[i];
  f = fopen(pkgsfile, "r");
  if (f == NULL) {
    perror(pkgsfile);
    exit(1);
  }
  skip = 1;
  while (fgets(buf, sizeof(buf), f)) {
    if (*buf && buf[strlen(buf) - 1] == '\n')
      buf[strlen(buf) - 1] = '\0';
    if (strncasecmp(buf, "Package:", 8) == 0) {
      int any = 0;
      skip = 1;
      fieldcpy(cur_pkg, buf);
      if (strcmp(cur_pkg, prev_pkg) != 0) {
        if (output_pkg != -1)
          pkgs[output_pkg] = NULL;
        if (cur_deps[0])
          outputdeps(cur_deps);
        if (cur_predeps[0])
          outputdeps(cur_predeps);
        strcpy(prev_pkg, cur_pkg);
      }
      cur_deps[0] = cur_predeps[0] = '\0';
      output_pkg = -1;
      for (i = 0; i < pkgc; i++) {
        if (!pkgs[i])
          continue;
        any = 1;
        if (strcmp(cur_pkg, pkgs[i]) == 0) {
          skip = 0;
          output_pkg = i;
          break;
        }
      }
      if (!any)
        break;
    } else if (!skip && strncasecmp(buf, "Depends:", 8) == 0)
      fieldcpy(cur_deps, buf);
    else if (!skip && strncasecmp(buf, "Pre-Depends:", 12) == 0)
      fieldcpy(cur_predeps, buf);
  }
  if (cur_deps[0])
    outputdeps(cur_deps);
  if (cur_predeps[0])
    outputdeps(cur_predeps);
  fclose(f);
}


x86 assembly (clang, -O0):
<dogetdeps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1700,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0xffffffff,-0x16f4(%rbp)
ff ff ff
movb   $0x0,-0x13c0(%rbp)
movb   $0x0,-0xfd0(%rbp)
movb   $0x0,-0xbe0(%rbp)
movb   $0x0,-0x7f0(%rbp)
movl   $0x0,-0x16e4(%rbp)
mov    -0x16e4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1237 <dogetdeps+0x87>
mov    -0x10(%rbp),%rax
movslq -0x16e4(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
movslq -0x16e4(%rbp),%rax
mov    %rcx,-0x16e0(%rbp,%rax,8)
ff
mov    -0x16e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x16e4(%rbp)
jmp    11f6 <dogetdeps+0x46>
mov    -0x8(%rbp),%rdi
lea    0xdbe(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x16f0(%rbp)
cmpq   $0x0,-0x16f0(%rbp)
jne    126f <dogetdeps+0xbf>
mov    -0x8(%rbp),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
movl   $0x1,-0x16e8(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x16f0(%rbp),%rdx
mov    $0x3e8,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     150f <dogetdeps+0x35f>
movsbl -0x400(%rbp),%eax
cmp    $0x0,%eax
je     12e6 <dogetdeps+0x136>
lea    -0x400(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movsbl -0x400(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    12e6 <dogetdeps+0x136>
lea    -0x400(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x400(%rbp,%rax,1)
lea    -0x400(%rbp),%rdi
lea    0xd0e(%rip),%rsi
mov    $0x8,%edx
call   1090 <strncasecmp@plt>
cmp    $0x0,%rax
jne    1477 <dogetdeps+0x2c7>
movl   $0x0,-0x16f8(%rbp)
movl   $0x1,-0x16e8(%rbp)
lea    -0x7f0(%rbp),%rdi
lea    -0x400(%rbp),%rsi
call   10d0 <fieldcpy@plt>
lea    -0x7f0(%rbp),%rdi
lea    -0x13c0(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     13b1 <dogetdeps+0x201>
cmpl   $0xffffffff,-0x16f4(%rbp)
je     136c <dogetdeps+0x1bc>
movslq -0x16f4(%rbp),%rax
movq   $0x0,-0x16e0(%rbp,%rax,8)
cmpb   $0x0,-0xbe0(%rbp)
je     1385 <dogetdeps+0x1d5>
lea    -0xbe0(%rbp),%rdi
call   1080 <outputdeps@plt>
cmpb   $0x0,-0xfd0(%rbp)
je     139e <dogetdeps+0x1ee>
lea    -0xfd0(%rbp),%rdi
call   1080 <outputdeps@plt>
lea    -0x13c0(%rbp),%rdi
lea    -0x7f0(%rbp),%rsi
call   1030 <strcpy@plt>
movb   $0x0,-0xfd0(%rbp)
movb   $0x0,-0xbe0(%rbp)
movl   $0xffffffff,-0x16f4(%rbp)
ff ff ff
movl   $0x0,-0x16e4(%rbp)
mov    -0x16e4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1460 <dogetdeps+0x2b0>
movslq -0x16e4(%rbp),%rax
cmpq   $0x0,-0x16e0(%rbp,%rax,8)
jne    13fd <dogetdeps+0x24d>
jmp    144c <dogetdeps+0x29c>
movl   $0x1,-0x16f8(%rbp)
lea    -0x7f0(%rbp),%rdi
movslq -0x16e4(%rbp),%rax
mov    -0x16e0(%rbp,%rax,8),%rsi
ff
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1447 <dogetdeps+0x297>
movl   $0x0,-0x16e8(%rbp)
mov    -0x16e4(%rbp),%eax
mov    %eax,-0x16f4(%rbp)
jmp    1460 <dogetdeps+0x2b0>
jmp    144c <dogetdeps+0x29c>
mov    -0x16e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x16e4(%rbp)
jmp    13d3 <dogetdeps+0x223>
cmpl   $0x0,-0x16f8(%rbp)
jne    1472 <dogetdeps+0x2c2>
jmp    150f <dogetdeps+0x35f>
jmp    150a <dogetdeps+0x35a>
cmpl   $0x0,-0x16e8(%rbp)
jne    14be <dogetdeps+0x30e>
lea    -0x400(%rbp),%rdi
lea    0xb7d(%rip),%rsi
mov    $0x8,%edx
call   1090 <strncasecmp@plt>
cmp    $0x0,%rax
jne    14be <dogetdeps+0x30e>
lea    -0xbe0(%rbp),%rdi
lea    -0x400(%rbp),%rsi
call   10d0 <fieldcpy@plt>
jmp    1505 <dogetdeps+0x355>
cmpl   $0x0,-0x16e8(%rbp)
jne    1500 <dogetdeps+0x350>
lea    -0x400(%rbp),%rdi
lea    0xb32(%rip),%rsi
mov    $0xc,%edx
call   1090 <strncasecmp@plt>
cmp    $0x0,%rax
jne    1500 <dogetdeps+0x350>
lea    -0xfd0(%rbp),%rdi
lea    -0x400(%rbp),%rsi
call   10d0 <fieldcpy@plt>
jmp    1505 <dogetdeps+0x355>
jmp    150a <dogetdeps+0x35a>
jmp    1279 <dogetdeps+0xc9>
cmpb   $0x0,-0xbe0(%rbp)
je     1528 <dogetdeps+0x378>
lea    -0xbe0(%rbp),%rdi
call   1080 <outputdeps@plt>
cmpb   $0x0,-0xfd0(%rbp)
je     1541 <dogetdeps+0x391>
lea    -0xfd0(%rbp),%rdi
call   1080 <outputdeps@plt>
mov    -0x16f0(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x1700,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dogetdeps>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x16d8,%rsp
mov    %rdi,%rbx
movb   $0x0,0xb10(%rsp)
movb   $0x0,0x10(%rsp)
movb   $0x0,0x400(%rsp)
movb   $0x0,0xf00(%rsp)
mov    %edx,%r13d
mov    %edx,0x4(%rsp)
test   %edx,%edx
jle    1211 <dogetdeps+0x51>
lea    0x0(,%r13,8),%rdx
lea    0x7f0(%rsp),%rdi
call   1090 <memcpy@plt>
lea    0xde8(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1459 <dogetdeps+0x299>
lea    0x12f0(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x3e8,%esi
mov    %rax,0x8(%rsp)
mov    %rax,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1415 <dogetdeps+0x255>
mov    $0x1,%r15d
mov    $0xffffffff,%r14d
lea    0xf00(%rsp),%rbx
jmp    1296 <dogetdeps+0xd6>
lea    0x400(%rsp),%rdi
mov    %rbp,%rsi
call   10e0 <fieldcpy@plt>
xor    %r12d,%r12d
mov    %rbp,%rdi
mov    $0x3e8,%esi
mov    0x8(%rsp),%rdx
call   1060 <fgets@plt>
mov    %r12d,%r15d
test   %rax,%rax
je     1415 <dogetdeps+0x255>
cmpb   $0x0,0x12f0(%rsp)
je     12c0 <dogetdeps+0x100>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbp,1)
jne    12c0 <dogetdeps+0x100>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
mov    %rbp,%rdi
lea    0xd38(%rip),%rsi
mov    $0x8,%edx
call   10a0 <strncasecmp@plt>
test   %rax,%rax
je     1340 <dogetdeps+0x180>
mov    $0x1,%r12d
test   %r15d,%r15d
jne    1278 <dogetdeps+0xb8>
mov    %rbp,%rdi
lea    0xd21(%rip),%rsi
mov    $0x8,%edx
call   10a0 <strncasecmp@plt>
test   %rax,%rax
je     1265 <dogetdeps+0xa5>
mov    %rbp,%rdi
lea    0xd00(%rip),%rsi
mov    $0xc,%edx
call   10a0 <strncasecmp@plt>
xor    %r12d,%r12d
test   %rax,%rax
jne    1278 <dogetdeps+0xb8>
lea    0x10(%rsp),%rdi
mov    %rbp,%rsi
call   10e0 <fieldcpy@plt>
jmp    1278 <dogetdeps+0xb8>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10e0 <fieldcpy@plt>
mov    %rbx,%rdi
lea    0xb10(%rsp),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     13ad <dogetdeps+0x1ed>
cmp    $0xffffffff,%r14d
je     1375 <dogetdeps+0x1b5>
movslq %r14d,%rax
movq   $0x0,0x7f0(%rsp,%rax,8)
cmpb   $0x0,0x400(%rsp)
je     138c <dogetdeps+0x1cc>
lea    0x400(%rsp),%rdi
call   1080 <outputdeps@plt>
cmpb   $0x0,0x10(%rsp)
je     139d <dogetdeps+0x1dd>
lea    0x10(%rsp),%rdi
call   1080 <outputdeps@plt>
lea    0xb10(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movb   $0x0,0x10(%rsp)
movb   $0x0,0x400(%rsp)
cmpl   $0x0,0x4(%rsp)
jle    143d <dogetdeps+0x27d>
xor    %r14d,%r14d
xor    %ecx,%ecx
jmp    13d9 <dogetdeps+0x219>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14
cmp    %r14,%r13
je     1400 <dogetdeps+0x240>
mov    0x7f0(%rsp,%r14,8),%rsi
test   %rsi,%rsi
je     13d0 <dogetdeps+0x210>
mov    %rbx,%rdi
call   1070 <strcmp@plt>
mov    $0x1,%ecx
test   %rax,%rax
jne    13d0 <dogetdeps+0x210>
jmp    1275 <dogetdeps+0xb5>
nopl   (%rax)
test   %ecx,%ecx
je     1415 <dogetdeps+0x255>
mov    $0xffffffff,%r14d
mov    $0x1,%r12d
jmp    1278 <dogetdeps+0xb8>
cmpb   $0x0,0x400(%rsp)
je     142c <dogetdeps+0x26c>
lea    0x400(%rsp),%rdi
call   1080 <outputdeps@plt>
cmpb   $0x0,0x10(%rsp)
je     143d <dogetdeps+0x27d>
lea    0x10(%rsp),%rdi
call   1080 <outputdeps@plt>
mov    0x8(%rsp),%rdi
call   1040 <fclose@plt>
add    $0x16d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [9 x i8] c"Package:\00"
@.str.2 = [9 x i8] c"Depends:\00"
@.str.3 = [13 x i8] c"Pre-Depends:\00"
define void @dogetdeps(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [1000 x i8]
%8 = alloca [1000 x i8]
%9 = alloca [1000 x i8]
%10 = alloca [1000 x i8]
%11 = alloca [1000 x i8]
%12 = alloca [100 x i8*]
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i32
%17 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
store i32 -1, i32* %16
%18 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
store i8 0, i8* %18
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
store i8 0, i8* %19
%20 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
store i8 0, i8* %20
%21 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
store i8 0, i8* %21
store i32 0, i32* %13
br label %22
22: ; preds = %35, %3
%23 = load i32, i32* %13
%24 = load i32, i32* %6
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %38
26: ; preds = %22
%27 = load i8**, i8*** %5
%28 = load i32, i32* %13
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = load i32, i32* %13
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100 x i8*], [100 x i8*]* %12, i64 0, i64 %33
store i8* %31, i8** %34
br label %35
35: ; preds = %26
%36 = load i32, i32* %13
%37 = add nsw i32 %36, 1
store i32 %37, i32* %13
br label %22
38: ; preds = %22
%39 = load i8*, i8** %4
%40 = call i32* @fopen(i8* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %40, i32** %15
%41 = load i32*, i32** %15
%42 = icmp eq i32* %41, null
br i1 %42, label %43, label %47
43: ; preds = %38
%44 = load i8*, i8** %4
%45 = call i32 @perror(i8* %44)
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %38
store i32 1, i32* %14
br label %48
48: ; preds = %167, %47
%49 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%50 = load i32*, i32** %15
%51 = call i64 @fgets(i8* %49, i32 1000, i32* %50)
%52 = icmp ne i64 %51, 0
br i1 %52, label %53, label %168
53: ; preds = %48
%54 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %73
58: ; preds = %53
%59 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%60 = call i32 @strlen(i8* %59)
%61 = sub nsw i32 %60, 1
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 %62
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 10
br i1 %66, label %67, label %73
67: ; preds = %58
%68 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%69 = call i32 @strlen(i8* %68)
%70 = sub nsw i32 %69, 1
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 %71
store i8 0, i8* %72
br label %73
73: ; preds = %67, %58, %53
%74 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%75 = call i64 @strncasecmp(i8* %74, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %143
77: ; preds = %73
store i32 0, i32* %17
store i32 1, i32* %14
%78 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%79 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%80 = call i32 @fieldcpy(i8* %78, i8* %79)
%81 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%82 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%83 = call i64 @strcmp(i8* %81, i8* %82)
%84 = icmp ne i64 %83, 0
br i1 %84, label %85, label %110
85: ; preds = %77
%86 = load i32, i32* %16
%87 = icmp ne i32 %86, -1
br i1 %87, label %88, label %92
88: ; preds = %85
%89 = load i32, i32* %16
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [100 x i8*], [100 x i8*]* %12, i64 0, i64 %90
store i8* null, i8** %91
br label %92
92: ; preds = %88, %85
%93 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%94 = load i8, i8* %93
%95 = icmp ne i8 %94, 0
br i1 %95, label %96, label %99
96: ; preds = %92
%97 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%98 = call i32 @outputdeps(i8* %97)
br label %99
99: ; preds = %96, %92
%100 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%101 = load i8, i8* %100
%102 = icmp ne i8 %101, 0
br i1 %102, label %103, label %106
103: ; preds = %99
%104 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%105 = call i32 @outputdeps(i8* %104)
br label %106
106: ; preds = %103, %99
%107 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%108 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%109 = call i32 @strcpy(i8* %107, i8* %108)
br label %110
110: ; preds = %106, %77
%111 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
store i8 0, i8* %111
%112 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
store i8 0, i8* %112
store i32 -1, i32* %16
store i32 0, i32* %13
br label %113
113: ; preds = %135, %110
%114 = load i32, i32* %13
%115 = load i32, i32* %6
%116 = icmp slt i32 %114, %115
br i1 %116, label %117, label %138
117: ; preds = %113
%118 = load i32, i32* %13
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [100 x i8*], [100 x i8*]* %12, i64 0, i64 %119
%121 = load i8*, i8** %120
%122 = icmp ne i8* %121, null
br i1 %122, label %124, label %123
123: ; preds = %117
br label %135
124: ; preds = %117
store i32 1, i32* %17
%125 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%126 = load i32, i32* %13
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [100 x i8*], [100 x i8*]* %12, i64 0, i64 %127
%129 = load i8*, i8** %128
%130 = call i64 @strcmp(i8* %125, i8* %129)
%131 = icmp eq i64 %130, 0
br i1 %131, label %132, label %134
132: ; preds = %124
store i32 0, i32* %14
%133 = load i32, i32* %13
store i32 %133, i32* %16
br label %138
134: ; preds = %124
br label %135
135: ; preds = %134, %123
%136 = load i32, i32* %13
%137 = add nsw i32 %136, 1
store i32 %137, i32* %13
br label %113
138: ; preds = %132, %113
%139 = load i32, i32* %17
%140 = icmp ne i32 %139, 0
br i1 %140, label %142, label %141
141: ; preds = %138
br label %168
142: ; preds = %138
br label %167
143: ; preds = %73
%144 = load i32, i32* %14
%145 = icmp ne i32 %144, 0
br i1 %145, label %154, label %146
146: ; preds = %143
%147 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%148 = call i64 @strncasecmp(i8* %147, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 8)
%149 = icmp eq i64 %148, 0
br i1 %149, label %150, label %154
150: ; preds = %146
%151 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%152 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%153 = call i32 @fieldcpy(i8* %151, i8* %152)
br label %166
154: ; preds = %146, %143
%155 = load i32, i32* %14
%156 = icmp ne i32 %155, 0
br i1 %156, label %165, label %157
157: ; preds = %154
%158 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%159 = call i64 @strncasecmp(i8* %158, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 12)
%160 = icmp eq i64 %159, 0
br i1 %160, label %161, label %165
161: ; preds = %157
%162 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%163 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%164 = call i32 @fieldcpy(i8* %162, i8* %163)
br label %165
165: ; preds = %161, %157, %154
br label %166
166: ; preds = %165, %150
br label %167
167: ; preds = %166, %142
br label %48
168: ; preds = %141, %48
%169 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%170 = load i8, i8* %169
%171 = icmp ne i8 %170, 0
br i1 %171, label %172, label %175
172: ; preds = %168
%173 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%174 = call i32 @outputdeps(i8* %173)
br label %175
175: ; preds = %172, %168
%176 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%177 = load i8, i8* %176
%178 = icmp ne i8 %177, 0
br i1 %178, label %179, label %182
179: ; preds = %175
%180 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%181 = call i32 @outputdeps(i8* %180)
br label %182
182: ; preds = %179, %175
%183 = load i32*, i32** %15
%184 = call i32 @fclose(i32* %183)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [9 x i8] c"Package:\00"
@.str.2 = [9 x i8] c"Depends:\00"
@.str.3 = [13 x i8] c"Pre-Depends:\00"
define void @dogetdeps(i8* nocapture %0, i8** nocapture %1, i32 %2) {
%4 = alloca [1000 x i8]
%5 = alloca [1000 x i8]
%6 = alloca [1000 x i8]
%7 = alloca [1000 x i8]
%8 = alloca [1000 x i8]
%9 = alloca [100 x i8*]
%10 = bitcast [100 x i8*]* %9 to i8*
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
store i8 0, i8* %15
store i8 0, i8* %14
store i8 0, i8* %13
store i8 0, i8* %12
%16 = icmp sgt i32 %2, 0
br i1 %16, label %17, label %21
17: ; preds = %3
%18 = bitcast i8** %1 to i8*
%19 = zext i32 %2 to i64
%20 = shl nuw nsw i64 %19, 3
br label %21
21: ; preds = %17, %3
%22 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%23 = icmp eq i32* %22, null
br i1 %23, label %29, label %24
24: ; preds = %21
%25 = call i64 @fgets(i8* %11, i32 1000, i32* %22)
%26 = icmp eq i64 %25, 0
br i1 %26, label %108, label %27
27: ; preds = %24
%28 = zext i32 %2 to i64
br label %32
29: ; preds = %21
%30 = tail call i32 @perror(i8* %0)
%31 = tail call i32 @exit(i32 1)
unreachable
32: ; preds = %27, %103
%33 = phi i32 [ -1, %27 ], [ %105, %103 ]
%34 = phi i32 [ 1, %27 ], [ %104, %103 ]
%35 = load i8, i8* %11
%36 = icmp eq i8 %35, 0
br i1 %36, label %49, label %37
37: ; preds = %32
%38 = call i32 @strlen(i8* %11)
%39 = add nsw i32 %38, -1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = icmp eq i8 %42, 10
br i1 %43, label %44, label %49
44: ; preds = %37
%45 = call i32 @strlen(i8* %11)
%46 = add nsw i32 %45, -1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %47
store i8 0, i8* %48
br label %49
49: ; preds = %44, %37, %32
%50 = call i64 @strncasecmp(i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %89
52: ; preds = %49
%53 = call i32 @fieldcpy(i8* %12, i8* %11)
%54 = call i64 @strcmp(i8* %12, i8* %15)
%55 = icmp eq i64 %54, 0
br i1 %55, label %73, label %56
56: ; preds = %52
%57 = icmp eq i32 %33, -1
br i1 %57, label %61, label %58
58: ; preds = %56
%59 = sext i32 %33 to i64
%60 = getelementptr inbounds [100 x i8*], [100 x i8*]* %9, i64 0, i64 %59
store i8* null, i8** %60
br label %61
61: ; preds = %58, %56
%62 = load i8, i8* %13
%63 = icmp eq i8 %62, 0
br i1 %63, label %66, label %64
64: ; preds = %61
%65 = call i32 @outputdeps(i8* %13)
br label %66
66: ; preds = %64, %61
%67 = load i8, i8* %14
%68 = icmp eq i8 %67, 0
br i1 %68, label %71, label %69
69: ; preds = %66
%70 = call i32 @outputdeps(i8* %14)
br label %71
71: ; preds = %69, %66
%72 = call i32 @strcpy(i8* %15, i8* %12)
br label %73
73: ; preds = %71, %52
store i8 0, i8* %14
store i8 0, i8* %13
br i1 %16, label %74, label %118
74: ; preds = %73, %83
%75 = phi i64 [ %85, %83 ], [ 0, %73 ]
%76 = phi i32 [ %84, %83 ], [ 0, %73 ]
%77 = getelementptr inbounds [100 x i8*], [100 x i8*]* %9, i64 0, i64 %75
%78 = load i8*, i8** %77
%79 = icmp eq i8* %78, null
br i1 %79, label %83, label %80
80: ; preds = %74
%81 = call i64 @strcmp(i8* %12, i8* %78)
%82 = icmp eq i64 %81, 0
br i1 %82, label %101, label %83
83: ; preds = %80, %74
%84 = phi i32 [ 1, %80 ], [ %76, %74 ]
%85 = add nuw nsw i64 %75, 1
%86 = icmp eq i64 %85, %28
br i1 %86, label %87, label %74
87: ; preds = %83
%88 = icmp eq i32 %84, 0
br i1 %88, label %108, label %103
89: ; preds = %49
%90 = icmp eq i32 %34, 0
br i1 %90, label %91, label %103
91: ; preds = %89
%92 = call i64 @strncasecmp(i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 8)
%93 = icmp eq i64 %92, 0
br i1 %93, label %94, label %96
94: ; preds = %91
%95 = call i32 @fieldcpy(i8* %13, i8* %11)
br label %103
96: ; preds = %91
%97 = call i64 @strncasecmp(i8* %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 12)
%98 = icmp eq i64 %97, 0
br i1 %98, label %99, label %103
99: ; preds = %96
%100 = call i32 @fieldcpy(i8* %14, i8* %11)
br label %103
101: ; preds = %80
%102 = trunc i64 %75 to i32
br label %103
103: ; preds = %101, %87, %89, %94, %99, %96
%104 = phi i32 [ 1, %87 ], [ 0, %99 ], [ 0, %96 ], [ 0, %94 ], [ 1, %89 ], [ 0, %101 ]
%105 = phi i32 [ -1, %87 ], [ %33, %99 ], [ %33, %96 ], [ %33, %94 ], [ %33, %89 ], [ %102, %101 ]
%106 = call i64 @fgets(i8* %11, i32 1000, i32* %22)
%107 = icmp eq i64 %106, 0
br i1 %107, label %108, label %32
108: ; preds = %103, %87, %24
%109 = load i8, i8* %13
%110 = icmp eq i8 %109, 0
br i1 %110, label %113, label %111
111: ; preds = %108
%112 = call i32 @outputdeps(i8* %13)
br label %113
113: ; preds = %111, %108
%114 = load i8, i8* %14
%115 = icmp eq i8 %114, 0
br i1 %115, label %118, label %116
116: ; preds = %113
%117 = call i32 @outputdeps(i8* %14)
br label %118
118: ; preds = %73, %116, %113
%119 = call i32 @fclose(i32* %22)
ret void
}