#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 dirent {
  char *d_name;
};
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
scalar_t__ CheckExtension(char *, char *);
int /*<<< orphan*/ FixFilename(char *, char *);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ puts(char *);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcat(char *, char *);
char *strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *strrchr(char *, char);
void ShowStats(int fancy) {
  DIR *d;
  struct dirent *de;
  char buf[256];
  char fn[128];
  FILE *fp;
  char *s, *t;
  char logdir[256];
  if ("logs/"[0] != '/')
    FixFilename("logs/", logdir);
  else
    strcpy(logdir, "logs/");
  s = logdir + strlen(logdir) - 1;
  if (*s != '/')
    strcat(logdir, "/");
  d = opendir(logdir);
  if (!d) {
    puts("<html><head>PHPLMON Error</head><body>");
    printf("Unable to open log directory (%s)\n<p></body></html>", logdir);
    return;
  }
  puts("<html><head><title>PHPL Page Stats</title></head>");
  puts("<body>");
  if (fancy) {
    puts("<center><table border> <caption>PHPL Page Stats</caption>");
    puts("<tr> <th>HTML Page</th> <th>Total</th> <th>Today</th> <th>Last "
         "Access</th> <th>By</th> </tr>");
  } else {
    puts("<pre><u>  <i><b>HTML Page</b></i>\t  <i><b>Total</b></i>  "
         "<i><b>Today</b></i>   <i><b>Last Access</b></i>    "
         "<i><b>By</b></i></u>");
  }
  while ((de = readdir(d))) {
    if (CheckExtension(de->d_name, ".cnt")) {
      strcpy(fn, de->d_name);
      sprintf(buf, "%s%s", logdir, de->d_name);
      fp = fopen(buf, "r");
      if (!fp)
        continue;
      s = strrchr(fn, '.');
      if (s)
        *s = '\0';
      if (fancy)
        puts("<tr>");
      if (fgets(buf, 255, fp)) {
        t = buf + strlen(buf) - 1;
        if (*t == '\n' || *t == '\r')
          *t = '\0';
        t = strchr(buf, ' ');
        if (t)
          *t = '\0';
        if (fancy) {
          if (t)
            printf(
                "<td><a href=\"phplmon.cgi?ref_show+%s.html\">%s.html</a></td> "
                "<td align=\"right\"><a "
                "href=\"phplview.cgi?%s%s.log+dheb\">%s</a></td> <td "
                "align=\"right\"><a "
                "href=\"phplview.cgi?%s%s.log+tdheb\">%s</a></td> ",
                fn, fn, logdir, fn, buf, logdir, fn, t + 1);
          else
            printf(
                "<td><a href=\"phplmon.cgi?ref_show+%s.html\">%s.html</a></td> "
                "<td align=\"right\"><a "
                "href=\"phplview.cgi?%s%s.log+dheb\">%s</a></td> <td "
                "align=\"right\">0</td> ",
                fn, fn, logdir, fn, buf);
        } else {
          if (t)
            printf("<a href=\"phplmon.cgi?ref_show+%s\">%-16s</a><a "
                   "href=\"phplview.cgi?%s%s.log+adheb\">%4s</a> <a "
                   "href=\"phplview.cgi?%s%s.log+atdheb\">%4s</a> ",
                   fn, fn, logdir, fn, buf, logdir, fn, t + 1);
          else
            printf("<a href=\"phplmon.cgi?ref_show+%s\">%-16s</a><a "
                   "href=\"phplview.cgi?%s%s.log+adheb\">%4s</a>    0 ",
                   fn, fn, logdir, fn, buf);
        }
        if (fgets(buf, 255, fp)) {
          t = buf + strlen(buf) - 1;
          if (*t == '\n' || *t == '\r')
            *t = '\0';
          if (fancy)
            printf("<td>%s</td> ", buf);
          else
            printf("%-15s ", buf);
          if (fgets(buf, 255, fp)) {
            t = buf + strlen(buf) - 1;
            if (*t == '\n' || *t == '\r')
              *t = '\0';
            if (fancy)
              printf("<td><i>%s</i></td>\n", buf);
            else
              printf("<i>%-15s</i>\n", buf);
          }
        }
      }
      fclose(fp);
      if (fancy)
        puts("</tr>");
    }
  }
  if (fancy)
    puts("</table></center>");
  else
    puts("</pre>");
  printf("<hr><font size=-1><i><a href=\"%s\">PHP Tools</a> Copyright &copy "
         "1995 Rasmus Lerdorf</i></font><br>\n",
         "http://www.io.org/~rasmus/phpl.cgi?pages/phptools.html");
  puts("</body></html>");
  fflush(stdout);
  closedir(d);
}


