#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 incsubseq(int *, int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int A[20], n, i, j, cnt, max = 0, tmp;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &A[i]);
  }
  for (i = 0; i < n; i++) {
    cnt = incsubseq(A, n, i);
    if (cnt > max)
      max = cnt;
  }
  printf("%d", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x74(%rbp)
lea    0xeb0(%rip),%rdi
lea    -0x64(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    1195 <main+0x65>
movslq -0x68(%rbp),%rax
lea    -0x60(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe7e(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1160 <main+0x30>
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    11df <main+0xaf>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    -0x68(%rbp),%edx
call   1040 <incsubseq@plt>
mov    %eax,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    -0x74(%rbp),%eax
jle    11cc <main+0x9c>
mov    -0x70(%rbp),%eax
mov    %eax,-0x74(%rbp)
jmp    11d1 <main+0xa1>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    119c <main+0x6c>
mov    -0x74(%rbp),%esi
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11ac <main+0x7c>
lea    0x10(%rsp),%rbx
xor    %ebp,%ebp
lea    0xea2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rsi
add    $0x4,%rbx
cmp    %rsi,%rbp
jl     1160 <main+0x30>
test   %esi,%esi
jle    11ac <main+0x7c>
xor    %ebp,%ebp
lea    0x10(%rsp),%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%edx
call   1040 <incsubseq@plt>
cmp    %ebx,%eax
cmovg  %eax,%ebx
add    $0x1,%ebp
mov    0xc(%rsp),%esi
cmp    %esi,%ebp
jl     1190 <main+0x60>
jmp    11ae <main+0x7e>
xor    %ebx,%ebx
lea    0xe4b(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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