#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*/ printf(char *, ...);
int showAlphabetInN(int);
void showPowerset(int list[], int startID, int endId) {
  int id = startID;
  if (id > endId) {
    printf(" < ");
    for (id = 0; id <= endId; id++) {
      if (list[id] == 1)
        printf("%2c ", showAlphabetInN(id));
      else
        continue;
    }
    printf(">\n");
    return;
  } else {
    list[id] = 0;
    showPowerset(list, startID + 1, endId);
    list[id] = 1;
    showPowerset(list, startID + 1, endId);
  }
}


x86 assembly (clang, -O0):
<showPowerset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11cf <showPowerset+0x9f>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11bc <showPowerset+0x8c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    11a4 <showPowerset+0x74>
mov    -0x14(%rbp),%edi
call   1040 <showAlphabetInN@plt>
mov    %eax,%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a9 <showPowerset+0x79>
jmp    11ae <showPowerset+0x7e>
jmp    11ae <showPowerset+0x7e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1169 <showPowerset+0x39>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1211 <showPowerset+0xe1>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1050 <showPowerset@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1050 <showPowerset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showPowerset>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %edx,%r15d
mov    %rdi,%r14
cmp    %edx,%esi
jg     11a3 <showPowerset+0x63>
mov    %esi,%r12d
movslq %esi,%rax
lea    (%r14,%rax,4),%rbx
mov    %r15d,%r13d
neg    %r13d
add    $0x1,%r12d
nopw   0x0(%rax,%rax,1)
movl   $0x0,(%rbx)
mov    %r14,%rdi
mov    %r12d,%esi
mov    %r15d,%edx
call   1060 <showPowerset@plt>
movl   $0x1,(%rbx)
add    $0x4,%rbx
lea    (%r12,%r13,1),%eax
add    $0x1,%eax
mov    %r12d,%ecx
add    $0x1,%ecx
mov    %ecx,%r12d
cmp    $0x2,%eax
jne    1170 <showPowerset+0x30>
lea    0xe56(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r15d,%r15d
js     11f5 <showPowerset+0xb5>
add    $0x1,%r15d
lea    0xe43(%rip),%r12
xor    %ebx,%ebx
jmp    11d9 <showPowerset+0x99>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
cmp    %rbx,%r15
je     11f5 <showPowerset+0xb5>
cmpl   $0x1,(%r14,%rbx,4)
jne    11d0 <showPowerset+0x90>
mov    %ebx,%edi
call   1050 <showAlphabetInN@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11d0 <showPowerset+0x90>
lea    0xe0d(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

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

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