#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 *, int *);
int main() {
  int currentCount = 0, maxCount = 0, interest, input = 47541521465, prev = 0;
  scanf("%d", &interest);
  while (1) {
    prev = input;
    scanf("%d", &input);
    if (!input) {
      break;
    }
    if (input == interest) {
      currentCount++;
    } else {
      if (maxCount < currentCount && prev == interest) {
        maxCount = currentCount;
      }
      currentCount = 1;
    }
  }
  printf("%d", maxCount);
  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   $0x11b20c39,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xeae(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    0xe98(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
jne    1180 <main+0x60>
jmp    11c4 <main+0xa4>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    119a <main+0x7a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11bf <main+0x9f>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b8 <main+0x98>
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11b8 <main+0x98>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
jmp    115b <main+0x3b>
mov    -0xc(%rbp),%esi
lea    0xe32(%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   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x11b20c39,0x8(%rsp)
11
lea    0xec5(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
xor    %r12d,%r12d
test   %eax,%eax
je     11b8 <main+0x98>
mov    $0x11b20c39,%ecx
lea    0xe94(%rip),%r14
lea    0x8(%rsp),%r15
xor    %ebp,%ebp
jmp    11a9 <main+0x89>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %eax,%ecx
mov    %r12d,%eax
cmove  %ebp,%eax
cmp    %ebp,%r12d
cmovl  %eax,%r12d
mov    $0x1,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
mov    %ebx,%ecx
test   %eax,%eax
je     11b8 <main+0x98>
mov    %eax,%ebx
mov    0xc(%rsp),%eax
cmp    %eax,%ebx
jne    1180 <main+0x60>
add    $0x1,%ebp
jmp    1194 <main+0x74>
lea    0xe41(%rip),%rdi
mov    %r12d,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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