#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 */
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  unsigned char *next_in;
  int avail_out;
  unsigned char *next_out;
  int /*<<< orphan*/ avail_in;
  void *opaque;
  void *zfree;
  void *zalloc;
};
typedef TYPE_1__ z_stream;
struct dirent {
  char *d_name;
};
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ PATH_MAX;
int /*<<< orphan*/ Z_NO_FLUSH;
void *Z_NULL;
int Z_OK;
double atof(char *);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int inflate(TYPE_1__ *, int /*<<< orphan*/);
int /*<<< orphan*/ inflateEnd(TYPE_1__ *);
int inflateInit2(TYPE_1__ *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ printf(char *, char *);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int /*<<< orphan*/ *strstr(char *, char *);
char *strtok(char *, char *);
int main(int argc, char *argv[]) {
  char *log_dir, *out_file;
  char *type;
  DIR *dp;
  struct dirent *ep;
  double tstart, tstop;
  char *out_str;
  FILE *fd, *fdo;
  char buf[PATH_MAX + 1], logfile[PATH_MAX + 1];
  z_stream strm;
  int ret;
  char in[64 * 1024], out[64 * 1024];
  char *ptr;
  if (argc != 4) {
    printf("USAGE: %s <log_dir> <type> <out_file>\n", argv[0]);
    return EXIT_FAILURE;
  }
  if (argv[1][0] != '/') {
    fprintf(stderr,
            "%s: error: expected an absolute directory name for --prefix: %s\n",
            argv[0], argv[1]);
    return EXIT_FAILURE;
  }
  if (argv[3][0] != '/') {
    fprintf(stderr,
            "%s: error: expected an absolute directory name for --prefix: %s\n",
            argv[0], argv[3]);
    return EXIT_FAILURE;
  }
  log_dir = argv[1];
  type = argv[2];
  out_file = argv[3];
  dp = opendir(log_dir);
  if (!dp) {
    fprintf(stderr, "%s: error: error opening directory %s\n", argv[0],
            log_dir);
    return EXIT_FAILURE;
  }
  out_str = (char *)malloc(52428800);
  if (!out_str) {
    fprintf(stderr, "%s: error: allocation error.\n", argv[0]);
    return EXIT_FAILURE;
  }
  out_str[0] = '\0';
  while ((ep = readdir(dp))) {
    sprintf(logfile, "%s/%s", log_dir, ep->d_name);
    if (strstr(logfile, ".gz") == NULL)
      continue;
    fd = fopen(logfile, "rb");
    if (!fd) {
      fprintf(stderr, "%s: warn: cannot open file %s.\n", argv[0], logfile);
      continue;
    }
    strm.zalloc = Z_NULL;
    strm.zfree = Z_NULL;
    strm.opaque = Z_NULL;
    strm.avail_in = fread(in, 1, 64 * 1024, fd);
    strm.next_in = (unsigned char *)in;
    strm.avail_out = 64 * 1024;
    strm.next_out = (unsigned char *)out;
    ret = inflateInit2(&strm, 47);
    if (ret != Z_OK) {
      fprintf(stderr, "%s: err: cannot initialize inflate\n", argv[0]);
      fclose(fd);
      closedir(dp);
      free(out_str);
      return EXIT_FAILURE;
    }
    ret = inflate(&strm, Z_NO_FLUSH);
    tstart = -1.;
    tstop = -1.;
    ptr = strtok(out, " ");
    while (ptr != NULL && (tstart < 0. || tstop < 0.)) {
      if (strcmp(ptr, "TSTART") == 0) {
        ptr = strtok(NULL, " ");
        ptr = strtok(NULL, " ");
        tstart = atof(ptr);
      }
      if (strcmp(ptr, "TSTOP") == 0) {
        ptr = strtok(NULL, " ");
        ptr = strtok(NULL, " ");
        tstop = atof(ptr);
      }
      ptr = strtok(NULL, " ");
    }
    inflateEnd(&strm);
    fclose(fd);
    sprintf(out_str + strlen(out_str), "%s %lf %lf %s\n", logfile, tstart,
            tstop, type);
  }
  if (strlen(out_str) > 0)
    out_str[strlen(out_str) - 1] = '\0';
  fdo = fopen(out_file, "w");
  if (!fdo) {
    fprintf(stderr, "%s: err: cannot open outout file %s.\n", argv[0],
            out_file);
    closedir(dp);
    free(out_str);
    return EXIT_FAILURE;
  }
  fwrite(out_str, 1, strlen(out_str), fdo);
  fclose(fdo);
  closedir(dp);
  free(out_str);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2d90(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %rsp,%rdx
mov    %rdx,-0x68(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,%rsp
mov    %rcx,-0x70(%rbp)
mov    (%rax),%eax
add    $0x1,%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x200d8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x78(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     12e0 <main+0xa0>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xd48(%rip),%rdi
call   10b0 <printf@plt>
mov    0x2cec(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x200cc(%rbp)
jmp    18d6 <main+0x696>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1335 <main+0xf5>
mov    0x2cd5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xd1c(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    0x2c97(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x200cc(%rbp)
jmp    18d6 <main+0x696>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     138a <main+0x14a>
mov    0x2c80(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
lea    0xcc7(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    0x2c42(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x200cc(%rbp)
jmp    18d6 <main+0x696>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <opendir@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1403 <main+0x1c3>
mov    0x2c03(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x18(%rbp),%rcx
lea    0xc8f(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    0x2bc9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x200cc(%rbp)
jmp    18d6 <main+0x696>
mov    $0x3200000,%edi
call   1110 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1455 <main+0x215>
mov    0x2bad(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xc64(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    0x2b77(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x200cc(%rbp)
jmp    18d6 <main+0x696>
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x30(%rbp),%rdi
call   1100 <readdir@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     17d3 <main+0x593>
mov    -0x200d8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x38(%rbp),%rax
mov    (%rax),%rcx
lea    0xc29(%rip),%rsi
mov    $0x0,%al
call   1140 <sprintf@plt>
mov    -0x200d8(%rbp),%rdi
lea    0xc1a(%rip),%rsi
call   1160 <strstr@plt>
cmp    $0x0,%rax
jne    14b5 <main+0x275>
jmp    145c <main+0x21c>
mov    -0x200d8(%rbp),%rdi
lea    0xbfc(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    1501 <main+0x2c1>
mov    -0x200d8(%rbp),%rcx
mov    0x2aeb(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xbcd(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
jmp    145c <main+0x21c>
mov    0x2ab8(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x80(%rbp)
mov    0x2aaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x88(%rbp)
mov    0x2a99(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x90(%rbp)
lea    -0x100c0(%rbp),%rdi
mov    -0x58(%rbp),%rcx
mov    $0x1,%esi
mov    $0x10000,%edx
call   1050 <fread@plt>
mov    %eax,-0x98(%rbp)
lea    -0x100c0(%rbp),%rax
mov    %rax,-0xb0(%rbp)
movl   $0x10000,-0xa8(%rbp)
lea    -0x200c0(%rbp),%rax
mov    %rax,-0xa0(%rbp)
lea    -0xb0(%rbp),%rdi
mov    $0x2f,%esi
call   1090 <inflateInit2@plt>
mov    %eax,-0xb4(%rbp)
mov    -0xb4(%rbp),%eax
mov    0x2a4d(%rip),%rcx
cmp    (%rcx),%eax
je     15f7 <main+0x3b7>
mov    0x2a26(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xb28(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0x58(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x30(%rbp),%rdi
call   10c0 <closedir@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    0x29d5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x200cc(%rbp)
jmp    18d6 <main+0x696>
mov    0x29ca(%rip),%rax
mov    (%rax),%esi
lea    -0xb0(%rbp),%rdi
call   1040 <inflate@plt>
mov    %eax,-0xb4(%rbp)
movsd  0x9e6(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0x9d9(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
lea    -0x200c0(%rbp),%rdi
lea    0xacc(%rip),%rsi
call   1130 <strtok@plt>
mov    %rax,-0x200c8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x200c8(%rbp)
mov    %al,-0x200d9(%rbp)
je     168f <main+0x44f>
mov    $0x1,%al
xorps  %xmm0,%xmm0
ucomisd -0x40(%rbp),%xmm0
mov    %al,-0x200da(%rbp)
ja     1683 <main+0x443>
xorps  %xmm0,%xmm0
ucomisd -0x48(%rbp),%xmm0
seta   %al
mov    %al,-0x200da(%rbp)
mov    -0x200da(%rbp),%al
mov    %al,-0x200d9(%rbp)
mov    -0x200d9(%rbp),%al
test   $0x1,%al
jne    16a2 <main+0x462>
jmp    1776 <main+0x536>
mov    -0x200c8(%rbp),%rdi
lea    0xa58(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    16fe <main+0x4be>
xor    %eax,%eax
mov    %eax,%edi
lea    0xa3c(%rip),%rsi
call   1130 <strtok@plt>
mov    %rax,-0x200c8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xa25(%rip),%rsi
call   1130 <strtok@plt>
mov    %rax,-0x200c8(%rbp)
mov    -0x200c8(%rbp),%rdi
call   1060 <atof@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x200c8(%rbp),%rdi
lea    0xa03(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    175a <main+0x51a>
xor    %eax,%eax
mov    %eax,%edi
lea    0x9e0(%rip),%rsi
call   1130 <strtok@plt>
mov    %rax,-0x200c8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0x9c9(%rip),%rsi
call   1130 <strtok@plt>
mov    %rax,-0x200c8(%rbp)
mov    -0x200c8(%rbp),%rdi
call   1060 <atof@plt>
movsd  %xmm0,-0x48(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0x9a1(%rip),%rsi
call   1130 <strtok@plt>
mov    %rax,-0x200c8(%rbp)
jmp    1646 <main+0x406>
lea    -0xb0(%rbp),%rdi
call   10f0 <inflateEnd@plt>
mov    -0x58(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x200e8(%rbp)
mov    -0x50(%rbp),%rdi
call   10a0 <strlen@plt>
mov    -0x200e8(%rbp),%rdi
mov    -0x200d8(%rbp),%rdx
cltq
add    %rax,%rdi
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
mov    -0x28(%rbp),%rcx
lea    0x94e(%rip),%rsi
mov    $0x2,%al
call   1140 <sprintf@plt>
jmp    145c <main+0x21c>
mov    -0x50(%rbp),%rdi
call   10a0 <strlen@plt>
cmp    $0x0,%eax
jle    180c <main+0x5cc>
mov    -0x50(%rbp),%rax
mov    %rax,-0x200f0(%rbp)
mov    -0x50(%rbp),%rdi
call   10a0 <strlen@plt>
mov    %eax,%ecx
mov    -0x200f0(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
lea    0x90d(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    187a <main+0x63a>
mov    0x279e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x20(%rbp),%rcx
lea    0x8e0(%rip),%rsi
mov    $0x0,%al
call   10e0 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   10c0 <closedir@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    0x2752(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x200cc(%rbp)
jmp    18d6 <main+0x696>
mov    -0x50(%rbp),%rax
mov    %rax,-0x200f8(%rbp)
mov    -0x50(%rbp),%rdi
call   10a0 <strlen@plt>
mov    -0x200f8(%rbp),%rdi
mov    %eax,%edx
mov    -0x60(%rbp),%rcx
mov    $0x1,%esi
call   1150 <fwrite@plt>
mov    -0x60(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x30(%rbp),%rdi
call   10c0 <closedir@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    0x26e9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x200cc(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20088,%rsp
mov    %rsi,%r15
mov    0x2d92(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %rsp,%r12
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
cmp    $0x4,%edi
jne    12f4 <main+0xb4>
mov    0x8(%r15),%rbx
cmpb   $0x2f,(%rbx)
jne    155c <main+0x31c>
mov    0x18(%r15),%r14
cmpb   $0x2f,(%r14)
jne    1574 <main+0x334>
mov    0x10(%r15),%rax
mov    %rax,-0x60(%rbp)
mov    %rbx,%rdi
call   1080 <opendir@plt>
test   %rax,%rax
je     15a9 <main+0x369>
mov    %rax,%r13
mov    $0x3200000,%edi
call   1110 <malloc@plt>
test   %rax,%rax
je     1636 <main+0x3f6>
mov    %rbx,-0x70(%rbp)
mov    %r14,-0x58(%rbp)
mov    %rax,-0x40(%rbp)
movb   $0x0,(%rax)
mov    %r13,%rdi
call   1100 <readdir@plt>
test   %rax,%rax
je     15be <main+0x37e>
lea    0xe1e(%rip),%r14
mov    %r13,-0x48(%rbp)
mov    %r15,-0x50(%rbp)
jmp    136f <main+0x12f>
mov    (%r15),%rsi
lea    0xd0a(%rip),%rdi
call   10b0 <printf@plt>
jmp    1591 <main+0x351>
nopl   0x0(%rax,%rax,1)
lea    -0xa8(%rbp),%rdi
call   10f0 <inflateEnd@plt>
mov    -0x68(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x40(%rbp),%rbx
mov    %rbx,%rdi
call   10a0 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
lea    0xdd7(%rip),%rsi
mov    %r12,%rdx
movsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x60(%rbp),%rcx
mov    $0x2,%al
call   1140 <sprintf@plt>
mov    -0x48(%rbp),%r13
mov    -0x50(%rbp),%r15
mov    %r13,%rdi
call   1100 <readdir@plt>
test   %rax,%rax
je     15be <main+0x37e>
mov    (%rax),%rcx
mov    %r12,%rdi
lea    0xd39(%rip),%rsi
mov    -0x70(%rbp),%rdx
xor    %eax,%eax
call   1140 <sprintf@plt>
mov    %r12,%rdi
lea    0xd2a(%rip),%rsi
call   1160 <strstr@plt>
test   %rax,%rax
je     135e <main+0x11e>
mov    %r12,%rdi
lea    0xd1a(%rip),%rsi
call   1120 <fopen@plt>
test   %rax,%rax
je     1536 <main+0x2f6>
mov    %rax,%r13
mov    0x2c03(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x78(%rbp)
mov    %rax,-0x80(%rbp)
mov    %rax,-0x88(%rbp)
lea    -0x200b0(%rbp),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x10000,%edx
mov    %r13,%rcx
call   1050 <fread@plt>
mov    %eax,-0x90(%rbp)
mov    %rbx,-0xa8(%rbp)
lea    -0x100b0(%rbp),%rax
movl   $0x10000,-0xa0(%rbp)
mov    %rax,-0x98(%rbp)
lea    -0xa8(%rbp),%rbx
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1090 <inflateInit2@plt>
mov    0x2bbd(%rip),%rcx
cmp    (%rcx),%eax
jne    167f <main+0x43f>
mov    %r13,-0x68(%rbp)
mov    0x2b8a(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <inflate@plt>
lea    -0x100b0(%rbp),%rdi
lea    0xcb0(%rip),%rbx
mov    %rbx,%rsi
call   1130 <strtok@plt>
movsd  0xb9a(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
test   %rax,%rax
lea    0xc95(%rip),%r15
je     1310 <main+0xd0>
mov    %rax,%r13
movsd  0xb75(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  %xmm0,-0x30(%rbp)
jmp    14b6 <main+0x276>
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %rbx,%rsi
call   1130 <strtok@plt>
mov    %rax,%r13
test   %rax,%rax
je     1310 <main+0xd0>
xorpd  %xmm0,%xmm0
ucomisd -0x38(%rbp),%xmm0
ja     14cc <main+0x28c>
ucomisd -0x30(%rbp),%xmm0
jbe    1310 <main+0xd0>
mov    %r13,%rdi
mov    %r14,%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
jne    1500 <main+0x2c0>
xor    %edi,%edi
mov    %rbx,%rsi
call   1130 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1130 <strtok@plt>
mov    %rax,%r13
mov    %rax,%rdi
call   1060 <atof@plt>
movsd  %xmm0,-0x38(%rbp)
mov    %r13,%rdi
mov    %r15,%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
jne    14a0 <main+0x260>
xor    %edi,%edi
mov    %rbx,%rsi
call   1130 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1130 <strtok@plt>
mov    %rax,%rdi
call   1060 <atof@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    14a0 <main+0x260>
mov    0x2a93(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xb79(%rip),%rsi
mov    %r12,%rcx
xor    %eax,%eax
call   10e0 <fprintf@plt>
mov    -0x48(%rbp),%r13
jmp    135e <main+0x11e>
mov    0x2a6d(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xac0(%rip),%rsi
mov    %rbx,%rcx
jmp    158a <main+0x34a>
mov    0x2a55(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xaa8(%rip),%rsi
mov    %r14,%rcx
xor    %eax,%eax
call   10e0 <fprintf@plt>
mov    0x2a20(%rip),%rax
mov    (%rax),%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2a20(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xab4(%rip),%rsi
jmp    156f <main+0x32f>
mov    -0x40(%rbp),%rbx
mov    %rbx,%rdi
call   10a0 <strlen@plt>
test   %eax,%eax
jle    15dd <main+0x39d>
mov    %rbx,%rdi
call   10a0 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
lea    0xb40(%rip),%rsi
mov    -0x58(%rbp),%r12
mov    %r12,%rdi
call   1120 <fopen@plt>
test   %rax,%rax
je     1655 <main+0x415>
mov    %rax,%r14
mov    %rbx,%rdi
call   10a0 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1150 <fwrite@plt>
mov    %r14,%rdi
call   1070 <fclose@plt>
mov    %r13,%rdi
call   10c0 <closedir@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x297f(%rip),%rax
jmp    1598 <main+0x358>
mov    0x2993(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xa4e(%rip),%rsi
xor    %eax,%eax
call   10e0 <fprintf@plt>
jmp    1591 <main+0x351>
mov    0x2974(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xabe(%rip),%rsi
mov    %r12,%rcx
xor    %eax,%eax
call   10e0 <fprintf@plt>
mov    %r13,%rdi
call   10c0 <closedir@plt>
mov    %rbx,%rdi
jmp    16b2 <main+0x472>
mov    0x294a(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%rax
mov    (%rax),%rdx
lea    0xa4c(%rip),%rsi
xor    %eax,%eax
call   10e0 <fprintf@plt>
mov    %r13,%rdi
call   1070 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   10c0 <closedir@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
jmp    1591 <main+0x351>

LLVM IR (-O0):
%struct.dirent = type { i8* }
%struct.TYPE_5__ = type { i8*, i32, i8*, i32, i8*, i8*, i8* }
@PATH_MAX = global i32 0
@.str = [39 x i8] c"USAGE: %s <log_dir> <type> <out_file>\0A\00"
@EXIT_FAILURE = global i32 0
@stderr = global i32 0
@.str.1 = [65 x i8] c"%s: error: expected an absolute directory name for --prefix: %s\0A\00"
@.str.2 = [39 x i8] c"%s: error: error opening directory %s\0A\00"
@.str.3 = [30 x i8] c"%s: error: allocation error.\0A\00"
@.str.4 = [6 x i8] c"%s/%s\00"
@.str.5 = [4 x i8] c".gz\00"
@.str.6 = [3 x i8] c"rb\00"
@.str.7 = [32 x i8] c"%s: warn: cannot open file %s.\0A\00"
@Z_NULL = global i8* null
@Z_OK = global i32 0
@.str.8 = [36 x i8] c"%s: err: cannot initialize inflate\0A\00"
@Z_NO_FLUSH = global i32 0
@.str.9 = [2 x i8] c" \00"
@.str.10 = [7 x i8] c"TSTART\00"
@.str.11 = [6 x i8] c"TSTOP\00"
@.str.12 = [15 x i8] c"%s %lf %lf %s\0A\00"
@.str.13 = [2 x i8] c"w\00"
@.str.14 = [38 x i8] c"%s: err: cannot open outout file %s.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca %struct.dirent*
%11 = alloca double
%12 = alloca double
%13 = alloca i8*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i8*
%17 = alloca i64
%18 = alloca i64
%19 = alloca %struct.TYPE_5__
%20 = alloca i32
%21 = alloca [65536 x i8]
%22 = alloca [65536 x i8]
%23 = alloca i8*
%24 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%25 = load i32, i32* @PATH_MAX
%26 = add nsw i32 %25, 1
%27 = zext i32 %26 to i64
%28 = call i8* @llvm.stacksave()
store i8* %28, i8** %16
%29 = alloca i8, i64 %27
store i64 %27, i64* %17
%30 = load i32, i32* @PATH_MAX
%31 = add nsw i32 %30, 1
%32 = zext i32 %31 to i64
%33 = alloca i8, i64 %32
store i64 %32, i64* %18
%34 = load i32, i32* %4
%35 = icmp ne i32 %34, 4
br i1 %35, label %36, label %42
36: ; preds = %2
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 0
%39 = load i8*, i8** %38
%40 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %39)
%41 = load i32, i32* @EXIT_FAILURE
store i32 %41, i32* %3
store i32 1, i32* %24
br label %263
42: ; preds = %2
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 1
%45 = load i8*, i8** %44
%46 = getelementptr inbounds i8, i8* %45, i64 0
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp ne i32 %48, 47
br i1 %49, label %50, label %60
50: ; preds = %42
%51 = load i32, i32* @stderr
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 0
%54 = load i8*, i8** %53
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 1
%57 = load i8*, i8** %56
%58 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), i8* %54, i8* %57)
%59 = load i32, i32* @EXIT_FAILURE
store i32 %59, i32* %3
store i32 1, i32* %24
br label %263
60: ; preds = %42
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 3
%63 = load i8*, i8** %62
%64 = getelementptr inbounds i8, i8* %63, i64 0
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = icmp ne i32 %66, 47
br i1 %67, label %68, label %78
68: ; preds = %60
%69 = load i32, i32* @stderr
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 0
%72 = load i8*, i8** %71
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 3
%75 = load i8*, i8** %74
%76 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), i8* %72, i8* %75)
%77 = load i32, i32* @EXIT_FAILURE
store i32 %77, i32* %3
store i32 1, i32* %24
br label %263
78: ; preds = %60
%79 = load i8**, i8*** %5
%80 = getelementptr inbounds i8*, i8** %79, i64 1
%81 = load i8*, i8** %80
store i8* %81, i8** %6
%82 = load i8**, i8*** %5
%83 = getelementptr inbounds i8*, i8** %82, i64 2
%84 = load i8*, i8** %83
store i8* %84, i8** %8
%85 = load i8**, i8*** %5
%86 = getelementptr inbounds i8*, i8** %85, i64 3
%87 = load i8*, i8** %86
store i8* %87, i8** %7
%88 = load i8*, i8** %6
%89 = call i32* @opendir(i8* %88)
store i32* %89, i32** %9
%90 = load i32*, i32** %9
%91 = icmp ne i32* %90, null
br i1 %91, label %100, label %92
92: ; preds = %78
%93 = load i32, i32* @stderr
%94 = load i8**, i8*** %5
%95 = getelementptr inbounds i8*, i8** %94, i64 0
%96 = load i8*, i8** %95
%97 = load i8*, i8** %6
%98 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %93, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %96, i8* %97)
%99 = load i32, i32* @EXIT_FAILURE
store i32 %99, i32* %3
store i32 1, i32* %24
br label %263
100: ; preds = %78
%101 = call i64 @malloc(i32 52428800)
%102 = inttoptr i64 %101 to i8*
store i8* %102, i8** %13
%103 = load i8*, i8** %13
%104 = icmp ne i8* %103, null
br i1 %104, label %112, label %105
105: ; preds = %100
%106 = load i32, i32* @stderr
%107 = load i8**, i8*** %5
%108 = getelementptr inbounds i8*, i8** %107, i64 0
%109 = load i8*, i8** %108
%110 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %106, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %109)
%111 = load i32, i32* @EXIT_FAILURE
store i32 %111, i32* %3
store i32 1, i32* %24
br label %263
112: ; preds = %100
%113 = load i8*, i8** %13
%114 = getelementptr inbounds i8, i8* %113, i64 0
store i8 0, i8* %114
br label %115
115: ; preds = %209, %132, %127, %112
%116 = load i32*, i32** %9
%117 = call %struct.dirent* @readdir(i32* %116)
store %struct.dirent* %117, %struct.dirent** %10
%118 = icmp ne %struct.dirent* %117, null
br i1 %118, label %119, label %222
119: ; preds = %115
%120 = load i8*, i8** %6
%121 = load %struct.dirent*, %struct.dirent** %10
%122 = getelementptr inbounds %struct.dirent, %struct.dirent* %121, i32 0, i32 0
%123 = load i8*, i8** %122
%124 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %33, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %120, i8* %123)
%125 = call i32* @strstr(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%126 = icmp eq i32* %125, null
br i1 %126, label %127, label %128
127: ; preds = %119
br label %115
128: ; preds = %119
%129 = call i32* @fopen(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32* %129, i32** %14
%130 = load i32*, i32** %14
%131 = icmp ne i32* %130, null
br i1 %131, label %138, label %132
132: ; preds = %128
%133 = load i32, i32* @stderr
%134 = load i8**, i8*** %5
%135 = getelementptr inbounds i8*, i8** %134, i64 0
%136 = load i8*, i8** %135
%137 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %133, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* %136, i8* %33)
br label %115
138: ; preds = %128
%139 = load i8*, i8** @Z_NULL
%140 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %19, i32 0, i32 6
store i8* %139, i8** %140
%141 = load i8*, i8** @Z_NULL
%142 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %19, i32 0, i32 5
store i8* %141, i8** %142
%143 = load i8*, i8** @Z_NULL
%144 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %19, i32 0, i32 4
store i8* %143, i8** %144
%145 = getelementptr inbounds [65536 x i8], [65536 x i8]* %21, i64 0, i64 0
%146 = load i32*, i32** %14
%147 = call i32 @fread(i8* %145, i32 1, i32 65536, i32* %146)
%148 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %19, i32 0, i32 3
store i32 %147, i32* %148
%149 = getelementptr inbounds [65536 x i8], [65536 x i8]* %21, i64 0, i64 0
%150 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %19, i32 0, i32 0
store i8* %149, i8** %150
%151 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %19, i32 0, i32 1
store i32 65536, i32* %151
%152 = getelementptr inbounds [65536 x i8], [65536 x i8]* %22, i64 0, i64 0
%153 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %19, i32 0, i32 2
store i8* %152, i8** %153
%154 = call i32 @inflateInit2(%struct.TYPE_5__* %19, i32 47)
store i32 %154, i32* %20
%155 = load i32, i32* %20
%156 = load i32, i32* @Z_OK
%157 = icmp ne i32 %155, %156
br i1 %157, label %158, label %171
158: ; preds = %138
%159 = load i32, i32* @stderr
%160 = load i8**, i8*** %5
%161 = getelementptr inbounds i8*, i8** %160, i64 0
%162 = load i8*, i8** %161
%163 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %159, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), i8* %162)
%164 = load i32*, i32** %14
%165 = call i32 @fclose(i32* %164)
%166 = load i32*, i32** %9
%167 = call i32 @closedir(i32* %166)
%168 = load i8*, i8** %13
%169 = call i32 @free(i8* %168)
%170 = load i32, i32* @EXIT_FAILURE
store i32 %170, i32* %3
store i32 1, i32* %24
br label %263
171: ; preds = %138
%172 = load i32, i32* @Z_NO_FLUSH
%173 = call i32 @inflate(%struct.TYPE_5__* %19, i32 %172)
store i32 %173, i32* %20
store double -1.000000e+00, double* %11
store double -1.000000e+00, double* %12
%174 = getelementptr inbounds [65536 x i8], [65536 x i8]* %22, i64 0, i64 0
%175 = call i8* @strtok(i8* %174, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i8* %175, i8** %23
br label %176
176: ; preds = %207, %171
%177 = load i8*, i8** %23
%178 = icmp ne i8* %177, null
br i1 %178, label %179, label %187
179: ; preds = %176
%180 = load double, double* %11
%181 = fcmp olt double %180, 0.000000e+00
br i1 %181, label %185, label %182
182: ; preds = %179
%183 = load double, double* %12
%184 = fcmp olt double %183, 0.000000e+00
br label %185
185: ; preds = %182, %179
%186 = phi i1 [ true, %179 ], [ %184, %182 ]
br label %187
187: ; preds = %185, %176
%188 = phi i1 [ false, %176 ], [ %186, %185 ]
br i1 %188, label %189, label %209
189: ; preds = %187
%190 = load i8*, i8** %23
%191 = call i64 @strcmp(i8* %190, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%192 = icmp eq i64 %191, 0
br i1 %192, label %193, label %198
193: ; preds = %189
%194 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i8* %194, i8** %23
%195 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i8* %195, i8** %23
%196 = load i8*, i8** %23
%197 = call double @atof(i8* %196)
store double %197, double* %11
br label %198
198: ; preds = %193, %189
%199 = load i8*, i8** %23
%200 = call i64 @strcmp(i8* %199, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%201 = icmp eq i64 %200, 0
br i1 %201, label %202, label %207
202: ; preds = %198
%203 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i8* %203, i8** %23
%204 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i8* %204, i8** %23
%205 = load i8*, i8** %23
%206 = call double @atof(i8* %205)
store double %206, double* %12
br label %207
207: ; preds = %202, %198
%208 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i8* %208, i8** %23
br label %176
209: ; preds = %187
%210 = call i32 @inflateEnd(%struct.TYPE_5__* %19)
%211 = load i32*, i32** %14
%212 = call i32 @fclose(i32* %211)
%213 = load i8*, i8** %13
%214 = load i8*, i8** %13
%215 = call i32 @strlen(i8* %214)
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds i8, i8* %213, i64 %216
%218 = load double, double* %11
%219 = load double, double* %12
%220 = load i8*, i8** %8
%221 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %217, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i8* %33, double %218, double %219, i8* %220)
br label %115
222: ; preds = %115
%223 = load i8*, i8** %13
%224 = call i32 @strlen(i8* %223)
%225 = icmp sgt i32 %224, 0
br i1 %225, label %226, label %233
226: ; preds = %222
%227 = load i8*, i8** %13
%228 = load i8*, i8** %13
%229 = call i32 @strlen(i8* %228)
%230 = sub nsw i32 %229, 1
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds i8, i8* %227, i64 %231
store i8 0, i8* %232
br label %233
233: ; preds = %226, %222
%234 = load i8*, i8** %7
%235 = call i32* @fopen(i8* %234, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
store i32* %235, i32** %15
%236 = load i32*, i32** %15
%237 = icmp ne i32* %236, null
br i1 %237, label %250, label %238
238: ; preds = %233
%239 = load i32, i32* @stderr
%240 = load i8**, i8*** %5
%241 = getelementptr inbounds i8*, i8** %240, i64 0
%242 = load i8*, i8** %241
%243 = load i8*, i8** %7
%244 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %239, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.14, i64 0, i64 0), i8* %242, i8* %243)
%245 = load i32*, i32** %9
%246 = call i32 @closedir(i32* %245)
%247 = load i8*, i8** %13
%248 = call i32 @free(i8* %247)
%249 = load i32, i32* @EXIT_FAILURE
store i32 %249, i32* %3
store i32 1, i32* %24
br label %263
250: ; preds = %233
%251 = load i8*, i8** %13
%252 = load i8*, i8** %13
%253 = call i32 @strlen(i8* %252)
%254 = load i32*, i32** %15
%255 = call i32 @fwrite(i8* %251, i32 1, i32 %253, i32* %254)
%256 = load i32*, i32** %15
%257 = call i32 @fclose(i32* %256)
%258 = load i32*, i32** %9
%259 = call i32 @closedir(i32* %258)
%260 = load i8*, i8** %13
%261 = call i32 @free(i8* %260)
%262 = load i32, i32* @EXIT_SUCCESS
store i32 %262, i32* %3
store i32 1, i32* %24
br label %263
263: ; preds = %250, %238, %158, %105, %92, %68, %50, %36
%264 = load i8*, i8** %16
%265 = load i32, i32* %3
ret i32 %265
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i8*, i32, i8*, i32, i8*, i8*, i8* }
%struct.dirent = type { i8* }
@PATH_MAX = global i32 0
@.str = [39 x i8] c"USAGE: %s <log_dir> <type> <out_file>\0A\00"
@EXIT_FAILURE = global i32 0
@stderr = global i32 0
@.str.1 = [65 x i8] c"%s: error: expected an absolute directory name for --prefix: %s\0A\00"
@.str.2 = [39 x i8] c"%s: error: error opening directory %s\0A\00"
@.str.3 = [30 x i8] c"%s: error: allocation error.\0A\00"
@.str.4 = [6 x i8] c"%s/%s\00"
@.str.5 = [4 x i8] c".gz\00"
@.str.6 = [3 x i8] c"rb\00"
@.str.7 = [32 x i8] c"%s: warn: cannot open file %s.\0A\00"
@Z_NULL = global i8* null
@Z_OK = global i32 0
@.str.8 = [36 x i8] c"%s: err: cannot initialize inflate\0A\00"
@Z_NO_FLUSH = global i32 0
@.str.9 = [2 x i8] c" \00"
@.str.10 = [7 x i8] c"TSTART\00"
@.str.11 = [6 x i8] c"TSTOP\00"
@.str.12 = [15 x i8] c"%s %lf %lf %s\0A\00"
@.str.13 = [2 x i8] c"w\00"
@.str.14 = [38 x i8] c"%s: err: cannot open outout file %s.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.TYPE_5__
%4 = alloca [65536 x i8]
%5 = alloca [65536 x i8]
%6 = load i32, i32* @PATH_MAX
%7 = add nsw i32 %6, 1
%8 = zext i32 %7 to i64
%9 = alloca i8, i64 %8
%10 = bitcast %struct.TYPE_5__* %3 to i8*
%11 = getelementptr inbounds [65536 x i8], [65536 x i8]* %4, i64 0, i64 0
%12 = getelementptr inbounds [65536 x i8], [65536 x i8]* %5, i64 0, i64 0
%13 = icmp eq i32 %0, 4
br i1 %13, label %17, label %14
14: ; preds = %2
%15 = load i8*, i8** %1
%16 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %157
17: ; preds = %2
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 47
br i1 %21, label %26, label %22
22: ; preds = %17
%23 = load i32, i32* @stderr
%24 = load i8*, i8** %1
%25 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), i8* %24, i8* %19)
br label %157
26: ; preds = %17
%27 = getelementptr inbounds i8*, i8** %1, i64 3
%28 = load i8*, i8** %27
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 47
br i1 %30, label %35, label %31
31: ; preds = %26
%32 = load i32, i32* @stderr
%33 = load i8*, i8** %1
%34 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), i8* %33, i8* %28)
br label %157
35: ; preds = %26
%36 = getelementptr inbounds i8*, i8** %1, i64 2
%37 = load i8*, i8** %36
%38 = tail call i32* @opendir(i8* %19)
%39 = icmp eq i32* %38, null
br i1 %39, label %40, label %44
40: ; preds = %35
%41 = load i32, i32* @stderr
%42 = load i8*, i8** %1
%43 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %42, i8* %19)
br label %157
44: ; preds = %35
%45 = tail call i64 @malloc(i32 52428800)
%46 = inttoptr i64 %45 to i8*
%47 = icmp eq i64 %45, 0
br i1 %47, label %48, label %52
48: ; preds = %44
%49 = load i32, i32* @stderr
%50 = load i8*, i8** %1
%51 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %50)
br label %157
52: ; preds = %44
store i8 0, i8* %46
%53 = call %struct.dirent* @readdir(i32* %38)
%54 = icmp eq %struct.dirent* %53, null
br i1 %54, label %134, label %55
55: ; preds = %52
%56 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 6
%57 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 5
%58 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 4
%59 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 3
%60 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 0
%61 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 1
%62 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 2
br label %63
63: ; preds = %55, %77
%64 = phi %struct.dirent* [ %53, %55 ], [ %78, %77 ]
%65 = getelementptr inbounds %struct.dirent, %struct.dirent* %64, i64 0, i32 0
%66 = load i8*, i8** %65
%67 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %19, i8* %66)
%68 = call i32* @strstr(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%69 = icmp eq i32* %68, null
br i1 %69, label %77, label %70
70: ; preds = %63
%71 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%72 = icmp eq i32* %71, null
br i1 %72, label %73, label %80
73: ; preds = %70
%74 = load i32, i32* @stderr
%75 = load i8*, i8** %1
%76 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* %75, i8* %9)
br label %77
77: ; preds = %73, %125, %63
%78 = call %struct.dirent* @readdir(i32* %38)
%79 = icmp eq %struct.dirent* %78, null
br i1 %79, label %134, label %63
80: ; preds = %70
%81 = load i8*, i8** @Z_NULL
store i8* %81, i8** %56
store i8* %81, i8** %57
store i8* %81, i8** %58
%82 = call i32 @fread(i8* %11, i32 1, i32 65536, i32* %71)
store i32 %82, i32* %59
store i8* %11, i8** %60
store i32 65536, i32* %61
store i8* %12, i8** %62
%83 = call i32 @inflateInit2(%struct.TYPE_5__* %3, i32 47)
%84 = load i32, i32* @Z_OK
%85 = icmp eq i32 %83, %84
br i1 %85, label %93, label %86
86: ; preds = %80
%87 = load i32, i32* @stderr
%88 = load i8*, i8** %1
%89 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), i8* %88)
%90 = call i32 @fclose(i32* %71)
%91 = call i32 @closedir(i32* %38)
%92 = call i32 @free(i8* %46)
br label %157
93: ; preds = %80
%94 = load i32, i32* @Z_NO_FLUSH
%95 = call i32 @inflate(%struct.TYPE_5__* %3, i32 %94)
%96 = call i8* @strtok(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%97 = icmp eq i8* %96, null
br i1 %97, label %125, label %98
98: ; preds = %93, %121
%99 = phi i8* [ %123, %121 ], [ %96, %93 ]
%100 = phi double [ %113, %121 ], [ -1.000000e+00, %93 ]
%101 = phi double [ %122, %121 ], [ -1.000000e+00, %93 ]
%102 = fcmp olt double %100, 0.000000e+00
%103 = fcmp olt double %101, 0.000000e+00
%104 = select i1 %102, i1 true, i1 %103
br i1 %104, label %105, label %125
105: ; preds = %98
%106 = call i64 @strcmp(i8* %99, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
br i1 %107, label %108, label %112
108: ; preds = %105
%109 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%110 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%111 = call double @atof(i8* %110)
br label %112
112: ; preds = %108, %105
%113 = phi double [ %111, %108 ], [ %100, %105 ]
%114 = phi i8* [ %110, %108 ], [ %99, %105 ]
%115 = call i64 @strcmp(i8* %114, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%116 = icmp eq i64 %115, 0
br i1 %116, label %117, label %121
117: ; preds = %112
%118 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%119 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%120 = call double @atof(i8* %119)
br label %121
121: ; preds = %117, %112
%122 = phi double [ %120, %117 ], [ %101, %112 ]
%123 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%124 = icmp eq i8* %123, null
br i1 %124, label %125, label %98
125: ; preds = %98, %121, %93
%126 = phi double [ -1.000000e+00, %93 ], [ %122, %121 ], [ %101, %98 ]
%127 = phi double [ -1.000000e+00, %93 ], [ %113, %121 ], [ %100, %98 ]
%128 = call i32 @inflateEnd(%struct.TYPE_5__* %3)
%129 = call i32 @fclose(i32* %71)
%130 = call i32 @strlen(i8* %46)
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i8, i8* %46, i64 %131
%133 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %132, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i8* %9, double %127, double %126, i8* %37)
br label %77
134: ; preds = %77, %52
%135 = call i32 @strlen(i8* %46)
%136 = icmp sgt i32 %135, 0
br i1 %136, label %137, label %142
137: ; preds = %134
%138 = call i32 @strlen(i8* %46)
%139 = add nsw i32 %138, -1
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i8, i8* %46, i64 %140
store i8 0, i8* %141
br label %142
142: ; preds = %137, %134
%143 = call i32* @fopen(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%144 = icmp eq i32* %143, null
br i1 %144, label %145, label %151
145: ; preds = %142
%146 = load i32, i32* @stderr
%147 = load i8*, i8** %1
%148 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %146, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.14, i64 0, i64 0), i8* %147, i8* %28)
%149 = call i32 @closedir(i32* %38)
%150 = call i32 @free(i8* %46)
br label %157
151: ; preds = %142
%152 = call i32 @strlen(i8* %46)
%153 = call i32 @fwrite(i8* %46, i32 1, i32 %152, i32* %143)
%154 = call i32 @fclose(i32* %143)
%155 = call i32 @closedir(i32* %38)
%156 = call i32 @free(i8* %46)
br label %157
157: ; preds = %151, %145, %86, %48, %40, %31, %22, %14
%158 = phi i32* [ @EXIT_FAILURE, %14 ], [ @EXIT_FAILURE, %22 ], [ @EXIT_FAILURE, %31 ], [ @EXIT_FAILURE, %86 ], [ @EXIT_SUCCESS, %151 ], [ @EXIT_FAILURE, %145 ], [ @EXIT_FAILURE, %48 ], [ @EXIT_FAILURE, %40 ]
%159 = load i32, i32* %158
ret i32 %159
}