#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[6];
  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] = "--numeric-owner";
  cmds[5] = 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    $0xe0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0x0,-0x68(%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)
movq   $0x0,-0xb0(%rbp)
movq   $0x0,-0xb8(%rbp)
lea    0xd91(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xd8f(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    0xd80(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xd87(%rip),%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
lea    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
lea    -0x60(%rbp),%r10
lea    -0x68(%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,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
je     130b <get_tar_listing+0x11b>
mov    -0x54(%rbp),%esi
lea    0xd49(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
mov    0x2cec(%rip),%rax
mov    (%rax),%edi
mov    -0x68(%rbp),%rdx
lea    0xd45(%rip),%rsi
call   10a0 <fprintf@plt>
jmp    172b <get_tar_listing+0x53b>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x68(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    1333 <get_tar_listing+0x143>
movl   $0x0,-0x4(%rbp)
jmp    1824 <get_tar_listing+0x634>
mov    -0x60(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x6c(%rbp)
cmpl   $0x0,-0x6c(%rbp)
jg     135e <get_tar_listing+0x16e>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1824 <get_tar_listing+0x634>
mov    -0x6c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x88(%rbp)
mov    -0x6c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x90(%rbp)
mov    -0x6c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x98(%rbp)
mov    -0x6c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x6c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0xa8(%rbp)
mov    -0x6c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0xb0(%rbp)
mov    -0x6c(%rbp),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
mov    %rax,-0xb8(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x6c(%rbp),%esi
lea    0xc1d(%rip),%rdx
call   1040 <fmemopen@plt>
mov    %rax,-0x80(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x6c(%rbp),%esi
add    $0xa,%esi
mov    -0x80(%rbp),%rdx
call   1090 <fgets@plt>
cmp    $0x0,%rax
je     165d <get_tar_listing+0x46d>
mov    -0x88(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x70(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x70(%rbp)
mov    %al,-0xc5(%rbp)
jle    145a <get_tar_listing+0x26a>
mov    -0x88(%rbp),%rax
mov    -0x70(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1080 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xc5(%rbp)
mov    -0xc5(%rbp),%al
test   $0x1,%al
jne    146d <get_tar_listing+0x27d>
jmp    147b <get_tar_listing+0x28b>
mov    -0x70(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x70(%rbp)
jmp    1422 <get_tar_listing+0x232>
mov    -0x88(%rbp),%rax
movslq -0x70(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x88(%rbp),%rdi
mov    -0x90(%rbp),%rdx
mov    -0x98(%rbp),%rcx
mov    -0xa0(%rbp),%r8
mov    -0xa8(%rbp),%r9
mov    -0xb0(%rbp),%r10
lea    0xb8f(%rip),%rsi
lea    -0x58(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10d0 <sscanf@plt>
mov    %eax,-0x54(%rbp)
cmpl   $0x5,-0x54(%rbp)
je     14f4 <get_tar_listing+0x304>
mov    -0x88(%rbp),%rsi
lea    0xb6f(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    172b <get_tar_listing+0x53b>
movl   $0x0,-0xc4(%rbp)
mov    -0x90(%rbp),%rdi
lea    -0xc4(%rbp),%rsi
call   1100 <parse_file_type@plt>
cmp    $0x0,%rax
jge    1535 <get_tar_listing+0x345>
mov    -0x90(%rbp),%rsi
lea    0xb48(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    172b <get_tar_listing+0x53b>
movq   $0x0,-0xc0(%rbp)
mov    -0xa0(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   1110 <parse_long_long@plt>
cmp    $0x0,%rax
jge    1577 <get_tar_listing+0x387>
mov    -0xa0(%rbp),%rsi
lea    0xb1b(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    172b <get_tar_listing+0x53b>
cmpq   $0x0,-0xc0(%rbp)
jge    159f <get_tar_listing+0x3af>
mov    -0xc0(%rbp),%rsi
lea    0xb0a(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    172b <get_tar_listing+0x53b>
mov    -0x88(%rbp),%rdi
movslq -0x58(%rbp),%rax
add    %rax,%rdi
mov    -0xb8(%rbp),%rsi
call   1070 <parse_c_string@plt>
mov    %eax,-0x74(%rbp)
cmp    $0x0,%eax
jge    15e6 <get_tar_listing+0x3f6>
mov    -0x88(%rbp),%rsi
movslq -0x58(%rbp),%rax
add    %rax,%rsi
lea    0xadc(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    172b <get_tar_listing+0x53b>
cmpl   $0x0,-0x74(%rbp)
jne    1603 <get_tar_listing+0x413>
lea    0xad4(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    172b <get_tar_listing+0x53b>
mov    -0x74(%rbp),%eax
mov    %eax,-0xcc(%rbp)
mov    -0xb8(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0xcc(%rbp),%eax
cmp    %ecx,%eax
je     163b <get_tar_listing+0x44b>
lea    0xaac(%rip),%rdi
mov    $0x0,%al
call   10e0 <error@plt>
jmp    172b <get_tar_listing+0x53b>
mov    -0x18(%rbp),%rdi
mov    -0xc0(%rbp),%rsi
mov    -0xc4(%rbp),%edx
mov    -0xb8(%rbp),%rcx
call   10b0 <append_entry@plt>
jmp    13f3 <get_tar_listing+0x203>
mov    -0x80(%rbp),%rdi
call   1050 <fclose@plt>
movq   $0x0,-0x80(%rbp)
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x60(%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    -0xb0(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0xb0(%rbp)
mov    -0xb8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0xb8(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1824 <get_tar_listing+0x634>
cmpq   $0x0,-0x60(%rbp)
je     173f <get_tar_listing+0x54f>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x68(%rbp)
je     1753 <get_tar_listing+0x563>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x80(%rbp)
je     1767 <get_tar_listing+0x577>
mov    -0x80(%rbp),%rdi
call   1050 <fclose@plt>
cmpq   $0x0,-0x88(%rbp)
je     1781 <get_tar_listing+0x591>
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x90(%rbp)
je     179b <get_tar_listing+0x5ab>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x98(%rbp)
je     17b5 <get_tar_listing+0x5c5>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0xa0(%rbp)
je     17cf <get_tar_listing+0x5df>
mov    -0xa0(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0xa8(%rbp)
je     17e9 <get_tar_listing+0x5f9>
mov    -0xa8(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0xb0(%rbp)
je     1803 <get_tar_listing+0x613>
mov    -0xb0(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0xb8(%rbp)
je     181d <get_tar_listing+0x62d>
mov    -0xb8(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tar_listing>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%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)
lea    0xdd9(%rip),%rax
mov    %rax,0x80(%rsp)
movq   $0x0,0x88(%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     137b <get_tar_listing+0x18b>
lea    0xd9d(%rip),%rdi
xor    %ecx,%ecx
mov    %rcx,0x38(%rsp)
mov    %eax,%esi
xor    %eax,%eax
call   10e0 <error@plt>
mov    0x2d37(%rip),%rax
mov    (%rax),%edi
mov    0x20(%rsp),%rdx
lea    0xd8f(%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     12e2 <get_tar_listing+0xf2>
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
test   %rdi,%rdi
je     12f1 <get_tar_listing+0x101>
call   1030 <free@plt>
mov    0x38(%rsp),%rdi
test   %rdi,%rdi
je     1300 <get_tar_listing+0x110>
call   1050 <fclose@plt>
test   %r14,%r14
je     130d <get_tar_listing+0x11d>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
test   %rdi,%rdi
je     131c <get_tar_listing+0x12c>
call   1030 <free@plt>
test   %rbx,%rbx
je     1329 <get_tar_listing+0x139>
mov    %rbx,%rdi
call   1030 <free@plt>
test   %rbp,%rbp
je     1336 <get_tar_listing+0x146>
mov    %rbp,%rdi
call   1030 <free@plt>
test   %r15,%r15
mov    %r13,%rbx
je     1346 <get_tar_listing+0x156>
mov    %r15,%rdi
call   1030 <free@plt>
test   %r12,%r12
je     1353 <get_tar_listing+0x163>
mov    %r12,%rdi
call   1030 <free@plt>
mov    $0xffffffff,%r12d
test   %rbx,%rbx
je     1366 <get_tar_listing+0x176>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12d,%eax
add    $0x98,%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     1366 <get_tar_listing+0x176>
call   1060 <strlen@plt>
test   %eax,%eax
jle    157f <get_tar_listing+0x38f>
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    0xbf5(%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     1589 <get_tar_listing+0x399>
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
cs nopw 0x0(%rax,%rax,1)
test   %r12d,%r12d
jle    1480 <get_tar_listing+0x290>
movzbl -0x1(%r14,%r12,1),%edi
add    $0xffffffffffffffff,%r12
call   1080 <isspace@plt>
test   %rax,%rax
jne    1460 <get_tar_listing+0x270>
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    15ec <get_tar_listing+0x3fc>
movl   $0x0,0x28(%rsp)
mov    %rbx,%rdi
lea    0x28(%rsp),%rsi
call   1100 <parse_file_type@plt>
test   %rax,%rax
js     15fd <get_tar_listing+0x40d>
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     1610 <get_tar_listing+0x420>
mov    0x40(%rsp),%rsi
test   %rsi,%rsi
js     161f <get_tar_listing+0x42f>
movslq 0x2c(%rsp),%rdi
add    %r14,%rdi
mov    %rbx,%rsi
call   1070 <parse_c_string@plt>
test   %eax,%eax
js     1639 <get_tar_listing+0x449>
je     1657 <get_tar_listing+0x467>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <strlen@plt>
cmp    %eax,%ebp
jne    1663 <get_tar_listing+0x473>
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    143f <get_tar_listing+0x24f>
mov    $0x5,%r12d
jmp    1591 <get_tar_listing+0x3a1>
mov    0x8(%rsp),%rdi
jmp    1361 <get_tar_listing+0x171>
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    135e <get_tar_listing+0x16e>
mov    0x30(%rsp),%r13
lea    0xa5f(%rip),%rdi
mov    %r14,%rsi
jmp    1629 <get_tar_listing+0x439>
mov    0x30(%rsp),%r13
lea    0xa68(%rip),%rdi
mov    0x18(%rsp),%rsi
jmp    1629 <get_tar_listing+0x439>
mov    %rbx,%r13
lea    0xa6c(%rip),%rdi
mov    %rbp,%rsi
jmp    1629 <get_tar_listing+0x439>
mov    %rbx,%r13
lea    0xa74(%rip),%rdi
xor    %eax,%eax
call   10e0 <error@plt>
mov    (%rsp),%rbx
jmp    12d3 <get_tar_listing+0xe3>
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    1674 <get_tar_listing+0x484>
mov    %rbx,%r13
lea    0xa6a(%rip),%rdi
jmp    166d <get_tar_listing+0x47d>
mov    %rbx,%r13
lea    0xa6e(%rip),%rdi
xor    %eax,%eax
call   10e0 <error@plt>
mov    0x10(%rsp),%rbp
mov    (%rsp),%rbx
jmp    12d3 <get_tar_listing+0xe3>

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

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