#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 /*<<< orphan*/ puts(char *);
void printCombi(int list[], int size, int i) {
  if (i == 0) {
    printf("%3d\n", list[size]);
    return;
  }
  if (size == i) {
    int j = 0;
    printf("#");
    for (j = 0; j < size; j++) {
      printf("%2d", list[j]);
    }
    puts("");
    return;
  } else if (size != i) {
    printCombi(list, size - 1, i);
    printf("*%2d", list[i]);
    printCombi(list, size - 1, i - 1);
  }
}


x86 assembly (clang, -O0):
<printCombi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    116a <printCombi+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1227 <printCombi+0xf7>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11d6 <printCombi+0xa6>
movl   $0x0,-0x14(%rbp)
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c5 <printCombi+0x95>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1192 <printCombi+0x62>
lea    0xe38(%rip),%rdi
call   1030 <puts@plt>
jmp    1227 <printCombi+0xf7>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1222 <printCombi+0xf2>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1050 <printCombi@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
call   1050 <printCombi@plt>
jmp    1227 <printCombi+0xf7>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCombi>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r12d
mov    %rdi,%r14
test   %edx,%edx
je     118c <printCombi+0x5c>
mov    %edx,%ebx
movslq %edx,%rax
lea    (%r14,%rax,4),%rbp
lea    0xeb3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %ebx,%r12d
je     11a9 <printCombi+0x79>
add    $0xffffffff,%r12d
mov    %r14,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
call   1050 <printCombi@plt>
mov    0x0(%rbp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xfffffffffffffffc,%rbp
add    $0xffffffff,%ebx
jne    1160 <printCombi+0x30>
movslq %r12d,%rax
mov    (%r14,%rax,4),%esi
lea    0xe66(%rip),%rdi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
mov    $0x23,%edi
call   1030 <putchar@plt>
test   %r12d,%r12d
jle    11e7 <printCombi+0xb7>
mov    %r12d,%ebp
lea    0xe44(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11d0 <printCombi+0xa0>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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