#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 EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int ch, count, place;
  char sign[10] = "aabaabrac";
  place = 0;
  count = 0;
  while ((ch = getchar()) != EOF) {
    if (sign[place] == ch) {
      place++;
      if (place == 9) {
        place = 0;
        count++;
      }
    } else {
      place = 0;
    }
  }
  printf("%d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x26(%rbp)
mov    0xec0(%rip),%ax
mov    %ax,-0x1e(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%eax
je     11b9 <main+0x99>
movslq -0x1c(%rbp),%rax
movsbl -0x26(%rbp,%rax,1),%eax
cmp    -0x14(%rbp),%eax
jne    11ad <main+0x8d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x9,-0x1c(%rbp)
jne    11a8 <main+0x88>
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b4 <main+0x94>
movl   $0x0,-0x1c(%rbp)
jmp    115a <main+0x3a>
mov    -0x18(%rbp),%esi
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb0(%rip),%r14
cmp    (%r14),%eax
jne    1156 <main+0x36>
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r15d,%r15d
lea    0xea0(%rip),%r12
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    118d <main+0x6d>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebp
xor    %eax,%eax
cmp    $0x9,%ebp
sete   %al
cmove  %r15d,%ebp
add    %eax,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
je     113d <main+0x1d>
movslq %ebp,%rcx
movsbl (%rcx,%r12,1),%ecx
cmp    %ecx,%eax
je     1170 <main+0x50>
xor    %ebp,%ebp
jmp    1181 <main+0x61>

LLVM IR (-O0):
@__const.main.sign = [10 x i8] c"aabaabrac\00"
@EOF = global i32 0
@.str = [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 [10 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [10 x i8]* %9 to i8*
store i32 0, i32* %8
store i32 0, i32* %7
br label %11
11: ; preds = %33, %2
%12 = call i32 (...) @getchar()
store i32 %12, i32* %6
%13 = load i32, i32* @EOF
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %34
15: ; preds = %11
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i32, i32* %6
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %32
23: ; preds = %15
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = icmp eq i32 %26, 9
br i1 %27, label %28, label %31
28: ; preds = %23
store i32 0, i32* %8
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %31
31: ; preds = %28, %23
br label %33
32: ; preds = %15
store i32 0, i32* %8
br label %33
33: ; preds = %32, %31
br label %11
34: ; preds = %11
%35 = load i32, i32* %7
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
ret i32 0
}

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