#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 */
long long INT_MAX;
scalar_t__ S_ISDIR(int);
int /*<<< orphan*/ append_entry(struct archive_file *, long long, int,
                                unsigned char *);
scalar_t__ check_file_name(unsigned char *, unsigned char **, unsigned char **);
scalar_t__ check_zip_date(unsigned char *, 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);
unsigned char *malloc(int);
scalar_t__ parse_long_long(unsigned char *, long long *);
scalar_t__ parse_zip_file_type(unsigned char *, int *);
int sscanf(unsigned char *, char *, unsigned char *, unsigned char *,
           unsigned char *, unsigned char *, unsigned char *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(unsigned char *, char *);
int strlen(unsigned char *);
int /*<<< orphan*/ strncmp(unsigned char *, char *, int);
int get_zip_listing(const unsigned char *path, struct archive_file *arch,
                    unsigned char **forbidden_names,
                    unsigned char **forbidden_suffixes) {
  char *cmds[4];
  int r, retval = -1, state = 0, n;
  unsigned char *out = 0, *err = 0;
  int out_len, linelen;
  unsigned char *linebuf = 0;
  FILE *fin = 0;
  unsigned char *dbuf = 0;
  unsigned char *tbuf = 0;
  unsigned char *mbuf = 0;
  unsigned char *zbuf = 0;
  unsigned char *cbuf = 0;
  unsigned char *fbuf = 0;
  unsigned char *name_ptr;
  int file_count = 0, dir_count = 0;
  int file_type = 0;
  long long file_size, comp_size, tmp;
  long long file_total = 0, comp_total = 0;
  cmds[0] = "/usr/bin/7z";
  cmds[1] = "l";
  cmds[2] = (char *)path;
  cmds[3] = 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 cleanup;
  }
  free(err);
  err = 0;
  if (!out) {
    retval = 0;
    goto cleanup;
  }
  out_len = strlen(out);
  linebuf = malloc(out_len + 10);
  dbuf = malloc(out_len + 10);
  tbuf = malloc(out_len + 10);
  mbuf = malloc(out_len + 10);
  zbuf = malloc(out_len + 10);
  cbuf = malloc(out_len + 10);
  fbuf = malloc(out_len + 10);
  fin = fmemopen(out, out_len, "r");
  while (fgets(linebuf, out_len + 10, fin)) {
    linelen = strlen(linebuf);
    while (linelen > 0 && isspace(linebuf[linelen - 1])) {
      --linelen;
    }
    linebuf[linelen] = 0;
    if (state == 0) {
      if (!strncmp(linebuf, "------------------- ", 20))
        state = 1;
      continue;
    }
    if (state == 2) {
      if (sscanf(linebuf, "%s%s%s%s%s%s%n", zbuf, cbuf, dbuf, tbuf, mbuf, fbuf,
                 &n) != 6) {
        error("invalid summary line");
        return -1;
      }
      if (linebuf[n]) {
        error("garbage in the summary line");
        return -1;
      }
      if (strcmp(tbuf, "files,") != 0) {
        error("expected 'files,', got '%s'", tbuf);
        return -1;
      }
      if (strcmp(fbuf, "folders") != 0) {
        error("expected 'folders', got '%s'", fbuf);
        return -1;
      }
      if (parse_long_long(zbuf, &tmp) < 0) {
        error("invalid total size");
        return -1;
      }
      if (tmp != file_total) {
        error("total size mismatch");
        return -1;
      }
      if (parse_long_long(cbuf, &tmp) < 0) {
        error("invalid total compressed size");
        return -1;
      }
      if (tmp != comp_total) {
        error("compressed size mismatch");
        return -1;
      }
      if (parse_long_long(dbuf, &tmp) < 0) {
        error("invalid file count");
        return -1;
      }
      if (tmp != file_count) {
        error("file count mismatch");
        return -1;
      }
      if (parse_long_long(mbuf, &tmp) < 0) {
        error("invalid directory count");
        return -1;
      }
      if (tmp != dir_count) {
        error("directory count mismatch");
        return -1;
      }
      state = 3;
      continue;
    }
    if (state == 3) {
      error("garbage after the end of listing");
      goto cleanup;
    }
    if (!strncmp(linebuf, "------------------- ", 20)) {
      state = 2;
      continue;
    }
    if (sscanf(linebuf, "%s%s%s%s%s%n", dbuf, tbuf, mbuf, zbuf, cbuf, &n) !=
        5) {
      error("listing line %s is invalid", linebuf);
      goto cleanup;
    }
    if (n >= 53) {
      error("file information takes >= 53 characters");
      goto cleanup;
    }
    name_ptr = linebuf + 53;
    if (check_zip_date(dbuf, tbuf) < 0) {
      goto cleanup;
    }
    if (parse_zip_file_type(mbuf, &file_type) < 0) {
      goto cleanup;
    }
    if (parse_long_long(zbuf, &file_size) < 0) {
      error("invalid file size '%s'", zbuf);
      goto cleanup;
    }
    if (file_size < 0 || file_size > INT_MAX) {
      error("invalid file size: %lld", file_size);
      goto cleanup;
    }
    if (parse_long_long(cbuf, &comp_size) < 0) {
      error("invalid compressed size '%s'", cbuf);
      goto cleanup;
    }
    if (comp_size < 0 || comp_size > INT_MAX) {
      error("invalid compressed size '%s'", comp_size);
      goto cleanup;
    }
    if (check_file_name(name_ptr, forbidden_names, forbidden_suffixes) < 0) {
      goto cleanup;
    }
    file_total += file_size;
    comp_total += comp_size;
    if (S_ISDIR(file_type)) {
      dir_count++;
    } else {
      file_count++;
    }
    append_entry(arch, file_size, file_type, name_ptr);
  }
  fclose(fin);
  fin = 0;
  if (state != 3) {
    error("unexpected listing end");
    return -1;
  }
  retval = 0;
cleanup:
  if (fin)
    fclose(fin);
  free(out);
  free(err);
  free(linebuf);
  free(dbuf);
  free(tbuf);
  free(mbuf);
  free(zbuf);
  free(cbuf);
  free(fbuf);
  return retval;
}


