#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*/ scanf(char *, int *);
int /*<<< orphan*/ sequence(int *, int);
int main() {
  int n;
  while (1) {
    scanf("%d", &n);
    if (!n)
      break;
    int arr[n];
    for (int i = 0; i < n; i++)
      scanf("%d", arr + i);
    sequence(arr, n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    114e <main+0x2e>
jmp    11c9 <main+0xa9>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b1 <main+0x91>
mov    -0x28(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe62(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    117c <main+0x5c>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <sequence@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
jmp    112f <main+0xf>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xecb(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x2c(%rbp),%eax
test   %eax,%eax
je     11be <main+0x9e>
lea    0xeb4(%rip),%r12
jmp    116e <main+0x4e>
xchg   %ax,%ax
mov    %r15,%rdi
call   1030 <sequence@plt>
mov    %r13,%rsp
mov    %r12,%rdi
lea    -0x2c(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x2c(%rbp),%eax
test   %eax,%eax
je     11be <main+0x9e>
mov    %rsp,%r13
mov    %eax,%eax
mov    %rsp,%r15
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    -0x2c(%rbp),%esi
test   %esi,%esi
jle    1150 <main+0x30>
mov    %r15,%rbx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x1,%r14
movslq -0x2c(%rbp),%rsi
add    $0x4,%rbx
cmp    %rsi,%r14
jl     11a0 <main+0x80>
jmp    1150 <main+0x30>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
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 i8*
%4 = alloca i64
%5 = alloca i32
store i32 0, i32* %1
br label %6
6: ; preds = %0, %28
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %6
br label %32
11: ; preds = %6
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %3
%15 = alloca i32, i64 %13
store i64 %13, i64* %4
store i32 0, i32* %5
br label %16
16: ; preds = %25, %11
%17 = load i32, i32* %5
%18 = load i32, i32* %2
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %28
20: ; preds = %16
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %15, i64 %22
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %23)
br label %25
25: ; preds = %20
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %16
28: ; preds = %16
%29 = load i32, i32* %2
%30 = call i32 @sequence(i32* %15, i32 %29)
%31 = load i8*, i8** %3
br label %6
32: ; preds = %10
ret i32 0
}

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