#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_subsets(size_t, int *);
int /*<<< orphan*/ printf(char *);
int scanf(char *, ...);
int main(void) {
  printf("Enter set size, followed by set elements\n");
  size_t set_size;
  while (scanf("%zu", &set_size) == 1) {
    int set[set_size];
    size_t i;
    for (i = 0; i < set_size; i++) {
      scanf("%d", &set[i]);
    }
    print_subsets(set_size, set);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    11eb <main+0xbb>
mov    -0x10(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    11d2 <main+0xa2>
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1196 <main+0x66>
mov    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdi
call   1030 <print_subsets@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
jmp    114b <main+0x1b>
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    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaf(%rip),%rdi
lea    -0x30(%rbp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    11e0 <main+0xb0>
lea    0xe9c(%rip),%r13
jmp    1194 <main+0x64>
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %r12,%rsi
call   1040 <print_subsets@plt>
mov    %r14,%rsp
lea    0xe7c(%rip),%rdi
lea    -0x30(%rbp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    11e0 <main+0xb0>
mov    %rsp,%r14
mov    -0x30(%rbp),%rax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
cmpq   $0x0,-0x30(%rbp)
je     1170 <main+0x40>
mov    %r12,%rbx
xor    %r15d,%r15d
nopl   (%rax)
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%r15
mov    -0x30(%rbp),%rdi
add    $0x4,%rbx
cmp    %rdi,%r15
jb     11c0 <main+0x90>
jmp    1172 <main+0x42>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Enter set size, followed by set elements\0A\00"
@.str.1 = [4 x i8] c"%zu\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %25, %0
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %29
10: ; preds = %7
%11 = load i64, i64* %2
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %3
%13 = alloca i32, i64 %11
store i64 %11, i64* %4
store i64 0, i64* %5
br label %14
14: ; preds = %22, %10
%15 = load i64, i64* %5
%16 = load i64, i64* %2
%17 = icmp ult i64 %15, %16
br i1 %17, label %18, label %25
18: ; preds = %14
%19 = load i64, i64* %5
%20 = getelementptr inbounds i32, i32* %13, i64 %19
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %20)
br label %22
22: ; preds = %18
%23 = load i64, i64* %5
%24 = add i64 %23, 1
store i64 %24, i64* %5
br label %14
25: ; preds = %14
%26 = load i64, i64* %2
%27 = call i32 @print_subsets(i64 %26, i32* %13)
%28 = load i8*, i8** %3
br label %7
29: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%zu\00"
@.str.2 = [3 x i8] c"%d\00"
@str = [41 x i8] c"Enter set size, followed by set elements\00"
define i32 @main() {
%1 = alloca i64
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%3 = bitcast i64* %1 to i8*
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %24
6: ; preds = %0, %19
%7 = load i64, i64* %1
%8 = call i8* @llvm.stacksave()
%9 = alloca i32, i64 %7
%10 = load i64, i64* %1
%11 = icmp eq i64 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %6, %12
%13 = phi i64 [ %16, %12 ], [ 0, %6 ]
%14 = getelementptr inbounds i32, i32* %9, i64 %13
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %14)
%16 = add nuw i64 %13, 1
%17 = load i64, i64* %1
%18 = icmp ult i64 %16, %17
br i1 %18, label %12, label %19
19: ; preds = %12, %6
%20 = phi i64 [ 0, %6 ], [ %17, %12 ]
%21 = call i32 @print_subsets(i64 %20, i32* %9)
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%23 = icmp eq i32 %22, 1
br i1 %23, label %6, label %24
24: ; preds = %19, %0
ret i32 0
}