#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 */
struct archive_file {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ append_entry(struct archive_file *, long long, int,
                                unsigned char *);
int ejudge_invoke_process(char **, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/, unsigned char **,
                          unsigned char **);
int /*<<< orphan*/ error(char *, ...);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(unsigned char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fmemopen(unsigned char *, int, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char *);
int /*<<< orphan*/ free(unsigned char *);
scalar_t__ isspace(unsigned char);
scalar_t__ malloc(int);
int parse_c_string(unsigned char *, unsigned char *);
scalar_t__ parse_file_type(unsigned char *, int *);
scalar_t__ parse_long_long(unsigned char *, long long *);
int sscanf(unsigned char *, char *, unsigned char *, unsigned char *,
           unsigned char *, unsigned char *, unsigned char *, int *);
int /*<<< orphan*/ stderr;
int strlen(unsigned char *);
int get_tar_listing(const unsigned char *path, struct archive_file *arch) {
  char *cmds[5];
  int r, n;
  unsigned char *out = 0, *err = 0;
  int len, len1, len2;
  FILE *fin = 0;
  unsigned char *buf1 = 0;
  unsigned char *arg1 = 0;
  unsigned char *arg2 = 0;
  unsigned char *arg3 = 0;
  unsigned char *arg4 = 0;
  unsigned char *arg5 = 0;
  unsigned char *arg6 = 0;
  long long filesize;
  int filetype;
  cmds[0] = "/bin/tar";
  cmds[1] = "tvf";
  cmds[2] = (char *)path;
  cmds[3] = "--quoting-style=c";
  cmds[4] = 0;
  r = ejudge_invoke_process(cmds, NULL, NULL, NULL, NULL, 0, &out, &err);
  if (r != 0) {
    error("archiver exit code: %d", r);
    fprintf(stderr, "%s\n", err);
    goto fail;
  }
  free(err);
  err = 0;
  if (!out)
    return 0;
  len = strlen(out);
  if (len <= 0) {
    free(out);
    return 0;
  }
  buf1 = (unsigned char *)malloc(len + 10);
  arg1 = (unsigned char *)malloc(len + 10);
  arg2 = (unsigned char *)malloc(len + 10);
  arg3 = (unsigned char *)malloc(len + 10);
  arg4 = (unsigned char *)malloc(len + 10);
  arg5 = (unsigned char *)malloc(len + 10);
  arg6 = (unsigned char *)malloc(len + 10);
  fin = fmemopen(out, len, "r");
  while (fgets(buf1, len + 10, fin)) {
    len1 = strlen(buf1);
    while (len1 > 0 && isspace(buf1[len1 - 1]))
      --len1;
    buf1[len1] = 0;
    r = sscanf(buf1, "%s%s%s%s%s%n", arg1, arg2, arg3, arg4, arg5, &n);
    if (r != 5) {
      error("invalid archive output %s", buf1);
      goto fail;
    }
    filetype = 0;
    if (parse_file_type(arg1, &filetype) < 0) {
      error("invalid file type %s", arg1);
      goto fail;
    }
    filesize = 0;
    if (parse_long_long(arg3, &filesize) < 0) {
      error("invalid file length %s", arg3);
      goto fail;
    }
    if (filesize < 0) {
      error("invalid file length %lld", filesize);
      goto fail;
    }
    if ((len2 = parse_c_string(buf1 + n, arg6)) < 0) {
      error("invalid file name %s", buf1 + n);
      goto fail;
    }
    if (!len2) {
      error("empty file name");
      goto fail;
    }
    if (len2 != strlen(arg6)) {
      error("file name contains \\0");
      goto fail;
    }
    append_entry(arch, filesize, filetype, arg6);
  }
  fclose(fin);
  fin = 0;
  free(out);
  out = 0;
  free(buf1);
  buf1 = 0;
  free(arg1);
  arg1 = 0;
  free(arg2);
  arg2 = 0;
  free(arg3);
  arg3 = 0;
  free(arg4);
  arg4 = 0;
  free(arg5);
  arg5 = 0;
  free(arg6);
  arg6 = 0;
  return r;
fail:
  if (out)
    free(out);
  if (err)
    free(err);
  if (fin)
    fclose(fin);
  if (buf1)
    free(buf1);
  if (arg1)
    free(arg1);
  if (arg2)
    free(arg2);
  if (arg3)
    free(arg3);
  if (arg4)
    free(arg4);
  if (arg5)
    free(arg5);
  if (arg6)
    free(arg6);
  return -1;
}


x86 assembly (clang, -O0):
<get_tar_listing>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x70(%rbp)
movq   $0x0,-0x78(%rbp)
movq   $0x0,-0x80(%rbp)
movq   $0x0,-0x88(%rbp)
movq   $0x0,-0x90(%rbp)
movq   $0x0,-0x98(%rbp)
movq   $0x0,-0xa0(%rbp)
movq   $0x0,-0xa8(%rbp)
lea    0xd97(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xd95(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    0xd86(%rip),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
lea    -0x40(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
lea    -0x50(%rbp),%r10
lea    -0x58(%rbp),%rax
mov    %r8,%rsi
mov    %r8,%rdx
mov    %r8,%rcx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10f0 <ejudge_invoke_process@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
je     12fa <get_tar_listing+0x10a>
mov    -0x44(%rbp),%esi
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
mov    0x2cfd(%rip),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%rdx
lea    0xd46(%rip),%rsi
call   10a0 <fprintf@plt>
jmp    16e7 <get_tar_listing+0x4f7>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x58(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1322 <get_tar_listing+0x132>
movl   $0x0,-0x4(%rbp)
jmp    17d4 <get_tar_listing+0x5e4>
mov    -0x50(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0x5c(%rbp)
jg     134d <get_tar_listing+0x15d>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    17d4 <get_tar_listing+0x5e4>
mov    -0x5c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x78(%rbp)
mov    -0x5c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x80(%rbp)
mov    -0x5c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x88(%rbp)
mov    -0x5c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x90(%rbp)
mov    -0x5c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x98(%rbp)
mov    -0x5c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x5c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0xa8(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x5c(%rbp),%esi
lea    0xc34(%rip),%rdx
call   1040 <fmemopen@plt>
mov    %rax,-0x70(%rbp)
mov    -0x78(%rbp),%rdi
mov    -0x5c(%rbp),%esi
add    $0xa,%esi
mov    -0x70(%rbp),%rdx
call   1090 <fgets@plt>
cmp    $0x0,%rax
je     1625 <get_tar_listing+0x435>
mov    -0x78(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x60(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x60(%rbp)
mov    %al,-0xb5(%rbp)
jle    143a <get_tar_listing+0x24a>
mov    -0x78(%rbp),%rax
mov    -0x60(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1080 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xb5(%rbp)
mov    -0xb5(%rbp),%al
test   $0x1,%al
jne    144d <get_tar_listing+0x25d>
jmp    145b <get_tar_listing+0x26b>
mov    -0x60(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x60(%rbp)
jmp    1405 <get_tar_listing+0x215>
mov    -0x78(%rbp),%rax
movslq -0x60(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x78(%rbp),%rdi
mov    -0x80(%rbp),%rdx
mov    -0x88(%rbp),%rcx
mov    -0x90(%rbp),%r8
mov    -0x98(%rbp),%r9
mov    -0xa0(%rbp),%r10
lea    0xba8(%rip),%rsi
lea    -0x48(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10d0 <sscanf@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x5,-0x44(%rbp)
je     14c8 <get_tar_listing+0x2d8>
mov    -0x78(%rbp),%rsi
lea    0xb8b(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    16e7 <get_tar_listing+0x4f7>
movl   $0x0,-0xb4(%rbp)
mov    -0x80(%rbp),%rdi
lea    -0xb4(%rbp),%rsi
call   1100 <parse_file_type@plt>
cmp    $0x0,%rax
jge    1503 <get_tar_listing+0x313>
mov    -0x80(%rbp),%rsi
lea    0xb6a(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    16e7 <get_tar_listing+0x4f7>
movq   $0x0,-0xb0(%rbp)
mov    -0x90(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1110 <parse_long_long@plt>
cmp    $0x0,%rax
jge    1545 <get_tar_listing+0x355>
mov    -0x90(%rbp),%rsi
lea    0xb3d(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    16e7 <get_tar_listing+0x4f7>
cmpq   $0x0,-0xb0(%rbp)
jge    156d <get_tar_listing+0x37d>
mov    -0xb0(%rbp),%rsi
lea    0xb2c(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    16e7 <get_tar_listing+0x4f7>
mov    -0x78(%rbp),%rdi
movslq -0x48(%rbp),%rax
add    %rax,%rdi
mov    -0xa8(%rbp),%rsi
call   1070 <parse_c_string@plt>
mov    %eax,-0x64(%rbp)
cmp    $0x0,%eax
jge    15ae <get_tar_listing+0x3be>
mov    -0x78(%rbp),%rsi
movslq -0x48(%rbp),%rax
add    %rax,%rsi
lea    0xb04(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    16e7 <get_tar_listing+0x4f7>
cmpl   $0x0,-0x64(%rbp)
jne    15cb <get_tar_listing+0x3db>
lea    0xafc(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    16e7 <get_tar_listing+0x4f7>
mov    -0x64(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    -0xa8(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0xbc(%rbp),%eax
cmp    %ecx,%eax
je     1603 <get_tar_listing+0x413>
lea    0xad4(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    16e7 <get_tar_listing+0x4f7>
mov    -0x18(%rbp),%rdi
mov    -0xb0(%rbp),%rsi
mov    -0xb4(%rbp),%edx
mov    -0xa8(%rbp),%rcx
call   10b0 <append_entry@plt>
jmp    13dc <get_tar_listing+0x1ec>
mov    -0x70(%rbp),%rdi
call   1050 <fclose@plt>
movq   $0x0,-0x70(%rbp)
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x50(%rbp)
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x78(%rbp)
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x80(%rbp)
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x88(%rbp)
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x90(%rbp)
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x98(%rbp)
mov    -0xa0(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0xa0(%rbp)
mov    -0xa8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0xa8(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    17d4 <get_tar_listing+0x5e4>
cmpq   $0x0,-0x50(%rbp)
je     16fb <get_tar_listing+0x50b>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x58(%rbp)
je     170f <get_tar_listing+0x51f>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x70(%rbp)
je     1723 <get_tar_listing+0x533>
mov    -0x70(%rbp),%rdi
call   1050 <fclose@plt>
cmpq   $0x0,-0x78(%rbp)
je     1737 <get_tar_listing+0x547>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x80(%rbp)
je     174b <get_tar_listing+0x55b>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x88(%rbp)
je     1765 <get_tar_listing+0x575>
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x90(%rbp)
je     177f <get_tar_listing+0x58f>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x98(%rbp)
je     1799 <get_tar_listing+0x5a9>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0xa0(%rbp)
je     17b3 <get_tar_listing+0x5c3>
mov    -0xa0(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0xa8(%rbp)
je     17cd <get_tar_listing+0x5dd>
mov    -0xa8(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tar_listing>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rsi,%rbx
movq   $0x0,0x8(%rsp)
movq   $0x0,0x20(%rsp)
lea    0xde3(%rip),%rax
mov    %rax,0x60(%rsp)
lea    0xde0(%rip),%rax
mov    %rax,0x68(%rsp)
mov    %rdi,0x70(%rsp)
lea    0xdd3(%rip),%rax
mov    %rax,0x78(%rsp)
movq   $0x0,0x80(%rsp)
lea    0x20(%rsp),%rax
lea    0x8(%rsp),%rbp
xor    %r12d,%r12d
lea    0x60(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
push   %rbp
call   10f0 <ejudge_invoke_process@plt>
add    $0x10,%rsp
test   %eax,%eax
je     136c <get_tar_listing+0x17c>
lea    0xd9c(%rip),%rdi
xor    %ecx,%ecx
mov    %rcx,0x38(%rsp)
mov    %eax,%esi
xor    %eax,%eax
call   10e0 <error@plt>
mov    0x2d46(%rip),%rax
mov    (%rax),%edi
mov    0x20(%rsp),%rdx
lea    0xd8e(%rip),%rsi
call   10a0 <fprintf@plt>
xor    %r14d,%r14d
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %ebx,%ebx
xor    %ebp,%ebp
xor    %r15d,%r15d
xor    %r12d,%r12d
xor    %r13d,%r13d
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     12d3 <get_tar_listing+0xe3>
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
test   %rdi,%rdi
je     12e2 <get_tar_listing+0xf2>
call   1030 <free@plt>
mov    0x38(%rsp),%rdi
test   %rdi,%rdi
je     12f1 <get_tar_listing+0x101>
call   1050 <fclose@plt>
test   %r14,%r14
je     12fe <get_tar_listing+0x10e>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
test   %rdi,%rdi
je     130d <get_tar_listing+0x11d>
call   1030 <free@plt>
test   %rbx,%rbx
je     131a <get_tar_listing+0x12a>
mov    %rbx,%rdi
call   1030 <free@plt>
test   %rbp,%rbp
je     1327 <get_tar_listing+0x137>
mov    %rbp,%rdi
call   1030 <free@plt>
test   %r15,%r15
mov    %r13,%rbx
je     1337 <get_tar_listing+0x147>
mov    %r15,%rdi
call   1030 <free@plt>
test   %r12,%r12
je     1344 <get_tar_listing+0x154>
mov    %r12,%rdi
call   1030 <free@plt>
mov    $0xffffffff,%r12d
test   %rbx,%rbx
je     1357 <get_tar_listing+0x167>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12d,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
movq   $0x0,0x20(%rsp)
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     1357 <get_tar_listing+0x167>
call   1060 <strlen@plt>
test   %eax,%eax
jle    156f <get_tar_listing+0x37f>
mov    %eax,%r13d
mov    %eax,%ebp
add    $0xa,%r13d
mov    %r13d,%edi
call   10c0 <malloc@plt>
mov    %rax,%r14
mov    %r13d,%edi
call   10c0 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    %r13d,%edi
call   10c0 <malloc@plt>
mov    %rax,(%rsp)
mov    %r13d,%edi
call   10c0 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    %r13d,%edi
call   10c0 <malloc@plt>
mov    %rax,0x48(%rsp)
mov    %r13d,%edi
call   10c0 <malloc@plt>
mov    %rax,0x50(%rsp)
mov    %r13d,%edi
call   10c0 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    0x8(%rsp),%rdi
lea    0xc04(%rip),%rdx
mov    %ebp,%esi
call   1040 <fmemopen@plt>
mov    %r14,%rdi
mov    %r13d,%esi
mov    %rax,0x38(%rsp)
mov    %rax,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     1579 <get_tar_listing+0x389>
mov    %rbx,0x58(%rsp)
mov    0x48(%rsp),%r15
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
mov    %eax,%r12d
test   %eax,%eax
mov    $0x0,%eax
cmovns %eax,%ebp
nopw   0x0(%rax,%rax,1)
test   %r12d,%r12d
jle    1470 <get_tar_listing+0x280>
movzbl -0x1(%r14,%r12,1),%edi
add    $0xffffffffffffffff,%r12
call   1080 <isspace@plt>
test   %rax,%rax
jne    1450 <get_tar_listing+0x260>
add    $0x1,%r12d
mov    %r12d,%ebp
movslq %ebp,%rax
movb   $0x0,(%r14,%rax,1)
mov    %r14,%rdi
lea    0xbb8(%rip),%rsi
mov    0x18(%rsp),%rbx
mov    %rbx,%rdx
mov    (%rsp),%rcx
mov    0x10(%rsp),%rbp
mov    %rbp,%r8
mov    %r15,%r9
lea    0x2c(%rsp),%rax
push   %rax
mov    0x58(%rsp),%r12
push   %r12
call   10d0 <sscanf@plt>
add    $0x10,%rsp
cmp    $0x5,%eax
jne    15dc <get_tar_listing+0x3ec>
movl   $0x0,0x28(%rsp)
mov    %rbx,%rdi
lea    0x28(%rsp),%rsi
call   1100 <parse_file_type@plt>
test   %rax,%rax
js     15ed <get_tar_listing+0x3fd>
movq   $0x0,0x40(%rsp)
mov    %rbp,%rdi
lea    0x40(%rsp),%rsi
call   1110 <parse_long_long@plt>
test   %rax,%rax
mov    0x30(%rsp),%rbx
js     1600 <get_tar_listing+0x410>
mov    0x40(%rsp),%rsi
test   %rsi,%rsi
js     160f <get_tar_listing+0x41f>
movslq 0x2c(%rsp),%rdi
add    %r14,%rdi
mov    %rbx,%rsi
call   1070 <parse_c_string@plt>
test   %eax,%eax
js     1629 <get_tar_listing+0x439>
je     1647 <get_tar_listing+0x457>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <strlen@plt>
cmp    %eax,%ebp
jne    1653 <get_tar_listing+0x463>
mov    0x40(%rsp),%rsi
mov    0x28(%rsp),%edx
mov    0x58(%rsp),%rdi
mov    %rbx,%rcx
call   10b0 <append_entry@plt>
mov    %r14,%rdi
mov    %r13d,%esi
mov    0x38(%rsp),%rdx
call   1090 <fgets@plt>
test   %rax,%rax
jne    1430 <get_tar_listing+0x240>
mov    $0x5,%r12d
jmp    1581 <get_tar_listing+0x391>
mov    0x8(%rsp),%rdi
jmp    1352 <get_tar_listing+0x162>
xor    %r12d,%r12d
mov    0x30(%rsp),%rbx
mov    0x38(%rsp),%rdi
call   1050 <fclose@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
movq   $0x0,0x8(%rsp)
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x48(%rsp),%rdi
call   1030 <free@plt>
mov    0x50(%rsp),%rdi
call   1030 <free@plt>
jmp    134f <get_tar_listing+0x15f>
mov    0x30(%rsp),%r13
lea    0xa5f(%rip),%rdi
mov    %r14,%rsi
jmp    1619 <get_tar_listing+0x429>
mov    0x30(%rsp),%r13
lea    0xa68(%rip),%rdi
mov    0x18(%rsp),%rsi
jmp    1619 <get_tar_listing+0x429>
mov    %rbx,%r13
lea    0xa6c(%rip),%rdi
mov    %rbp,%rsi
jmp    1619 <get_tar_listing+0x429>
mov    %rbx,%r13
lea    0xa74(%rip),%rdi
xor    %eax,%eax
call   10e0 <error@plt>
mov    (%rsp),%rbx
jmp    12c4 <get_tar_listing+0xd4>
mov    %rbx,%r13
movslq 0x2c(%rsp),%rax
mov    %r14,%rsi
add    %rax,%rsi
lea    0xa68(%rip),%rdi
xor    %eax,%eax
call   10e0 <error@plt>
jmp    1664 <get_tar_listing+0x474>
mov    %rbx,%r13
lea    0xa6a(%rip),%rdi
jmp    165d <get_tar_listing+0x46d>
mov    %rbx,%r13
lea    0xa6e(%rip),%rdi
xor    %eax,%eax
call   10e0 <error@plt>
mov    0x10(%rsp),%rbp
mov    (%rsp),%rbx
jmp    12c4 <get_tar_listing+0xd4>

LLVM IR (-O0):
%struct.archive_file = type { i32 }
@.str = [9 x i8] c"/bin/tar\00"
@.str.1 = [4 x i8] c"tvf\00"
@.str.2 = [18 x i8] c"--quoting-style=c\00"
@.str.3 = [23 x i8] c"archiver exit code: %d\00"
@stderr = global i32 0
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [13 x i8] c"%s%s%s%s%s%n\00"
@.str.7 = [26 x i8] c"invalid archive output %s\00"
@.str.8 = [21 x i8] c"invalid file type %s\00"
@.str.9 = [23 x i8] c"invalid file length %s\00"
@.str.10 = [25 x i8] c"invalid file length %lld\00"
@.str.11 = [21 x i8] c"invalid file name %s\00"
@.str.12 = [16 x i8] c"empty file name\00"
@.str.13 = [22 x i8] c"file name contains \\0\00"
define i32 @get_tar_listing(i8* %0, %struct.archive_file* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.archive_file*
%6 = alloca [5 x i8*]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i64
%23 = alloca i32
store i8* %0, i8** %4
store %struct.archive_file* %1, %struct.archive_file** %5
store i8* null, i8** %9
store i8* null, i8** %10
store i32* null, i32** %14
store i8* null, i8** %15
store i8* null, i8** %16
store i8* null, i8** %17
store i8* null, i8** %18
store i8* null, i8** %19
store i8* null, i8** %20
store i8* null, i8** %21
%24 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %24
%25 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %25
%26 = load i8*, i8** %4
%27 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 2
store i8* %26, i8** %27
%28 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 3
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8** %28
%29 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 4
store i8* null, i8** %29
%30 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 0
%31 = call i32 @ejudge_invoke_process(i8** %30, i32* null, i32* null, i32* null, i32* null, i32 0, i8** %9, i8** %10)
store i32 %31, i32* %7
%32 = load i32, i32* %7
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %40
34: ; preds = %2
%35 = load i32, i32* %7
%36 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = load i32, i32* @stderr
%38 = load i8*, i8** %10
%39 = call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %38)
br label %202
40: ; preds = %2
%41 = load i8*, i8** %10
%42 = call i32 @free(i8* %41)
store i8* null, i8** %10
%43 = load i8*, i8** %9
%44 = icmp ne i8* %43, null
br i1 %44, label %46, label %45
45: ; preds = %40
store i32 0, i32* %3
br label %263
46: ; preds = %40
%47 = load i8*, i8** %9
%48 = call i32 @strlen(i8* %47)
store i32 %48, i32* %11
%49 = load i32, i32* %11
%50 = icmp sle i32 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %46
%52 = load i8*, i8** %9
%53 = call i32 @free(i8* %52)
store i32 0, i32* %3
br label %263
54: ; preds = %46
%55 = load i32, i32* %11
%56 = add nsw i32 %55, 10
%57 = call i64 @malloc(i32 %56)
%58 = inttoptr i64 %57 to i8*
store i8* %58, i8** %15
%59 = load i32, i32* %11
%60 = add nsw i32 %59, 10
%61 = call i64 @malloc(i32 %60)
%62 = inttoptr i64 %61 to i8*
store i8* %62, i8** %16
%63 = load i32, i32* %11
%64 = add nsw i32 %63, 10
%65 = call i64 @malloc(i32 %64)
%66 = inttoptr i64 %65 to i8*
store i8* %66, i8** %17
%67 = load i32, i32* %11
%68 = add nsw i32 %67, 10
%69 = call i64 @malloc(i32 %68)
%70 = inttoptr i64 %69 to i8*
store i8* %70, i8** %18
%71 = load i32, i32* %11
%72 = add nsw i32 %71, 10
%73 = call i64 @malloc(i32 %72)
%74 = inttoptr i64 %73 to i8*
store i8* %74, i8** %19
%75 = load i32, i32* %11
%76 = add nsw i32 %75, 10
%77 = call i64 @malloc(i32 %76)
%78 = inttoptr i64 %77 to i8*
store i8* %78, i8** %20
%79 = load i32, i32* %11
%80 = add nsw i32 %79, 10
%81 = call i64 @malloc(i32 %80)
%82 = inttoptr i64 %81 to i8*
store i8* %82, i8** %21
%83 = load i8*, i8** %9
%84 = load i32, i32* %11
%85 = call i32* @fmemopen(i8* %83, i32 %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %85, i32** %14
br label %86
86: ; preds = %176, %54
%87 = load i8*, i8** %15
%88 = load i32, i32* %11
%89 = add nsw i32 %88, 10
%90 = load i32*, i32** %14
%91 = call i64 @fgets(i8* %87, i32 %89, i32* %90)
%92 = icmp ne i64 %91, 0
br i1 %92, label %93, label %182
93: ; preds = %86
%94 = load i8*, i8** %15
%95 = call i32 @strlen(i8* %94)
store i32 %95, i32* %12
br label %96
96: ; preds = %110, %93
%97 = load i32, i32* %12
%98 = icmp sgt i32 %97, 0
br i1 %98, label %99, label %108
99: ; preds = %96
%100 = load i8*, i8** %15
%101 = load i32, i32* %12
%102 = sub nsw i32 %101, 1
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %100, i64 %103
%105 = load i8, i8* %104
%106 = call i64 @isspace(i8 zeroext %105)
%107 = icmp ne i64 %106, 0
br label %108
108: ; preds = %99, %96
%109 = phi i1 [ false, %96 ], [ %107, %99 ]
br i1 %109, label %110, label %113
110: ; preds = %108
%111 = load i32, i32* %12
%112 = add nsw i32 %111, -1
store i32 %112, i32* %12
br label %96
113: ; preds = %108
%114 = load i8*, i8** %15
%115 = load i32, i32* %12
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i8, i8* %114, i64 %116
store i8 0, i8* %117
%118 = load i8*, i8** %15
%119 = load i8*, i8** %16
%120 = load i8*, i8** %17
%121 = load i8*, i8** %18
%122 = load i8*, i8** %19
%123 = load i8*, i8** %20
%124 = call i32 @sscanf(i8* %118, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %119, i8* %120, i8* %121, i8* %122, i8* %123, i32* %8)
store i32 %124, i32* %7
%125 = load i32, i32* %7
%126 = icmp ne i32 %125, 5
br i1 %126, label %127, label %130
127: ; preds = %113
%128 = load i8*, i8** %15
%129 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %128)
br label %202
130: ; preds = %113
store i32 0, i32* %23
%131 = load i8*, i8** %16
%132 = call i64 @parse_file_type(i8* %131, i32* %23)
%133 = icmp slt i64 %132, 0
br i1 %133, label %134, label %137
134: ; preds = %130
%135 = load i8*, i8** %16
%136 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %135)
br label %202
137: ; preds = %130
store i64 0, i64* %22
%138 = load i8*, i8** %18
%139 = call i64 @parse_long_long(i8* %138, i64* %22)
%140 = icmp slt i64 %139, 0
br i1 %140, label %141, label %144
141: ; preds = %137
%142 = load i8*, i8** %18
%143 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %142)
br label %202
144: ; preds = %137
%145 = load i64, i64* %22
%146 = icmp slt i64 %145, 0
br i1 %146, label %147, label %150
147: ; preds = %144
%148 = load i64, i64* %22
%149 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i64 %148)
br label %202
150: ; preds = %144
%151 = load i8*, i8** %15
%152 = load i32, i32* %8
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds i8, i8* %151, i64 %153
%155 = load i8*, i8** %21
%156 = call i32 @parse_c_string(i8* %154, i8* %155)
store i32 %156, i32* %13
%157 = icmp slt i32 %156, 0
br i1 %157, label %158, label %164
158: ; preds = %150
%159 = load i8*, i8** %15
%160 = load i32, i32* %8
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds i8, i8* %159, i64 %161
%163 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %162)
br label %202
164: ; preds = %150
%165 = load i32, i32* %13
%166 = icmp ne i32 %165, 0
br i1 %166, label %169, label %167
167: ; preds = %164
%168 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
br label %202
169: ; preds = %164
%170 = load i32, i32* %13
%171 = load i8*, i8** %21
%172 = call i32 @strlen(i8* %171)
%173 = icmp ne i32 %170, %172
br i1 %173, label %174, label %176
174: ; preds = %169
%175 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0))
br label %202
176: ; preds = %169
%177 = load %struct.archive_file*, %struct.archive_file** %5
%178 = load i64, i64* %22
%179 = load i32, i32* %23
%180 = load i8*, i8** %21
%181 = call i32 @append_entry(%struct.archive_file* %177, i64 %178, i32 %179, i8* %180)
br label %86
182: ; preds = %86
%183 = load i32*, i32** %14
%184 = call i32 @fclose(i32* %183)
store i32* null, i32** %14
%185 = load i8*, i8** %9
%186 = call i32 @free(i8* %185)
store i8* null, i8** %9
%187 = load i8*, i8** %15
%188 = call i32 @free(i8* %187)
store i8* null, i8** %15
%189 = load i8*, i8** %16
%190 = call i32 @free(i8* %189)
store i8* null, i8** %16
%191 = load i8*, i8** %17
%192 = call i32 @free(i8* %191)
store i8* null, i8** %17
%193 = load i8*, i8** %18
%194 = call i32 @free(i8* %193)
store i8* null, i8** %18
%195 = load i8*, i8** %19
%196 = call i32 @free(i8* %195)
store i8* null, i8** %19
%197 = load i8*, i8** %20
%198 = call i32 @free(i8* %197)
store i8* null, i8** %20
%199 = load i8*, i8** %21
%200 = call i32 @free(i8* %199)
store i8* null, i8** %21
%201 = load i32, i32* %7
store i32 %201, i32* %3
br label %263
202: ; preds = %174, %167, %158, %147, %141, %134, %127, %34
%203 = load i8*, i8** %9
%204 = icmp ne i8* %203, null
br i1 %204, label %205, label %208
205: ; preds = %202
%206 = load i8*, i8** %9
%207 = call i32 @free(i8* %206)
br label %208
208: ; preds = %205, %202
%209 = load i8*, i8** %10
%210 = icmp ne i8* %209, null
br i1 %210, label %211, label %214
211: ; preds = %208
%212 = load i8*, i8** %10
%213 = call i32 @free(i8* %212)
br label %214
214: ; preds = %211, %208
%215 = load i32*, i32** %14
%216 = icmp ne i32* %215, null
br i1 %216, label %217, label %220
217: ; preds = %214
%218 = load i32*, i32** %14
%219 = call i32 @fclose(i32* %218)
br label %220
220: ; preds = %217, %214
%221 = load i8*, i8** %15
%222 = icmp ne i8* %221, null
br i1 %222, label %223, label %226
223: ; preds = %220
%224 = load i8*, i8** %15
%225 = call i32 @free(i8* %224)
br label %226
226: ; preds = %223, %220
%227 = load i8*, i8** %16
%228 = icmp ne i8* %227, null
br i1 %228, label %229, label %232
229: ; preds = %226
%230 = load i8*, i8** %16
%231 = call i32 @free(i8* %230)
br label %232
232: ; preds = %229, %226
%233 = load i8*, i8** %17
%234 = icmp ne i8* %233, null
br i1 %234, label %235, label %238
235: ; preds = %232
%236 = load i8*, i8** %17
%237 = call i32 @free(i8* %236)
br label %238
238: ; preds = %235, %232
%239 = load i8*, i8** %18
%240 = icmp ne i8* %239, null
br i1 %240, label %241, label %244
241: ; preds = %238
%242 = load i8*, i8** %18
%243 = call i32 @free(i8* %242)
br label %244
244: ; preds = %241, %238
%245 = load i8*, i8** %19
%246 = icmp ne i8* %245, null
br i1 %246, label %247, label %250
247: ; preds = %244
%248 = load i8*, i8** %19
%249 = call i32 @free(i8* %248)
br label %250
250: ; preds = %247, %244
%251 = load i8*, i8** %20
%252 = icmp ne i8* %251, null
br i1 %252, label %253, label %256
253: ; preds = %250
%254 = load i8*, i8** %20
%255 = call i32 @free(i8* %254)
br label %256
256: ; preds = %253, %250
%257 = load i8*, i8** %21
%258 = icmp ne i8* %257, null
br i1 %258, label %259, label %262
259: ; preds = %256
%260 = load i8*, i8** %21
%261 = call i32 @free(i8* %260)
br label %262
262: ; preds = %259, %256
store i32 -1, i32* %3
br label %263
263: ; preds = %262, %182, %51, %45
%264 = load i32, i32* %3
ret i32 %264
}

LLVM IR (-O2):
%struct.archive_file = type { i32 }
@.str = [9 x i8] c"/bin/tar\00"
@.str.1 = [4 x i8] c"tvf\00"
@.str.2 = [18 x i8] c"--quoting-style=c\00"
@.str.3 = [23 x i8] c"archiver exit code: %d\00"
@stderr = global i32 0
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [13 x i8] c"%s%s%s%s%s%n\00"
@.str.7 = [26 x i8] c"invalid archive output %s\00"
@.str.8 = [21 x i8] c"invalid file type %s\00"
@.str.9 = [23 x i8] c"invalid file length %s\00"
@.str.10 = [25 x i8] c"invalid file length %lld\00"
@.str.11 = [21 x i8] c"invalid file name %s\00"
@.str.12 = [16 x i8] c"empty file name\00"
@.str.13 = [22 x i8] c"file name contains \\0\00"
define i32 @get_tar_listing(i8* %0, %struct.archive_file* %1) {
%3 = alloca [5 x i8*]
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = bitcast [5 x i8*]* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i8** %5 to i8*
store i8* null, i8** %5
%12 = bitcast i8** %6 to i8*
store i8* null, i8** %6
%13 = bitcast i64* %7 to i8*
%14 = bitcast i32* %8 to i8*
%15 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %15
%16 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %16
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 2
store i8* %0, i8** %17
%18 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 3
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8** %18
%19 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 4
store i8* null, i8** %19
%20 = call i32 @ejudge_invoke_process(i8** %15, i32* null, i32* null, i32* null, i32* null, i32 0, i8** %5, i8** %6)
%21 = icmp eq i32 %20, 0
br i1 %21, label %27, label %22
22: ; preds = %2
%23 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%24 = load i32, i32* @stderr
%25 = load i8*, i8** %6
%26 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %25)
br label %135
27: ; preds = %2
%28 = load i8*, i8** %6
%29 = call i32 @free(i8* %28)
store i8* null, i8** %6
%30 = load i8*, i8** %5
%31 = icmp eq i8* %30, null
br i1 %31, label %185, label %32
32: ; preds = %27
%33 = call i32 @strlen(i8* %30)
%34 = icmp slt i32 %33, 1
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = load i8*, i8** %5
%37 = call i32 @free(i8* %36)
br label %185
38: ; preds = %32
%39 = add nuw nsw i32 %33, 10
%40 = call i64 @malloc(i32 %39)
%41 = inttoptr i64 %40 to i8*
%42 = call i64 @malloc(i32 %39)
%43 = inttoptr i64 %42 to i8*
%44 = call i64 @malloc(i32 %39)
%45 = inttoptr i64 %44 to i8*
%46 = call i64 @malloc(i32 %39)
%47 = inttoptr i64 %46 to i8*
%48 = call i64 @malloc(i32 %39)
%49 = inttoptr i64 %48 to i8*
%50 = call i64 @malloc(i32 %39)
%51 = inttoptr i64 %50 to i8*
%52 = call i64 @malloc(i32 %39)
%53 = inttoptr i64 %52 to i8*
%54 = load i8*, i8** %5
%55 = call i32* @fmemopen(i8* %54, i32 %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%56 = call i64 @fgets(i8* %41, i32 %39, i32* %55)
%57 = icmp eq i64 %56, 0
br i1 %57, label %123, label %58
58: ; preds = %38, %117
%59 = call i32 @strlen(i8* %41)
%60 = zext i32 %59 to i64
%61 = call i32 @llvm.smin.i32(i32 %59, i32 0)
br label %62
62: ; preds = %66, %58
%63 = phi i64 [ %67, %66 ], [ %60, %58 ]
%64 = trunc i64 %63 to i32
%65 = icmp sgt i32 %64, 0
br i1 %65, label %66, label %74
66: ; preds = %62
%67 = add nsw i64 %63, -1
%68 = getelementptr inbounds i8, i8* %41, i64 %67
%69 = load i8, i8* %68
%70 = call i64 @isspace(i8 zeroext %69)
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %62
72: ; preds = %66
%73 = trunc i64 %63 to i32
br label %74
74: ; preds = %62, %72
%75 = phi i32 [ %73, %72 ], [ %61, %62 ]
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8, i8* %41, i64 %76
store i8 0, i8* %77
%78 = call i32 @sscanf(i8* %41, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %43, i8* %45, i8* %47, i8* %49, i8* %51, i32* %4)
%79 = icmp eq i32 %78, 5
br i1 %79, label %82, label %80
80: ; preds = %74
%81 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %41)
br label %135
82: ; preds = %74
store i32 0, i32* %8
%83 = call i64 @parse_file_type(i8* %43, i32* %8)
%84 = icmp slt i64 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %82
%86 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %43)
br label %135
87: ; preds = %82
store i64 0, i64* %7
%88 = call i64 @parse_long_long(i8* %47, i64* %7)
%89 = icmp slt i64 %88, 0
br i1 %89, label %90, label %92
90: ; preds = %87
%91 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %47)
br label %135
92: ; preds = %87
%93 = load i64, i64* %7
%94 = icmp slt i64 %93, 0
br i1 %94, label %95, label %97
95: ; preds = %92
%96 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i64 %93)
br label %135
97: ; preds = %92
%98 = load i32, i32* %4
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8, i8* %41, i64 %99
%101 = call i32 @parse_c_string(i8* %100, i8* %53)
%102 = icmp slt i32 %101, 0
br i1 %102, label %103, label %108
103: ; preds = %97
%104 = load i32, i32* %4
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8, i8* %41, i64 %105
%107 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %106)
br label %135
108: ; preds = %97
%109 = icmp eq i32 %101, 0
br i1 %109, label %110, label %112
110: ; preds = %108
%111 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
br label %135
112: ; preds = %108
%113 = call i32 @strlen(i8* %53)
%114 = icmp eq i32 %101, %113
br i1 %114, label %117, label %115
115: ; preds = %112
%116 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0))
br label %135
117: ; preds = %112
%118 = load i64, i64* %7
%119 = load i32, i32* %8
%120 = call i32 @append_entry(%struct.archive_file* %1, i64 %118, i32 %119, i8* %53)
%121 = call i64 @fgets(i8* %41, i32 %39, i32* %55)
%122 = icmp eq i64 %121, 0
br i1 %122, label %123, label %58
123: ; preds = %117, %38
%124 = phi i32 [ 0, %38 ], [ 5, %117 ]
%125 = call i32 @fclose(i32* %55)
%126 = load i8*, i8** %5
%127 = call i32 @free(i8* %126)
store i8* null, i8** %5
%128 = call i32 @free(i8* %41)
%129 = call i32 @free(i8* %43)
%130 = call i32 @free(i8* %45)
%131 = call i32 @free(i8* %47)
%132 = call i32 @free(i8* %49)
%133 = call i32 @free(i8* %51)
%134 = call i32 @free(i8* %53)
br label %185
135: ; preds = %115, %110, %103, %95, %90, %85, %80, %22
%136 = phi i32* [ null, %22 ], [ %55, %80 ], [ %55, %85 ], [ %55, %90 ], [ %55, %95 ], [ %55, %103 ], [ %55, %115 ], [ %55, %110 ]
%137 = phi i8* [ null, %22 ], [ %41, %80 ], [ %41, %85 ], [ %41, %90 ], [ %41, %95 ], [ %41, %103 ], [ %41, %115 ], [ %41, %110 ]
%138 = phi i8* [ null, %22 ], [ %43, %80 ], [ %43, %85 ], [ %43, %90 ], [ %43, %95 ], [ %43, %103 ], [ %43, %115 ], [ %43, %110 ]
%139 = phi i8* [ null, %22 ], [ %45, %80 ], [ %45, %85 ], [ %45, %90 ], [ %45, %95 ], [ %45, %103 ], [ %45, %115 ], [ %45, %110 ]
%140 = phi i8* [ null, %22 ], [ %47, %80 ], [ %47, %85 ], [ %47, %90 ], [ %47, %95 ], [ %47, %103 ], [ %47, %115 ], [ %47, %110 ]
%141 = phi i8* [ null, %22 ], [ %49, %80 ], [ %49, %85 ], [ %49, %90 ], [ %49, %95 ], [ %49, %103 ], [ %49, %115 ], [ %49, %110 ]
%142 = phi i8* [ null, %22 ], [ %51, %80 ], [ %51, %85 ], [ %51, %90 ], [ %51, %95 ], [ %51, %103 ], [ %51, %115 ], [ %51, %110 ]
%143 = phi i8* [ null, %22 ], [ %53, %80 ], [ %53, %85 ], [ %53, %90 ], [ %53, %95 ], [ %53, %103 ], [ %53, %115 ], [ %53, %110 ]
%144 = load i8*, i8** %5
%145 = icmp eq i8* %144, null
br i1 %145, label %148, label %146
146: ; preds = %135
%147 = call i32 @free(i8* %144)
br label %148
148: ; preds = %146, %135
%149 = load i8*, i8** %6
%150 = icmp eq i8* %149, null
br i1 %150, label %153, label %151
151: ; preds = %148
%152 = call i32 @free(i8* %149)
br label %153
153: ; preds = %151, %148
%154 = icmp eq i32* %136, null
br i1 %154, label %157, label %155
155: ; preds = %153
%156 = call i32 @fclose(i32* %136)
br label %157
157: ; preds = %155, %153
%158 = icmp eq i8* %137, null
br i1 %158, label %161, label %159
159: ; preds = %157
%160 = call i32 @free(i8* %137)
br label %161
161: ; preds = %159, %157
%162 = icmp eq i8* %138, null
br i1 %162, label %165, label %163
163: ; preds = %161
%164 = call i32 @free(i8* %138)
br label %165
165: ; preds = %163, %161
%166 = icmp eq i8* %139, null
br i1 %166, label %169, label %167
167: ; preds = %165
%168 = call i32 @free(i8* %139)
br label %169
169: ; preds = %167, %165
%170 = icmp eq i8* %140, null
br i1 %170, label %173, label %171
171: ; preds = %169
%172 = call i32 @free(i8* %140)
br label %173
173: ; preds = %171, %169
%174 = icmp eq i8* %141, null
br i1 %174, label %177, label %175
175: ; preds = %173
%176 = call i32 @free(i8* %141)
br label %177
177: ; preds = %175, %173
%178 = icmp eq i8* %142, null
br i1 %178, label %181, label %179
179: ; preds = %177
%180 = call i32 @free(i8* %142)
br label %181
181: ; preds = %179, %177
%182 = icmp eq i8* %143, null
br i1 %182, label %185, label %183
183: ; preds = %181
%184 = call i32 @free(i8* %143)
br label %185
185: ; preds = %181, %183, %27, %123, %35
%186 = phi i32 [ 0, %35 ], [ %124, %123 ], [ 0, %27 ], [ -1, %183 ], [ -1, %181 ]
ret i32 %186
}