#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 */
unsigned int pow(int, int);
int /*<<< orphan*/ printf(char *);
void printSet(int inputs) {
  unsigned int num_points, num_pos, this_point, i, j;
  num_points = pow(2, inputs);
  for (i = 0; i < num_points; i++) {
    num_pos = 0;
    this_point = i;
    for (j = 0; j < inputs; j++) {
      if ((this_point & 1) == 1) {
        printf("1 ");
        num_pos++;
      } else
        printf("-1 ");
      this_point >>= 1;
    }
    if ((num_pos % 2) == 1)
      printf("1\n");
    else
      printf("0\n");
  }
}


x86 assembly (clang, -O0):
<printSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    11f9 <printSet+0xd9>
movl   $0x0,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    11ba <printSet+0x9a>
mov    -0x10(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1197 <printSet+0x77>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a3 <printSet+0x83>
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1162 <printSet+0x42>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    11da <printSet+0xba>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
jmp    11e6 <printSet+0xc6>
lea    0xe26(%rip),%rdi
call   1030 <printf@plt>
jmp    11eb <printSet+0xcb>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1142 <printSet+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSet>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,%r15d
mov    $0x2,%edi
mov    %r15d,%esi
call   1050 <pow@plt>
mov    %eax,0x4(%rsp)
test   %eax,%eax
je     11e3 <printSet+0xb3>
xor    %r14d,%r14d
lea    0xe9f(%rip),%r12
lea    0xe99(%rip),%rbx
mov    %r15d,(%rsp)
jmp    1187 <printSet+0x57>
xchg   %ax,%ax
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
add    $0x1,%r14d
cmp    0x4(%rsp),%r14d
je     11e3 <printSet+0xb3>
test   %r15d,%r15d
je     1170 <printSet+0x40>
xor    %r13d,%r13d
mov    %r14d,%ebp
jmp    11b0 <printSet+0x80>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rdi
call   1040 <printf@plt>
shr    %ebp
add    $0xffffffff,%r15d
je     11d0 <printSet+0xa0>
test   $0x1,%bpl
je     11a0 <printSet+0x70>
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0x1,%r13d
jmp    11a8 <printSet+0x78>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xe2f(%rip),%rdi
test   $0x1,%r13b
mov    (%rsp),%r15d
je     1170 <printSet+0x40>
jmp    1177 <printSet+0x47>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"1 \00"
@.str.1 = [4 x i8] c"-1 \00"
@.str.2 = [3 x i8] c"1\0A\00"
@.str.3 = [3 x i8] c"0\0A\00"
define void @printSet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @pow(i32 2, i32 %8)
store i32 %9, i32* %3
store i32 0, i32* %6
br label %10
10: ; preds = %45, %1
%11 = load i32, i32* %6
%12 = load i32, i32* %3
%13 = icmp ult i32 %11, %12
br i1 %13, label %14, label %48
14: ; preds = %10
store i32 0, i32* %4
%15 = load i32, i32* %6
store i32 %15, i32* %5
store i32 0, i32* %7
br label %16
16: ; preds = %33, %14
%17 = load i32, i32* %7
%18 = load i32, i32* %2
%19 = icmp ult i32 %17, %18
br i1 %19, label %20, label %36
20: ; preds = %16
%21 = load i32, i32* %5
%22 = and i32 %21, 1
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%26 = load i32, i32* %4
%27 = add i32 %26, 1
store i32 %27, i32* %4
br label %30
28: ; preds = %20
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %28, %24
%31 = load i32, i32* %5
%32 = lshr i32 %31, 1
store i32 %32, i32* %5
br label %33
33: ; preds = %30
%34 = load i32, i32* %7
%35 = add i32 %34, 1
store i32 %35, i32* %7
br label %16
36: ; preds = %16
%37 = load i32, i32* %4
%38 = urem i32 %37, 2
%39 = icmp eq i32 %38, 1
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %44
42: ; preds = %36
%43 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
br label %45
45: ; preds = %44
%46 = load i32, i32* %6
%47 = add i32 %46, 1
store i32 %47, i32* %6
br label %10
48: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"1 \00"
@.str.1 = [4 x i8] c"-1 \00"
@str = [2 x i8] c"0\00"
@str.4 = [2 x i8] c"1\00"
define void @printSet(i32 %0) {
%2 = tail call i32 @pow(i32 2, i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %33, label %4
4: ; preds = %1
%5 = icmp eq i32 %0, 0
br label %6
6: ; preds = %4, %28
%7 = phi i32 [ 0, %4 ], [ %31, %28 ]
br i1 %5, label %27, label %8
8: ; preds = %6, %19
%9 = phi i32 [ %22, %19 ], [ 0, %6 ]
%10 = phi i32 [ %21, %19 ], [ %7, %6 ]
%11 = phi i32 [ %20, %19 ], [ 0, %6 ]
%12 = and i32 %10, 1
%13 = icmp eq i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %8
%15 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%16 = add i32 %11, 1
br label %19
17: ; preds = %8
%18 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
%20 = phi i32 [ %16, %14 ], [ %11, %17 ]
%21 = lshr i32 %10, 1
%22 = add nuw i32 %9, 1
%23 = icmp eq i32 %22, %0
br i1 %23, label %24, label %8
24: ; preds = %19
%25 = and i32 %20, 1
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %6, %24
br label %28
28: ; preds = %24, %27
%29 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), %27 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0), %24 ]
%30 = tail call i32 @puts(i8* dereferenceable(1) %29)
%31 = add nuw i32 %7, 1
%32 = icmp eq i32 %31, %2
br i1 %32, label %33, label %6
33: ; preds = %28, %1
ret void
}