#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 *);
void showBooleanCombi(int list[], int startId, int endId) {
  int id = startId;
  if (id > endId) {
    printf("< ");
    for (id = 0; id <= endId; id++) {
      if (list[id] == 0)
        printf("False ");
      else
        printf("True ");
    }
    printf(">\n");
    return;
  } else {
    list[id] = 0;
    showBooleanCombi(list, startId + 1, endId);
    list[id] = 1;
    showBooleanCombi(list, startId + 1, endId);
  }
}


x86 assembly (clang, -O0):
<showBooleanCombi>:
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    11b6 <showBooleanCombi+0x96>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11a5 <showBooleanCombi+0x85>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1186 <showBooleanCombi+0x66>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    1192 <showBooleanCombi+0x72>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
jmp    1197 <showBooleanCombi+0x77>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <showBooleanCombi+0x37>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
jmp    11f8 <showBooleanCombi+0xd8>
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   1040 <showBooleanCombi@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   1040 <showBooleanCombi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showBooleanCombi>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %edx,%r15d
mov    %rdi,%r14
cmp    %edx,%esi
jg     1193 <showBooleanCombi+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   1050 <showBooleanCombi@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    1160 <showBooleanCombi+0x30>
lea    0xe66(%rip),%rdi
call   1040 <printf@plt>
test   %r15d,%r15d
js     11dd <showBooleanCombi+0xad>
add    $0x1,%r15d
xor    %ebx,%ebx
lea    0xe52(%rip),%r12
lea    0xe52(%rip),%r13
jmp    11ce <showBooleanCombi+0x9e>
nopw   0x0(%rax,%rax,1)
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
je     11dd <showBooleanCombi+0xad>
cmpl   $0x0,(%r14,%rbx,4)
mov    %r12,%rdi
je     11c0 <showBooleanCombi+0x90>
mov    %r13,%rdi
jmp    11c0 <showBooleanCombi+0x90>
lea    0xe2c(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

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

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