#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 MAXPATHLEN;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ isalpha(char);
scalar_t__ isdigit(char);
void *malloc(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strncmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strstr(char *, char *);
int find_issexes(const char *issname, char ***aptr) {
  char **aarray = NULL;
  FILE *inf = NULL;
  char line[MAXPATHLEN];
  char *ret;
  int ns = 0;
  int i = 0;
  char *pend = NULL;
  char *pstart = NULL;
  int len = 0;
  inf = fopen(issname, "rb");
  if (!inf) {
    fprintf(stderr, "Error: Cannot open ISS file [%s]\n", issname);
    exit(-1);
  }
  while ((ret = fgets(line, MAXPATHLEN, inf))) {
    if (!strncmp(line, "; Applications", 14))
      break;
  }
  if (!ret) {
    fprintf(stderr, "Missing \"; Applications\" marker\n");
    exit(-1);
  }
  while ((ret = fgets(line, MAXPATHLEN, inf))) {
    if (!strncmp(line, "; End of Applications", 21))
      break;
    if (!strncmp(line, "Source:", 7))
      ++ns;
  }
  if (!ret) {
    fprintf(stderr, "Missing \"; End of Applications\" marker\n");
    exit(-1);
  }
  if (ns) {
    *aptr = malloc(sizeof(char *) * (ns + 1));
    aarray = *aptr;
    for (i = 0; i < ns; ++i)
      aarray[i] = malloc(sizeof(char) * MAXPATHLEN);
    aarray[ns] = NULL;
  }
  fclose(inf);
  inf = fopen(issname, "rb");
  while ((ret = fgets(line, MAXPATHLEN, inf))) {
    if (!strncmp(line, "; Applications", 14))
      break;
  }
  i = 0;
  while ((ret = fgets(line, MAXPATHLEN, inf))) {
    if (!strncmp(line, "; End of Applications", 21))
      break;
    if (!strncmp(line, "Source:", 7)) {
      pend = strstr(line, ".exe");
      pstart = pend - 1;
      while (isalpha(*pstart) || isdigit(*pstart))
        --pstart;
      ++pstart;
      len = pend - pstart;
      strncpy(aarray[i], pstart, len);
      aarray[i++][len] = '\0';
    }
  }
  fclose(inf);
  return ns;
}


x86 assembly (clang, -O0):
<find_issexes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    0x2e11(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xdd4(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1265 <find_issexes+0xb5>
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xdaf(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
jmp    126a <find_issexes+0xba>
mov    -0x60(%rbp),%rdi
mov    0x2d73(%rip),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rdx
call   1070 <fgets@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     12b6 <find_issexes+0x106>
mov    -0x60(%rbp),%rdi
lea    0xd8c(%rip),%rsi
mov    $0xe,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12b1 <find_issexes+0x101>
jmp    12b6 <find_issexes+0x106>
jmp    126a <find_issexes+0xba>
cmpq   $0x0,-0x38(%rbp)
jne    12e2 <find_issexes+0x132>
mov    0x2d10(%rip),%rax
mov    (%rax),%edi
lea    0xd63(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
jmp    12e7 <find_issexes+0x137>
mov    -0x60(%rbp),%rdi
mov    0x2cf6(%rip),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rdx
call   1070 <fgets@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     135a <find_issexes+0x1aa>
mov    -0x60(%rbp),%rdi
lea    0xd3f(%rip),%rsi
mov    $0x15,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    132e <find_issexes+0x17e>
jmp    135a <find_issexes+0x1aa>
mov    -0x60(%rbp),%rdi
lea    0xd32(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1355 <find_issexes+0x1a5>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12e7 <find_issexes+0x137>
cmpq   $0x0,-0x38(%rbp)
jne    1386 <find_issexes+0x1d6>
mov    0x2c6c(%rip),%rax
mov    (%rax),%edi
lea    0xcfe(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
cmpl   $0x0,-0x3c(%rbp)
je     140d <find_issexes+0x25d>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    13fd <find_issexes+0x24d>
mov    0x2c16(%rip),%rax
movslq (%rax),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    13bf <find_issexes+0x20f>
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x8(%rbp),%rdi
lea    0xbdf(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x60(%rbp),%rdi
mov    0x2bb3(%rip),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rdx
call   1070 <fgets@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     1476 <find_issexes+0x2c6>
mov    -0x60(%rbp),%rdi
lea    0xbcc(%rip),%rsi
mov    $0xe,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1471 <find_issexes+0x2c1>
jmp    1476 <find_issexes+0x2c6>
jmp    142a <find_issexes+0x27a>
movl   $0x0,-0x40(%rbp)
mov    -0x60(%rbp),%rdi
mov    0x2b60(%rip),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rdx
call   1070 <fgets@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     15ac <find_issexes+0x3fc>
mov    -0x60(%rbp),%rdi
lea    0xba9(%rip),%rsi
mov    $0x15,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    14c4 <find_issexes+0x314>
jmp    15ac <find_issexes+0x3fc>
mov    -0x60(%rbp),%rdi
lea    0xb9c(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    15a7 <find_issexes+0x3f7>
mov    -0x60(%rbp),%rdi
lea    0xbae(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
movsbl (%rax),%edi
call   10a0 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x61(%rbp)
jne    1536 <find_issexes+0x386>
mov    -0x50(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x61(%rbp)
mov    -0x61(%rbp),%al
test   $0x1,%al
jne    1546 <find_issexes+0x396>
jmp    1557 <find_issexes+0x3a7>
mov    -0x50(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x50(%rbp)
jmp    1502 <find_issexes+0x352>
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x50(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x54(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x54(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x40(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    147d <find_issexes+0x2cd>
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x3c(%rbp),%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_issexes>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,-0x38(%rbp)
mov    %rdi,%r12
mov    0x2e19(%rip),%r14
mov    (%r14),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xe16(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     14e2 <find_issexes+0x332>
mov    %rax,%r13
lea    0xe23(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%esi
mov    %rbx,%rdi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     14c1 <find_issexes+0x311>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xe,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    1210 <find_issexes+0x60>
mov    %r12,-0x30(%rbp)
mov    (%r14),%esi
mov    %rbx,%rdi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     12b5 <find_issexes+0x105>
xor    %eax,%eax
mov    %rax,-0x40(%rbp)
lea    0xdf6(%rip),%r15
lea    0xe05(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x15,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     12ca <find_issexes+0x11a>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x1,%eax
mov    -0x40(%rbp),%rax
adc    $0x0,%eax
mov    %rax,-0x40(%rbp)
mov    (%r14),%esi
mov    %rbx,%rdi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
jne    1270 <find_issexes+0xc0>
mov    0x2d1c(%rip),%rax
mov    (%rax),%edi
lea    0xdae(%rip),%rsi
jmp    14d1 <find_issexes+0x321>
mov    %rbx,-0x48(%rbp)
mov    -0x40(%rbp),%rbx
test   %ebx,%ebx
je     1326 <find_issexes+0x176>
lea    0x8(,%rbx,8),%edi
call   1090 <malloc@plt>
mov    %rax,%r15
mov    -0x38(%rbp),%rax
mov    %r15,(%rax)
mov    (%r14),%r12d
mov    %ebx,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12d,%edi
call   1090 <malloc@plt>
mov    %rax,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1300 <find_issexes+0x150>
movq   $0x0,(%r15,%r14,8)
mov    0x2cc4(%rip),%r14
jmp    1329 <find_issexes+0x179>
xor    %r15d,%r15d
mov    %r15,-0x38(%rbp)
mov    %r13,%rdi
call   1060 <fclose@plt>
lea    0xcc4(%rip),%rsi
mov    -0x30(%rbp),%rdi
call   10b0 <fopen@plt>
mov    %rax,%r12
lea    0xcd6(%rip),%r13
mov    -0x48(%rbp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14),%esi
mov    %rbx,%rdi
mov    %r12,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1387 <find_issexes+0x1d7>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0xe,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    1360 <find_issexes+0x1b0>
mov    (%r14),%esi
mov    %rbx,%rdi
mov    %r12,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     14a6 <find_issexes+0x2f6>
xor    %eax,%eax
mov    %rax,-0x30(%rbp)
lea    0xcaa(%rip),%r13
movabs $0x100000000,%r15
mov    %r12,-0x50(%rbp)
jmp    13d7 <find_issexes+0x227>
nopl   0x0(%rax,%rax,1)
mov    (%r14),%esi
mov    %rbx,%rdi
mov    %r12,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     14a6 <find_issexes+0x2f6>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0x15,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     14a6 <find_issexes+0x2f6>
mov    %rbx,%rdi
lea    0xc72(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    13c0 <find_issexes+0x210>
mov    %rbx,%rdi
lea    0xc8a(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,%r13
xor    %r14d,%r14d
xor    %r12d,%r12d
jmp    1437 <find_issexes+0x287>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %r15,%r12
add    $0xffffffffffffffff,%r14
movsbl -0x1(%r13,%r14,1),%edi
call   10a0 <isalpha@plt>
test   %rax,%rax
jne    1430 <find_issexes+0x280>
movsbl -0x1(%r13,%r14,1),%edi
call   1050 <isdigit@plt>
test   %rax,%rax
jne    1430 <find_issexes+0x280>
mov    %r14d,%edx
neg    %edx
movslq -0x30(%rbp),%rbx
mov    -0x38(%rbp),%rax
mov    (%rax,%rbx,8),%rdi
add    %r14,%r13
mov    %r13,%rsi
call   1030 <strncpy@plt>
lea    0x1(%rbx),%eax
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax,%rbx,8),%rax
mov    0x2b5f(%rip),%r14
sar    $0x20,%r12
movb   $0x0,(%rax,%r12,1)
mov    -0x48(%rbp),%rbx
mov    -0x50(%rbp),%r12
lea    0xbb4(%rip),%r13
jmp    13c0 <find_issexes+0x210>
mov    %r12,%rdi
call   1060 <fclose@plt>
mov    -0x40(%rbp),%rax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b10(%rip),%rax
mov    (%rax),%edi
lea    0xb63(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
mov    0x2aef(%rip),%rax
mov    (%rax),%edi
lea    0xb11(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>

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

LLVM IR (-O2):
@MAXPATHLEN = global i32 0
@.str = [3 x i8] c"rb\00"
@stderr = global i32 0
@.str.1 = [34 x i8] c"Error: Cannot open ISS file [%s]\0A\00"
@.str.2 = [15 x i8] c"; Applications\00"
@.str.3 = [33 x i8] c"Missing \22; Applications\22 marker\0A\00"
@.str.4 = [22 x i8] c"; End of Applications\00"
@.str.5 = [8 x i8] c"Source:\00"
@.str.6 = [40 x i8] c"Missing \22; End of Applications\22 marker\0A\00"
@.str.7 = [5 x i8] c".exe\00"
define i32 @find_issexes(i8* %0, i8*** nocapture writeonly %1) {
%3 = load i32, i32* @MAXPATHLEN
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%11 = tail call i32 @exit(i32 -1)
unreachable
12: ; preds = %2, %16
%13 = load i32, i32* @MAXPATHLEN
%14 = call i8* @fgets(i8* %5, i32 %13, i32* %6)
%15 = icmp eq i8* %14, null
br i1 %15, label %23, label %16
16: ; preds = %12
%17 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 14)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %12
19: ; preds = %16
%20 = load i32, i32* @MAXPATHLEN
%21 = call i8* @fgets(i8* %5, i32 %20, i32* %6)
%22 = icmp eq i8* %21, null
br i1 %22, label %39, label %27
23: ; preds = %12
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 @exit(i32 -1)
unreachable
27: ; preds = %19, %31
%28 = phi i32 [ %35, %31 ], [ 0, %19 ]
%29 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 21)
%30 = icmp eq i32 %29, 0
br i1 %30, label %43, label %31
31: ; preds = %27
%32 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 7)
%33 = icmp eq i32 %32, 0
%34 = zext i1 %33 to i32
%35 = add nuw nsw i32 %28, %34
%36 = load i32, i32* @MAXPATHLEN
%37 = call i8* @fgets(i8* %5, i32 %36, i32* %6)
%38 = icmp eq i8* %37, null
br i1 %38, label %39, label %27
39: ; preds = %31, %19
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
%42 = call i32 @exit(i32 -1)
unreachable
43: ; preds = %27
%44 = icmp eq i32 %28, 0
br i1 %44, label %61, label %45
45: ; preds = %43
%46 = shl i32 %28, 3
%47 = add i32 %46, 8
%48 = call i8* @malloc(i32 %47)
%49 = bitcast i8* %48 to i8**
%50 = bitcast i8*** %1 to i8**
store i8* %48, i8** %50
%51 = load i32, i32* @MAXPATHLEN
%52 = zext i32 %28 to i64
br label %53
53: ; preds = %45, %53
%54 = phi i64 [ 0, %45 ], [ %57, %53 ]
%55 = call i8* @malloc(i32 %51)
%56 = getelementptr inbounds i8*, i8** %49, i64 %54
store i8* %55, i8** %56
%57 = add nuw nsw i64 %54, 1
%58 = icmp eq i64 %57, %52
br i1 %58, label %59, label %53
59: ; preds = %53
%60 = getelementptr inbounds i8*, i8** %49, i64 %52
store i8* null, i8** %60
br label %61
61: ; preds = %59, %43
%62 = phi i8** [ %49, %59 ], [ null, %43 ]
%63 = call i32 @fclose(i32* %6)
%64 = call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %65
65: ; preds = %69, %61
%66 = load i32, i32* @MAXPATHLEN
%67 = call i8* @fgets(i8* %5, i32 %66, i32* %64)
%68 = icmp eq i8* %67, null
br i1 %68, label %72, label %69
69: ; preds = %65
%70 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 14)
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %65
72: ; preds = %69, %65
%73 = load i32, i32* @MAXPATHLEN
%74 = call i8* @fgets(i8* %5, i32 %73, i32* %64)
%75 = icmp eq i8* %74, null
br i1 %75, label %115, label %76
76: ; preds = %72, %110
%77 = phi i32 [ %111, %110 ], [ 0, %72 ]
%78 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 21)
%79 = icmp eq i32 %78, 0
br i1 %79, label %115, label %80
80: ; preds = %76
%81 = call i32 @strncmp(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 7)
%82 = icmp eq i32 %81, 0
br i1 %82, label %83, label %110
83: ; preds = %80
%84 = call i8* @strstr(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %85
85: ; preds = %91, %83
%86 = phi i8* [ %84, %83 ], [ %87, %91 ]
%87 = getelementptr inbounds i8, i8* %86, i64 -1
%88 = load i8, i8* %87
%89 = call i64 @isalpha(i8 signext %88)
%90 = icmp eq i64 %89, 0
br i1 %90, label %92, label %91
91: ; preds = %85, %92
br label %85
92: ; preds = %85
%93 = load i8, i8* %87
%94 = call i64 @isdigit(i8 signext %93)
%95 = icmp eq i64 %94, 0
br i1 %95, label %96, label %91
96: ; preds = %92
%97 = ptrtoint i8* %84 to i64
%98 = ptrtoint i8* %86 to i64
%99 = sub i64 %97, %98
%100 = trunc i64 %99 to i32
%101 = sext i32 %77 to i64
%102 = getelementptr inbounds i8*, i8** %62, i64 %101
%103 = load i8*, i8** %102
%104 = call i32 @strncpy(i8* %103, i8* %86, i32 %100)
%105 = add nsw i32 %77, 1
%106 = load i8*, i8** %102
%107 = shl i64 %99, 32
%108 = ashr exact i64 %107, 32
%109 = getelementptr inbounds i8, i8* %106, i64 %108
store i8 0, i8* %109
br label %110
110: ; preds = %96, %80
%111 = phi i32 [ %77, %80 ], [ %105, %96 ]
%112 = load i32, i32* @MAXPATHLEN
%113 = call i8* @fgets(i8* %5, i32 %112, i32* %64)
%114 = icmp eq i8* %113, null
br i1 %114, label %115, label %76
115: ; preds = %110, %76, %72
%116 = call i32 @fclose(i32* %64)
ret i32 %28
}