#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 S_IROTH;
int S_IRWXG;
int S_IRWXU;
int S_IXOTH;
char const *concat(int, char const *, char *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
scalar_t__ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
scalar_t__ isEmpty(char *, int);
scalar_t__ isEqual(char *, char *);
int /*<<< orphan*/ logOutFile(char *, ...);
int /*<<< orphan*/ mkpath(char const *, int);
int strtol(char *, int /*<<< orphan*/ *, int);
void extract(const char *file, const char *output) {
  char buffer[512];
  char outbuffer[512];
  char name[512];
  char mode[8];
  char uid[8];
  char gid[8];
  char size[12];
  char mtime[12];
  char chksum[8];
  char typeflag[1];
  char linkname[100];
  char magic[6];
  char version[2];
  char uname[32];
  char gname[32];
  char devmajor[8];
  char devminor[8];
  char prefix[155];
  char devnull[12];
  FILE *in;
  in = fopen(file, "r");
  int bufferCount;
  int fileSize;
  int done = false;
  char old[100];
  FILE *out;
  while (fread(name, 1, 100, in) != 0 && !done) {
    fread(mode, 1, 8, in);
    fread(uid, 1, 8, in);
    fread(gid, 1, 8, in);
    fread(size, 1, 12, in);
    fread(mtime, 1, 12, in);
    fread(chksum, 1, 8, in);
    fread(typeflag, 1, 1, in);
    fread(linkname, 1, 100, in);
    fread(magic, 1, 6, in);
    fread(version, 1, 2, in);
    fread(uname, 1, 32, in);
    fread(gname, 1, 32, in);
    fread(devmajor, 1, 8, in);
    fread(devminor, 1, 8, in);
    fread(prefix, 1, 155, in);
    fread(devnull, 1, 12, in);
    bool isEOL = false;
    if (isEmpty(name, 100)) {
      logOutFile("Name flag is all 0's, possibly EOL\n");
      isEOL = true;
    } else if (isEqual(name, "././@LongLink")) {
      logOutFile("Detected a long file name, adjusting\n");
      fread(name, 1, 512, in);
      fread(old, 1, 100, in);
      fread(mode, 1, 8, in);
      fread(uid, 1, 8, in);
      fread(gid, 1, 8, in);
      fread(size, 1, 12, in);
      fread(mtime, 1, 12, in);
      fread(chksum, 1, 8, in);
      fread(typeflag, 1, 1, in);
      fread(linkname, 1, 100, in);
      fread(magic, 1, 6, in);
      fread(version, 1, 2, in);
      fread(uname, 1, 32, in);
      fread(gname, 1, 32, in);
      fread(devmajor, 1, 8, in);
      fread(devminor, 1, 8, in);
      fread(prefix, 1, 155, in);
      fread(devnull, 1, 12, in);
    }
    logOutFile("Extracting %s\n", name);
    fileSize = strtol(size, NULL, 8);
    bufferCount = fileSize > 0 ? ((fileSize - 1) / 512) + 1 : 0;
    if (isEOL && bufferCount <= 0) {
      fread(buffer, 1, 512, in);
      if (isEOL && isEmpty(buffer, 512)) {
        logOutFile("EOL reached\n");
        done = true;
      }
    }
    if (bufferCount == 0) {
      mkpath(concat(3, output, "/", name),
             S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
    } else {
      out = fopen(concat(3, output, "/", name), "w");
      while (bufferCount-- > 0) {
        fread(buffer, 1, 512, in);
        if (fileSize >= 512) {
          fwrite(buffer, 1, 512, out);
          fileSize -= 512;
        } else {
          fwrite(buffer, 1, fileSize, out);
          fileSize = 0;
        }
      }
      fclose(out);
    }
    logOutFile("--\n");
  }
  fclose(in);
}


x86 assembly (clang, -O0):
<extract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x860,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe42(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x7c8(%rbp)
movl   $0x0,-0x7d4(%rbp)
lea    -0x610(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x64,%edx
call   1030 <fread@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x84d(%rbp)
je     1218 <extract+0x78>
cmpl   $0x0,-0x7d4(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x84d(%rbp)
mov    -0x84d(%rbp),%al
test   $0x1,%al
jne    122b <extract+0x8b>
jmp    18b4 <extract+0x714>
lea    -0x618(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x620(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x628(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x634(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0xc,%edx
call   1030 <fread@plt>
lea    -0x640(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0xc,%edx
call   1030 <fread@plt>
lea    -0x648(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x649(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
lea    -0x6b0(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x64,%edx
call   1030 <fread@plt>
lea    -0x6b6(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x6,%edx
call   1030 <fread@plt>
lea    -0x6b8(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
lea    -0x6e0(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x20,%edx
call   1030 <fread@plt>
lea    -0x700(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x20,%edx
call   1030 <fread@plt>
lea    -0x708(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x710(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x7b0(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x9b,%edx
call   1030 <fread@plt>
lea    -0x7bc(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0xc,%edx
call   1030 <fread@plt>
movl   $0x0,-0x84c(%rbp)
lea    -0x610(%rbp),%rdi
mov    $0x64,%esi
call   1080 <isEmpty@plt>
cmp    $0x0,%rax
je     143a <extract+0x29a>
lea    0xbde(%rip),%rdi
mov    $0x0,%al
call   1060 <logOutFile@plt>
movl   $0x1,-0x84c(%rbp)
jmp    1671 <extract+0x4d1>
lea    -0x610(%rbp),%rdi
lea    0xbde(%rip),%rsi
call   10b0 <isEqual@plt>
cmp    $0x0,%rax
je     166c <extract+0x4cc>
lea    0xbd6(%rip),%rdi
mov    $0x0,%al
call   1060 <logOutFile@plt>
lea    -0x610(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x200,%edx
call   1030 <fread@plt>
lea    -0x840(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x64,%edx
call   1030 <fread@plt>
lea    -0x618(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x620(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x628(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x634(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0xc,%edx
call   1030 <fread@plt>
lea    -0x640(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0xc,%edx
call   1030 <fread@plt>
lea    -0x648(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x649(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
lea    -0x6b0(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x64,%edx
call   1030 <fread@plt>
lea    -0x6b6(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x6,%edx
call   1030 <fread@plt>
lea    -0x6b8(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
lea    -0x6e0(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x20,%edx
call   1030 <fread@plt>
lea    -0x700(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x20,%edx
call   1030 <fread@plt>
lea    -0x708(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x710(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
lea    -0x7b0(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x9b,%edx
call   1030 <fread@plt>
lea    -0x7bc(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0xc,%edx
call   1030 <fread@plt>
jmp    1671 <extract+0x4d1>
lea    -0x610(%rbp),%rsi
lea    0x9db(%rip),%rdi
mov    $0x0,%al
call   1060 <logOutFile@plt>
lea    -0x634(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x8,%edx
call   1070 <strtol@plt>
mov    %eax,-0x7d0(%rbp)
cmpl   $0x0,-0x7d0(%rbp)
jle    16cd <extract+0x52d>
mov    -0x7d0(%rbp),%eax
sub    $0x1,%eax
mov    $0x200,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x854(%rbp)
jmp    16da <extract+0x53a>
xor    %eax,%eax
mov    %eax,-0x854(%rbp)
jmp    16da <extract+0x53a>
mov    -0x854(%rbp),%eax
mov    %eax,-0x7cc(%rbp)
cmpl   $0x0,-0x84c(%rbp)
je     1762 <extract+0x5c2>
cmpl   $0x0,-0x7cc(%rbp)
jg     1762 <extract+0x5c2>
lea    -0x210(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x200,%edx
call   1030 <fread@plt>
cmpl   $0x0,-0x84c(%rbp)
je     175d <extract+0x5bd>
lea    -0x210(%rbp),%rdi
mov    $0x200,%esi
call   1080 <isEmpty@plt>
cmp    $0x0,%rax
je     175d <extract+0x5bd>
lea    0x91d(%rip),%rdi
mov    $0x0,%al
call   1060 <logOutFile@plt>
movl   $0x1,-0x7d4(%rbp)
jmp    1762 <extract+0x5c2>
cmpl   $0x0,-0x7cc(%rbp)
jne    17bc <extract+0x61c>
mov    -0x10(%rbp),%rsi
lea    -0x610(%rbp),%rcx
mov    $0x3,%edi
lea    0x8f0(%rip),%rdx
call   1050 <concat@plt>
mov    %rax,%rdi
mov    0x2853(%rip),%rax
mov    (%rax),%esi
mov    0x283a(%rip),%rax
or     (%rax),%esi
mov    0x2821(%rip),%rax
or     (%rax),%esi
mov    0x2830(%rip),%rax
or     (%rax),%esi
call   1090 <mkpath@plt>
jmp    18a1 <extract+0x701>
mov    -0x10(%rbp),%rsi
lea    -0x610(%rbp),%rcx
mov    $0x3,%edi
lea    0x8a3(%rip),%rdx
call   1050 <concat@plt>
mov    %rax,%rdi
lea    0x896(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x848(%rbp)
mov    -0x7cc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x7cc(%rbp)
cmp    $0x0,%eax
jle    1895 <extract+0x6f5>
lea    -0x210(%rbp),%rdi
mov    -0x7c8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x200,%edx
call   1030 <fread@plt>
cmpl   $0x200,-0x7d0(%rbp)
jl     1868 <extract+0x6c8>
lea    -0x210(%rbp),%rdi
mov    -0x848(%rbp),%rcx
mov    $0x1,%esi
mov    $0x200,%edx
call   10c0 <fwrite@plt>
mov    -0x7d0(%rbp),%eax
sub    $0x200,%eax
mov    %eax,-0x7d0(%rbp)
jmp    1890 <extract+0x6f0>
lea    -0x210(%rbp),%rdi
mov    -0x7d0(%rbp),%edx
mov    -0x848(%rbp),%rcx
mov    $0x1,%esi
call   10c0 <fwrite@plt>
movl   $0x0,-0x7d0(%rbp)
jmp    17ee <extract+0x64e>
mov    -0x848(%rbp),%rdi
call   1040 <fclose@plt>
lea    0x7d2(%rip),%rdi
mov    $0x0,%al
call   1060 <logOutFile@plt>
jmp    11d4 <extract+0x34>
mov    -0x7c8(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x860,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x638,%rsp
mov    %rsi,0x8(%rsp)
lea    0xe43(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
lea    0x230(%rsp),%rdi
mov    $0x1,%esi
mov    $0x64,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
test   %rax,%rax
je     171a <extract+0x57a>
lea    0x1c(%rsp),%r13
lea    0x230(%rsp),%r15
lea    0x430(%rsp),%r12
nopl   (%rax)
lea    0x50(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x48(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x40(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0xc,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x64(%rsp),%rdi
mov    $0x1,%esi
mov    $0xc,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x38(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x5(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0xb0(%rsp),%rdi
mov    $0x1,%esi
mov    $0x64,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x16(%rsp),%rdi
mov    $0x1,%esi
mov    $0x6,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x90(%rsp),%rdi
mov    $0x1,%esi
mov    $0x20,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x70(%rsp),%rdi
mov    $0x1,%esi
mov    $0x20,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x30(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x28(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x120(%rsp),%rdi
mov    $0x1,%esi
mov    $0x9b,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x58(%rsp),%rdi
mov    $0x1,%esi
mov    $0xc,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    %r15,%rdi
mov    $0x64,%esi
call   1080 <isEmpty@plt>
test   %rax,%rax
je     13a0 <extract+0x200>
lea    0xc72(%rip),%rdi
xor    %eax,%eax
call   1060 <logOutFile@plt>
mov    $0x1,%r14b
jmp    156f <extract+0x3cf>
nop
mov    %r15,%rdi
lea    0xc7c(%rip),%rsi
call   10b0 <isEqual@plt>
xor    %r14d,%r14d
test   %rax,%rax
je     156f <extract+0x3cf>
lea    0xc72(%rip),%rdi
xor    %eax,%eax
call   1060 <logOutFile@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x200,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x1c0(%rsp),%rdi
mov    $0x1,%esi
mov    $0x64,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x50(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x48(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x40(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0xc,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x64(%rsp),%rdi
mov    $0x1,%esi
mov    $0xc,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x38(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x5(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0xb0(%rsp),%rdi
mov    $0x1,%esi
mov    $0x64,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x16(%rsp),%rdi
mov    $0x1,%esi
mov    $0x6,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x90(%rsp),%rdi
mov    $0x1,%esi
mov    $0x20,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x70(%rsp),%rdi
mov    $0x1,%esi
mov    $0x20,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x30(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x28(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x120(%rsp),%rdi
mov    $0x1,%esi
mov    $0x9b,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x58(%rsp),%rdi
mov    $0x1,%esi
mov    $0xc,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0xae4(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <logOutFile@plt>
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1070 <strtol@plt>
test   %eax,%eax
jle    1650 <extract+0x4b0>
mov    %eax,%r13d
mov    %eax,%ebp
add    $0xffffffff,%ebp
shr    $0x9,%ebp
mov    $0x3,%edi
mov    0x8(%rsp),%rsi
lea    0xac3(%rip),%rdx
mov    %r15,%rcx
call   1050 <concat@plt>
mov    %rax,%rdi
lea    0xab3(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r14
add    $0x1,%ebp
jmp    15f3 <extract+0x453>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13d,%edx
mov    %r14,%rcx
call   10c0 <fwrite@plt>
xor    %r13d,%r13d
add    $0xffffffff,%ebp
jle    1632 <extract+0x492>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x200,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    %r12,%rdi
mov    $0x1,%esi
cmp    $0x200,%r13d
jl     15e0 <extract+0x440>
mov    $0x200,%edx
mov    %r14,%rcx
call   10c0 <fwrite@plt>
add    $0xfffffe00,%r13d
add    $0xffffffff,%ebp
jg     15f3 <extract+0x453>
mov    %r14,%rdi
call   1040 <fclose@plt>
xor    %ebp,%ebp
lea    0x1c(%rsp),%r13
lea    0x230(%rsp),%r15
jmp    16ea <extract+0x54a>
xchg   %ax,%ax
xor    %ebp,%ebp
test   %r14b,%r14b
je     1698 <extract+0x4f8>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x200,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    %r12,%rdi
mov    $0x200,%esi
call   1080 <isEmpty@plt>
test   %rax,%rax
lea    0x1c(%rsp),%r13
je     169d <extract+0x4fd>
lea    0x9df(%rip),%rdi
xor    %eax,%eax
call   1060 <logOutFile@plt>
mov    $0x1,%ebp
jmp    169d <extract+0x4fd>
lea    0x1c(%rsp),%r13
mov    $0x3,%edi
mov    0x8(%rsp),%rsi
lea    0x9c8(%rip),%rdx
lea    0x230(%rsp),%r15
mov    %r15,%rcx
call   1050 <concat@plt>
mov    0x2913(%rip),%rcx
mov    (%rcx),%esi
mov    0x291a(%rip),%rcx
or     (%rcx),%esi
mov    0x28f1(%rip),%rcx
or     (%rcx),%esi
mov    0x2900(%rip),%rcx
or     (%rcx),%esi
mov    %rax,%rdi
call   1090 <mkpath@plt>
lea    0x989(%rip),%rdi
xor    %eax,%eax
call   1060 <logOutFile@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x64,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
test   %rax,%rax
je     171a <extract+0x57a>
test   %ebp,%ebp
je     1200 <extract+0x60>
mov    %rbx,%rdi
call   1040 <fclose@plt>
add    $0x638,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [36 x i8] c"Name flag is all 0's, possibly EOL\0A\00"
@.str.2 = [14 x i8] c"././@LongLink\00"
@.str.3 = [38 x i8] c"Detected a long file name, adjusting\0A\00"
@.str.4 = [15 x i8] c"Extracting %s\0A\00"
@.str.5 = [13 x i8] c"EOL reached\0A\00"
@.str.6 = [2 x i8] c"/\00"
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
@.str.7 = [2 x i8] c"w\00"
@.str.8 = [4 x i8] c"--\0A\00"
define void @extract(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [512 x i8]
%6 = alloca [512 x i8]
%7 = alloca [512 x i8]
%8 = alloca [8 x i8]
%9 = alloca [8 x i8]
%10 = alloca [8 x i8]
%11 = alloca [12 x i8]
%12 = alloca [12 x i8]
%13 = alloca [8 x i8]
%14 = alloca [1 x i8]
%15 = alloca [100 x i8]
%16 = alloca [6 x i8]
%17 = alloca [2 x i8]
%18 = alloca [32 x i8]
%19 = alloca [32 x i8]
%20 = alloca [8 x i8]
%21 = alloca [8 x i8]
%22 = alloca [155 x i8]
%23 = alloca [12 x i8]
%24 = alloca i32*
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca [100 x i8]
%29 = alloca i32*
%30 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%31 = load i8*, i8** %3
%32 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %32, i32** %24
store i32 0, i32* %27
br label %33
33: ; preds = %237, %2
%34 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%35 = load i32*, i32** %24
%36 = call i64 @fread(i8* %34, i32 1, i32 100, i32* %35)
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %42
38: ; preds = %33
%39 = load i32, i32* %27
%40 = icmp ne i32 %39, 0
%41 = xor i1 %40, true
br label %42
42: ; preds = %38, %33
%43 = phi i1 [ false, %33 ], [ %41, %38 ]
br i1 %43, label %44, label %239
44: ; preds = %42
%45 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%46 = load i32*, i32** %24
%47 = call i64 @fread(i8* %45, i32 1, i32 8, i32* %46)
%48 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%49 = load i32*, i32** %24
%50 = call i64 @fread(i8* %48, i32 1, i32 8, i32* %49)
%51 = getelementptr inbounds [8 x i8], [8 x i8]* %10, i64 0, i64 0
%52 = load i32*, i32** %24
%53 = call i64 @fread(i8* %51, i32 1, i32 8, i32* %52)
%54 = getelementptr inbounds [12 x i8], [12 x i8]* %11, i64 0, i64 0
%55 = load i32*, i32** %24
%56 = call i64 @fread(i8* %54, i32 1, i32 12, i32* %55)
%57 = getelementptr inbounds [12 x i8], [12 x i8]* %12, i64 0, i64 0
%58 = load i32*, i32** %24
%59 = call i64 @fread(i8* %57, i32 1, i32 12, i32* %58)
%60 = getelementptr inbounds [8 x i8], [8 x i8]* %13, i64 0, i64 0
%61 = load i32*, i32** %24
%62 = call i64 @fread(i8* %60, i32 1, i32 8, i32* %61)
%63 = getelementptr inbounds [1 x i8], [1 x i8]* %14, i64 0, i64 0
%64 = load i32*, i32** %24
%65 = call i64 @fread(i8* %63, i32 1, i32 1, i32* %64)
%66 = getelementptr inbounds [100 x i8], [100 x i8]* %15, i64 0, i64 0
%67 = load i32*, i32** %24
%68 = call i64 @fread(i8* %66, i32 1, i32 100, i32* %67)
%69 = getelementptr inbounds [6 x i8], [6 x i8]* %16, i64 0, i64 0
%70 = load i32*, i32** %24
%71 = call i64 @fread(i8* %69, i32 1, i32 6, i32* %70)
%72 = getelementptr inbounds [2 x i8], [2 x i8]* %17, i64 0, i64 0
%73 = load i32*, i32** %24
%74 = call i64 @fread(i8* %72, i32 1, i32 2, i32* %73)
%75 = getelementptr inbounds [32 x i8], [32 x i8]* %18, i64 0, i64 0
%76 = load i32*, i32** %24
%77 = call i64 @fread(i8* %75, i32 1, i32 32, i32* %76)
%78 = getelementptr inbounds [32 x i8], [32 x i8]* %19, i64 0, i64 0
%79 = load i32*, i32** %24
%80 = call i64 @fread(i8* %78, i32 1, i32 32, i32* %79)
%81 = getelementptr inbounds [8 x i8], [8 x i8]* %20, i64 0, i64 0
%82 = load i32*, i32** %24
%83 = call i64 @fread(i8* %81, i32 1, i32 8, i32* %82)
%84 = getelementptr inbounds [8 x i8], [8 x i8]* %21, i64 0, i64 0
%85 = load i32*, i32** %24
%86 = call i64 @fread(i8* %84, i32 1, i32 8, i32* %85)
%87 = getelementptr inbounds [155 x i8], [155 x i8]* %22, i64 0, i64 0
%88 = load i32*, i32** %24
%89 = call i64 @fread(i8* %87, i32 1, i32 155, i32* %88)
%90 = getelementptr inbounds [12 x i8], [12 x i8]* %23, i64 0, i64 0
%91 = load i32*, i32** %24
%92 = call i64 @fread(i8* %90, i32 1, i32 12, i32* %91)
store i32 0, i32* %30
%93 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%94 = call i64 @isEmpty(i8* %93, i32 100)
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %98
96: ; preds = %44
%97 = call i32 (i8*, ...) @logOutFile(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %30
br label %159
98: ; preds = %44
%99 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%100 = call i64 @isEqual(i8* %99, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%101 = icmp ne i64 %100, 0
br i1 %101, label %102, label %158
102: ; preds = %98
%103 = call i32 (i8*, ...) @logOutFile(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%104 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%105 = load i32*, i32** %24
%106 = call i64 @fread(i8* %104, i32 1, i32 512, i32* %105)
%107 = getelementptr inbounds [100 x i8], [100 x i8]* %28, i64 0, i64 0
%108 = load i32*, i32** %24
%109 = call i64 @fread(i8* %107, i32 1, i32 100, i32* %108)
%110 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%111 = load i32*, i32** %24
%112 = call i64 @fread(i8* %110, i32 1, i32 8, i32* %111)
%113 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%114 = load i32*, i32** %24
%115 = call i64 @fread(i8* %113, i32 1, i32 8, i32* %114)
%116 = getelementptr inbounds [8 x i8], [8 x i8]* %10, i64 0, i64 0
%117 = load i32*, i32** %24
%118 = call i64 @fread(i8* %116, i32 1, i32 8, i32* %117)
%119 = getelementptr inbounds [12 x i8], [12 x i8]* %11, i64 0, i64 0
%120 = load i32*, i32** %24
%121 = call i64 @fread(i8* %119, i32 1, i32 12, i32* %120)
%122 = getelementptr inbounds [12 x i8], [12 x i8]* %12, i64 0, i64 0
%123 = load i32*, i32** %24
%124 = call i64 @fread(i8* %122, i32 1, i32 12, i32* %123)
%125 = getelementptr inbounds [8 x i8], [8 x i8]* %13, i64 0, i64 0
%126 = load i32*, i32** %24
%127 = call i64 @fread(i8* %125, i32 1, i32 8, i32* %126)
%128 = getelementptr inbounds [1 x i8], [1 x i8]* %14, i64 0, i64 0
%129 = load i32*, i32** %24
%130 = call i64 @fread(i8* %128, i32 1, i32 1, i32* %129)
%131 = getelementptr inbounds [100 x i8], [100 x i8]* %15, i64 0, i64 0
%132 = load i32*, i32** %24
%133 = call i64 @fread(i8* %131, i32 1, i32 100, i32* %132)
%134 = getelementptr inbounds [6 x i8], [6 x i8]* %16, i64 0, i64 0
%135 = load i32*, i32** %24
%136 = call i64 @fread(i8* %134, i32 1, i32 6, i32* %135)
%137 = getelementptr inbounds [2 x i8], [2 x i8]* %17, i64 0, i64 0
%138 = load i32*, i32** %24
%139 = call i64 @fread(i8* %137, i32 1, i32 2, i32* %138)
%140 = getelementptr inbounds [32 x i8], [32 x i8]* %18, i64 0, i64 0
%141 = load i32*, i32** %24
%142 = call i64 @fread(i8* %140, i32 1, i32 32, i32* %141)
%143 = getelementptr inbounds [32 x i8], [32 x i8]* %19, i64 0, i64 0
%144 = load i32*, i32** %24
%145 = call i64 @fread(i8* %143, i32 1, i32 32, i32* %144)
%146 = getelementptr inbounds [8 x i8], [8 x i8]* %20, i64 0, i64 0
%147 = load i32*, i32** %24
%148 = call i64 @fread(i8* %146, i32 1, i32 8, i32* %147)
%149 = getelementptr inbounds [8 x i8], [8 x i8]* %21, i64 0, i64 0
%150 = load i32*, i32** %24
%151 = call i64 @fread(i8* %149, i32 1, i32 8, i32* %150)
%152 = getelementptr inbounds [155 x i8], [155 x i8]* %22, i64 0, i64 0
%153 = load i32*, i32** %24
%154 = call i64 @fread(i8* %152, i32 1, i32 155, i32* %153)
%155 = getelementptr inbounds [12 x i8], [12 x i8]* %23, i64 0, i64 0
%156 = load i32*, i32** %24
%157 = call i64 @fread(i8* %155, i32 1, i32 12, i32* %156)
br label %158
158: ; preds = %102, %98
br label %159
159: ; preds = %158, %96
%160 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%161 = call i32 (i8*, ...) @logOutFile(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %160)
%162 = getelementptr inbounds [12 x i8], [12 x i8]* %11, i64 0, i64 0
%163 = call i32 @strtol(i8* %162, i32* null, i32 8)
store i32 %163, i32* %26
%164 = load i32, i32* %26
%165 = icmp sgt i32 %164, 0
br i1 %165, label %166, label %171
166: ; preds = %159
%167 = load i32, i32* %26
%168 = sub nsw i32 %167, 1
%169 = sdiv i32 %168, 512
%170 = add nsw i32 %169, 1
br label %172
171: ; preds = %159
br label %172
172: ; preds = %171, %166
%173 = phi i32 [ %170, %166 ], [ 0, %171 ]
store i32 %173, i32* %25
%174 = load i32, i32* %30
%175 = icmp ne i32 %174, 0
br i1 %175, label %176, label %192
176: ; preds = %172
%177 = load i32, i32* %25
%178 = icmp sle i32 %177, 0
br i1 %178, label %179, label %192
179: ; preds = %176
%180 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%181 = load i32*, i32** %24
%182 = call i64 @fread(i8* %180, i32 1, i32 512, i32* %181)
%183 = load i32, i32* %30
%184 = icmp ne i32 %183, 0
br i1 %184, label %185, label %191
185: ; preds = %179
%186 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%187 = call i64 @isEmpty(i8* %186, i32 512)
%188 = icmp ne i64 %187, 0
br i1 %188, label %189, label %191
189: ; preds = %185
%190 = call i32 (i8*, ...) @logOutFile(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %27
br label %191
191: ; preds = %189, %185, %179
br label %192
192: ; preds = %191, %176, %172
%193 = load i32, i32* %25
%194 = icmp eq i32 %193, 0
br i1 %194, label %195, label %207
195: ; preds = %192
%196 = load i8*, i8** %4
%197 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%198 = call i8* @concat(i32 3, i8* %196, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* %197)
%199 = load i32, i32* @S_IRWXU
%200 = load i32, i32* @S_IRWXG
%201 = or i32 %199, %200
%202 = load i32, i32* @S_IROTH
%203 = or i32 %201, %202
%204 = load i32, i32* @S_IXOTH
%205 = or i32 %203, %204
%206 = call i32 @mkpath(i8* %198, i32 %205)
br label %237
207: ; preds = %192
%208 = load i8*, i8** %4
%209 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%210 = call i8* @concat(i32 3, i8* %208, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* %209)
%211 = call i32* @fopen(i8* %210, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %211, i32** %29
br label %212
212: ; preds = %233, %207
%213 = load i32, i32* %25
%214 = add nsw i32 %213, -1
store i32 %214, i32* %25
%215 = icmp sgt i32 %213, 0
br i1 %215, label %216, label %234
216: ; preds = %212
%217 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%218 = load i32*, i32** %24
%219 = call i64 @fread(i8* %217, i32 1, i32 512, i32* %218)
%220 = load i32, i32* %26
%221 = icmp sge i32 %220, 512
br i1 %221, label %222, label %228
222: ; preds = %216
%223 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%224 = load i32*, i32** %29
%225 = call i32 @fwrite(i8* %223, i32 1, i32 512, i32* %224)
%226 = load i32, i32* %26
%227 = sub nsw i32 %226, 512
store i32 %227, i32* %26
br label %233
228: ; preds = %216
%229 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%230 = load i32, i32* %26
%231 = load i32*, i32** %29
%232 = call i32 @fwrite(i8* %229, i32 1, i32 %230, i32* %231)
store i32 0, i32* %26
br label %233
233: ; preds = %228, %222
br label %212
234: ; preds = %212
%235 = load i32*, i32** %29
%236 = call i32 @fclose(i32* %235)
br label %237
237: ; preds = %234, %195
%238 = call i32 (i8*, ...) @logOutFile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %33
239: ; preds = %42
%240 = load i32*, i32** %24
%241 = call i32 @fclose(i32* %240)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [36 x i8] c"Name flag is all 0's, possibly EOL\0A\00"
@.str.2 = [14 x i8] c"././@LongLink\00"
@.str.3 = [38 x i8] c"Detected a long file name, adjusting\0A\00"
@.str.4 = [15 x i8] c"Extracting %s\0A\00"
@.str.5 = [13 x i8] c"EOL reached\0A\00"
@.str.6 = [2 x i8] c"/\00"
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
@.str.7 = [2 x i8] c"w\00"
@.str.8 = [4 x i8] c"--\0A\00"
define void @extract(i8* nocapture %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = alloca [8 x i8]
%6 = alloca [8 x i8]
%7 = alloca [8 x i8]
%8 = alloca [12 x i8]
%9 = alloca [12 x i8]
%10 = alloca [8 x i8]
%11 = alloca [1 x i8]
%12 = alloca [100 x i8]
%13 = alloca [6 x i8]
%14 = alloca [2 x i8]
%15 = alloca [32 x i8]
%16 = alloca [32 x i8]
%17 = alloca [8 x i8]
%18 = alloca [8 x i8]
%19 = alloca [155 x i8]
%20 = alloca [12 x i8]
%21 = alloca [100 x i8]
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%24 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%25 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%26 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%27 = getelementptr inbounds [12 x i8], [12 x i8]* %8, i64 0, i64 0
%28 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 0
%29 = getelementptr inbounds [8 x i8], [8 x i8]* %10, i64 0, i64 0
%30 = getelementptr inbounds [1 x i8], [1 x i8]* %11, i64 0, i64 0
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%32 = getelementptr inbounds [6 x i8], [6 x i8]* %13, i64 0, i64 0
%33 = getelementptr inbounds [2 x i8], [2 x i8]* %14, i64 0, i64 0
%34 = getelementptr inbounds [32 x i8], [32 x i8]* %15, i64 0, i64 0
%35 = getelementptr inbounds [32 x i8], [32 x i8]* %16, i64 0, i64 0
%36 = getelementptr inbounds [8 x i8], [8 x i8]* %17, i64 0, i64 0
%37 = getelementptr inbounds [8 x i8], [8 x i8]* %18, i64 0, i64 0
%38 = getelementptr inbounds [155 x i8], [155 x i8]* %19, i64 0, i64 0
%39 = getelementptr inbounds [12 x i8], [12 x i8]* %20, i64 0, i64 0
%40 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %21, i64 0, i64 0
%42 = call i64 @fread(i8* %23, i32 1, i32 100, i32* %40)
%43 = icmp eq i64 %42, 0
br i1 %43, label %139, label %44
44: ; preds = %2, %132
%45 = call i64 @fread(i8* %24, i32 1, i32 8, i32* %40)
%46 = call i64 @fread(i8* %25, i32 1, i32 8, i32* %40)
%47 = call i64 @fread(i8* %26, i32 1, i32 8, i32* %40)
%48 = call i64 @fread(i8* %27, i32 1, i32 12, i32* %40)
%49 = call i64 @fread(i8* %28, i32 1, i32 12, i32* %40)
%50 = call i64 @fread(i8* %29, i32 1, i32 8, i32* %40)
%51 = call i64 @fread(i8* %30, i32 1, i32 1, i32* %40)
%52 = call i64 @fread(i8* %31, i32 1, i32 100, i32* %40)
%53 = call i64 @fread(i8* %32, i32 1, i32 6, i32* %40)
%54 = call i64 @fread(i8* %33, i32 1, i32 2, i32* %40)
%55 = call i64 @fread(i8* %34, i32 1, i32 32, i32* %40)
%56 = call i64 @fread(i8* %35, i32 1, i32 32, i32* %40)
%57 = call i64 @fread(i8* %36, i32 1, i32 8, i32* %40)
%58 = call i64 @fread(i8* %37, i32 1, i32 8, i32* %40)
%59 = call i64 @fread(i8* %38, i32 1, i32 155, i32* %40)
%60 = call i64 @fread(i8* %39, i32 1, i32 12, i32* %40)
%61 = call i64 @isEmpty(i8* %23, i32 100)
%62 = icmp eq i64 %61, 0
br i1 %62, label %65, label %63
63: ; preds = %44
%64 = call i32 (i8*, ...) @logOutFile(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
br label %88
65: ; preds = %44
%66 = call i64 @isEqual(i8* %23, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %88, label %68
68: ; preds = %65
%69 = call i32 (i8*, ...) @logOutFile(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%70 = call i64 @fread(i8* %23, i32 1, i32 512, i32* %40)
%71 = call i64 @fread(i8* %41, i32 1, i32 100, i32* %40)
%72 = call i64 @fread(i8* %24, i32 1, i32 8, i32* %40)
%73 = call i64 @fread(i8* %25, i32 1, i32 8, i32* %40)
%74 = call i64 @fread(i8* %26, i32 1, i32 8, i32* %40)
%75 = call i64 @fread(i8* %27, i32 1, i32 12, i32* %40)
%76 = call i64 @fread(i8* %28, i32 1, i32 12, i32* %40)
%77 = call i64 @fread(i8* %29, i32 1, i32 8, i32* %40)
%78 = call i64 @fread(i8* %30, i32 1, i32 1, i32* %40)
%79 = call i64 @fread(i8* %31, i32 1, i32 100, i32* %40)
%80 = call i64 @fread(i8* %32, i32 1, i32 6, i32* %40)
%81 = call i64 @fread(i8* %33, i32 1, i32 2, i32* %40)
%82 = call i64 @fread(i8* %34, i32 1, i32 32, i32* %40)
%83 = call i64 @fread(i8* %35, i32 1, i32 32, i32* %40)
%84 = call i64 @fread(i8* %36, i32 1, i32 8, i32* %40)
%85 = call i64 @fread(i8* %37, i32 1, i32 8, i32* %40)
%86 = call i64 @fread(i8* %38, i32 1, i32 155, i32* %40)
%87 = call i64 @fread(i8* %39, i32 1, i32 12, i32* %40)
br label %88
88: ; preds = %65, %68, %63
%89 = phi i1 [ false, %65 ], [ false, %68 ], [ true, %63 ]
%90 = call i32 (i8*, ...) @logOutFile(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %23)
%91 = call i32 @strtol(i8* nocapture %27, i32* null, i32 8)
%92 = icmp sgt i32 %91, 0
br i1 %92, label %100, label %93
93: ; preds = %88
br i1 %89, label %94, label %105
94: ; preds = %93
%95 = call i64 @fread(i8* %22, i32 1, i32 512, i32* %40)
%96 = call i64 @isEmpty(i8* %22, i32 512)
%97 = icmp eq i64 %96, 0
br i1 %97, label %105, label %98
98: ; preds = %94
%99 = call i32 (i8*, ...) @logOutFile(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %105
100: ; preds = %88
%101 = add nsw i32 %91, -1
%102 = lshr i32 %101, 9
%103 = call i8* @concat(i32 3, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* %23)
%104 = call i32* @fopen(i8* %103, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %116
105: ; preds = %93, %94, %98
%106 = phi i32 [ 0, %93 ], [ 0, %94 ], [ 1, %98 ]
%107 = call i8* @concat(i32 3, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* %23)
%108 = load i32, i32* @S_IRWXU
%109 = load i32, i32* @S_IRWXG
%110 = or i32 %109, %108
%111 = load i32, i32* @S_IROTH
%112 = or i32 %110, %111
%113 = load i32, i32* @S_IXOTH
%114 = or i32 %112, %113
%115 = call i32 @mkpath(i8* %107, i32 %114)
br label %132
116: ; preds = %100, %126
%117 = phi i32 [ %102, %100 ], [ %128, %126 ]
%118 = phi i32 [ %91, %100 ], [ %127, %126 ]
%119 = call i64 @fread(i8* %22, i32 1, i32 512, i32* %40)
%120 = icmp sgt i32 %118, 511
br i1 %120, label %121, label %124
121: ; preds = %116
%122 = call i32 @fwrite(i8* %22, i32 1, i32 512, i32* %104)
%123 = add nsw i32 %118, -512
br label %126
124: ; preds = %116
%125 = call i32 @fwrite(i8* %22, i32 1, i32 %118, i32* %104)
br label %126
126: ; preds = %124, %121
%127 = phi i32 [ %123, %121 ], [ 0, %124 ]
%128 = add nsw i32 %117, -1
%129 = icmp sgt i32 %117, 0
br i1 %129, label %116, label %130
130: ; preds = %126
%131 = call i32 @fclose(i32* %104)
br label %132
132: ; preds = %130, %105
%133 = phi i32 [ 0, %130 ], [ %106, %105 ]
%134 = call i32 (i8*, ...) @logOutFile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%135 = call i64 @fread(i8* %23, i32 1, i32 100, i32* %40)
%136 = icmp ne i64 %135, 0
%137 = icmp eq i32 %133, 0
%138 = and i1 %136, %137
br i1 %138, label %44, label %139
139: ; preds = %132, %2
%140 = call i32 @fclose(i32* %40)
ret void
}