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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, int);
main(int argc, char **argv) {
  int c, articles = 0, lines = 0;
  char s[1024], *t;
  FILE *F;
  F = fopen(argv[1], "r");
  while (fgets(s, 1023, F)) {
    lines++;
    t = s;
    c = 0;
    while (*++t) {
      if (*t == '	')
        c++;
    }
    if (c > 1) {
      articles++;
    }
  }
  fclose(F);
  printf("%d\n", articles);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8a(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x430(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x430(%rbp),%rdx
mov    $0x3ff,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     121a <main+0xda>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x428(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x428(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x428(%rbp)
cmpb   $0x0,0x1(%rax)
je     1202 <main+0xc2>
mov    -0x428(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    11fd <main+0xbd>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c2 <main+0x82>
cmpl   $0x1,-0x14(%rbp)
jle    1215 <main+0xd5>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1182 <main+0x42>
mov    -0x430(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%esi
lea    0xdd2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    0x8(%rsi),%rdi
lea    0xeaa(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3ff,%esi
mov    %rax,%rdx
call   1050 <fgets@plt>
xor    %ebp,%ebp
jmp    1196 <main+0x56>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x2,%eax
sbb    $0xffffffff,%ebp
mov    %rbx,%rdi
mov    $0x3ff,%esi
mov    %r14,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     11b6 <main+0x76>
mov    %rbx,%rcx
xor    %eax,%eax
movzbl 0x1(%rcx),%edx
test   %dl,%dl
je     1180 <main+0x40>
add    $0x1,%rcx
cmp    $0x9,%dl
jne    11a0 <main+0x60>
add    $0x1,%eax
jmp    11a0 <main+0x60>
mov    %r14,%rdi
call   1030 <fclose@plt>
lea    0xe3d(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [1024 x i8]
%10 = alloca i8*
%11 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %15, i32** %11
br label %16
16: ; preds = %45, %2
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%18 = load i32*, i32** %11
%19 = call i64 @fgets(i8* %17, i32 1023, i32* %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %46
21: ; preds = %16
%22 = load i32, i32* %8
%23 = add nsw i32 %22, 1
store i32 %23, i32* %8
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
store i8* %24, i8** %10
store i32 0, i32* %6
br label %25
25: ; preds = %38, %21
%26 = load i8*, i8** %10
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %10
%28 = load i8, i8* %27
%29 = icmp ne i8 %28, 0
br i1 %29, label %30, label %39
30: ; preds = %25
%31 = load i8*, i8** %10
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 9
br i1 %34, label %35, label %38
35: ; preds = %30
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %38
38: ; preds = %35, %30
br label %25
39: ; preds = %25
%40 = load i32, i32* %6
%41 = icmp sgt i32 %40, 1
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
store i32 %44, i32* %7
br label %45
45: ; preds = %42, %39
br label %16
46: ; preds = %16
%47 = load i32*, i32** %11
%48 = call i32 @fclose(i32* %47)
%49 = load i32, i32* %7
%50 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %49)
%51 = load i32, i32* %3
ret i32 %51
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = call i64 @fgets(i8* %4, i32 1023, i32* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %27, label %10
10: ; preds = %2, %21
%11 = phi i32 [ %24, %21 ], [ 0, %2 ]
br label %12
12: ; preds = %19, %10
%13 = phi i8* [ %17, %19 ], [ %4, %10 ]
%14 = phi i32 [ %20, %19 ], [ 0, %10 ]
br label %15
15: ; preds = %12, %15
%16 = phi i8* [ %17, %15 ], [ %13, %12 ]
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
switch i8 %18, label %15 [
i8 0, label %21
i8 9, label %19
]
19: ; preds = %15
%20 = add nuw nsw i32 %14, 1
br label %12
21: ; preds = %15
%22 = icmp ugt i32 %14, 1
%23 = zext i1 %22 to i32
%24 = add nuw nsw i32 %11, %23
%25 = call i64 @fgets(i8* %4, i32 1023, i32* %7)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %10
27: ; preds = %21, %2
%28 = phi i32 [ 0, %2 ], [ %24, %21 ]
%29 = call i32 @fclose(i32* %7)
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %28)
ret i32 0
}