#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 */
typedef int /*<<< orphan*/ line;
typedef int /*<<< orphan*/ *gzFile;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ gzclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ gzeof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *gzgets(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ *gzopen(char const *const, char *);
int /*<<< orphan*/ printf(char *, char const *const, ...);
int /*<<< orphan*/ stderr;
scalar_t__ strlen(char *);
int main(int argc, char *argv[]) {
  gzFile file;
  char const *const fileName = argv[1];
  if (argc == 1) {
    fprintf(stderr, "Usage: %s <sequence_file>\n", argv[0]);
    return 1;
  }
  if ((file = gzopen(fileName, "r")) == NULL) {
    printf("Could not open %s\n", fileName);
    return 1;
  }
  char line[5000000];
  int k = 0;
  double b = 0;
  double i = 0;
  int fq = 4;
  while (!gzeof(file)) {
    if ((gzgets(file, line, sizeof(line))) != NULL) {
      k++;
      if (k % fq == 0) {
        b += strlen(line);
        i++;
      }
    }
  }
  gzclose(file);
  printf("Filename = %s ; Reads = %.0f ; Bases = %.0f\n", argv[1], i, b - i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4c4b80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11c7 <main+0x57>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe52(%rip),%rsi
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1310 <main+0x1a0>
mov    -0x20(%rbp),%rdi
lea    0xe51(%rip),%rsi
call   1090 <gzopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1203 <main+0x93>
mov    -0x20(%rbp),%rsi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1310 <main+0x1a0>
movl   $0x0,-0x4c4b64(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x4c4b70(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x4c4b78(%rbp)
ff
movl   $0x4,-0x4c4b7c(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <gzeof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    124b <main+0xdb>
jmp    12d2 <main+0x162>
mov    -0x18(%rbp),%rdi
lea    -0x4c4b60(%rbp),%rsi
mov    $0x4c4b40,%edx
call   1040 <gzgets@plt>
cmp    $0x0,%rax
je     12cd <main+0x15d>
mov    -0x4c4b64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c4b64(%rbp)
mov    -0x4c4b64(%rbp),%eax
cltd
idivl  -0x4c4b7c(%rbp)
cmp    $0x0,%edx
jne    12c8 <main+0x158>
lea    -0x4c4b60(%rbp),%rdi
call   1050 <strlen@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x4c4b70(%rbp),%xmm0
ff
movsd  %xmm0,-0x4c4b70(%rbp)
ff
movsd  0xd48(%rip),%xmm0
addsd  -0x4c4b78(%rbp),%xmm0
ff
movsd  %xmm0,-0x4c4b78(%rbp)
ff
jmp    12cd <main+0x15d>
jmp    122d <main+0xbd>
mov    -0x18(%rbp),%rdi
call   1030 <gzclose@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
movsd  -0x4c4b78(%rbp),%xmm0
ff
movsd  -0x4c4b70(%rbp),%xmm1
ff
subsd  -0x4c4b78(%rbp),%xmm1
ff
lea    0xd36(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4c4b80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x4c4b58,%rsp
mov    %rsi,%r14
cmp    $0x1,%edi
jne    119f <main+0x2f>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xe70(%rip),%rsi
call   1080 <fprintf@plt>
jmp    1217 <main+0xa7>
mov    0x8(%r14),%r15
lea    0xe79(%rip),%rsi
mov    %r15,%rdi
call   1090 <gzopen@plt>
test   %rax,%rax
je     1206 <main+0x96>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <gzeof@plt>
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
test   %eax,%eax
je     122a <main+0xba>
mov    %rbx,%rdi
call   1030 <gzclose@plt>
mov    0x8(%r14),%rsi
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
lea    0xe3d(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
xor    %eax,%eax
jmp    121c <main+0xac>
lea    0xe18(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%eax
add    $0x4c4b58,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebp,%ebp
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x10(%rsp),%r15
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
jmp    1260 <main+0xf0>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1070 <gzeof@plt>
test   %eax,%eax
jne    11d9 <main+0x69>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x4c4b40,%edx
call   1040 <gzgets@plt>
test   %rax,%rax
je     1250 <main+0xe0>
add    $0x1,%ebp
test   $0x3,%bpl
jne    1250 <main+0xe0>
mov    %r15,%rdi
call   1050 <strlen@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0xd56(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
jmp    1250 <main+0xe0>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s <sequence_file>\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [19 x i8] c"Could not open %s\0A\00"
@.str.3 = [45 x i8] c"Filename = %s ; Reads = %.0f ; Bases = %.0f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca [5000000 x i8]
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
store i8* %15, i8** %7
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %24
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %22)
store i32 1, i32* %3
br label %70
24: ; preds = %2
%25 = load i8*, i8** %7
%26 = call i32* @gzopen(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %26, i32** %6
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i8*, i8** %7
%30 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %29)
store i32 1, i32* %3
br label %70
31: ; preds = %24
store i32 0, i32* %9
store double 0.000000e+00, double* %10
store double 0.000000e+00, double* %11
store i32 4, i32* %12
br label %32
32: ; preds = %58, %31
%33 = load i32*, i32** %6
%34 = call i32 @gzeof(i32* %33)
%35 = icmp ne i32 %34, 0
%36 = xor i1 %35, true
br i1 %36, label %37, label %59
37: ; preds = %32
%38 = load i32*, i32** %6
%39 = getelementptr inbounds [5000000 x i8], [5000000 x i8]* %8, i64 0, i64 0
%40 = call i32* @gzgets(i32* %38, i8* %39, i32 5000000)
%41 = icmp ne i32* %40, null
br i1 %41, label %42, label %58
42: ; preds = %37
%43 = load i32, i32* %9
%44 = add nsw i32 %43, 1
store i32 %44, i32* %9
%45 = load i32, i32* %9
%46 = load i32, i32* %12
%47 = srem i32 %45, %46
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %57
49: ; preds = %42
%50 = getelementptr inbounds [5000000 x i8], [5000000 x i8]* %8, i64 0, i64 0
%51 = call i64 @strlen(i8* %50)
%52 = sitofp i64 %51 to double
%53 = load double, double* %10
%54 = fadd double %53, %52
store double %54, double* %10
%55 = load double, double* %11
%56 = fadd double %55, 1.000000e+00
store double %56, double* %11
br label %57
57: ; preds = %49, %42
br label %58
58: ; preds = %57, %37
br label %32
59: ; preds = %32
%60 = load i32*, i32** %6
%61 = call i32 @gzclose(i32* %60)
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 1
%64 = load i8*, i8** %63
%65 = load double, double* %11
%66 = load double, double* %10
%67 = load double, double* %11
%68 = fsub double %66, %67
%69 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* %64, double %65, double %68)
store i32 0, i32* %3
br label %70
70: ; preds = %59, %28, %18
%71 = load i32, i32* %3
ret i32 %71
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s <sequence_file>\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [19 x i8] c"Could not open %s\0A\00"
@.str.3 = [45 x i8] c"Filename = %s ; Reads = %.0f ; Bases = %.0f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [5000000 x i8]
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = icmp eq i32 %0, 1
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %1
%10 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %48
11: ; preds = %2
%12 = tail call i32* @gzopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %5)
br label %48
16: ; preds = %11
%17 = getelementptr inbounds [5000000 x i8], [5000000 x i8]* %3, i64 0, i64 0
%18 = call i32 @gzeof(i32* %12)
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %41
20: ; preds = %16, %35
%21 = phi double [ %38, %35 ], [ 0.000000e+00, %16 ]
%22 = phi double [ %37, %35 ], [ 0.000000e+00, %16 ]
%23 = phi i32 [ %36, %35 ], [ 0, %16 ]
%24 = call i32* @gzgets(i32* %12, i8* %17, i32 5000000)
%25 = icmp eq i32* %24, null
br i1 %25, label %35, label %26
26: ; preds = %20
%27 = add nsw i32 %23, 1
%28 = and i32 %27, 3
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %35
30: ; preds = %26
%31 = call i64 @strlen(i8* %17)
%32 = sitofp i64 %31 to double
%33 = fadd double %22, %32
%34 = fadd double %21, 1.000000e+00
br label %35
35: ; preds = %26, %30, %20
%36 = phi i32 [ %27, %30 ], [ %27, %26 ], [ %23, %20 ]
%37 = phi double [ %33, %30 ], [ %22, %26 ], [ %22, %20 ]
%38 = phi double [ %34, %30 ], [ %21, %26 ], [ %21, %20 ]
%39 = call i32 @gzeof(i32* %12)
%40 = icmp eq i32 %39, 0
br i1 %40, label %20, label %41
41: ; preds = %35, %16
%42 = phi double [ 0.000000e+00, %16 ], [ %37, %35 ]
%43 = phi double [ 0.000000e+00, %16 ], [ %38, %35 ]
%44 = call i32 @gzclose(i32* %12)
%45 = load i8*, i8** %4
%46 = fsub double %42, %43
%47 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* %45, double %43, double %46)
br label %48
48: ; preds = %41, %14, %7
%49 = phi i32 [ 1, %7 ], [ 1, %14 ], [ 0, %41 ]
ret i32 %49
}