#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*/ print_w_seq(int *, int, int *);
int /*<<< orphan*/ read_int_array(int *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num_tests;
  int stack[1000];
  int p[1000];
  scanf("%d", &num_tests);
  for (int i = 0; i < num_tests; ++i) {
    int len;
    scanf("%d", &len);
    read_int_array(p, len);
    print_w_seq(p, len, stack);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
movl   $0x0,-0x1f54(%rbp)
mov    -0x1f54(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11bd <main+0x8d>
lea    0xe8e(%rip),%rdi
lea    -0x1f58(%rbp),%rsi
call   1030 <scanf@plt>
lea    -0x1f50(%rbp),%rdi
mov    -0x1f58(%rbp),%esi
call   1040 <read_int_array@plt>
lea    -0x1f50(%rbp),%rdi
mov    -0x1f58(%rbp),%esi
lea    -0xfb0(%rbp),%rdx
call   1050 <print_w_seq@plt>
mov    -0x1f54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f54(%rbp)
jmp    115c <main+0x2c>
xor    %eax,%eax
add    $0x1f60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1f50,%rsp
lea    0xeba(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1030 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11af <main+0x7f>
xor    %ebp,%ebp
lea    0xea0(%rip),%r14
lea    0x8(%rsp),%r15
lea    0x10(%rsp),%rbx
lea    0xfb0(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <scanf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1040 <read_int_array@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
mov    %r12,%rdx
call   1050 <print_w_seq@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     1180 <main+0x50>
xor    %eax,%eax
add    $0x1f50,%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 [1000 x i32]
%4 = alloca [1000 x i32]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %5
br label %8
8: ; preds = %21, %0
%9 = load i32, i32* %5
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%14 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 0
%15 = load i32, i32* %6
%16 = call i32 @read_int_array(i32* %14, i32 %15)
%17 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 0
%18 = load i32, i32* %6
%19 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 0
%20 = call i32 @print_w_seq(i32* %17, i32 %18, i32* %19)
br label %21
21: ; preds = %12
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %8
24: ; preds = %8
ret i32 0
}

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