#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*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char **);
scalar_t__ strcmp(char *, char *);
main() {
  int golo = 0, i = 0, max = 0;
  char c[2];
  for (;;) {
    scanf("%s", &c);
    if (strcmp(c, "!") == 0)
      break;
    if (strcmp(c, "o") == 0 || strcmp(c, "O") == 0) {
      golo = golo + 1;
      if (golo > max)
        max = golo;
    } else
      golo = 0;
  }
  printf("%d\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0x12(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x12(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1183 <main+0x53>
jmp    11e3 <main+0xb3>
lea    -0x12(%rbp),%rdi
lea    0xe77(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11b7 <main+0x87>
lea    -0x12(%rbp),%rdi
lea    0xe5f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11d7 <main+0xa7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11d2 <main+0xa2>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11de <main+0xae>
movl   $0x0,-0x8(%rbp)
jmp    1154 <main+0x24>
mov    -0x10(%rbp),%esi
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
lea    0x6(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xead(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     11d6 <main+0xa6>
lea    0x6(%rsp),%rbx
lea    0xe8f(%rip),%r15
lea    0xe8b(%rip),%r12
xor    %r13d,%r13d
jmp    11a9 <main+0x79>
nopl   (%rax)
lea    0x1(%r13),%r14d
cmp    %ebp,%r13d
cmovge %r14d,%ebp
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strcmp@plt>
mov    %r14d,%r13d
test   %rax,%rax
je     11d6 <main+0xa6>
mov    %rbx,%rdi
lea    0xe52(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1180 <main+0x50>
mov    %rbx,%rdi
lea    0xe40(%rip),%rsi
call   1040 <strcmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
jne    118b <main+0x5b>
jmp    1180 <main+0x50>
lea    0xe2c(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"!\00"
@.str.2 = [2 x i8] c"o\00"
@.str.3 = [2 x i8] c"O\00"
@.str.4 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %31, %0
%7 = bitcast [2 x i8]* %5 to i8**
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %7)
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %6
br label %32
13: ; preds = %6
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %13
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %17, %13
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = load i32, i32* %4
%26 = icmp sgt i32 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %21
%28 = load i32, i32* %2
store i32 %28, i32* %4
br label %29
29: ; preds = %27, %21
br label %31
30: ; preds = %17
store i32 0, i32* %2
br label %31
31: ; preds = %30, %29
br label %6
32: ; preds = %12
%33 = load i32, i32* %4
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %33)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"!\00"
@.str.2 = [2 x i8] c"o\00"
@.str.3 = [2 x i8] c"O\00"
@.str.4 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = bitcast [2 x i8]* %1 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %25, label %7
7: ; preds = %0, %19
%8 = phi i32 [ %21, %19 ], [ 0, %0 ]
%9 = phi i32 [ %20, %19 ], [ 0, %0 ]
%10 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12, %7
%16 = add nsw i32 %9, 1
%17 = icmp slt i32 %9, %8
%18 = select i1 %17, i32 %8, i32 %16
br label %19
19: ; preds = %15, %12
%20 = phi i32 [ %16, %15 ], [ 0, %12 ]
%21 = phi i32 [ %18, %15 ], [ %8, %12 ]
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
%23 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %7
25: ; preds = %19, %0
%26 = phi i32 [ 0, %0 ], [ %21, %19 ]
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %26)
ret i32 0
}