#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 EOF;
int fgetc(int /*<<< orphan*/ *);
int readcounter(FILE *file) {
  int c;
  int seqcounter = 0;
  int i = 0;
  int descrstar = 0;
  int descrend = 0;
  if (file) {
    while ((c = fgetc(file)) != EOF) {
      if (c == '>')
        descrstar = 1;
      if (c == '\n')
        descrend = 1;
      if ((descrstar == 1) && (descrend == 1)) {
        if (!((c == '\n') || (c == ' '))) {
          seqcounter++;
        }
      }
    }
  }
  return seqcounter;
}


x86 assembly (clang, -O0):
<readcounter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     11c5 <readcounter+0xb5>
jmp    1148 <readcounter+0x38>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%eax
je     11c0 <readcounter+0xb0>
cmpl   $0x3e,-0xc(%rbp)
jne    1174 <readcounter+0x64>
movl   $0x1,-0x18(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    1185 <readcounter+0x75>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    11bb <readcounter+0xab>
cmpl   $0x1,-0x1c(%rbp)
jne    11bb <readcounter+0xab>
cmpl   $0xa,-0xc(%rbp)
je     11b6 <readcounter+0xa6>
cmpl   $0x20,-0xc(%rbp)
je     11b6 <readcounter+0xa6>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11bb <readcounter+0xab>
jmp    1148 <readcounter+0x38>
jmp    11c5 <readcounter+0xb5>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readcounter>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r14d,%r14d
test   %rdi,%rdi
je     1137 <readcounter+0x27>
mov    %rdi,%r13
call   1030 <fgetc@plt>
mov    0x2eb6(%rip),%r15
cmp    (%r15),%eax
jne    1149 <readcounter+0x39>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebp,%ebp
mov    $0x1,%r12d
xor    %ebx,%ebx
xor    %r14d,%r14d
jmp    116d <readcounter+0x5d>
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1030 <fgetc@plt>
cmp    (%r15),%eax
je     1137 <readcounter+0x27>
cmp    $0x3e,%eax
cmove  %r12d,%ebx
cmp    $0xa,%eax
cmove  %r12d,%ebp
cmp    $0x1,%ebx
jne    1160 <readcounter+0x50>
cmp    $0x1,%ebp
jne    1160 <readcounter+0x50>
cmp    $0xa,%eax
je     1160 <readcounter+0x50>
cmp    $0x20,%eax
je     1160 <readcounter+0x50>
add    $0x1,%r14d
jmp    1160 <readcounter+0x50>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @readcounter(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = load i32*, i32** %2
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %42
10: ; preds = %1
br label %11
11: ; preds = %40, %10
%12 = load i32*, i32** %2
%13 = call i32 @fgetc(i32* %12)
store i32 %13, i32* %3
%14 = load i32, i32* @EOF
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %41
16: ; preds = %11
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 62
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 1, i32* %6
br label %20
20: ; preds = %19, %16
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 10
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 1, i32* %7
br label %24
24: ; preds = %23, %20
%25 = load i32, i32* %6
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %40
27: ; preds = %24
%28 = load i32, i32* %7
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %40
30: ; preds = %27
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 10
br i1 %32, label %39, label %33
33: ; preds = %30
%34 = load i32, i32* %3
%35 = icmp eq i32 %34, 32
br i1 %35, label %39, label %36
36: ; preds = %33
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %39
39: ; preds = %36, %33, %30
br label %40
40: ; preds = %39, %27, %24
br label %11
41: ; preds = %11
br label %42
42: ; preds = %41, %1
%43 = load i32, i32* %4
ret i32 %43
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @readcounter(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %27, label %3
3: ; preds = %1
%4 = tail call i32 @fgetc(i32* %0)
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %27, label %7
7: ; preds = %3, %22
%8 = phi i32 [ %24, %22 ], [ %4, %3 ]
%9 = phi i32 [ %15, %22 ], [ 0, %3 ]
%10 = phi i32 [ %13, %22 ], [ 0, %3 ]
%11 = phi i32 [ %23, %22 ], [ 0, %3 ]
%12 = icmp eq i32 %8, 62
%13 = select i1 %12, i32 1, i32 %10
%14 = icmp eq i32 %8, 10
%15 = select i1 %14, i32 1, i32 %9
%16 = icmp eq i32 %13, 1
%17 = icmp eq i32 %15, 1
%18 = select i1 %16, i1 %17, i1 false
br i1 %18, label %19, label %22
19: ; preds = %7
switch i32 %8, label %20 [
i32 32, label %22
i32 10, label %22
]
20: ; preds = %19
%21 = add nsw i32 %11, 1
br label %22
22: ; preds = %19, %19, %20, %7
%23 = phi i32 [ %11, %19 ], [ %21, %20 ], [ %11, %7 ], [ %11, %19 ]
%24 = tail call i32 @fgetc(i32* %0)
%25 = load i32, i32* @EOF
%26 = icmp eq i32 %24, %25
br i1 %26, label %27, label %7
27: ; preds = %22, %3, %1
%28 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %23, %22 ]
ret i32 %28
}