#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);
int /*<<< orphan*/ putchar(char);
void print_subset2(int n, int *b, int cur) {
  int i;
  if (cur == n) {
    for (i = 0; i < cur; ++i)
      if (b[i])
        printf("%3d", i);
    putchar('\n');
    return;
  }
  b[cur] = 1;
  print_subset2(n, b, cur + 1);
  b[cur] = 0;
  print_subset2(n, b, cur + 1);
}


x86 assembly (clang, -O0):
<print_subset2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    11a4 <print_subset2+0x74>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1195 <print_subset2+0x65>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1182 <print_subset2+0x52>
mov    -0x18(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
jmp    1187 <print_subset2+0x57>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1155 <print_subset2+0x25>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11e6 <print_subset2+0xb6>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
call   1050 <print_subset2@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
call   1050 <print_subset2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_subset2>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
cmp    %edi,%edx
je     1195 <print_subset2+0x65>
mov    %edi,%r15d
movslq %ebx,%rax
lea    (%r14,%rax,4),%rbp
mov    %edi,%r12d
neg    %r12d
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movl   $0x1,0x0(%rbp)
mov    %r15d,%edi
mov    %r14,%rsi
mov    %ebx,%edx
call   1050 <print_subset2@plt>
movl   $0x0,0x0(%rbp)
add    $0x4,%rbp
lea    (%r12,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1160 <print_subset2+0x30>
mov    %r15d,%ebx
test   %ebx,%ebx
jle    11cc <print_subset2+0x9c>
mov    %ebx,%ebp
xor    %ebx,%ebx
lea    0xe5c(%rip),%r15
jmp    11b9 <print_subset2+0x89>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%rbp
je     11cc <print_subset2+0x9c>
cmpl   $0x0,(%r14,%rbx,4)
je     11b0 <print_subset2+0x80>
mov    %r15,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
jmp    11b0 <print_subset2+0x80>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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