#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 */

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ filter(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ show_statistics();
int main(int argc, char *argv[]) {
  char *inf;
  if (argc == 1) {
    inf = "gcov.log";
  } else if (argc == 2) {
    inf = argv[1];
  } else {
    printf("Usage: %s [<input-file>]\n", argv[0]);
    exit(1);
  }
  filter(inf);
  show_statistics();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1170 <main+0x30>
lea    0xe99(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11ad <main+0x6d>
cmpl   $0x2,-0x8(%rbp)
jne    118b <main+0x4b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    11a8 <main+0x68>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
jmp    11ad <main+0x6d>
mov    -0x18(%rbp),%rdi
call   1040 <filter@plt>
mov    $0x0,%al
call   1050 <show_statistics@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
je     1151 <main+0x11>
cmp    $0x2,%edi
jne    1168 <main+0x28>
mov    0x8(%rsi),%rdi
jmp    1158 <main+0x18>
lea    0xea8(%rip),%rdi
call   1040 <filter@plt>
xor    %eax,%eax
call   1050 <show_statistics@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsi),%rsi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"gcov.log\00"
@.str.1 = [26 x i8] c"Usage: %s [<input-file>]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %6
br label %24
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
store i8* %16, i8** %6
br label %23
17: ; preds = %10
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %13
br label %24
24: ; preds = %23, %9
%25 = load i8*, i8** %6
%26 = call i32 @filter(i8* %25)
%27 = call i32 (...) @show_statistics()
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@.str = [9 x i8] c"gcov.log\00"
@.str.1 = [26 x i8] c"Usage: %s [<input-file>]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %6 [
i32 1, label %10
i32 2, label %3
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
br label %10
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2, %3
%11 = phi i8* [ %5, %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %2 ]
%12 = tail call i32 @filter(i8* %11)
%13 = tail call i32 (...) @show_statistics()
ret i32 0
}