#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 findMaxConsecutiveOnes(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr1[] = {1, 1, 0, 1, 1, 1};
  printf("%d\n", findMaxConsecutiveOnes(arr1, 6));
  printf("%d\n", findMaxConsecutiveOnes(NULL, 6));
  printf("%d\n", findMaxConsecutiveOnes(arr1, 0));
  printf("%d\n", findMaxConsecutiveOnes(arr1, 1));
  printf("%d\n", findMaxConsecutiveOnes(arr1, 2));
  printf("%d\n", findMaxConsecutiveOnes(arr1, 3));
  printf("%d\n", findMaxConsecutiveOnes(arr1, 4));
  printf("%d\n", findMaxConsecutiveOnes(arr1, 5));
  int arr2[] = {0, 0, 0, 0, 0, 0};
  printf("%d\n", findMaxConsecutiveOnes(arr2, 0));
  printf("%d\n", findMaxConsecutiveOnes(arr2, 1));
  printf("%d\n", findMaxConsecutiveOnes(arr2, 2));
  printf("%d\n", findMaxConsecutiveOnes(arr2, 3));
  printf("%d\n", findMaxConsecutiveOnes(arr2, 4));
  printf("%d\n", findMaxConsecutiveOnes(arr2, 5));
  printf("%d\n", findMaxConsecutiveOnes(arr2, 6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
mov    $0x6,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x1,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x3,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xe18(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xdfc(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xde0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xdb7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x1,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xd9b(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x2,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xd7f(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x3,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xd63(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x4,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xd47(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xd2b(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x6,%esi
call   1050 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xd0f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    0xee0(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x6,%esi
call   1040 <findMaxConsecutiveOnes@plt>
lea    0xebe(%rip),%r15
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x5,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.arr1 = [6 x i32] [i32 1, i32 1, i32 0, i32 1, i32 1, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca [6 x i32]
store i32 0, i32* %1
%4 = bitcast [6 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%6 = call i32 @findMaxConsecutiveOnes(i32* %5, i32 6)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @findMaxConsecutiveOnes(i32* null, i32 6)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%11 = call i32 @findMaxConsecutiveOnes(i32* %10, i32 0)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%14 = call i32 @findMaxConsecutiveOnes(i32* %13, i32 1)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%17 = call i32 @findMaxConsecutiveOnes(i32* %16, i32 2)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%20 = call i32 @findMaxConsecutiveOnes(i32* %19, i32 3)
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%23 = call i32 @findMaxConsecutiveOnes(i32* %22, i32 4)
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%26 = call i32 @findMaxConsecutiveOnes(i32* %25, i32 5)
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = bitcast [6 x i32]* %3 to i8*
%29 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%30 = call i32 @findMaxConsecutiveOnes(i32* %29, i32 0)
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%33 = call i32 @findMaxConsecutiveOnes(i32* %32, i32 1)
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%36 = call i32 @findMaxConsecutiveOnes(i32* %35, i32 2)
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%39 = call i32 @findMaxConsecutiveOnes(i32* %38, i32 3)
%40 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%42 = call i32 @findMaxConsecutiveOnes(i32* %41, i32 4)
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%45 = call i32 @findMaxConsecutiveOnes(i32* %44, i32 5)
%46 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%48 = call i32 @findMaxConsecutiveOnes(i32* %47, i32 6)
%49 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %48)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr1 = [6 x i32] [i32 1, i32 1, i32 0, i32 1, i32 1, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca [6 x i32]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%5 = call i32 @findMaxConsecutiveOnes(i32* %4, i32 6)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @findMaxConsecutiveOnes(i32* null, i32 6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @findMaxConsecutiveOnes(i32* %4, i32 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @findMaxConsecutiveOnes(i32* %4, i32 1)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @findMaxConsecutiveOnes(i32* %4, i32 2)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = call i32 @findMaxConsecutiveOnes(i32* %4, i32 3)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call i32 @findMaxConsecutiveOnes(i32* %4, i32 4)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = call i32 @findMaxConsecutiveOnes(i32* %4, i32 5)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = bitcast [6 x i32]* %2 to i8*
%22 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%23 = call i32 @findMaxConsecutiveOnes(i32* %22, i32 0)
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = call i32 @findMaxConsecutiveOnes(i32* %22, i32 1)
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = call i32 @findMaxConsecutiveOnes(i32* %22, i32 2)
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = call i32 @findMaxConsecutiveOnes(i32* %22, i32 3)
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = call i32 @findMaxConsecutiveOnes(i32* %22, i32 4)
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %31)
%33 = call i32 @findMaxConsecutiveOnes(i32* %22, i32 5)
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = call i32 @findMaxConsecutiveOnes(i32* %22, i32 6)
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
ret i32 0
}