#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 seq(int *, int, int, int);
int main() {
  int a[50];
  int n;
  int i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++)
    printf("%d\n", seq(a, 2, i + 1, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0xd4(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0xd8(%rbp)
mov    -0xd8(%rbp),%eax
cmp    -0xd4(%rbp),%eax
jge    11a6 <main+0x76>
movslq -0xd8(%rbp),%rax
lea    -0xd0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe73(%rip),%rdi
call   1050 <scanf@plt>
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    115f <main+0x2f>
movl   $0x0,-0xd8(%rbp)
mov    -0xd8(%rbp),%eax
cmp    -0xd4(%rbp),%eax
jge    1204 <main+0xd4>
lea    -0xd0(%rbp),%rdi
mov    -0xd8(%rbp),%edx
add    $0x1,%edx
mov    -0xd4(%rbp),%ecx
mov    $0x2,%esi
call   1040 <seq@plt>
mov    %eax,%esi
lea    0xe18(%rip),%rdi
call   1030 <printf@plt>
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    11b0 <main+0x80>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xe0,%rsp
lea    0xebd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11c4 <main+0x94>
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
lea    0xe9e(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rcx
add    $0x4,%r15
cmp    %rcx,%rbx
jl     1170 <main+0x40>
test   %ecx,%ecx
jle    11c4 <main+0x94>
xor    %ebx,%ebx
lea    0x10(%rsp),%r14
lea    0xe64(%rip),%r15
nop
add    $0x1,%ebx
mov    %r14,%rdi
mov    $0x2,%esi
mov    %ebx,%edx
call   1040 <seq@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0xc(%rsp),%ecx
cmp    %ecx,%ebx
jl     11a0 <main+0x70>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [50 x i32]
%2 = alloca i32
%3 = bitcast [50 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 %28
8: ; preds = %12
%9 = icmp sgt i32 %17, 0
br i1 %9, label %10, label %28
10: ; preds = %8
%11 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
br label %20
12: ; preds = %0, %12
%13 = phi i64 [ %16, %12 ], [ 0, %0 ]
%14 = getelementptr inbounds [50 x i32], [50 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 ], [ %26, %20 ]
%22 = phi i32 [ 0, %10 ], [ %23, %20 ]
%23 = add nuw nsw i32 %22, 1
%24 = call i32 @seq(i32* %11, i32 2, i32 %23, i32 %21)
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %2
%27 = icmp slt i32 %23, %26
br i1 %27, label %20, label %28
28: ; preds = %20, %0, %8
ret i32 0
}