#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 timeb {
  long time;
};
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int BUFSIZ;
scalar_t__ chdir(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ fstat(int /*<<< orphan*/, struct stat *);
int /*<<< orphan*/ ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ ftime(struct timeb *);
long getdate(char *, struct timeb *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strncmp(char *, char *, int);
main() {
  FILE *Hfile, *Afile;
  char buffer[BUFSIZ], datestr[BUFSIZ];
  char *index();
  struct stat stbuf;
  struct timeb now;
  long t;
  Hfile = fopen("/usr/new/lib/news/history", "r");
  if (Hfile == 0) {
    perror("/usr/new/lib/news/history");
    exit(1);
  }
  if (chdir("/usr/spool/news") < 0) {
    perror("/usr/spool/news");
    exit(1);
  }
  (void)ftime(&now);
  while (fgets(buffer, BUFSIZ, Hfile) != 0) {
    register char *p, *file;
    p = index(buffer, '\t');
    if (p == 0)
      continue;
    file = index(p + 1, '\t');
    if (file == 0 || file[1] == '\n')
      continue;
    *file = '\0';
    t = getdate(p, &now);
    if ((t + (24L * 60L * 60L) * 14L) < now.time)
      continue;
    strcpy(datestr, p);
    p = file;
    while (*++p != ' ' && *p != '\n')
      if (*p == '.')
        *p = '/';
    *p = '\0';
    file++;
    if (strncmp(file, "net", 3) && strncmp(file, "mod", 3) &&
        strncmp(file, "comp", 4) && strncmp(file, "sci", 3) &&
        strncmp(file, "news", 4) && strncmp(file, "rec", 3) &&
        strncmp(file, "talk", 4) && strncmp(file, "misc", 4) &&
        strncmp(file, "soc", 4))
      continue;
    Afile = fopen(file, "r");
    if (Afile == 0)
      continue;
    while (fgets(buffer, BUFSIZ, Afile) != 0 && buffer[0] != '\n')
      fputs(buffer, stdout);
    fstat(fileno(Afile), &stbuf);
    printf("Date-Received: %s\n", datestr);
    printf("Bytes: %ld\n\n", stbuf.st_size - ftell(Afile));
    fclose(Afile);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2dca(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x68(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x28(%rbp)
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
lea    0xda0(%rip),%rdi
lea    0xdb3(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1291 <main+0x91>
lea    0xd7e(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xd84(%rip),%rdi
call   1060 <chdir@plt>
cmp    $0x0,%rax
jge    12bd <main+0xbd>
lea    0xd6e(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    -0x40(%rbp),%rdi
call   1110 <ftime@plt>
mov    -0x68(%rbp),%rdi
mov    0x2d0f(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   10a0 <fgets@plt>
cmp    $0x0,%rax
je     15ef <main+0x3ef>
mov    -0x68(%rbp),%rdi
mov    $0x9,%esi
call   1090 <index@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1308 <main+0x108>
jmp    12c6 <main+0xc6>
mov    -0x50(%rbp),%rdi
add    $0x1,%rdi
mov    $0x9,%esi
call   1090 <index@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     133a <main+0x13a>
mov    -0x58(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0xa,%eax
jne    133f <main+0x13f>
jmp    12c6 <main+0xc6>
mov    -0x58(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x50(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   10d0 <getdate@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
add    $0x127500,%rax
cmp    -0x40(%rbp),%rax
jge    1370 <main+0x170>
jmp    12c6 <main+0xc6>
mov    -0x60(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x58(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x50(%rbp)
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x69(%rbp)
je     13b6 <main+0x1b6>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x69(%rbp)
mov    -0x69(%rbp),%al
test   $0x1,%al
jne    13c6 <main+0x1c6>
jmp    13e2 <main+0x1e2>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    13dd <main+0x1dd>
mov    -0x50(%rbp),%rax
movb   $0x2f,(%rax)
jmp    1385 <main+0x185>
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
lea    0xc2c(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1511 <main+0x311>
mov    -0x58(%rbp),%rdi
lea    0xc11(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1511 <main+0x311>
mov    -0x58(%rbp),%rdi
lea    0xbf6(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1511 <main+0x311>
mov    -0x58(%rbp),%rdi
lea    0xbdc(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1511 <main+0x311>
mov    -0x58(%rbp),%rdi
lea    0xbab(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1511 <main+0x311>
mov    -0x58(%rbp),%rdi
lea    0xba2(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1511 <main+0x311>
mov    -0x58(%rbp),%rdi
lea    0xb87(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1511 <main+0x311>
mov    -0x58(%rbp),%rdi
lea    0xb6d(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1511 <main+0x311>
mov    -0x58(%rbp),%rdi
lea    0xb53(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1511 <main+0x311>
jmp    12c6 <main+0xc6>
mov    -0x58(%rbp),%rdi
lea    0xafe(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1535 <main+0x335>
jmp    12c6 <main+0xc6>
jmp    153a <main+0x33a>
mov    -0x68(%rbp),%rdi
mov    0x2a9b(%rip),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
call   10a0 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x6a(%rbp)
je     1572 <main+0x372>
mov    -0x68(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x6a(%rbp)
mov    -0x6a(%rbp),%al
test   $0x1,%al
jne    1582 <main+0x382>
jmp    1599 <main+0x399>
mov    -0x68(%rbp),%rdi
mov    0x2a4b(%rip),%rax
mov    (%rax),%esi
call   1080 <fputs@plt>
jmp    153a <main+0x33a>
mov    -0x18(%rbp),%rdi
call   10c0 <fileno@plt>
mov    %eax,%edi
lea    -0x38(%rbp),%rsi
call   1120 <fstat@plt>
mov    -0x60(%rbp),%rsi
lea    0xa97(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x18(%rbp),%rdi
call   10b0 <ftell@plt>
mov    -0x70(%rbp),%esi
sub    %eax,%esi
lea    0xa88(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
jmp    12c6 <main+0xc6>
lea    0xa77(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x20(%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    $0x18,%rsp
mov    0x2db8(%rip),%r14
mov    (%r14),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
lea    0xdb0(%rip),%rdi
lea    0xdc3(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     14f8 <main+0x2e8>
mov    %rax,%r15
lea    0xdad(%rip),%rdi
call   1070 <chdir@plt>
test   %rax,%rax
js     1501 <main+0x2f1>
lea    -0x40(%rbp),%rdi
call   1120 <ftime@plt>
jmp    12e0 <main+0xd0>
mov    %r13,%rdi
call   10d0 <fileno@plt>
mov    %eax,%edi
lea    -0x30(%rbp),%rsi
call   1130 <fstat@plt>
lea    0xdad(%rip),%rdi
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    -0x30(%rbp),%r12d
mov    %r13,%rdi
call   10c0 <ftell@plt>
sub    %eax,%r12d
lea    0xd9f(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r13,%rdi
call   1060 <fclose@plt>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14),%esi
mov    %rbx,%rdi
mov    %r15,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     14dd <main+0x2cd>
mov    %rbx,%rdi
mov    $0x9,%esi
call   10a0 <index@plt>
test   %rax,%rax
je     12e0 <main+0xd0>
mov    %rax,%r12
lea    0x1(%rax),%rdi
mov    $0x9,%esi
call   10a0 <index@plt>
test   %rax,%rax
je     12e0 <main+0xd0>
mov    %rax,%r13
cmpb   $0xa,0x1(%rax)
je     12e0 <main+0xd0>
movb   $0x0,0x0(%r13)
mov    %r12,%rdi
lea    -0x40(%rbp),%rsi
call   10e0 <getdate@plt>
add    $0x127500,%rax
cmp    -0x40(%rbp),%rax
jl     12e0 <main+0xd0>
add    $0x1,%r13
mov    -0x38(%rbp),%rdi
mov    %r12,%rsi
call   1050 <strcpy@plt>
mov    %r13,%rax
jmp    1367 <main+0x157>
nopw   0x0(%rax,%rax,1)
movb   $0x2f,(%rax)
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x2e,%cl
je     1360 <main+0x150>
cmp    $0xa,%cl
je     137f <main+0x16f>
cmp    $0x20,%cl
je     137f <main+0x16f>
add    $0x1,%rax
jmp    1367 <main+0x157>
movb   $0x0,(%rax)
mov    %r13,%rdi
lea    0xca0(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1477 <main+0x267>
mov    %r13,%rdi
lea    0xc87(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1477 <main+0x267>
mov    %r13,%rdi
lea    0xc6e(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1477 <main+0x267>
mov    %r13,%rdi
lea    0xc56(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1477 <main+0x267>
mov    %r13,%rdi
lea    0xc27(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1477 <main+0x267>
mov    %r13,%rdi
lea    0xc24(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1477 <main+0x267>
mov    %r13,%rdi
lea    0xc0f(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1477 <main+0x267>
mov    %r13,%rdi
lea    0xbfb(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1477 <main+0x267>
mov    %r13,%rdi
lea    0xbe7(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    12e0 <main+0xd0>
mov    %r13,%rdi
lea    0xb99(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     12e0 <main+0xd0>
mov    %rax,%r13
mov    (%r14),%esi
mov    %rbx,%rdi
mov    %rax,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
mov    0x2b2e(%rip),%r12
je     1288 <main+0x78>
cmpb   $0xa,(%rbx)
je     1288 <main+0x78>
mov    (%r12),%esi
mov    %rbx,%rdi
call   1090 <fputs@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
mov    %r13,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
jne    14b0 <main+0x2a0>
jmp    1288 <main+0x78>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb01(%rip),%rdi
jmp    1508 <main+0x2f8>
lea    0xb14(%rip),%rdi
call   1100 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.timeb = type { i64 }
@BUFSIZ = global i32 0
@.str = [26 x i8] c"/usr/new/lib/news/history\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [16 x i8] c"/usr/spool/news\00"
@.str.3 = [4 x i8] c"net\00"
@.str.4 = [4 x i8] c"mod\00"
@.str.5 = [5 x i8] c"comp\00"
@.str.6 = [4 x i8] c"sci\00"
@.str.7 = [5 x i8] c"news\00"
@.str.8 = [4 x i8] c"rec\00"
@.str.9 = [5 x i8] c"talk\00"
@.str.10 = [5 x i8] c"misc\00"
@.str.11 = [4 x i8] c"soc\00"
@stdout = global i32 0
@.str.12 = [19 x i8] c"Date-Received: %s\0A\00"
@.str.13 = [13 x i8] c"Bytes: %ld\0A\0A\00"
@.str.14 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca %struct.stat
%8 = alloca %struct.timeb
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i8*
store i32 0, i32* %1
%12 = load i32, i32* @BUFSIZ
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %4
%15 = alloca i8, i64 %13
store i64 %13, i64* %5
%16 = load i32, i32* @BUFSIZ
%17 = zext i32 %16 to i64
%18 = alloca i8, i64 %17
store i64 %17, i64* %6
%19 = call i32* @fopen(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %19, i32** %2
%20 = load i32*, i32** %2
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %25
22: ; preds = %0
%23 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %0
%26 = call i64 @chdir(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp slt i64 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %25
%32 = call i32 @ftime(%struct.timeb* %8)
br label %33
33: ; preds = %153, %136, %130, %65, %55, %42, %31
%34 = load i32, i32* @BUFSIZ
%35 = load i32*, i32** %2
%36 = call i64 @fgets(i8* %15, i32 %34, i32* %35)
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %166
38: ; preds = %33
%39 = call i8* @index(i8* %15, i32 9)
store i8* %39, i8** %10
%40 = load i8*, i8** %10
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %43
42: ; preds = %38
br label %33
43: ; preds = %38
%44 = load i8*, i8** %10
%45 = getelementptr inbounds i8, i8* %44, i64 1
%46 = call i8* @index(i8* %45, i32 9)
store i8* %46, i8** %11
%47 = load i8*, i8** %11
%48 = icmp eq i8* %47, null
br i1 %48, label %55, label %49
49: ; preds = %43
%50 = load i8*, i8** %11
%51 = getelementptr inbounds i8, i8* %50, i64 1
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 10
br i1 %54, label %55, label %56
55: ; preds = %49, %43
br label %33
56: ; preds = %49
%57 = load i8*, i8** %11
store i8 0, i8* %57
%58 = load i8*, i8** %10
%59 = call i64 @getdate(i8* %58, %struct.timeb* %8)
store i64 %59, i64* %9
%60 = load i64, i64* %9
%61 = add nsw i64 %60, 1209600
%62 = getelementptr inbounds %struct.timeb, %struct.timeb* %8, i32 0, i32 0
%63 = load i64, i64* %62
%64 = icmp slt i64 %61, %63
br i1 %64, label %65, label %66
65: ; preds = %56
br label %33
66: ; preds = %56
%67 = load i8*, i8** %10
%68 = call i32 @strcpy(i8* %18, i8* %67)
%69 = load i8*, i8** %11
store i8* %69, i8** %10
br label %70
70: ; preds = %90, %66
%71 = load i8*, i8** %10
%72 = getelementptr inbounds i8, i8* %71, i32 1
store i8* %72, i8** %10
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp ne i32 %74, 32
br i1 %75, label %76, label %81
76: ; preds = %70
%77 = load i8*, i8** %10
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp ne i32 %79, 10
br label %81
81: ; preds = %76, %70
%82 = phi i1 [ false, %70 ], [ %80, %76 ]
br i1 %82, label %83, label %91
83: ; preds = %81
%84 = load i8*, i8** %10
%85 = load i8, i8* %84
%86 = sext i8 %85 to i32
%87 = icmp eq i32 %86, 46
br i1 %87, label %88, label %90
88: ; preds = %83
%89 = load i8*, i8** %10
store i8 47, i8* %89
br label %90
90: ; preds = %88, %83
br label %70
91: ; preds = %81
%92 = load i8*, i8** %10
store i8 0, i8* %92
%93 = load i8*, i8** %11
%94 = getelementptr inbounds i8, i8* %93, i32 1
store i8* %94, i8** %11
%95 = load i8*, i8** %11
%96 = call i64 @strncmp(i8* %95, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%97 = icmp ne i64 %96, 0
br i1 %97, label %98, label %131
98: ; preds = %91
%99 = load i8*, i8** %11
%100 = call i64 @strncmp(i8* %99, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%101 = icmp ne i64 %100, 0
br i1 %101, label %102, label %131
102: ; preds = %98
%103 = load i8*, i8** %11
%104 = call i64 @strncmp(i8* %103, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%105 = icmp ne i64 %104, 0
br i1 %105, label %106, label %131
106: ; preds = %102
%107 = load i8*, i8** %11
%108 = call i64 @strncmp(i8* %107, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%109 = icmp ne i64 %108, 0
br i1 %109, label %110, label %131
110: ; preds = %106
%111 = load i8*, i8** %11
%112 = call i64 @strncmp(i8* %111, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%113 = icmp ne i64 %112, 0
br i1 %113, label %114, label %131
114: ; preds = %110
%115 = load i8*, i8** %11
%116 = call i64 @strncmp(i8* %115, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 3)
%117 = icmp ne i64 %116, 0
br i1 %117, label %118, label %131
118: ; preds = %114
%119 = load i8*, i8** %11
%120 = call i64 @strncmp(i8* %119, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 4)
%121 = icmp ne i64 %120, 0
br i1 %121, label %122, label %131
122: ; preds = %118
%123 = load i8*, i8** %11
%124 = call i64 @strncmp(i8* %123, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%125 = icmp ne i64 %124, 0
br i1 %125, label %126, label %131
126: ; preds = %122
%127 = load i8*, i8** %11
%128 = call i64 @strncmp(i8* %127, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 4)
%129 = icmp ne i64 %128, 0
br i1 %129, label %130, label %131
130: ; preds = %126
br label %33
131: ; preds = %126, %122, %118, %114, %110, %106, %102, %98, %91
%132 = load i8*, i8** %11
%133 = call i32* @fopen(i8* %132, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %133, i32** %3
%134 = load i32*, i32** %3
%135 = icmp eq i32* %134, null
br i1 %135, label %136, label %137
136: ; preds = %131
br label %33
137: ; preds = %131
br label %138
138: ; preds = %150, %137
%139 = load i32, i32* @BUFSIZ
%140 = load i32*, i32** %3
%141 = call i64 @fgets(i8* %15, i32 %139, i32* %140)
%142 = icmp ne i64 %141, 0
br i1 %142, label %143, label %148
143: ; preds = %138
%144 = getelementptr inbounds i8, i8* %15, i64 0
%145 = load i8, i8* %144
%146 = sext i8 %145 to i32
%147 = icmp ne i32 %146, 10
br label %148
148: ; preds = %143, %138
%149 = phi i1 [ false, %138 ], [ %147, %143 ]
br i1 %149, label %150, label %153
150: ; preds = %148
%151 = load i32, i32* @stdout
%152 = call i32 @fputs(i8* %15, i32 %151)
br label %138
153: ; preds = %148
%154 = load i32*, i32** %3
%155 = call i32 @fileno(i32* %154)
%156 = call i32 @fstat(i32 %155, %struct.stat* %7)
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* %18)
%158 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%159 = load i32, i32* %158
%160 = load i32*, i32** %3
%161 = call i32 @ftell(i32* %160)
%162 = sub nsw i32 %159, %161
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 %162)
%164 = load i32*, i32** %3
%165 = call i32 @fclose(i32* %164)
br label %33
166: ; preds = %33
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%168 = load i8*, i8** %4
%169 = load i32, i32* %1
ret i32 %169
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.timeb = type { i64 }
@BUFSIZ = global i32 0
@.str = [26 x i8] c"/usr/new/lib/news/history\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [16 x i8] c"/usr/spool/news\00"
@.str.3 = [4 x i8] c"net\00"
@.str.4 = [4 x i8] c"mod\00"
@.str.5 = [5 x i8] c"comp\00"
@.str.6 = [4 x i8] c"sci\00"
@.str.7 = [5 x i8] c"news\00"
@.str.8 = [4 x i8] c"rec\00"
@.str.9 = [5 x i8] c"talk\00"
@.str.10 = [5 x i8] c"misc\00"
@.str.11 = [4 x i8] c"soc\00"
@stdout = global i32 0
@.str.12 = [19 x i8] c"Date-Received: %s\0A\00"
@.str.13 = [13 x i8] c"Bytes: %ld\0A\0A\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = alloca %struct.timeb
%3 = load i32, i32* @BUFSIZ
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = alloca i8, i64 %4
%7 = bitcast %struct.stat* %1 to i8*
%8 = bitcast %struct.timeb* %2 to i8*
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %0
%15 = tail call i64 @chdir(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%19 = tail call i32 @exit(i32 1)
unreachable
20: ; preds = %14
%21 = call i32 @ftime(%struct.timeb* %2)
%22 = load i32, i32* @BUFSIZ
%23 = call i64 @fgets(i8* %5, i32 %22, i32* %9)
%24 = icmp eq i64 %23, 0
br i1 %24, label %108, label %25
25: ; preds = %20
%26 = getelementptr inbounds %struct.timeb, %struct.timeb* %2, i64 0, i32 0
%27 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
br label %28
28: ; preds = %25, %104
%29 = call i8* @index(i8* %5, i32 9)
%30 = icmp eq i8* %29, null
br i1 %30, label %104, label %31
31: ; preds = %28
%32 = getelementptr inbounds i8, i8* %29, i64 1
%33 = call i8* @index(i8* %32, i32 9)
%34 = icmp eq i8* %33, null
br i1 %34, label %104, label %35
35: ; preds = %31
%36 = getelementptr inbounds i8, i8* %33, i64 1
%37 = load i8, i8* %36
%38 = icmp eq i8 %37, 10
br i1 %38, label %104, label %39
39: ; preds = %35
store i8 0, i8* %33
%40 = call i64 @getdate(i8* %29, %struct.timeb* %2)
%41 = add nsw i64 %40, 1209600
%42 = load i64, i64* %26
%43 = icmp slt i64 %41, %42
br i1 %43, label %104, label %44
44: ; preds = %39
%45 = call i32 @strcpy(i8* %6, i8* %29)
br label %46
46: ; preds = %50, %44
%47 = phi i8* [ %33, %44 ], [ %48, %50 ]
%48 = getelementptr inbounds i8, i8* %47, i64 1
%49 = load i8, i8* %48
switch i8 %49, label %50 [
i8 32, label %52
i8 10, label %52
i8 46, label %51
]
50: ; preds = %46, %51
br label %46
51: ; preds = %46
store i8 47, i8* %48
br label %50
52: ; preds = %46, %46
store i8 0, i8* %48
%53 = call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%54 = icmp eq i64 %53, 0
br i1 %54, label %79, label %55
55: ; preds = %52
%56 = call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%57 = icmp eq i64 %56, 0
br i1 %57, label %79, label %58
58: ; preds = %55
%59 = call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%60 = icmp eq i64 %59, 0
br i1 %60, label %79, label %61
61: ; preds = %58
%62 = call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%63 = icmp eq i64 %62, 0
br i1 %63, label %79, label %64
64: ; preds = %61
%65 = call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%66 = icmp eq i64 %65, 0
br i1 %66, label %79, label %67
67: ; preds = %64
%68 = call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 3)
%69 = icmp eq i64 %68, 0
br i1 %69, label %79, label %70
70: ; preds = %67
%71 = call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 4)
%72 = icmp eq i64 %71, 0
br i1 %72, label %79, label %73
73: ; preds = %70
%74 = call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%75 = icmp eq i64 %74, 0
br i1 %75, label %79, label %76
76: ; preds = %73
%77 = call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 4)
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %104
79: ; preds = %76, %73, %70, %67, %64, %61, %58, %55, %52
%80 = call i32* @fopen(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%81 = icmp eq i32* %80, null
br i1 %81, label %104, label %82
82: ; preds = %79
%83 = load i32, i32* @BUFSIZ
%84 = call i64 @fgets(i8* %5, i32 %83, i32* %80)
%85 = icmp eq i64 %84, 0
br i1 %85, label %95, label %86
86: ; preds = %82, %89
%87 = load i8, i8* %5
%88 = icmp eq i8 %87, 10
br i1 %88, label %95, label %89
89: ; preds = %86
%90 = load i32, i32* @stdout
%91 = call i32 @fputs(i8* %5, i32 %90)
%92 = load i32, i32* @BUFSIZ
%93 = call i64 @fgets(i8* %5, i32 %92, i32* %80)
%94 = icmp eq i64 %93, 0
br i1 %94, label %95, label %86
95: ; preds = %86, %89, %82
%96 = call i32 @fileno(i32* %80)
%97 = call i32 @fstat(i32 %96, %struct.stat* %1)
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* %6)
%99 = load i32, i32* %27
%100 = call i32 @ftell(i32* %80)
%101 = sub nsw i32 %99, %100
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 %101)
%103 = call i32 @fclose(i32* %80)
br label %104
104: ; preds = %79, %76, %39, %31, %35, %28, %95
%105 = load i32, i32* @BUFSIZ
%106 = call i64 @fgets(i8* %5, i32 %105, i32* %9)
%107 = icmp eq i64 %106, 0
br i1 %107, label %108, label %28
108: ; preds = %104, %20
%109 = call i32 @putchar(i32 10)
ret i32 0
}