#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*/ printPowerSet(int *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, i, s, t, ans;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    int set[n];
    for (i = 0; i < n; i++)
      scanf("%d", &set[i]);
    printPowerSet(set, 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    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     11de <main+0xbe>
lea    0xea6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c6 <main+0xa6>
mov    -0x30(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe4d(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1191 <main+0x71>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <printPowerSet@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
jmp    113f <main+0x1f>
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    -0x30(%rbp),%rsi
call   1040 <scanf@plt>
subl   $0x1,-0x30(%rbp)
jae    1155 <main+0x35>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xea4(%rip),%r12
jmp    1171 <main+0x51>
xchg   %ax,%ax
mov    %r15,%rdi
call   1030 <printPowerSet@plt>
mov    %r13,%rsp
subl   $0x1,-0x30(%rbp)
jb     1144 <main+0x24>
mov    %r12,%rdi
lea    -0x2c(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rsp,%r13
mov    -0x2c(%rbp),%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    1160 <main+0x40>
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     11b0 <main+0x90>
jmp    1160 <main+0x40>

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

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