x86 assembly (clang, -O0):
<ShowStats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x300,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x2c0(%rbp),%rsi
lea    0xdd4(%rip),%rdi
call   1130 <FixFilename@plt>
lea    -0x2c0(%rbp),%rax
mov    %rax,-0x2c8(%rbp)
lea    -0x2c0(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x2c8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x1b0(%rbp)
mov    -0x1b0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     128b <ShowStats+0x7b>
lea    -0x2c0(%rbp),%rdi
lea    0xd7e(%rip),%rsi
call   1110 <strcat@plt>
lea    -0x2c0(%rbp),%rdi
call   1060 <opendir@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    12cc <ShowStats+0xbc>
lea    0xd59(%rip),%rdi
call   1040 <puts@plt>
lea    -0x2c0(%rbp),%rsi
lea    0xd6d(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    1811 <ShowStats+0x601>
lea    0xd8e(%rip),%rdi
call   1040 <puts@plt>
lea    0xd47(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,-0x4(%rbp)
je     130b <ShowStats+0xfb>
lea    0xd9e(%rip),%rdi
call   1040 <puts@plt>
lea    0xdcc(%rip),%rdi
call   1040 <puts@plt>
jmp    1317 <ShowStats+0x107>
lea    0xe18(%rip),%rdi
call   1040 <puts@plt>
jmp    131c <ShowStats+0x10c>
mov    -0x10(%rbp),%rdi
call   10e0 <readdir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     17b2 <ShowStats+0x5a2>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xe6a(%rip),%rsi
call   10d0 <CheckExtension@plt>
cmp    $0x0,%rax
je     17ad <ShowStats+0x59d>
lea    -0x1a0(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x120(%rbp),%rdi
lea    -0x2c0(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
lea    0xe31(%rip),%rsi
call   1120 <sprintf@plt>
lea    -0x120(%rbp),%rdi
lea    0xe23(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,-0x1a8(%rbp)
cmpq   $0x0,-0x1a8(%rbp)
jne    13b1 <ShowStats+0x1a1>
jmp    131c <ShowStats+0x10c>
lea    -0x1a0(%rbp),%rdi
mov    $0x2e,%esi
call   10a0 <strrchr@plt>
mov    %rax,-0x1b0(%rbp)
cmpq   $0x0,-0x1b0(%rbp)
je     13e1 <ShowStats+0x1d1>
mov    -0x1b0(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0x4(%rbp)
je     13f7 <ShowStats+0x1e7>
lea    0xdc5(%rip),%rdi
call   1040 <puts@plt>
lea    -0x120(%rbp),%rdi
mov    -0x1a8(%rbp),%rdx
mov    $0xff,%esi
call   10c0 <fgets@plt>
cmp    $0x0,%rax
je     1786 <ShowStats+0x576>
lea    -0x120(%rbp),%rax
mov    %rax,-0x2d0(%rbp)
lea    -0x120(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x2d0(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x1b8(%rbp)
mov    -0x1b8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1473 <ShowStats+0x263>
mov    -0x1b8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    147d <ShowStats+0x26d>
mov    -0x1b8(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x120(%rbp),%rdi
mov    $0x20,%esi
call   1080 <strchr@plt>
mov    %rax,-0x1b8(%rbp)
cmpq   $0x0,-0x1b8(%rbp)
je     14ad <ShowStats+0x29d>
mov    -0x1b8(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0x4(%rbp)
je     1558 <ShowStats+0x348>
cmpq   $0x0,-0x1b8(%rbp)
je     1522 <ShowStats+0x312>
lea    -0x1a0(%rbp),%rsi
lea    -0x1a0(%rbp),%rdx
lea    -0x2c0(%rbp),%rcx
lea    -0x1a0(%rbp),%r8
lea    -0x120(%rbp),%r9
lea    -0x2c0(%rbp),%r11
lea    -0x1a0(%rbp),%r10
mov    -0x1b8(%rbp),%rax
add    $0x1,%rax
lea    0xcb4(%rip),%rdi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   1090 <printf@plt>
jmp    1553 <ShowStats+0x343>
lea    -0x1a0(%rbp),%rsi
lea    -0x1a0(%rbp),%rdx
lea    -0x2c0(%rbp),%rcx
lea    -0x1a0(%rbp),%r8
lea    -0x120(%rbp),%r9
lea    0xd34(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    15f9 <ShowStats+0x3e9>
cmpq   $0x0,-0x1b8(%rbp)
je     15c3 <ShowStats+0x3b3>
lea    -0x1a0(%rbp),%rsi
lea    -0x1a0(%rbp),%rdx
lea    -0x2c0(%rbp),%rcx
lea    -0x1a0(%rbp),%r8
lea    -0x120(%rbp),%r9
lea    -0x2c0(%rbp),%r11
lea    -0x1a0(%rbp),%r10
mov    -0x1b8(%rbp),%rax
add    $0x1,%rax
lea    0xd70(%rip),%rdi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   1090 <printf@plt>
jmp    15f4 <ShowStats+0x3e4>
lea    -0x1a0(%rbp),%rsi
lea    -0x1a0(%rbp),%rdx
lea    -0x2c0(%rbp),%rcx
lea    -0x1a0(%rbp),%r8
lea    -0x120(%rbp),%r9
lea    0xdb5(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    15f9 <ShowStats+0x3e9>
lea    -0x120(%rbp),%rdi
mov    -0x1a8(%rbp),%rdx
mov    $0xff,%esi
call   10c0 <fgets@plt>
cmp    $0x0,%rax
je     1781 <ShowStats+0x571>
lea    -0x120(%rbp),%rax
mov    %rax,-0x2d8(%rbp)
lea    -0x120(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x2d8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x1b8(%rbp)
mov    -0x1b8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1675 <ShowStats+0x465>
mov    -0x1b8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    167f <ShowStats+0x46f>
mov    -0x1b8(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0x4(%rbp)
je     16a3 <ShowStats+0x493>
lea    -0x120(%rbp),%rsi
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    16b8 <ShowStats+0x4a8>
lea    -0x120(%rbp),%rsi
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    -0x120(%rbp),%rdi
mov    -0x1a8(%rbp),%rdx
mov    $0xff,%esi
call   10c0 <fgets@plt>
cmp    $0x0,%rax
je     177c <ShowStats+0x56c>
lea    -0x120(%rbp),%rax
mov    %rax,-0x2e0(%rbp)
lea    -0x120(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x2e0(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x1b8(%rbp)
mov    -0x1b8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1734 <ShowStats+0x524>
mov    -0x1b8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    173e <ShowStats+0x52e>
mov    -0x1b8(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0x4(%rbp)
je     1762 <ShowStats+0x552>
lea    -0x120(%rbp),%rsi
lea    0xcbf(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    1777 <ShowStats+0x567>
lea    -0x120(%rbp),%rsi
lea    0xcb9(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    177c <ShowStats+0x56c>
jmp    1781 <ShowStats+0x571>
jmp    1786 <ShowStats+0x576>
mov    -0x1a8(%rbp),%rdi
call   1050 <fclose@plt>
cmpl   $0x0,-0x4(%rbp)
je     17a8 <ShowStats+0x598>
lea    0x981(%rip),%rdi
call   1040 <puts@plt>
jmp    17ad <ShowStats+0x59d>
jmp    131c <ShowStats+0x10c>
cmpl   $0x0,-0x4(%rbp)
je     17cd <ShowStats+0x5bd>
lea    0xc74(%rip),%rdi
call   1040 <puts@plt>
jmp    17d9 <ShowStats+0x5c9>
lea    0xc75(%rip),%rdi
call   1040 <puts@plt>
lea    0xc70(%rip),%rdi
lea    0xccd(%rip),%rsi
mov    $0x0,%al
call   1090 <printf@plt>
lea    0x85d(%rip),%rdi
call   1040 <puts@plt>
mov    0x27df(%rip),%rax
mov    (%rax),%edi
call   10f0 <fflush@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <closedir@plt>
add    $0x300,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowStats>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x298,%rsp
mov    %edi,%r12d
lea    0xdd5(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1130 <FixFilename@plt>
mov    %rbx,%rdi
call   1070 <strlen@plt>
cltq
cmpb   $0x2f,0xf(%rsp,%rax,1)
je     125a <ShowStats+0x4a>
lea    0xdb4(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1110 <strcat@plt>
lea    0x10(%rsp),%rdi
call   1060 <opendir@plt>
test   %rax,%rax
je     129e <ShowStats+0x8e>
mov    %rax,%rbx
lea    0xdee(%rip),%rdi
call   1040 <puts@plt>
lea    0xda7(%rip),%rdi
call   1040 <puts@plt>
test   %r12d,%r12d
je     12c2 <ShowStats+0xb2>
lea    0xe03(%rip),%rdi
call   1040 <puts@plt>
lea    0xe31(%rip),%rdi
jmp    12c9 <ShowStats+0xb9>
lea    0xd61(%rip),%rdi
call   1040 <puts@plt>
lea    0xd7c(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    158f <ShowStats+0x37f>
lea    0xe61(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   10e0 <readdir@plt>
test   %rax,%rax
je     153e <ShowStats+0x32e>
mov    %rax,%rbp
test   %r12d,%r12d
lea    0x1122(%rip),%rax
lea    0x110e(%rip),%rcx
cmove  %rax,%rcx
mov    %rcx,0x8(%rsp)
lea    0x210(%rsp),%r13
lea    0x110(%rsp),%r15
jmp    133d <ShowStats+0x12d>
xchg   %ax,%ax
mov    %r14,%rdi
call   1050 <fclose@plt>
test   %r12d,%r12d
je     1329 <ShowStats+0x119>
lea    0xe00(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   10e0 <readdir@plt>
mov    %rax,%rbp
test   %rax,%rax
je     153e <ShowStats+0x32e>
mov    0x0(%rbp),%rdi
lea    0xe63(%rip),%rsi
call   10d0 <CheckExtension@plt>
test   %rax,%rax
je     1329 <ShowStats+0x119>
mov    0x0(%rbp),%rsi
mov    %r13,%rdi
call   1030 <strcpy@plt>
mov    0x0(%rbp),%rcx
mov    %r15,%rdi
lea    0xe44(%rip),%rsi
lea    0x10(%rsp),%rdx
call   1120 <sprintf@plt>
mov    %r15,%rdi
lea    0xe35(%rip),%rsi
call   1100 <fopen@plt>
test   %rax,%rax
je     1329 <ShowStats+0x119>
mov    %rax,%r14
mov    %r13,%rdi
mov    $0x2e,%esi
call   10a0 <strrchr@plt>
test   %rax,%rax
je     13a2 <ShowStats+0x192>
movb   $0x0,(%rax)
test   %r12d,%r12d
je     13b3 <ShowStats+0x1a3>
lea    0xe09(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
mov    $0xff,%esi
mov    %r14,%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
je     1310 <ShowStats+0x100>
mov    %r15,%rdi
call   1070 <strlen@plt>
cltq
movzbl 0x10f(%rsp,%rax,1),%ecx
cmp    $0xd,%cl
je     13e8 <ShowStats+0x1d8>
cmp    $0xa,%cl
jne    13f0 <ShowStats+0x1e0>
movb   $0x0,0x10f(%rsp,%rax,1)
mov    %r15,%rdi
mov    $0x20,%esi
call   1080 <strchr@plt>
test   %rax,%rax
je     141e <ShowStats+0x20e>
mov    %rax,%rbp
add    $0x1,%rbp
movb   $0x0,(%rax)
sub    $0x8,%rsp
test   %r12d,%r12d
je     142c <ShowStats+0x21c>
lea    0xda0(%rip),%rdi
jmp    1433 <ShowStats+0x223>
test   %r12d,%r12d
je     1455 <ShowStats+0x245>
lea    0xe56(%rip),%rdi
jmp    145c <ShowStats+0x24c>
lea    0xee6(%rip),%rdi
mov    %r13,%rsi
mov    %r13,%rdx
lea    0x18(%rsp),%rcx
mov    %r13,%r8
mov    %r15,%r9
xor    %eax,%eax
push   %rbp
push   %r13
push   %rcx
call   1090 <printf@plt>
add    $0x20,%rsp
jmp    1474 <ShowStats+0x264>
lea    0xf46(%rip),%rdi
mov    %r13,%rsi
mov    %r13,%rdx
lea    0x10(%rsp),%rcx
mov    %r13,%r8
mov    %r15,%r9
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r15,%rdi
mov    $0xff,%esi
mov    %r14,%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
je     1310 <ShowStats+0x100>
mov    %r15,%rdi
call   1070 <strlen@plt>
cltq
movzbl 0x10f(%rsp,%rax,1),%ecx
cmp    $0xd,%cl
je     14a9 <ShowStats+0x299>
cmp    $0xa,%cl
jne    14b1 <ShowStats+0x2a1>
movb   $0x0,0x10f(%rsp,%rax,1)
mov    0x8(%rsp),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r15,%rdi
mov    $0xff,%esi
mov    %r14,%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
je     1310 <ShowStats+0x100>
mov    %r15,%rdi
call   1070 <strlen@plt>
cltq
movzbl 0x10f(%rsp,%rax,1),%ecx
cmp    $0xd,%cl
je     14f5 <ShowStats+0x2e5>
cmp    $0xa,%cl
jne    14fd <ShowStats+0x2ed>
movb   $0x0,0x10f(%rsp,%rax,1)
test   %r12d,%r12d
je     1520 <ShowStats+0x310>
lea    0xf0c(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
jmp    131d <ShowStats+0x10d>
lea    0xf02(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
jmp    1329 <ShowStats+0x119>
test   %r12d,%r12d
lea    0xf01(%rip),%rax
lea    0xee8(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
lea    0xef1(%rip),%rdi
lea    0xf4e(%rip),%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xade(%rip),%rdi
call   1040 <puts@plt>
mov    0x2a60(%rip),%rax
mov    (%rax),%edi
call   10f0 <fflush@plt>
mov    %rbx,%rdi
call   10b0 <closedir@plt>
add    $0x298,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
@.str = [6 x i8] c"logs/\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [39 x i8] c"<html><head>PHPLMON Error</head><body>\00"
@.str.3 = [52 x i8] c"Unable to open log directory (%s)\0A<p></body></html>\00"
@.str.4 = [50 x i8] c"<html><head><title>PHPL Page Stats</title></head>\00"
@.str.5 = [7 x i8] c"<body>\00"
@.str.6 = [58 x i8] c"<center><table border> <caption>PHPL Page Stats</caption>\00"
@.str.7 = [93 x i8] c"<tr> <th>HTML Page</th> <th>Total</th> <th>Today</th> <th>Last Access</th> <th>By</th> </tr>\00"
@.str.8 = [129 x i8] c"<pre><u> <i><b>HTML Page</b></i>\09 <i><b>Total</b></i> <i><b>Today</b></i> <i><b>Last Access</b></i> <i><b>By</b></i></u>\00"
@.str.9 = [5 x i8] c".cnt\00"
@.str.10 = [5 x i8] c"%s%s\00"
@.str.11 = [2 x i8] c"r\00"
@.str.12 = [5 x i8] c"<tr>\00"
@.str.13 = [196 x i8] c"<td><a href=\22phplmon.cgi?ref_show+%s.html\22>%s.html</a></td> <td align=\22right\22><a href=\22phplview.cgi?%s%s.log+dheb\22>%s</a></td> <td align=\22right\22><a href=\22phplview.cgi?%s%s.log+tdheb\22>%s</a></td> \00"
@.str.14 = [153 x i8] c"<td><a href=\22phplmon.cgi?ref_show+%s.html\22>%s.html</a></td> <td align=\22right\22><a href=\22phplview.cgi?%s%s.log+dheb\22>%s</a></td> <td align=\22right\22>0</td> \00"
@.str.15 = [137 x i8] c"<a href=\22phplmon.cgi?ref_show+%s\22>%-16s</a><a href=\22phplview.cgi?%s%s.log+adheb\22>%4s</a> <a href=\22phplview.cgi?%s%s.log+atdheb\22>%4s</a> \00"
@.str.16 = [95 x i8] c"<a href=\22phplmon.cgi?ref_show+%s\22>%-16s</a><a href=\22phplview.cgi?%s%s.log+adheb\22>%4s</a> 0 \00"
@.str.17 = [13 x i8] c"<td>%s</td> \00"
@.str.18 = [7 x i8] c"%-15s \00"
@.str.19 = [20 x i8] c"<td><i>%s</i></td>\0A\00"
@.str.20 = [14 x i8] c"<i>%-15s</i>\0A\00"
@.str.21 = [6 x i8] c"</tr>\00"
@.str.22 = [18 x i8] c"</table></center>\00"
@.str.23 = [7 x i8] c"</pre>\00"
@.str.24 = [100 x i8] c"<hr><font size=-1><i><a href=\22%s\22>PHP Tools</a> Copyright &copy 1995 Rasmus Lerdorf</i></font><br>\0A\00"
@.str.25 = [55 x i8] c"http://www.io.org/~rasmus/phpl.cgi?pages/phptools.html\00"
@.str.26 = [15 x i8] c"</body></html>\00"
@stdout = global i32 0
define void @ShowStats(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca %struct.dirent*
%5 = alloca [256 x i8]
%6 = alloca [128 x i8]
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca [256 x i8]
store i32 %0, i32* %2
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%12 = call i32 @FixFilename(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = getelementptr inbounds i8, i8* %17, i64 -1
store i8* %18, i8** %8
%19 = load i8*, i8** %8
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 47
br i1 %22, label %23, label %26
23: ; preds = %1
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%25 = call i32 @strcat(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %23, %1
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%28 = call i32* @opendir(i8* %27)
store i32* %28, i32** %3
%29 = load i32*, i32** %3
%30 = icmp ne i32* %29, null
br i1 %30, label %35, label %31
31: ; preds = %26
%32 = call i32 @puts(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%34 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i8* %33)
br label %252
35: ; preds = %26
%36 = call i32 @puts(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
%37 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%38 = load i32, i32* %2
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %35
%41 = call i32 @puts(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0))
%42 = call i32 @puts(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.7, i64 0, i64 0))
br label %45
43: ; preds = %35
%44 = call i32 @puts(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str.8, i64 0, i64 0))
br label %45
45: ; preds = %43, %40
br label %46
46: ; preds = %237, %72, %45
%47 = load i32*, i32** %3
%48 = call %struct.dirent* @readdir(i32* %47)
store %struct.dirent* %48, %struct.dirent** %4
%49 = icmp ne %struct.dirent* %48, null
br i1 %49, label %50, label %238
50: ; preds = %46
%51 = load %struct.dirent*, %struct.dirent** %4
%52 = getelementptr inbounds %struct.dirent, %struct.dirent* %51, i32 0, i32 0
%53 = load i8*, i8** %52
%54 = call i64 @CheckExtension(i8* %53, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%55 = icmp ne i64 %54, 0
br i1 %55, label %56, label %237
56: ; preds = %50
%57 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%58 = load %struct.dirent*, %struct.dirent** %4
%59 = getelementptr inbounds %struct.dirent, %struct.dirent* %58, i32 0, i32 0
%60 = load i8*, i8** %59
%61 = call i32 @strcpy(i8* %57, i8* %60)
%62 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%63 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%64 = load %struct.dirent*, %struct.dirent** %4
%65 = getelementptr inbounds %struct.dirent, %struct.dirent* %64, i32 0, i32 0
%66 = load i8*, i8** %65
%67 = call i32 @sprintf(i8* %62, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %63, i8* %66)
%68 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%69 = call i32* @fopen(i8* %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
store i32* %69, i32** %7
%70 = load i32*, i32** %7
%71 = icmp ne i32* %70, null
br i1 %71, label %73, label %72
72: ; preds = %56
br label %46
73: ; preds = %56
%74 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%75 = call i8* @strrchr(i8* %74, i8 signext 46)
store i8* %75, i8** %8
%76 = load i8*, i8** %8
%77 = icmp ne i8* %76, null
br i1 %77, label %78, label %80
78: ; preds = %73
%79 = load i8*, i8** %8
store i8 0, i8* %79
br label %80
80: ; preds = %78, %73
%81 = load i32, i32* %2
%82 = icmp ne i32 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %80
%84 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
br label %85
85: ; preds = %83, %80
%86 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%87 = load i32*, i32** %7
%88 = call i64 @fgets(i8* %86, i32 255, i32* %87)
%89 = icmp ne i64 %88, 0
br i1 %89, label %90, label %229
90: ; preds = %85
%91 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%92 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%93 = call i32 @strlen(i8* %92)
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i8, i8* %91, i64 %94
%96 = getelementptr inbounds i8, i8* %95, i64 -1
store i8* %96, i8** %9
%97 = load i8*, i8** %9
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 10
br i1 %100, label %106, label %101
101: ; preds = %90
%102 = load i8*, i8** %9
%103 = load i8, i8* %102
%104 = sext i8 %103 to i32
%105 = icmp eq i32 %104, 13
br i1 %105, label %106, label %108
106: ; preds = %101, %90
%107 = load i8*, i8** %9
store i8 0, i8* %107
br label %108
108: ; preds = %106, %101
%109 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%110 = call i8* @strchr(i8* %109, i8 signext 32)
store i8* %110, i8** %9
%111 = load i8*, i8** %9
%112 = icmp ne i8* %111, null
br i1 %112, label %113, label %115
113: ; preds = %108
%114 = load i8*, i8** %9
store i8 0, i8* %114
br label %115
115: ; preds = %113, %108
%116 = load i32, i32* %2
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %140
118: ; preds = %115
%119 = load i8*, i8** %9
%120 = icmp ne i8* %119, null
br i1 %120, label %121, label %132
121: ; preds = %118
%122 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%123 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%124 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%125 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%126 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%127 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%128 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%129 = load i8*, i8** %9
%130 = getelementptr inbounds i8, i8* %129, i64 1
%131 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str.13, i64 0, i64 0), i8* %122, i8* %123, i8* %124, i8* %125, i8* %126, i8* %127, i8* %128, i8* %130)
br label %139
132: ; preds = %118
%133 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%134 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%135 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%136 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%137 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%138 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.14, i64 0, i64 0), i8* %133, i8* %134, i8* %135, i8* %136, i8* %137)
br label %139
139: ; preds = %132, %121
br label %162
140: ; preds = %115
%141 = load i8*, i8** %9
%142 = icmp ne i8* %141, null
br i1 %142, label %143, label %154
143: ; preds = %140
%144 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%145 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%146 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%147 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%148 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%149 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%150 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%151 = load i8*, i8** %9
%152 = getelementptr inbounds i8, i8* %151, i64 1
%153 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.15, i64 0, i64 0), i8* %144, i8* %145, i8* %146, i8* %147, i8* %148, i8* %149, i8* %150, i8* %152)
br label %161
154: ; preds = %140
%155 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%156 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%157 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%158 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%159 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%160 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.16, i64 0, i64 0), i8* %155, i8* %156, i8* %157, i8* %158, i8* %159)
br label %161
161: ; preds = %154, %143
br label %162
162: ; preds = %161, %139
%163 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%164 = load i32*, i32** %7
%165 = call i64 @fgets(i8* %163, i32 255, i32* %164)
%166 = icmp ne i64 %165, 0
br i1 %166, label %167, label %228
167: ; preds = %162
%168 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%169 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%170 = call i32 @strlen(i8* %169)
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds i8, i8* %168, i64 %171
%173 = getelementptr inbounds i8, i8* %172, i64 -1
store i8* %173, i8** %9
%174 = load i8*, i8** %9
%175 = load i8, i8* %174
%176 = sext i8 %175 to i32
%177 = icmp eq i32 %176, 10
br i1 %177, label %183, label %178
178: ; preds = %167
%179 = load i8*, i8** %9
%180 = load i8, i8* %179
%181 = sext i8 %180 to i32
%182 = icmp eq i32 %181, 13
br i1 %182, label %183, label %185
183: ; preds = %178, %167
%184 = load i8*, i8** %9
store i8 0, i8* %184
br label %185
185: ; preds = %183, %178
%186 = load i32, i32* %2
%187 = icmp ne i32 %186, 0
br i1 %187, label %188, label %191
188: ; preds = %185
%189 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%190 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.17, i64 0, i64 0), i8* %189)
br label %194
191: ; preds = %185
%192 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%193 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i8* %192)
br label %194
194: ; preds = %191, %188
%195 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%196 = load i32*, i32** %7
%197 = call i64 @fgets(i8* %195, i32 255, i32* %196)
%198 = icmp ne i64 %197, 0
br i1 %198, label %199, label %227
199: ; preds = %194
%200 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%201 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%202 = call i32 @strlen(i8* %201)
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds i8, i8* %200, i64 %203
%205 = getelementptr inbounds i8, i8* %204, i64 -1
store i8* %205, i8** %9
%206 = load i8*, i8** %9
%207 = load i8, i8* %206
%208 = sext i8 %207 to i32
%209 = icmp eq i32 %208, 10
br i1 %209, label %215, label %210
210: ; preds = %199
%211 = load i8*, i8** %9
%212 = load i8, i8* %211
%213 = sext i8 %212 to i32
%214 = icmp eq i32 %213, 13
br i1 %214, label %215, label %217
215: ; preds = %210, %199
%216 = load i8*, i8** %9
store i8 0, i8* %216
br label %217
217: ; preds = %215, %210
%218 = load i32, i32* %2
%219 = icmp ne i32 %218, 0
br i1 %219, label %220, label %223
220: ; preds = %217
%221 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%222 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.19, i64 0, i64 0), i8* %221)
br label %226
223: ; preds = %217
%224 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%225 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.20, i64 0, i64 0), i8* %224)
br label %226
226: ; preds = %223, %220
br label %227
227: ; preds = %226, %194
br label %228
228: ; preds = %227, %162
br label %229
229: ; preds = %228, %85
%230 = load i32*, i32** %7
%231 = call i32 @fclose(i32* %230)
%232 = load i32, i32* %2
%233 = icmp ne i32 %232, 0
br i1 %233, label %234, label %236
234: ; preds = %229
%235 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0))
br label %236
236: ; preds = %234, %229
br label %237
237: ; preds = %236, %50
br label %46
238: ; preds = %46
%239 = load i32, i32* %2
%240 = icmp ne i32 %239, 0
br i1 %240, label %241, label %243
241: ; preds = %238
%242 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
br label %245
243: ; preds = %238
%244 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0))
br label %245
245: ; preds = %243, %241
%246 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.25, i64 0, i64 0))
%247 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.26, i64 0, i64 0))
%248 = load i32, i32* @stdout
%249 = call i32 @fflush(i32 %248)
%250 = load i32*, i32** %3
%251 = call i32 @closedir(i32* %250)
br label %252
252: ; preds = %245, %31
ret void
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
@.str = [6 x i8] c"logs/\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [39 x i8] c"<html><head>PHPLMON Error</head><body>\00"
@.str.3 = [52 x i8] c"Unable to open log directory (%s)\0A<p></body></html>\00"
@.str.4 = [50 x i8] c"<html><head><title>PHPL Page Stats</title></head>\00"
@.str.5 = [7 x i8] c"<body>\00"
@.str.6 = [58 x i8] c"<center><table border> <caption>PHPL Page Stats</caption>\00"
@.str.7 = [93 x i8] c"<tr> <th>HTML Page</th> <th>Total</th> <th>Today</th> <th>Last Access</th> <th>By</th> </tr>\00"
@.str.8 = [129 x i8] c"<pre><u> <i><b>HTML Page</b></i>\09 <i><b>Total</b></i> <i><b>Today</b></i> <i><b>Last Access</b></i> <i><b>By</b></i></u>\00"
@.str.9 = [5 x i8] c".cnt\00"
@.str.10 = [5 x i8] c"%s%s\00"
@.str.11 = [2 x i8] c"r\00"
@.str.12 = [5 x i8] c"<tr>\00"
@.str.13 = [196 x i8] c"<td><a href=\22phplmon.cgi?ref_show+%s.html\22>%s.html</a></td> <td align=\22right\22><a href=\22phplview.cgi?%s%s.log+dheb\22>%s</a></td> <td align=\22right\22><a href=\22phplview.cgi?%s%s.log+tdheb\22>%s</a></td> \00"
@.str.14 = [153 x i8] c"<td><a href=\22phplmon.cgi?ref_show+%s.html\22>%s.html</a></td> <td align=\22right\22><a href=\22phplview.cgi?%s%s.log+dheb\22>%s</a></td> <td align=\22right\22>0</td> \00"
@.str.15 = [137 x i8] c"<a href=\22phplmon.cgi?ref_show+%s\22>%-16s</a><a href=\22phplview.cgi?%s%s.log+adheb\22>%4s</a> <a href=\22phplview.cgi?%s%s.log+atdheb\22>%4s</a> \00"
@.str.16 = [95 x i8] c"<a href=\22phplmon.cgi?ref_show+%s\22>%-16s</a><a href=\22phplview.cgi?%s%s.log+adheb\22>%4s</a> 0 \00"
@.str.17 = [13 x i8] c"<td>%s</td> \00"
@.str.18 = [7 x i8] c"%-15s \00"
@.str.19 = [20 x i8] c"<td><i>%s</i></td>\0A\00"
@.str.20 = [14 x i8] c"<i>%-15s</i>\0A\00"
@.str.21 = [6 x i8] c"</tr>\00"
@.str.22 = [18 x i8] c"</table></center>\00"
@.str.23 = [7 x i8] c"</pre>\00"
@.str.24 = [100 x i8] c"<hr><font size=-1><i><a href=\22%s\22>PHP Tools</a> Copyright &copy 1995 Rasmus Lerdorf</i></font><br>\0A\00"
@.str.25 = [55 x i8] c"http://www.io.org/~rasmus/phpl.cgi?pages/phptools.html\00"
@.str.26 = [15 x i8] c"</body></html>\00"
@stdout = global i32 0
define void @ShowStats(i32 %0) {
%2 = alloca [256 x i8]
%3 = alloca [128 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%8 = call i32 @FixFilename(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @strlen(i8* %7)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %10
%12 = getelementptr inbounds i8, i8* %11, i64 -1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 47
br i1 %14, label %17, label %15
15: ; preds = %1
%16 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %1
%18 = call i32* @opendir(i8* %7)
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i8* %7)
br label %123
23: ; preds = %17
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%26 = icmp eq i32 %0, 0
br i1 %26, label %29, label %27
27: ; preds = %23
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0))
br label %29
29: ; preds = %23, %27
%30 = phi i8* [ getelementptr inbounds ([93 x i8], [93 x i8]* @.str.7, i64 0, i64 0), %27 ], [ getelementptr inbounds ([129 x i8], [129 x i8]* @.str.8, i64 0, i64 0), %23 ]
%31 = call i32 @puts(i8* dereferenceable(1) %30)
%32 = call %struct.dirent* @readdir(i32* %18)
%33 = icmp eq %struct.dirent* %32, null
br i1 %33, label %115, label %34
34: ; preds = %29
%35 = select i1 %26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.17, i64 0, i64 0)
br label %36
36: ; preds = %34, %112
%37 = phi %struct.dirent* [ %113, %112 ], [ %32, %34 ]
%38 = getelementptr inbounds %struct.dirent, %struct.dirent* %37, i64 0, i32 0
%39 = load i8*, i8** %38
%40 = call i64 @CheckExtension(i8* %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %112, label %42
42: ; preds = %36
%43 = load i8*, i8** %38
%44 = call i32 @strcpy(i8* %6, i8* %43)
%45 = load i8*, i8** %38
%46 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %7, i8* %45)
%47 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%48 = icmp eq i32* %47, null
br i1 %48, label %112, label %49
49: ; preds = %42
%50 = call i8* @strrchr(i8* %6, i8 signext 46)
%51 = icmp eq i8* %50, null
br i1 %51, label %53, label %52
52: ; preds = %49
store i8 0, i8* %50
br label %53
53: ; preds = %52, %49
br i1 %26, label %56, label %54
54: ; preds = %53
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
br label %56
56: ; preds = %54, %53
%57 = call i64 @fgets(i8* %5, i32 255, i32* %47)
%58 = icmp eq i64 %57, 0
br i1 %58, label %108, label %59
59: ; preds = %56
%60 = call i32 @strlen(i8* %5)
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %61
%63 = getelementptr inbounds i8, i8* %62, i64 -1
%64 = load i8, i8* %63
switch i8 %64, label %66 [
i8 10, label %65
i8 13, label %65
]
65: ; preds = %59, %59
store i8 0, i8* %63
br label %66
66: ; preds = %59, %65
%67 = call i8* @strchr(i8* %5, i8 signext 32)
%68 = icmp eq i8* %67, null
br i1 %68, label %69, label %70
69: ; preds = %66
br i1 %26, label %78, label %74
70: ; preds = %66
store i8 0, i8* %67
%71 = getelementptr inbounds i8, i8* %67, i64 1
br i1 %26, label %76, label %72
72: ; preds = %70
%73 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str.13, i64 0, i64 0), i8* %6, i8* %6, i8* %7, i8* %6, i8* %5, i8* %7, i8* %6, i8* %71)
br label %80
74: ; preds = %69
%75 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.14, i64 0, i64 0), i8* %6, i8* %6, i8* %7, i8* %6, i8* %5)
br label %80
76: ; preds = %70
%77 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.15, i64 0, i64 0), i8* %6, i8* %6, i8* %7, i8* %6, i8* %5, i8* %7, i8* %6, i8* %71)
br label %80
78: ; preds = %69
%79 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.16, i64 0, i64 0), i8* %6, i8* %6, i8* %7, i8* %6, i8* %5)
br label %80
80: ; preds = %76, %78, %72, %74
%81 = call i64 @fgets(i8* %5, i32 255, i32* %47)
%82 = icmp eq i64 %81, 0
br i1 %82, label %108, label %83
83: ; preds = %80
%84 = call i32 @strlen(i8* %5)
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %85
%87 = getelementptr inbounds i8, i8* %86, i64 -1
%88 = load i8, i8* %87
switch i8 %88, label %90 [
i8 10, label %89
i8 13, label %89
]
89: ; preds = %83, %83
store i8 0, i8* %87
br label %90
90: ; preds = %83, %89
%91 = call i32 (i8*, i8*, ...) @printf(i8* %35, i8* %5)
%92 = call i64 @fgets(i8* %5, i32 255, i32* %47)
%93 = icmp eq i64 %92, 0
br i1 %93, label %108, label %94
94: ; preds = %90
%95 = call i32 @strlen(i8* %5)
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %96
%98 = getelementptr inbounds i8, i8* %97, i64 -1
%99 = load i8, i8* %98
switch i8 %99, label %101 [
i8 10, label %100
i8 13, label %100
]
100: ; preds = %94, %94
store i8 0, i8* %98
br label %101
101: ; preds = %94, %100
br i1 %26, label %105, label %102
102: ; preds = %101
%103 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.19, i64 0, i64 0), i8* %5)
%104 = call i32 @fclose(i32* %47)
br label %110
105: ; preds = %101
%106 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.20, i64 0, i64 0), i8* %5)
%107 = call i32 @fclose(i32* %47)
br label %112
108: ; preds = %80, %90, %56
%109 = call i32 @fclose(i32* %47)
br i1 %26, label %112, label %110
110: ; preds = %102, %108
%111 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0))
br label %112
112: ; preds = %36, %110, %108, %105, %42
%113 = call %struct.dirent* @readdir(i32* %18)
%114 = icmp eq %struct.dirent* %113, null
br i1 %114, label %115, label %36
115: ; preds = %112, %29
%116 = select i1 %26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0)
%117 = call i32 @puts(i8* dereferenceable(1) %116)
%118 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.25, i64 0, i64 0))
%119 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.26, i64 0, i64 0))
%120 = load i32, i32* @stdout
%121 = call i32 @fflush(i32 %120)
%122 = call i32 @closedir(i32* %18)
br label %123
123: ; preds = %115, %20
ret void
}