x86 assembly (clang, -O0):
<get_zip_listing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0xffffffff,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
movq   $0x0,-0x68(%rbp)
movq   $0x0,-0x70(%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)
movl   $0x0,-0xc4(%rbp)
movl   $0x0,-0xc8(%rbp)
movl   $0x0,-0xcc(%rbp)
movq   $0x0,-0xf0(%rbp)
movq   $0x0,-0xf8(%rbp)
lea    0xd07(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xd08(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
movq   $0x0,-0x38(%rbp)
lea    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
lea    -0x68(%rbp),%r10
lea    -0x70(%rbp),%rax
mov    %r8,%rsi
mov    %r8,%rdx
mov    %r8,%rcx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1140 <ejudge_invoke_process@plt>
mov    %eax,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
je     137f <get_zip_listing+0x14f>
mov    -0x54(%rbp),%esi
lea    0xcb4(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
mov    0x2c70(%rip),%rax
mov    (%rax),%edi
mov    -0x70(%rbp),%rdx
lea    0xcb0(%rip),%rsi
call   10e0 <fprintf@plt>
jmp    1ac1 <get_zip_listing+0x891>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x70(%rbp)
cmpq   $0x0,-0x68(%rbp)
jne    13a7 <get_zip_listing+0x177>
movl   $0x0,-0x58(%rbp)
jmp    1ac1 <get_zip_listing+0x891>
mov    -0x68(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%edi
add    $0xa,%edi
call   1110 <malloc@plt>
mov    %rax,-0x80(%rbp)
mov    -0x74(%rbp),%edi
add    $0xa,%edi
call   1110 <malloc@plt>
mov    %rax,-0x90(%rbp)
mov    -0x74(%rbp),%edi
add    $0xa,%edi
call   1110 <malloc@plt>
mov    %rax,-0x98(%rbp)
mov    -0x74(%rbp),%edi
add    $0xa,%edi
call   1110 <malloc@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x74(%rbp),%edi
add    $0xa,%edi
call   1110 <malloc@plt>
mov    %rax,-0xa8(%rbp)
mov    -0x74(%rbp),%edi
add    $0xa,%edi
call   1110 <malloc@plt>
mov    %rax,-0xb0(%rbp)
mov    -0x74(%rbp),%edi
add    $0xa,%edi
call   1110 <malloc@plt>
mov    %rax,-0xb8(%rbp)
mov    -0x68(%rbp),%rdi
mov    -0x74(%rbp),%esi
lea    0xbed(%rip),%rdx
call   1050 <fmemopen@plt>
mov    %rax,-0x88(%rbp)
mov    -0x80(%rbp),%rdi
mov    -0x74(%rbp),%esi
add    $0xa,%esi
mov    -0x88(%rbp),%rdx
call   10c0 <fgets@plt>
cmp    $0x0,%rax
je     1a7f <get_zip_listing+0x84f>
mov    -0x80(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x78(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x78(%rbp)
mov    %al,-0xf9(%rbp)
jle    14a9 <get_zip_listing+0x279>
mov    -0x80(%rbp),%rax
mov    -0x78(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   10b0 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xf9(%rbp)
mov    -0xf9(%rbp),%al
test   $0x1,%al
jne    14bc <get_zip_listing+0x28c>
jmp    14ca <get_zip_listing+0x29a>
mov    -0x78(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x78(%rbp)
jmp    1474 <get_zip_listing+0x244>
mov    -0x80(%rbp),%rax
movslq -0x78(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
cmpl   $0x0,-0x5c(%rbp)
jne    150a <get_zip_listing+0x2da>
mov    -0x80(%rbp),%rdi
lea    0xb40(%rip),%rsi
mov    $0x14,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1505 <get_zip_listing+0x2d5>
movl   $0x1,-0x5c(%rbp)
jmp    1448 <get_zip_listing+0x218>
cmpl   $0x2,-0x5c(%rbp)
jne    17d3 <get_zip_listing+0x5a3>
mov    -0x80(%rbp),%rdi
mov    -0xa8(%rbp),%rdx
mov    -0xb0(%rbp),%rcx
mov    -0x90(%rbp),%r8
mov    -0x98(%rbp),%r9
mov    -0xa0(%rbp),%r11
mov    -0xb8(%rbp),%r10
lea    0xaf7(%rip),%rsi
lea    -0x60(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   1120 <sscanf@plt>
cmp    $0x6,%eax
je     1585 <get_zip_listing+0x355>
lea    0xadd(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1b44 <get_zip_listing+0x914>
mov    -0x80(%rbp),%rax
movslq -0x60(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     15b1 <get_zip_listing+0x381>
lea    0xac6(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1b44 <get_zip_listing+0x914>
mov    -0x98(%rbp),%rdi
lea    0xac1(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     15ef <get_zip_listing+0x3bf>
mov    -0x98(%rbp),%rsi
lea    0xaab(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1b44 <get_zip_listing+0x914>
mov    -0xb8(%rbp),%rdi
lea    0xaa6(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     162d <get_zip_listing+0x3fd>
mov    -0xb8(%rbp),%rsi
lea    0xa91(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1b44 <get_zip_listing+0x914>
mov    -0xa8(%rbp),%rdi
lea    -0xe8(%rbp),%rsi
call   1150 <parse_long_long@plt>
cmp    $0x0,%rax
jge    1664 <get_zip_listing+0x434>
lea    0xa77(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1b44 <get_zip_listing+0x914>
mov    -0xe8(%rbp),%rax
cmp    -0xf0(%rbp),%rax
je     1692 <get_zip_listing+0x462>
lea    0xa5c(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1b44 <get_zip_listing+0x914>
mov    -0xb0(%rbp),%rdi
lea    -0xe8(%rbp),%rsi
call   1150 <parse_long_long@plt>
cmp    $0x0,%rax
jge    16c9 <get_zip_listing+0x499>
lea    0xa39(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1b44 <get_zip_listing+0x914>
mov    -0xe8(%rbp),%rax
cmp    -0xf8(%rbp),%rax
je     16f7 <get_zip_listing+0x4c7>
lea    0xa29(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1b44 <get_zip_listing+0x914>
mov    -0x90(%rbp),%rdi
lea    -0xe8(%rbp),%rsi
call   1150 <parse_long_long@plt>
cmp    $0x0,%rax
jge    172e <get_zip_listing+0x4fe>
lea    0xa0b(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1b44 <get_zip_listing+0x914>
mov    -0xe8(%rbp),%rax
movslq -0xc4(%rbp),%rcx
cmp    %rcx,%rax
je     175f <get_zip_listing+0x52f>
lea    0x9ed(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1b44 <get_zip_listing+0x914>
mov    -0xa0(%rbp),%rdi
lea    -0xe8(%rbp),%rsi
call   1150 <parse_long_long@plt>
cmp    $0x0,%rax
jge    1796 <get_zip_listing+0x566>
lea    0x9ca(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1b44 <get_zip_listing+0x914>
mov    -0xe8(%rbp),%rax
movslq -0xc8(%rbp),%rcx
cmp    %rcx,%rax
je     17c7 <get_zip_listing+0x597>
lea    0x9b1(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1b44 <get_zip_listing+0x914>
movl   $0x3,-0x5c(%rbp)
jmp    1448 <get_zip_listing+0x218>
cmpl   $0x3,-0x5c(%rbp)
jne    17f0 <get_zip_listing+0x5c0>
lea    0x99a(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
jmp    1ac1 <get_zip_listing+0x891>
mov    -0x80(%rbp),%rdi
lea    0x830(%rip),%rsi
mov    $0x14,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    181a <get_zip_listing+0x5ea>
movl   $0x2,-0x5c(%rbp)
jmp    1448 <get_zip_listing+0x218>
mov    -0x80(%rbp),%rdi
mov    -0x90(%rbp),%rdx
mov    -0x98(%rbp),%rcx
mov    -0xa0(%rbp),%r8
mov    -0xa8(%rbp),%r9
mov    -0xb0(%rbp),%r10
lea    0x7fa(%rip),%rsi
lea    -0x60(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1120 <sscanf@plt>
cmp    $0x5,%eax
je     187c <get_zip_listing+0x64c>
mov    -0x80(%rbp),%rsi
lea    0x92f(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
jmp    1ac1 <get_zip_listing+0x891>
cmpl   $0x35,-0x60(%rbp)
jl     1899 <get_zip_listing+0x669>
lea    0x92d(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
jmp    1ac1 <get_zip_listing+0x891>
mov    -0x80(%rbp),%rax
add    $0x35,%rax
mov    %rax,-0xc0(%rbp)
mov    -0x90(%rbp),%rdi
mov    -0x98(%rbp),%rsi
call   10a0 <check_zip_date@plt>
cmp    $0x0,%rax
jge    18ca <get_zip_listing+0x69a>
jmp    1ac1 <get_zip_listing+0x891>
mov    -0xa0(%rbp),%rdi
lea    -0xcc(%rbp),%rsi
call   1090 <parse_zip_file_type@plt>
cmp    $0x0,%rax
jge    18ec <get_zip_listing+0x6bc>
jmp    1ac1 <get_zip_listing+0x891>
mov    -0xa8(%rbp),%rdi
lea    -0xd8(%rbp),%rsi
call   1150 <parse_long_long@plt>
cmp    $0x0,%rax
jge    1923 <get_zip_listing+0x6f3>
mov    -0xa8(%rbp),%rsi
lea    0x8cb(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
jmp    1ac1 <get_zip_listing+0x891>
cmpq   $0x0,-0xd8(%rbp)
jl     1948 <get_zip_listing+0x718>
mov    -0xd8(%rbp),%rax
mov    0x26a9(%rip),%rcx
cmp    (%rcx),%rax
jle    1962 <get_zip_listing+0x732>
mov    -0xd8(%rbp),%rsi
lea    0x8a3(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
jmp    1ac1 <get_zip_listing+0x891>
mov    -0xb0(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1150 <parse_long_long@plt>
cmp    $0x0,%rax
jge    1999 <get_zip_listing+0x769>
mov    -0xb0(%rbp),%rsi
lea    0x884(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
jmp    1ac1 <get_zip_listing+0x891>
cmpq   $0x0,-0xe0(%rbp)
jl     19be <get_zip_listing+0x78e>
mov    -0xe0(%rbp),%rax
mov    0x2633(%rip),%rcx
cmp    (%rcx),%rax
jle    19d8 <get_zip_listing+0x7a8>
mov    -0xe0(%rbp),%rsi
lea    0x845(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
jmp    1ac1 <get_zip_listing+0x891>
mov    -0xc0(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1100 <check_file_name@plt>
cmp    $0x0,%rax
jge    19fb <get_zip_listing+0x7cb>
jmp    1ac1 <get_zip_listing+0x891>
mov    -0xd8(%rbp),%rax
add    -0xf0(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    -0xe0(%rbp),%rax
add    -0xf8(%rbp),%rax
mov    %rax,-0xf8(%rbp)
mov    -0xcc(%rbp),%edi
call   1080 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1a4e <get_zip_listing+0x81e>
mov    -0xc8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc8(%rbp)
jmp    1a5d <get_zip_listing+0x82d>
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xd8(%rbp),%rsi
mov    -0xcc(%rbp),%edx
mov    -0xc0(%rbp),%rcx
call   10f0 <append_entry@plt>
jmp    1448 <get_zip_listing+0x218>
mov    -0x88(%rbp),%rdi
call   1060 <fclose@plt>
movq   $0x0,-0x88(%rbp)
cmpl   $0x3,-0x5c(%rbp)
je     1aba <get_zip_listing+0x88a>
lea    0x787(%rip),%rdi
mov    $0x0,%al
call   1130 <error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1b44 <get_zip_listing+0x914>
movl   $0x0,-0x58(%rbp)
cmpq   $0x0,-0x88(%rbp)
je     1adb <get_zip_listing+0x8ab>
mov    -0x88(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
mov    -0xa0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xa8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xb0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xb8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_zip_listing>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
movq   $0x0,0x60(%rsp)
movq   $0x0,0x38(%rsp)
movl   $0x0,0x28(%rsp)
lea    0xd95(%rip),%rax
mov    %rax,0xb0(%rsp)
lea    0xd92(%rip),%rax
mov    %rax,0xb8(%rsp)
mov    %rdi,0xc0(%rsp)
movq   $0x0,0xc8(%rsp)
lea    0x38(%rsp),%rax
lea    0x60(%rsp),%rbp
lea    0xb0(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
push   %rbp
call   1140 <ejudge_invoke_process@plt>
add    $0x10,%rsp
test   %eax,%eax
je     1375 <get_zip_listing+0x145>
lea    0xd40(%rip),%rdi
xor    %ecx,%ecx
mov    %rcx,0x50(%rsp)
mov    %eax,%esi
xor    %eax,%eax
call   1130 <error@plt>
mov    0x2cf3(%rip),%rax
mov    (%rax),%edi
mov    0x38(%rsp),%rdx
lea    0xd32(%rip),%rsi
call   10e0 <fprintf@plt>
mov    $0xffffffff,%eax
mov    %rax,(%rsp)
xor    %r13d,%r13d
xor    %ebx,%ebx
xor    %ebp,%ebp
xor    %r12d,%r12d
xor    %r15d,%r15d
xor    %r14d,%r14d
mov    0x60(%rsp),%rdi
call   1030 <free@plt>
mov    0x38(%rsp),%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    0x50(%rsp),%rdi
call   1030 <free@plt>
mov    (%rsp),%rax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x38(%rsp),%rdi
call   1030 <free@plt>
movq   $0x0,0x38(%rsp)
mov    0x60(%rsp),%rdi
test   %rdi,%rdi
je     186f <get_zip_listing+0x63f>
mov    %rbx,0x98(%rsp)
mov    %r15,0xa0(%rsp)
mov    %r14,0xa8(%rsp)
call   1070 <strlen@plt>
mov    %eax,%r12d
lea    0xa(%r12),%ebp
mov    %ebp,%edi
call   1110 <malloc@plt>
mov    %rax,%r14
mov    %ebp,%edi
call   1110 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    %ebp,%edi
call   1110 <malloc@plt>
mov    %rax,%r15
mov    %ebp,%edi
call   1110 <malloc@plt>
mov    %rax,%r13
mov    %ebp,%edi
call   1110 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1110 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    %ebp,%edi
call   1110 <malloc@plt>
mov    %rax,0x50(%rsp)
mov    0x60(%rsp),%rdi
lea    0xc16(%rip),%rdx
mov    %r12d,%esi
mov    %r15,%r12
call   1050 <fmemopen@plt>
mov    %r14,%rdi
mov    %ebp,0x4c(%rsp)
mov    %ebp,%esi
mov    %r13,%rbp
mov    %rax,0x30(%rsp)
mov    %rax,%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
je     1881 <get_zip_listing+0x651>
mov    %r14,%rax
add    $0x35,%rax
mov    %rax,0x88(%rsp)
xor    %eax,%eax
xor    %ecx,%ecx
xor    %edx,%edx
xor    %esi,%esi
xor    %r13d,%r13d
mov    %rbp,0x8(%rsp)
mov    %rax,0x68(%rsp)
mov    %rax,(%rsp)
mov    %rcx,0x70(%rsp)
mov    %rcx,0x78(%rsp)
mov    %edx,0x20(%rsp)
mov    %edx,0x48(%rsp)
mov    %esi,0x24(%rsp)
mov    %esi,0x44(%rsp)
mov    %rbx,%rbp
mov    %r14,%rdi
call   1070 <strlen@plt>
mov    %eax,%ebx
mov    %eax,%r15d
test   %eax,%eax
mov    $0x0,%eax
cmovns %eax,%ebx
nopl   0x0(%rax)
test   %r15d,%r15d
jle    14c0 <get_zip_listing+0x290>
movzbl -0x1(%r14,%r15,1),%edi
add    $0xffffffffffffffff,%r15
call   10b0 <isspace@plt>
test   %rax,%rax
jne    14a0 <get_zip_listing+0x270>
add    $0x1,%r15d
mov    %r15d,%ebx
movslq %ebx,%rax
movb   $0x0,(%r14,%rax,1)
cmp    $0x3,%r13d
je     18a3 <get_zip_listing+0x673>
cmp    $0x2,%r13d
je     16a4 <get_zip_listing+0x474>
test   %r13d,%r13d
mov    %rbp,%rbx
mov    %r14,%rdi
lea    0xb3f(%rip),%rsi
mov    $0x14,%edx
je     17df <get_zip_listing+0x5af>
call   1040 <strncmp@plt>
test   %eax,%eax
mov    0x8(%rsp),%rbp
je     17f4 <get_zip_listing+0x5c4>
mov    %rbx,%r9
mov    %r13d,%ebx
mov    %r14,%rdi
lea    0xb29(%rip),%rsi
mov    0x18(%rsp),%rdx
mov    %r12,%rcx
mov    %rbp,%r13
mov    %rbp,%r8
mov    %r9,%r15
xor    %eax,%eax
lea    0x2c(%rsp),%rbp
push   %rbp
push   0x18(%rsp)
call   1120 <sscanf@plt>
add    $0x10,%rsp
cmp    $0x5,%eax
jne    18b6 <get_zip_listing+0x686>
cmpl   $0x35,0x2c(%rsp)
jge    18cc <get_zip_listing+0x69c>
mov    0x18(%rsp),%rdi
mov    %r12,%rsi
call   10a0 <check_zip_date@plt>
test   %rax,%rax
mov    %r13,%rbp
mov    %ebx,%r13d
mov    %r15,%rbx
js     1910 <get_zip_listing+0x6e0>
mov    %rbp,%rdi
lea    0x28(%rsp),%rsi
call   1090 <parse_zip_file_type@plt>
test   %rax,%rax
js     1910 <get_zip_listing+0x6e0>
mov    %rbx,%rdi
lea    0x80(%rsp),%rsi
call   1150 <parse_long_long@plt>
test   %rax,%rax
js     18df <get_zip_listing+0x6af>
mov    0x80(%rsp),%rsi
test   %rsi,%rsi
js     18eb <get_zip_listing+0x6bb>
mov    0x2a2f(%rip),%rax
cmp    (%rax),%rsi
jg     18eb <get_zip_listing+0x6bb>
mov    0x10(%rsp),%rdi
lea    0x90(%rsp),%rsi
call   1150 <parse_long_long@plt>
test   %rax,%rax
js     18f4 <get_zip_listing+0x6c4>
mov    0x90(%rsp),%rsi
test   %rsi,%rsi
js     1902 <get_zip_listing+0x6d2>
mov    0x29f3(%rip),%rax
cmp    (%rax),%rsi
jg     1902 <get_zip_listing+0x6d2>
mov    0x88(%rsp),%rdi
mov    0xa0(%rsp),%rsi
mov    0xa8(%rsp),%rdx
call   1100 <check_file_name@plt>
test   %rax,%rax
js     1910 <get_zip_listing+0x6e0>
mov    0x78(%rsp),%rax
add    0x80(%rsp),%rax
mov    %rax,0x78(%rsp)
mov    (%rsp),%rax
add    0x90(%rsp),%rax
mov    %rax,(%rsp)
mov    0x28(%rsp),%edi
call   1080 <S_ISDIR@plt>
xor    %ecx,%ecx
xor    %edx,%edx
test   %rax,%rax
setne  %cl
sete   %dl
add    %edx,0x44(%rsp)
add    %ecx,0x48(%rsp)
mov    0x80(%rsp),%rsi
mov    0x28(%rsp),%edx
mov    0x98(%rsp),%rdi
mov    0x88(%rsp),%rcx
call   10f0 <append_entry@plt>
mov    %r14,%rdi
mov    0x4c(%rsp),%esi
mov    0x30(%rsp),%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
jne    1482 <get_zip_listing+0x252>
jmp    1881 <get_zip_listing+0x651>
sub    $0x8,%rsp
mov    %r14,%rdi
lea    0x98e(%rip),%rsi
mov    %r12,%r9
mov    %rbp,%r12
mov    %rbp,%rdx
mov    0x18(%rsp),%rcx
mov    0x20(%rsp),%r8
mov    %r9,0x8(%rsp)
xor    %eax,%eax
lea    0x34(%rsp),%rbp
push   %rbp
mov    0x60(%rsp),%rbx
push   %rbx
mov    0x20(%rsp),%rbp
push   %rbp
call   1120 <sscanf@plt>
add    $0x20,%rsp
cmp    $0x6,%eax
jne    193c <get_zip_listing+0x70c>
movslq 0x2c(%rsp),%rax
cmpb   $0x0,(%r14,%rax,1)
jne    1948 <get_zip_listing+0x718>
mov    (%rsp),%rdi
lea    0x975(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
jne    1954 <get_zip_listing+0x724>
mov    %rbx,%rdi
lea    0x980(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
jne    1961 <get_zip_listing+0x731>
mov    %r12,%rbx
mov    %r12,%rdi
lea    0x58(%rsp),%rbp
mov    %rbp,%rsi
call   1150 <parse_long_long@plt>
test   %rax,%rax
js     197c <get_zip_listing+0x74c>
mov    0x70(%rsp),%rax
cmp    %rax,0x58(%rsp)
jne    1988 <get_zip_listing+0x758>
mov    0x10(%rsp),%rdi
mov    %rbp,%rsi
call   1150 <parse_long_long@plt>
test   %rax,%rax
js     1994 <get_zip_listing+0x764>
mov    0x68(%rsp),%rax
cmp    %rax,0x58(%rsp)
jne    19a0 <get_zip_listing+0x770>
mov    0x18(%rsp),%rdi
mov    %rbp,%rsi
call   1150 <parse_long_long@plt>
test   %rax,%rax
js     19ac <get_zip_listing+0x77c>
movslq 0x24(%rsp),%rax
cmp    %rax,0x58(%rsp)
jne    19b8 <get_zip_listing+0x788>
mov    0x8(%rsp),%rdi
mov    %rbp,%rsi
call   1150 <parse_long_long@plt>
test   %rax,%rax
js     19c4 <get_zip_listing+0x794>
movslq 0x20(%rsp),%rax
mov    $0x3,%r13d
cmp    %rax,0x58(%rsp)
mov    (%rsp),%r12
mov    0x8(%rsp),%rbp
je     181d <get_zip_listing+0x5ed>
jmp    19d0 <get_zip_listing+0x7a0>
call   1040 <strncmp@plt>
xor    %r13d,%r13d
test   %eax,%eax
sete   %r13b
mov    0x8(%rsp),%rbp
jmp    181d <get_zip_listing+0x5ed>
mov    $0x2,%r13d
mov    (%rsp),%rax
mov    %rax,0x68(%rsp)
mov    0x78(%rsp),%rax
mov    %rax,0x70(%rsp)
mov    0x48(%rsp),%eax
mov    %eax,0x20(%rsp)
mov    0x44(%rsp),%eax
mov    %eax,0x24(%rsp)
mov    %r14,%rdi
mov    0x4c(%rsp),%esi
mov    0x30(%rsp),%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
mov    0x68(%rsp),%rax
mov    0x70(%rsp),%rcx
mov    0x20(%rsp),%edx
mov    0x24(%rsp),%esi
jne    145f <get_zip_listing+0x22f>
mov    0x30(%rsp),%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
mov    %rax,(%rsp)
cmp    $0x3,%r13d
mov    0x18(%rsp),%r15
mov    0x10(%rsp),%r13
je     1311 <get_zip_listing+0xe1>
jmp    188b <get_zip_listing+0x65b>
xor    %eax,%eax
mov    %rax,(%rsp)
xor    %eax,%eax
mov    %rax,0x50(%rsp)
jmp    1301 <get_zip_listing+0xd1>
mov    0x30(%rsp),%rdi
call   1060 <fclose@plt>
lea    0x99c(%rip),%rdi
xor    %eax,%eax
call   1130 <error@plt>
mov    $0xffffffff,%eax
jmp    1363 <get_zip_listing+0x133>
lea    0x8d4(%rip),%rdi
xor    %eax,%eax
call   1130 <error@plt>
mov    %rbp,%rbx
jmp    1910 <get_zip_listing+0x6e0>
lea    0x8e2(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1130 <error@plt>
mov    %r15,%rbx
jmp    1910 <get_zip_listing+0x6e0>
lea    0x8e7(%rip),%rdi
xor    %eax,%eax
call   1130 <error@plt>
mov    %r15,%rbx
jmp    1910 <get_zip_listing+0x6e0>
lea    0x8fc(%rip),%rdi
mov    %rbx,%rsi
jmp    1909 <get_zip_listing+0x6d9>
lea    0x907(%rip),%rdi
jmp    1909 <get_zip_listing+0x6d9>
lea    0x916(%rip),%rdi
mov    0x10(%rsp),%rsi
jmp    1909 <get_zip_listing+0x6d9>
lea    0x908(%rip),%rdi
xor    %eax,%eax
call   1130 <error@plt>
mov    0x10(%rsp),%r13
mov    $0xffffffff,%eax
mov    %rax,(%rsp)
mov    0x30(%rsp),%rdi
test   %rdi,%rdi
je     192d <get_zip_listing+0x6fd>
call   1060 <fclose@plt>
mov    0x8(%rsp),%rbp
mov    0x18(%rsp),%r15
jmp    1311 <get_zip_listing+0xe1>
lea    0x70c(%rip),%rdi
jmp    1892 <get_zip_listing+0x662>
lea    0x715(%rip),%rdi
jmp    1892 <get_zip_listing+0x662>
lea    0x72c(%rip),%rdi
mov    (%rsp),%rsi
jmp    196b <get_zip_listing+0x73b>
lea    0x743(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1130 <error@plt>
mov    $0xffffffff,%eax
jmp    1363 <get_zip_listing+0x133>
lea    0x745(%rip),%rdi
jmp    1892 <get_zip_listing+0x662>
lea    0x74c(%rip),%rdi
jmp    1892 <get_zip_listing+0x662>
lea    0x754(%rip),%rdi
jmp    1892 <get_zip_listing+0x662>
lea    0x766(%rip),%rdi
jmp    1892 <get_zip_listing+0x662>
lea    0x773(%rip),%rdi
jmp    1892 <get_zip_listing+0x662>
lea    0x77a(%rip),%rdi
jmp    1892 <get_zip_listing+0x662>
lea    0x782(%rip),%rdi
jmp    1892 <get_zip_listing+0x662>
lea    0x78e(%rip),%rdi
jmp    1892 <get_zip_listing+0x662>

LLVM IR (-O0):
%struct.archive_file = type { i32 }
@.str = [12 x i8] c"/usr/bin/7z\00"
@.str.1 = [2 x i8] c"l\00"
@.str.2 = [23 x i8] c"archiver exit code: %d\00"
@stderr = global i32 0
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [21 x i8] c"------------------- \00"
@.str.6 = [15 x i8] c"%s%s%s%s%s%s%n\00"
@.str.7 = [21 x i8] c"invalid summary line\00"
@.str.8 = [28 x i8] c"garbage in the summary line\00"
@.str.9 = [7 x i8] c"files,\00"
@.str.10 = [28 x i8] c"expected 'files,', got '%s'\00"
@.str.11 = [8 x i8] c"folders\00"
@.str.12 = [29 x i8] c"expected 'folders', got '%s'\00"
@.str.13 = [19 x i8] c"invalid total size\00"
@.str.14 = [20 x i8] c"total size mismatch\00"
@.str.15 = [30 x i8] c"invalid total compressed size\00"
@.str.16 = [25 x i8] c"compressed size mismatch\00"
@.str.17 = [19 x i8] c"invalid file count\00"
@.str.18 = [20 x i8] c"file count mismatch\00"
@.str.19 = [24 x i8] c"invalid directory count\00"
@.str.20 = [25 x i8] c"directory count mismatch\00"
@.str.21 = [33 x i8] c"garbage after the end of listing\00"
@.str.22 = [13 x i8] c"%s%s%s%s%s%n\00"
@.str.23 = [27 x i8] c"listing line %s is invalid\00"
@.str.24 = [40 x i8] c"file information takes >= 53 characters\00"
@.str.25 = [23 x i8] c"invalid file size '%s'\00"
@INT_MAX = global i64 0
@.str.26 = [24 x i8] c"invalid file size: %lld\00"
@.str.27 = [29 x i8] c"invalid compressed size '%s'\00"
@.str.28 = [23 x i8] c"unexpected listing end\00"
define i32 @get_zip_listing(i8* %0, %struct.archive_file* %1, i8** %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.archive_file*
%8 = alloca i8**
%9 = alloca i8**
%10 = alloca [4 x i8*]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i32*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i8*
%25 = alloca i8*
%26 = alloca i8*
%27 = alloca i8*
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i64
%32 = alloca i64
%33 = alloca i64
%34 = alloca i64
%35 = alloca i64
store i8* %0, i8** %6
store %struct.archive_file* %1, %struct.archive_file** %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
store i32 -1, i32* %12
store i32 0, i32* %13
store i8* null, i8** %15
store i8* null, i8** %16
store i8* null, i8** %19
store i32* null, i32** %20
store i8* null, i8** %21
store i8* null, i8** %22
store i8* null, i8** %23
store i8* null, i8** %24
store i8* null, i8** %25
store i8* null, i8** %26
store i32 0, i32* %28
store i32 0, i32* %29
store i32 0, i32* %30
store i64 0, i64* %34
store i64 0, i64* %35
%36 = getelementptr inbounds [4 x i8*], [4 x i8*]* %10, i64 0, i64 0
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %36
%37 = getelementptr inbounds [4 x i8*], [4 x i8*]* %10, i64 0, i64 1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %37
%38 = load i8*, i8** %6
%39 = getelementptr inbounds [4 x i8*], [4 x i8*]* %10, i64 0, i64 2
store i8* %38, i8** %39
%40 = getelementptr inbounds [4 x i8*], [4 x i8*]* %10, i64 0, i64 3
store i8* null, i8** %40
%41 = getelementptr inbounds [4 x i8*], [4 x i8*]* %10, i64 0, i64 0
%42 = call i32 @ejudge_invoke_process(i8** %41, i32* null, i32* null, i32* null, i32* null, i32 0, i8** %15, i8** %16)
store i32 %42, i32* %11
%43 = load i32, i32* %11
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %51
45: ; preds = %4
%46 = load i32, i32* %11
%47 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %46)
%48 = load i32, i32* @stderr
%49 = load i8*, i8** %16
%50 = call i32 @fprintf(i32 %48, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %49)
br label %324
51: ; preds = %4
%52 = load i8*, i8** %16
%53 = call i32 @free(i8* %52)
store i8* null, i8** %16
%54 = load i8*, i8** %15
%55 = icmp ne i8* %54, null
br i1 %55, label %57, label %56
56: ; preds = %51
store i32 0, i32* %12
br label %324
57: ; preds = %51
%58 = load i8*, i8** %15
%59 = call i32 @strlen(i8* %58)
store i32 %59, i32* %17
%60 = load i32, i32* %17
%61 = add nsw i32 %60, 10
%62 = call i8* @malloc(i32 %61)
store i8* %62, i8** %19
%63 = load i32, i32* %17
%64 = add nsw i32 %63, 10
%65 = call i8* @malloc(i32 %64)
store i8* %65, i8** %21
%66 = load i32, i32* %17
%67 = add nsw i32 %66, 10
%68 = call i8* @malloc(i32 %67)
store i8* %68, i8** %22
%69 = load i32, i32* %17
%70 = add nsw i32 %69, 10
%71 = call i8* @malloc(i32 %70)
store i8* %71, i8** %23
%72 = load i32, i32* %17
%73 = add nsw i32 %72, 10
%74 = call i8* @malloc(i32 %73)
store i8* %74, i8** %24
%75 = load i32, i32* %17
%76 = add nsw i32 %75, 10
%77 = call i8* @malloc(i32 %76)
store i8* %77, i8** %25
%78 = load i32, i32* %17
%79 = add nsw i32 %78, 10
%80 = call i8* @malloc(i32 %79)
store i8* %80, i8** %26
%81 = load i8*, i8** %15
%82 = load i32, i32* %17
%83 = call i32* @fmemopen(i8* %81, i32 %82, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %83, i32** %20
br label %84
84: ; preds = %310, %222, %212, %123, %57
%85 = load i8*, i8** %19
%86 = load i32, i32* %17
%87 = add nsw i32 %86, 10
%88 = load i32*, i32** %20
%89 = call i64 @fgets(i8* %85, i32 %87, i32* %88)
%90 = icmp ne i64 %89, 0
br i1 %90, label %91, label %316
91: ; preds = %84
%92 = load i8*, i8** %19
%93 = call i32 @strlen(i8* %92)
store i32 %93, i32* %18
br label %94
94: ; preds = %108, %91
%95 = load i32, i32* %18
%96 = icmp sgt i32 %95, 0
br i1 %96, label %97, label %106
97: ; preds = %94
%98 = load i8*, i8** %19
%99 = load i32, i32* %18
%100 = sub nsw i32 %99, 1
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i8, i8* %98, i64 %101
%103 = load i8, i8* %102
%104 = call i64 @isspace(i8 zeroext %103)
%105 = icmp ne i64 %104, 0
br label %106
106: ; preds = %97, %94
%107 = phi i1 [ false, %94 ], [ %105, %97 ]
br i1 %107, label %108, label %111
108: ; preds = %106
%109 = load i32, i32* %18
%110 = add nsw i32 %109, -1
store i32 %110, i32* %18
br label %94
111: ; preds = %106
%112 = load i8*, i8** %19
%113 = load i32, i32* %18
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i8, i8* %112, i64 %114
store i8 0, i8* %115
%116 = load i32, i32* %13
%117 = icmp eq i32 %116, 0
br i1 %117, label %118, label %124
118: ; preds = %111
%119 = load i8*, i8** %19
%120 = call i32 @strncmp(i8* %119, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 20)
%121 = icmp ne i32 %120, 0
br i1 %121, label %123, label %122
122: ; preds = %118
store i32 1, i32* %13
br label %123
123: ; preds = %122, %118
br label %84
124: ; preds = %111
%125 = load i32, i32* %13
%126 = icmp eq i32 %125, 2
br i1 %126, label %127, label %213
127: ; preds = %124
%128 = load i8*, i8** %19
%129 = load i8*, i8** %24
%130 = load i8*, i8** %25
%131 = load i8*, i8** %21
%132 = load i8*, i8** %22
%133 = load i8*, i8** %23
%134 = load i8*, i8** %26
%135 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...) @sscanf(i8* %128, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %129, i8* %130, i8* %131, i8* %132, i8* %133, i8* %134, i32* %14)
%136 = icmp ne i32 %135, 6
br i1 %136, label %137, label %139
137: ; preds = %127
%138 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
store i32 -1, i32* %5
br label %350
139: ; preds = %127
%140 = load i8*, i8** %19
%141 = load i32, i32* %14
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds i8, i8* %140, i64 %142
%144 = load i8, i8* %143
%145 = icmp ne i8 %144, 0
br i1 %145, label %146, label %148
146: ; preds = %139
%147 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0))
store i32 -1, i32* %5
br label %350
148: ; preds = %139
%149 = load i8*, i8** %22
%150 = call i64 @strcmp(i8* %149, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%151 = icmp ne i64 %150, 0
br i1 %151, label %152, label %155
152: ; preds = %148
%153 = load i8*, i8** %22
%154 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i8* %153)
store i32 -1, i32* %5
br label %350
155: ; preds = %148
%156 = load i8*, i8** %26
%157 = call i64 @strcmp(i8* %156, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%158 = icmp ne i64 %157, 0
br i1 %158, label %159, label %162
159: ; preds = %155
%160 = load i8*, i8** %26
%161 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0), i8* %160)
store i32 -1, i32* %5
br label %350
162: ; preds = %155
%163 = load i8*, i8** %24
%164 = call i64 @parse_long_long(i8* %163, i64* %33)
%165 = icmp slt i64 %164, 0
br i1 %165, label %166, label %168
166: ; preds = %162
%167 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0))
store i32 -1, i32* %5
br label %350
168: ; preds = %162
%169 = load i64, i64* %33
%170 = load i64, i64* %34
%171 = icmp ne i64 %169, %170
br i1 %171, label %172, label %174
172: ; preds = %168
%173 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0))
store i32 -1, i32* %5
br label %350
174: ; preds = %168
%175 = load i8*, i8** %25
%176 = call i64 @parse_long_long(i8* %175, i64* %33)
%177 = icmp slt i64 %176, 0
br i1 %177, label %178, label %180
178: ; preds = %174
%179 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.15, i64 0, i64 0))
store i32 -1, i32* %5
br label %350
180: ; preds = %174
%181 = load i64, i64* %33
%182 = load i64, i64* %35
%183 = icmp ne i64 %181, %182
br i1 %183, label %184, label %186
184: ; preds = %180
%185 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i64 0, i64 0))
store i32 -1, i32* %5
br label %350
186: ; preds = %180
%187 = load i8*, i8** %21
%188 = call i64 @parse_long_long(i8* %187, i64* %33)
%189 = icmp slt i64 %188, 0
br i1 %189, label %190, label %192
190: ; preds = %186
%191 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i64 0, i64 0))
store i32 -1, i32* %5
br label %350
192: ; preds = %186
%193 = load i64, i64* %33
%194 = load i32, i32* %28
%195 = sext i32 %194 to i64
%196 = icmp ne i64 %193, %195
br i1 %196, label %197, label %199
197: ; preds = %192
%198 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.18, i64 0, i64 0))
store i32 -1, i32* %5
br label %350
199: ; preds = %192
%200 = load i8*, i8** %23
%201 = call i64 @parse_long_long(i8* %200, i64* %33)
%202 = icmp slt i64 %201, 0
br i1 %202, label %203, label %205
203: ; preds = %199
%204 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.19, i64 0, i64 0))
store i32 -1, i32* %5
br label %350
205: ; preds = %199
%206 = load i64, i64* %33
%207 = load i32, i32* %29
%208 = sext i32 %207 to i64
%209 = icmp ne i64 %206, %208
br i1 %209, label %210, label %212
210: ; preds = %205
%211 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.20, i64 0, i64 0))
store i32 -1, i32* %5
br label %350
212: ; preds = %205
store i32 3, i32* %13
br label %84
213: ; preds = %124
%214 = load i32, i32* %13
%215 = icmp eq i32 %214, 3
br i1 %215, label %216, label %218
216: ; preds = %213
%217 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0))
br label %324
218: ; preds = %213
%219 = load i8*, i8** %19
%220 = call i32 @strncmp(i8* %219, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 20)
%221 = icmp ne i32 %220, 0
br i1 %221, label %223, label %222
222: ; preds = %218
store i32 2, i32* %13
br label %84
223: ; preds = %218
%224 = load i8*, i8** %19
%225 = load i8*, i8** %21
%226 = load i8*, i8** %22
%227 = load i8*, i8** %23
%228 = load i8*, i8** %24
%229 = load i8*, i8** %25
%230 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...) @sscanf(i8* %224, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0), i8* %225, i8* %226, i8* %227, i8* %228, i8* %229, i32* %14)
%231 = icmp ne i32 %230, 5
br i1 %231, label %232, label %235
232: ; preds = %223
%233 = load i8*, i8** %19
%234 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.23, i64 0, i64 0), i8* %233)
br label %324
235: ; preds = %223
%236 = load i32, i32* %14
%237 = icmp sge i32 %236, 53
br i1 %237, label %238, label %240
238: ; preds = %235
%239 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.24, i64 0, i64 0))
br label %324
240: ; preds = %235
%241 = load i8*, i8** %19
%242 = getelementptr inbounds i8, i8* %241, i64 53
store i8* %242, i8** %27
%243 = load i8*, i8** %21
%244 = load i8*, i8** %22
%245 = call i64 @check_zip_date(i8* %243, i8* %244)
%246 = icmp slt i64 %245, 0
br i1 %246, label %247, label %248
247: ; preds = %240
br label %324
248: ; preds = %240
%249 = load i8*, i8** %23
%250 = call i64 @parse_zip_file_type(i8* %249, i32* %30)
%251 = icmp slt i64 %250, 0
br i1 %251, label %252, label %253
252: ; preds = %248
br label %324
253: ; preds = %248
%254 = load i8*, i8** %24
%255 = call i64 @parse_long_long(i8* %254, i64* %31)
%256 = icmp slt i64 %255, 0
br i1 %256, label %257, label %260
257: ; preds = %253
%258 = load i8*, i8** %24
%259 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.25, i64 0, i64 0), i8* %258)
br label %324
260: ; preds = %253
%261 = load i64, i64* %31
%262 = icmp slt i64 %261, 0
br i1 %262, label %267, label %263
263: ; preds = %260
%264 = load i64, i64* %31
%265 = load i64, i64* @INT_MAX
%266 = icmp sgt i64 %264, %265
br i1 %266, label %267, label %270
267: ; preds = %263, %260
%268 = load i64, i64* %31
%269 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.26, i64 0, i64 0), i64 %268)
br label %324
270: ; preds = %263
%271 = load i8*, i8** %25
%272 = call i64 @parse_long_long(i8* %271, i64* %32)
%273 = icmp slt i64 %272, 0
br i1 %273, label %274, label %277
274: ; preds = %270
%275 = load i8*, i8** %25
%276 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.27, i64 0, i64 0), i8* %275)
br label %324
277: ; preds = %270
%278 = load i64, i64* %32
%279 = icmp slt i64 %278, 0
br i1 %279, label %284, label %280
280: ; preds = %277
%281 = load i64, i64* %32
%282 = load i64, i64* @INT_MAX
%283 = icmp sgt i64 %281, %282
br i1 %283, label %284, label %287
284: ; preds = %280, %277
%285 = load i64, i64* %32
%286 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.27, i64 0, i64 0), i64 %285)
br label %324
287: ; preds = %280
%288 = load i8*, i8** %27
%289 = load i8**, i8*** %8
%290 = load i8**, i8*** %9
%291 = call i64 @check_file_name(i8* %288, i8** %289, i8** %290)
%292 = icmp slt i64 %291, 0
br i1 %292, label %293, label %294
293: ; preds = %287
br label %324
294: ; preds = %287
%295 = load i64, i64* %31
%296 = load i64, i64* %34
%297 = add nsw i64 %296, %295
store i64 %297, i64* %34
%298 = load i64, i64* %32
%299 = load i64, i64* %35
%300 = add nsw i64 %299, %298
store i64 %300, i64* %35
%301 = load i32, i32* %30
%302 = call i64 @S_ISDIR(i32 %301)
%303 = icmp ne i64 %302, 0
br i1 %303, label %304, label %307
304: ; preds = %294
%305 = load i32, i32* %29
%306 = add nsw i32 %305, 1
store i32 %306, i32* %29
br label %310
307: ; preds = %294
%308 = load i32, i32* %28
%309 = add nsw i32 %308, 1
store i32 %309, i32* %28
br label %310
310: ; preds = %307, %304
%311 = load %struct.archive_file*, %struct.archive_file** %7
%312 = load i64, i64* %31
%313 = load i32, i32* %30
%314 = load i8*, i8** %27
%315 = call i32 @append_entry(%struct.archive_file* %311, i64 %312, i32 %313, i8* %314)
br label %84
316: ; preds = %84
%317 = load i32*, i32** %20
%318 = call i32 @fclose(i32* %317)
store i32* null, i32** %20
%319 = load i32, i32* %13
%320 = icmp ne i32 %319, 3
br i1 %320, label %321, label %323
321: ; preds = %316
%322 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.28, i64 0, i64 0))
store i32 -1, i32* %5
br label %350
323: ; preds = %316
store i32 0, i32* %12
br label %324
324: ; preds = %323, %293, %284, %274, %267, %257, %252, %247, %238, %232, %216, %56, %45
%325 = load i32*, i32** %20
%326 = icmp ne i32* %325, null
br i1 %326, label %327, label %330
327: ; preds = %324
%328 = load i32*, i32** %20
%329 = call i32 @fclose(i32* %328)
br label %330
330: ; preds = %327, %324
%331 = load i8*, i8** %15
%332 = call i32 @free(i8* %331)
%333 = load i8*, i8** %16
%334 = call i32 @free(i8* %333)
%335 = load i8*, i8** %19
%336 = call i32 @free(i8* %335)
%337 = load i8*, i8** %21
%338 = call i32 @free(i8* %337)
%339 = load i8*, i8** %22
%340 = call i32 @free(i8* %339)
%341 = load i8*, i8** %23
%342 = call i32 @free(i8* %341)
%343 = load i8*, i8** %24
%344 = call i32 @free(i8* %343)
%345 = load i8*, i8** %25
%346 = call i32 @free(i8* %345)
%347 = load i8*, i8** %26
%348 = call i32 @free(i8* %347)
%349 = load i32, i32* %12
store i32 %349, i32* %5
br label %350
350: ; preds = %330, %321, %210, %203, %197, %190, %184, %178, %172, %166, %159, %152, %146, %137
%351 = load i32, i32* %5
ret i32 %351
}

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