#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_CUR;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int get32bit(char *);
scalar_t__ memcmp(char *, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
char *strrchr(char *, char);
int main(int argc, char **argv) {
  FILE *infile, *outfile;
  char buf[1025];
  int fsyssize, headpos, datapos;
  int fheadertab, fheader, fname, fname2, fdata;
  int fcount, fsize, fnum;
  int i;
  printf("gcfsysd 0.1\n\n");
  if (argc != 2) {
    printf("argument is .fsys to unpack\n");
    return 1;
  }
  if (!(infile = fopen(argv[1], "rb"))) {
    printf("error opening %s\n", argv[1]);
    return 1;
  }
  fread(buf, 1, 8, infile);
  if (memcmp(buf, "FSYS", 4)) {
    printf("file format not recognized\n");
    return 1;
  }
  fread(buf, 1, 8, infile);
  fcount = get32bit(buf + 4);
  fseek(infile, 8, SEEK_CUR);
  fread(buf, 1, 12, infile);
  headpos = get32bit(buf);
  datapos = get32bit(buf + 4);
  fsyssize = get32bit(buf + 8);
  printf("Header info:\n\tfile count:\t%d\n\theader start:\t%08x\n\tdata "
         "start:\t%08x\n\tfile size:\t%08x (%d)\n\n",
         fcount, headpos, datapos, fsyssize, fsyssize);
  fseek(infile, headpos, SEEK_SET);
  fread(buf, 1, 4, infile);
  fheadertab = get32bit(buf);
  for (fnum = 0; fnum < fcount; fnum++) {
    fseek(infile, fheadertab, SEEK_SET);
    fheadertab += 4;
    fread(buf, 1, 4, infile);
    fheader = get32bit(buf);
    fseek(infile, fheader + 4, SEEK_SET);
    fread(buf, 1, 0x20, infile);
    fdata = get32bit(buf);
    fsize = get32bit(buf + 0x10);
    fseek(infile, fheader + 0x1C, SEEK_SET);
    fread(buf, 1, 12, infile);
    if ((fname = get32bit(buf)) || (fname = get32bit(buf + 8))) {
      fseek(infile, fname, SEEK_SET);
      fread(buf, 1, 512, infile);
      printf("\tFile %02d info:\n\t\tname: "
             "\"%s\"\n\t\toffset:\t%08x\n\t\tsize:\t%08x (%d)\n\n",
             fnum, buf, fdata, fsize, fsize);
    }
    if (!fname || !strcmp(buf, "(null)")) {
      char *namebase, *tp, t;
      namebase = strrchr(argv[1], '\\');
      if (!namebase)
        namebase = argv[1];
      else
        namebase++;
      tp = strrchr(argv[1], '.');
      if (!tp)
        tp = argv[1] + strlen(argv[1]);
      t = tp[0];
      tp[0] = '\0';
      sprintf(buf, "%s.%03d", namebase, fnum);
      tp[0] = t;
      printf("\tFile %02d info:\n\t\tmade-up name: "
             "\"%s\"\n\t\toffset:\t%08x\n\t\tsize:\t%08x (%d)\n\n",
             fnum, buf, fdata, fsize, fsize);
    }
    if (!(outfile = fopen(buf, "wb"))) {
      printf("error opening %s\n", buf);
      return 1;
    }
    fseek(infile, fdata, SEEK_SET);
    for (i = 0; i < fsize; i++) {
      fread(buf, 1, 1, infile);
      fwrite(buf, 1, 1, outfile);
    }
    fclose(outfile);
  }
  fclose(infile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x480,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
je     120b <main+0x4b>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    177d <main+0x5bd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe11(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    124f <main+0x8f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    177d <main+0x5bd>
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x430(%rbp),%rdi
lea    0xdc9(%rip),%rsi
mov    $0x4,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%rax
je     12a5 <main+0xe5>
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    177d <main+0x5bd>
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x430(%rbp),%rdi
add    $0x4,%rdi
call   1040 <get32bit@plt>
mov    %eax,-0x454(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d08(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
call   10b0 <fseek@plt>
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0xc,%edx
call   1030 <fread@plt>
lea    -0x430(%rbp),%rdi
call   1040 <get32bit@plt>
mov    %eax,-0x438(%rbp)
lea    -0x430(%rbp),%rdi
add    $0x4,%rdi
call   1040 <get32bit@plt>
mov    %eax,-0x43c(%rbp)
lea    -0x430(%rbp),%rdi
add    $0x8,%rdi
call   1040 <get32bit@plt>
mov    %eax,-0x434(%rbp)
mov    -0x454(%rbp),%esi
mov    -0x438(%rbp),%edx
mov    -0x43c(%rbp),%ecx
mov    -0x434(%rbp),%r8d
mov    -0x434(%rbp),%r9d
lea    0xcf6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x438(%rbp),%esi
mov    0x2c55(%rip),%rax
mov    (%rax),%edx
call   10b0 <fseek@plt>
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
lea    -0x430(%rbp),%rdi
call   1040 <get32bit@plt>
mov    %eax,-0x440(%rbp)
movl   $0x0,-0x45c(%rbp)
mov    -0x45c(%rbp),%eax
cmp    -0x454(%rbp),%eax
jge    176d <main+0x5ad>
mov    -0x18(%rbp),%rdi
mov    -0x440(%rbp),%esi
mov    0x2bf5(%rip),%rax
mov    (%rax),%edx
call   10b0 <fseek@plt>
mov    -0x440(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x440(%rbp)
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
lea    -0x430(%rbp),%rdi
call   1040 <get32bit@plt>
mov    %eax,-0x444(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x444(%rbp),%esi
add    $0x4,%esi
mov    0x2b9f(%rip),%rax
mov    (%rax),%edx
call   10b0 <fseek@plt>
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x20,%edx
call   1030 <fread@plt>
lea    -0x430(%rbp),%rdi
call   1040 <get32bit@plt>
mov    %eax,-0x450(%rbp)
lea    -0x430(%rbp),%rdi
add    $0x10,%rdi
call   1040 <get32bit@plt>
mov    %eax,-0x458(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x444(%rbp),%esi
add    $0x1c,%esi
mov    0x2b42(%rip),%rax
mov    (%rax),%edx
call   10b0 <fseek@plt>
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0xc,%edx
call   1030 <fread@plt>
lea    -0x430(%rbp),%rdi
call   1040 <get32bit@plt>
mov    %eax,-0x448(%rbp)
cmp    $0x0,%eax
jne    14f1 <main+0x331>
lea    -0x430(%rbp),%rdi
add    $0x8,%rdi
call   1040 <get32bit@plt>
mov    %eax,-0x448(%rbp)
cmp    $0x0,%eax
je     1552 <main+0x392>
mov    -0x18(%rbp),%rdi
mov    -0x448(%rbp),%esi
mov    0x2ad6(%rip),%rax
mov    (%rax),%edx
call   10b0 <fseek@plt>
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x200,%edx
call   1030 <fread@plt>
mov    -0x45c(%rbp),%esi
lea    -0x430(%rbp),%rdx
mov    -0x450(%rbp),%ecx
mov    -0x458(%rbp),%r8d
mov    -0x458(%rbp),%r9d
lea    0xb71(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
cmpl   $0x0,-0x448(%rbp)
je     157b <main+0x3bb>
lea    -0x430(%rbp),%rdi
lea    0xb90(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%eax
jne    1698 <main+0x4d8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x5c,%esi
call   1080 <strrchr@plt>
mov    %rax,-0x468(%rbp)
cmpq   $0x0,-0x468(%rbp)
jne    15b6 <main+0x3f6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x468(%rbp)
jmp    15c8 <main+0x408>
mov    -0x468(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x468(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x2e,%esi
call   1080 <strrchr@plt>
mov    %rax,-0x470(%rbp)
cmpq   $0x0,-0x470(%rbp)
jne    1621 <main+0x461>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x480(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x480(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x470(%rbp)
mov    -0x470(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x471(%rbp)
mov    -0x470(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x430(%rbp),%rdi
mov    -0x468(%rbp),%rdx
mov    -0x45c(%rbp),%ecx
lea    0xaaf(%rip),%rsi
call   10d0 <sprintf@plt>
mov    -0x471(%rbp),%cl
mov    -0x470(%rbp),%rax
mov    %cl,(%rax)
mov    -0x45c(%rbp),%esi
lea    -0x430(%rbp),%rdx
mov    -0x450(%rbp),%ecx
mov    -0x458(%rbp),%r8d
mov    -0x458(%rbp),%r9d
lea    0xa7b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x430(%rbp),%rdi
lea    0xaaf(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    16da <main+0x51a>
lea    -0x430(%rbp),%rsi
lea    0x967(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    177d <main+0x5bd>
mov    -0x18(%rbp),%rdi
mov    -0x450(%rbp),%esi
mov    0x28ed(%rip),%rax
mov    (%rax),%edx
call   10b0 <fseek@plt>
movl   $0x0,-0x460(%rbp)
mov    -0x460(%rbp),%eax
cmp    -0x458(%rbp),%eax
jge    1750 <main+0x590>
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
lea    -0x430(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   10e0 <fwrite@plt>
mov    -0x460(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x460(%rbp)
jmp    16fc <main+0x53c>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x45c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x45c(%rbp)
jmp    13c0 <main+0x200>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x480,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
mov    %rsi,%r15
mov    %edi,%ebx
lea    0xf34(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x2,%ebx
jne    1248 <main+0x88>
mov    0x8(%r15),%rdi
lea    0xe0e(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     125e <main+0x9e>
mov    %rax,%rbx
lea    0x20(%rsp),%r14
mov    $0x1,%ebp
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rax,%rcx
call   1040 <fread@plt>
lea    0xdf0(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   10b0 <memcmp@plt>
test   %rax,%rax
je     127a <main+0xba>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
jmp    1597 <main+0x3d7>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebp
jmp    1597 <main+0x3d7>
mov    0x8(%r15),%rsi
lea    0xd9a(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x1,%ebp
jmp    1597 <main+0x3d7>
mov    %r15,0x10(%rsp)
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
lea    0x24(%rsp),%r14
mov    %r14,%rdi
call   1050 <get32bit@plt>
mov    %eax,%r12d
mov    0x2d38(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x8,%esi
call   10c0 <fseek@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0xc,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %r15,%rdi
call   1050 <get32bit@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1050 <get32bit@plt>
mov    %eax,%r14d
lea    0x28(%rsp),%rdi
call   1050 <get32bit@plt>
lea    0xd20(%rip),%rdi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %eax,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2cc2(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   10c0 <fseek@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %r15,%rdi
call   1050 <get32bit@plt>
mov    %r12d,0x8(%rsp)
test   %r12d,%r12d
jle    158d <main+0x3cd>
mov    %eax,%ebp
lea    0x20(%rsp),%r12
xor    %r15d,%r15d
jmp    137e <main+0x1be>
nopl   0x0(%rax)
mov    0xc(%rsp),%ebp
add    $0x4,%ebp
mov    %r13,%rdi
call   1060 <fclose@plt>
add    $0x1,%r15d
cmp    0x8(%rsp),%r15d
je     158d <main+0x3cd>
mov    0x2c53(%rip),%r13
mov    0x0(%r13),%edx
mov    %rbx,%rdi
mov    %ebp,0xc(%rsp)
mov    %ebp,%esi
call   10c0 <fseek@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %r12,%rdi
call   1050 <get32bit@plt>
mov    %eax,%ebp
lea    0x4(%rbp),%esi
mov    0x0(%r13),%edx
mov    %rbx,%rdi
call   10c0 <fseek@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x20,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %r12,%rdi
call   1050 <get32bit@plt>
mov    %eax,%r13d
lea    0x30(%rsp),%rdi
call   1050 <get32bit@plt>
mov    %eax,%r14d
add    $0x1c,%ebp
mov    0x2bdc(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r13d,%ebp
call   10c0 <fseek@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0xc,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %r12,%rdi
call   1050 <get32bit@plt>
test   %eax,%eax
jne    143a <main+0x27a>
lea    0x28(%rsp),%rdi
call   1050 <get32bit@plt>
test   %eax,%eax
je     149a <main+0x2da>
mov    0x2b97(%rip),%rcx
mov    (%rcx),%edx
mov    %rbx,%rdi
mov    %eax,%esi
call   10c0 <fseek@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x200,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
lea    0xc0c(%rip),%rdi
mov    %r15d,%esi
mov    %r12,%rdx
mov    %ebp,%ecx
mov    %r14d,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x7,%edx
mov    %r12,%rdi
lea    0xc29(%rip),%rsi
call   10b0 <memcmp@plt>
test   %eax,%eax
jne    152b <main+0x36b>
mov    %ebp,0x4(%rsp)
mov    0x10(%rsp),%rax
mov    0x8(%rax),%rbp
mov    %rbp,%rdi
mov    $0x5c,%esi
call   1090 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbp,%rcx
mov    %rcx,0x18(%rsp)
mov    %rbp,%rdi
mov    $0x2e,%esi
call   1090 <strrchr@plt>
mov    %rax,%r13
test   %rax,%rax
jne    14e7 <main+0x327>
mov    %rbp,%rdi
call   1070 <strlen@plt>
movslq %eax,%r13
add    %rbp,%r13
mov    0x0(%r13),%bpl
movb   $0x0,0x0(%r13)
mov    %r12,%rdi
lea    0xbc3(%rip),%rsi
mov    0x18(%rsp),%rdx
mov    %r15d,%ecx
call   10e0 <sprintf@plt>
mov    %bpl,0x0(%r13)
lea    0xbb3(%rip),%rdi
mov    %r15d,%esi
mov    %r12,%rdx
mov    0x4(%rsp),%ebp
mov    %ebp,%ecx
mov    %r14d,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r12,%rdi
lea    0xbd9(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     15ab <main+0x3eb>
mov    %rax,%r13
mov    0x2a8f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   10c0 <fseek@plt>
test   %r14d,%r14d
jle    1360 <main+0x1a0>
xchg   %ax,%ax
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
movsbl 0x20(%rsp),%edi
mov    %r13,%rsi
call   10a0 <fputc@plt>
add    $0xffffffff,%r14d
jne    1560 <main+0x3a0>
jmp    1360 <main+0x1a0>
mov    %rbx,%rdi
call   1060 <fclose@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa51(%rip),%rdi
lea    0x20(%rsp),%rsi
jmp    1269 <main+0xa9>

LLVM IR (-O0):
@.str = [14 x i8] c"gcfsysd 0.1\0A\0A\00"
@.str.1 = [29 x i8] c"argument is .fsys to unpack\0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [18 x i8] c"error opening %s\0A\00"
@.str.4 = [5 x i8] c"FSYS\00"
@.str.5 = [28 x i8] c"file format not recognized\0A\00"
@SEEK_CUR = global i32 0
@.str.6 = [91 x i8] c"Header info:\0A\09file count:\09%d\0A\09header start:\09%08x\0A\09data start:\09%08x\0A\09file size:\09%08x (%d)\0A\0A\00"
@SEEK_SET = global i32 0
@.str.7 = [65 x i8] c"\09File %02d info:\0A\09\09name: \22%s\22\0A\09\09offset:\09%08x\0A\09\09size:\09%08x (%d)\0A\0A\00"
@.str.8 = [7 x i8] c"(null)\00"
@.str.9 = [8 x i8] c"%s.%03d\00"
@.str.10 = [73 x i8] c"\09File %02d info:\0A\09\09made-up name: \22%s\22\0A\09\09offset:\09%08x\0A\09\09size:\09%08x (%d)\0A\0A\00"
@.str.11 = [3 x i8] c"wb\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 [1025 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%25 = load i32, i32* %4
%26 = icmp ne i32 %25, 2
br i1 %26, label %27, label %29
27: ; preds = %2
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %236
29: ; preds = %2
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32* @fopen(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %33, i32** %6
%34 = icmp ne i32* %33, null
br i1 %34, label %40, label %35
35: ; preds = %29
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %38)
store i32 1, i32* %3
br label %236
40: ; preds = %29
%41 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%42 = load i32*, i32** %6
%43 = call i32 @fread(i8* %41, i32 1, i32 8, i32* %42)
%44 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%45 = call i64 @memcmp(i8* %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %40
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %236
49: ; preds = %40
%50 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%51 = load i32*, i32** %6
%52 = call i32 @fread(i8* %50, i32 1, i32 8, i32* %51)
%53 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%54 = getelementptr inbounds i8, i8* %53, i64 4
%55 = call i32 @get32bit(i8* %54)
store i32 %55, i32* %17
%56 = load i32*, i32** %6
%57 = load i32, i32* @SEEK_CUR
%58 = call i32 @fseek(i32* %56, i32 8, i32 %57)
%59 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%60 = load i32*, i32** %6
%61 = call i32 @fread(i8* %59, i32 1, i32 12, i32* %60)
%62 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%63 = call i32 @get32bit(i8* %62)
store i32 %63, i32* %10
%64 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%65 = getelementptr inbounds i8, i8* %64, i64 4
%66 = call i32 @get32bit(i8* %65)
store i32 %66, i32* %11
%67 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%68 = getelementptr inbounds i8, i8* %67, i64 8
%69 = call i32 @get32bit(i8* %68)
store i32 %69, i32* %9
%70 = load i32, i32* %17
%71 = load i32, i32* %10
%72 = load i32, i32* %11
%73 = load i32, i32* %9
%74 = load i32, i32* %9
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.6, i64 0, i64 0), i32 %70, i32 %71, i32 %72, i32 %73, i32 %74)
%76 = load i32*, i32** %6
%77 = load i32, i32* %10
%78 = load i32, i32* @SEEK_SET
%79 = call i32 @fseek(i32* %76, i32 %77, i32 %78)
%80 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%81 = load i32*, i32** %6
%82 = call i32 @fread(i8* %80, i32 1, i32 4, i32* %81)
%83 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%84 = call i32 @get32bit(i8* %83)
store i32 %84, i32* %12
store i32 0, i32* %19
br label %85
85: ; preds = %230, %49
%86 = load i32, i32* %19
%87 = load i32, i32* %17
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %233
89: ; preds = %85
%90 = load i32*, i32** %6
%91 = load i32, i32* %12
%92 = load i32, i32* @SEEK_SET
%93 = call i32 @fseek(i32* %90, i32 %91, i32 %92)
%94 = load i32, i32* %12
%95 = add nsw i32 %94, 4
store i32 %95, i32* %12
%96 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%97 = load i32*, i32** %6
%98 = call i32 @fread(i8* %96, i32 1, i32 4, i32* %97)
%99 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%100 = call i32 @get32bit(i8* %99)
store i32 %100, i32* %13
%101 = load i32*, i32** %6
%102 = load i32, i32* %13
%103 = add nsw i32 %102, 4
%104 = load i32, i32* @SEEK_SET
%105 = call i32 @fseek(i32* %101, i32 %103, i32 %104)
%106 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%107 = load i32*, i32** %6
%108 = call i32 @fread(i8* %106, i32 1, i32 32, i32* %107)
%109 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%110 = call i32 @get32bit(i8* %109)
store i32 %110, i32* %16
%111 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%112 = getelementptr inbounds i8, i8* %111, i64 16
%113 = call i32 @get32bit(i8* %112)
store i32 %113, i32* %18
%114 = load i32*, i32** %6
%115 = load i32, i32* %13
%116 = add nsw i32 %115, 28
%117 = load i32, i32* @SEEK_SET
%118 = call i32 @fseek(i32* %114, i32 %116, i32 %117)
%119 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%120 = load i32*, i32** %6
%121 = call i32 @fread(i8* %119, i32 1, i32 12, i32* %120)
%122 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%123 = call i32 @get32bit(i8* %122)
store i32 %123, i32* %14
%124 = icmp ne i32 %123, 0
br i1 %124, label %130, label %125
125: ; preds = %89
%126 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%127 = getelementptr inbounds i8, i8* %126, i64 8
%128 = call i32 @get32bit(i8* %127)
store i32 %128, i32* %14
%129 = icmp ne i32 %128, 0
br i1 %129, label %130, label %144
130: ; preds = %125, %89
%131 = load i32*, i32** %6
%132 = load i32, i32* %14
%133 = load i32, i32* @SEEK_SET
%134 = call i32 @fseek(i32* %131, i32 %132, i32 %133)
%135 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%136 = load i32*, i32** %6
%137 = call i32 @fread(i8* %135, i32 1, i32 512, i32* %136)
%138 = load i32, i32* %19
%139 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%140 = load i32, i32* %16
%141 = load i32, i32* %18
%142 = load i32, i32* %18
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.7, i64 0, i64 0), i32 %138, i8* %139, i32 %140, i32 %141, i32 %142)
br label %144
144: ; preds = %130, %125
%145 = load i32, i32* %14
%146 = icmp ne i32 %145, 0
br i1 %146, label %147, label %151
147: ; preds = %144
%148 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%149 = call i32 @strcmp(i8* %148, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%150 = icmp ne i32 %149, 0
br i1 %150, label %201, label %151
151: ; preds = %147, %144
%152 = load i8**, i8*** %5
%153 = getelementptr inbounds i8*, i8** %152, i64 1
%154 = load i8*, i8** %153
%155 = call i8* @strrchr(i8* %154, i8 signext 92)
store i8* %155, i8** %21
%156 = load i8*, i8** %21
%157 = icmp ne i8* %156, null
br i1 %157, label %162, label %158
158: ; preds = %151
%159 = load i8**, i8*** %5
%160 = getelementptr inbounds i8*, i8** %159, i64 1
%161 = load i8*, i8** %160
store i8* %161, i8** %21
br label %165
162: ; preds = %151
%163 = load i8*, i8** %21
%164 = getelementptr inbounds i8, i8* %163, i32 1
store i8* %164, i8** %21
br label %165
165: ; preds = %162, %158
%166 = load i8**, i8*** %5
%167 = getelementptr inbounds i8*, i8** %166, i64 1
%168 = load i8*, i8** %167
%169 = call i8* @strrchr(i8* %168, i8 signext 46)
store i8* %169, i8** %22
%170 = load i8*, i8** %22
%171 = icmp ne i8* %170, null
br i1 %171, label %182, label %172
172: ; preds = %165
%173 = load i8**, i8*** %5
%174 = getelementptr inbounds i8*, i8** %173, i64 1
%175 = load i8*, i8** %174
%176 = load i8**, i8*** %5
%177 = getelementptr inbounds i8*, i8** %176, i64 1
%178 = load i8*, i8** %177
%179 = call i32 @strlen(i8* %178)
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds i8, i8* %175, i64 %180
store i8* %181, i8** %22
br label %182
182: ; preds = %172, %165
%183 = load i8*, i8** %22
%184 = getelementptr inbounds i8, i8* %183, i64 0
%185 = load i8, i8* %184
store i8 %185, i8* %23
%186 = load i8*, i8** %22
%187 = getelementptr inbounds i8, i8* %186, i64 0
store i8 0, i8* %187
%188 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%189 = load i8*, i8** %21
%190 = load i32, i32* %19
%191 = call i32 @sprintf(i8* %188, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8* %189, i32 %190)
%192 = load i8, i8* %23
%193 = load i8*, i8** %22
%194 = getelementptr inbounds i8, i8* %193, i64 0
store i8 %192, i8* %194
%195 = load i32, i32* %19
%196 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%197 = load i32, i32* %16
%198 = load i32, i32* %18
%199 = load i32, i32* %18
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.10, i64 0, i64 0), i32 %195, i8* %196, i32 %197, i32 %198, i32 %199)
br label %201
201: ; preds = %182, %147
%202 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%203 = call i32* @fopen(i8* %202, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
store i32* %203, i32** %7
%204 = icmp ne i32* %203, null
br i1 %204, label %208, label %205
205: ; preds = %201
%206 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%207 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %206)
store i32 1, i32* %3
br label %236
208: ; preds = %201
%209 = load i32*, i32** %6
%210 = load i32, i32* %16
%211 = load i32, i32* @SEEK_SET
%212 = call i32 @fseek(i32* %209, i32 %210, i32 %211)
store i32 0, i32* %20
br label %213
213: ; preds = %224, %208
%214 = load i32, i32* %20
%215 = load i32, i32* %18
%216 = icmp slt i32 %214, %215
br i1 %216, label %217, label %227
217: ; preds = %213
%218 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%219 = load i32*, i32** %6
%220 = call i32 @fread(i8* %218, i32 1, i32 1, i32* %219)
%221 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%222 = load i32*, i32** %7
%223 = call i32 @fwrite(i8* %221, i32 1, i32 1, i32* %222)
br label %224
224: ; preds = %217
%225 = load i32, i32* %20
%226 = add nsw i32 %225, 1
store i32 %226, i32* %20
br label %213
227: ; preds = %213
%228 = load i32*, i32** %7
%229 = call i32 @fclose(i32* %228)
br label %230
230: ; preds = %227
%231 = load i32, i32* %19
%232 = add nsw i32 %231, 1
store i32 %232, i32* %19
br label %85
233: ; preds = %85
%234 = load i32*, i32** %6
%235 = call i32 @fclose(i32* %234)
store i32 0, i32* %3
br label %236
236: ; preds = %233, %205, %47, %35, %27
%237 = load i32, i32* %3
ret i32 %237
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [18 x i8] c"error opening %s\0A\00"
@.str.4 = [5 x i8] c"FSYS\00"
@SEEK_CUR = global i32 0
@.str.6 = [91 x i8] c"Header info:\0A\09file count:\09%d\0A\09header start:\09%08x\0A\09data start:\09%08x\0A\09file size:\09%08x (%d)\0A\0A\00"
@SEEK_SET = global i32 0
@.str.7 = [65 x i8] c"\09File %02d info:\0A\09\09name: \22%s\22\0A\09\09offset:\09%08x\0A\09\09size:\09%08x (%d)\0A\0A\00"
@.str.8 = [7 x i8] c"(null)\00"
@.str.9 = [8 x i8] c"%s.%03d\00"
@.str.10 = [73 x i8] c"\09File %02d info:\0A\09\09made-up name: \22%s\22\0A\09\09offset:\09%08x\0A\09\09size:\09%08x (%d)\0A\0A\00"
@.str.11 = [3 x i8] c"wb\00"
@str = [13 x i8] c"gcfsysd 0.1\0A\00"
@str.12 = [27 x i8] c"file format not recognized\00"
@str.13 = [28 x i8] c"argument is .fsys to unpack\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1025 x i8]
%4 = getelementptr inbounds [1025 x i8], [1025 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = icmp eq i32 %0, 2
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.13, i64 0, i64 0))
br label %113
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32* @fopen(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i8*, i8** %10
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %15)
br label %113
17: ; preds = %9
%18 = call i32 @fread(i8* %4, i32 1, i32 8, i32* %12)
%19 = call i64 @memcmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%20 = icmp eq i64 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %17
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.12, i64 0, i64 0))
br label %113
23: ; preds = %17
%24 = call i32 @fread(i8* %4, i32 1, i32 8, i32* %12)
%25 = getelementptr inbounds [1025 x i8], [1025 x i8]* %3, i64 0, i64 4
%26 = call i32 @get32bit(i8* %25)
%27 = load i32, i32* @SEEK_CUR
%28 = call i32 @fseek(i32* %12, i32 8, i32 %27)
%29 = call i32 @fread(i8* %4, i32 1, i32 12, i32* %12)
%30 = call i32 @get32bit(i8* %4)
%31 = call i32 @get32bit(i8* %25)
%32 = getelementptr inbounds [1025 x i8], [1025 x i8]* %3, i64 0, i64 8
%33 = call i32 @get32bit(i8* %32)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @.str.6, i64 0, i64 0), i32 %26, i32 %30, i32 %31, i32 %33, i32 %33)
%35 = load i32, i32* @SEEK_SET
%36 = call i32 @fseek(i32* %12, i32 %30, i32 %35)
%37 = call i32 @fread(i8* %4, i32 1, i32 4, i32* %12)
%38 = call i32 @get32bit(i8* %4)
%39 = icmp sgt i32 %26, 0
br i1 %39, label %40, label %111
40: ; preds = %23
%41 = getelementptr inbounds [1025 x i8], [1025 x i8]* %3, i64 0, i64 16
br label %42
42: ; preds = %40, %107
%43 = phi i32 [ 0, %40 ], [ %109, %107 ]
%44 = phi i32 [ %38, %40 ], [ %47, %107 ]
%45 = load i32, i32* @SEEK_SET
%46 = call i32 @fseek(i32* %12, i32 %44, i32 %45)
%47 = add nsw i32 %44, 4
%48 = call i32 @fread(i8* %4, i32 1, i32 4, i32* %12)
%49 = call i32 @get32bit(i8* %4)
%50 = add nsw i32 %49, 4
%51 = load i32, i32* @SEEK_SET
%52 = call i32 @fseek(i32* %12, i32 %50, i32 %51)
%53 = call i32 @fread(i8* %4, i32 1, i32 32, i32* %12)
%54 = call i32 @get32bit(i8* %4)
%55 = call i32 @get32bit(i8* %41)
%56 = add nsw i32 %49, 28
%57 = load i32, i32* @SEEK_SET
%58 = call i32 @fseek(i32* %12, i32 %56, i32 %57)
%59 = call i32 @fread(i8* %4, i32 1, i32 12, i32* %12)
%60 = call i32 @get32bit(i8* %4)
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %42
%63 = call i32 @get32bit(i8* %32)
%64 = icmp eq i32 %63, 0
br i1 %64, label %73, label %65
65: ; preds = %62, %42
%66 = phi i32 [ %60, %42 ], [ %63, %62 ]
%67 = load i32, i32* @SEEK_SET
%68 = call i32 @fseek(i32* %12, i32 %66, i32 %67)
%69 = call i32 @fread(i8* %4, i32 1, i32 512, i32* %12)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.7, i64 0, i64 0), i32 %43, i8* %4, i32 %54, i32 %55, i32 %55)
%71 = call i32 bitcast (i64 (i8*, i8*, i32)* @memcmp to i32 (i8*, i8*, i64)*)(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i64 7)
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %90
73: ; preds = %62, %65
%74 = load i8*, i8** %10
%75 = call i8* @strrchr(i8* dereferenceable(1) %74, i8 signext 92)
%76 = icmp eq i8* %75, null
%77 = getelementptr inbounds i8, i8* %75, i64 1
%78 = select i1 %76, i8* %74, i8* %77
%79 = call i8* @strrchr(i8* dereferenceable(1) %74, i8 signext 46)
%80 = icmp eq i8* %79, null
br i1 %80, label %81, label %85
81: ; preds = %73
%82 = call i32 @strlen(i8* %74)
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8, i8* %74, i64 %83
br label %85
85: ; preds = %81, %73
%86 = phi i8* [ %79, %73 ], [ %84, %81 ]
%87 = load i8, i8* %86
store i8 0, i8* %86
%88 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8* %78, i32 %43)
store i8 %87, i8* %86
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.10, i64 0, i64 0), i32 %43, i8* %4, i32 %54, i32 %55, i32 %55)
br label %90
90: ; preds = %85, %65
%91 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%92 = icmp eq i32* %91, null
br i1 %92, label %93, label %95
93: ; preds = %90
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %4)
br label %113
95: ; preds = %90
%96 = load i32, i32* @SEEK_SET
%97 = call i32 @fseek(i32* %12, i32 %54, i32 %96)
%98 = icmp sgt i32 %55, 0
br i1 %98, label %99, label %107
99: ; preds = %95, %99
%100 = phi i32 [ %105, %99 ], [ 0, %95 ]
%101 = call i32 @fread(i8* %4, i32 1, i32 1, i32* %12)
%102 = load i8, i8* %4
%103 = sext i8 %102 to i32
%104 = call i32 @fputc(i32 %103, i32* %91)
%105 = add nuw nsw i32 %100, 1
%106 = icmp eq i32 %105, %55
br i1 %106, label %107, label %99
107: ; preds = %99, %95
%108 = call i32 @fclose(i32* %91)
%109 = add nuw nsw i32 %43, 1
%110 = icmp eq i32 %109, %26
br i1 %110, label %111, label %42
111: ; preds = %107, %23
%112 = call i32 @fclose(i32* %12)
br label %113
113: ; preds = %111, %93, %21, %14, %7
%114 = phi i32 [ 1, %7 ], [ 1, %21 ], [ 1, %93 ], [ 0, %111 ], [ 1, %14 ]
ret i32 %114
}