#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*/ printCombInstance(char *, int, int *);
void printComb(char *str, int size, int startPos, int combLen,
               int *selectionMark) {
  if (combLen == 0) {
    printCombInstance(str, size, selectionMark);
    return;
  }
  if (startPos == size)
    return;
  if (combLen > size - startPos)
    return;
  selectionMark[startPos] = 1;
  printComb(str, size, startPos + 1, combLen - 1, selectionMark);
  selectionMark[startPos] = 0;
  printComb(str, size, startPos + 1, combLen, selectionMark);
}


x86 assembly (clang, -O0):
<printComb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1158 <printComb+0x38>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <printCombInstance@plt>
jmp    11d2 <printComb+0xb2>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1169 <printComb+0x49>
jmp    11d2 <printComb+0xb2>
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jle    117f <printComb+0x5f>
jmp    11d2 <printComb+0xb2>
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x20(%rbp),%r8
call   1040 <printComb@plt>
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1040 <printComb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printComb>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8,%r13
mov    %rdi,%r15
mov    %ecx,0x4(%rsp)
test   %ecx,%ecx
je     11e5 <printComb+0xc5>
mov    %edx,%ebp
cmp    %edx,%esi
je     11d6 <printComb+0xb6>
movslq %ebp,%rax
movslq %esi,%rbx
movslq 0x4(%rsp),%rdx
mov    %rbx,%rcx
sub    %rax,%rcx
mov    %rdx,0x8(%rsp)
cmp    %rdx,%rcx
jl     11d6 <printComb+0xb6>
addl   $0xffffffff,0x4(%rsp)
lea    0x0(,%rax,4),%r12
add    %r13,%r12
not    %rax
add    %rbx,%rax
add    $0x1,%ebp
mov    %rax,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rax,0x10(%rsp)
movl   $0x1,(%r12)
mov    %r15,%rdi
mov    %esi,%ebx
mov    %ebp,%edx
mov    0x4(%rsp),%ecx
mov    %r13,%r8
call   1040 <printComb@plt>
mov    0x10(%rsp),%rax
movl   $0x0,(%r12)
sub    $0x1,%r14
jb     11d6 <printComb+0xb6>
mov    %ebx,%esi
add    $0x1,%ebp
add    $0x4,%r12
cmp    0x8(%rsp),%rax
mov    %r14,%rax
jge    1190 <printComb+0x70>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r15,%rdi
mov    %r13,%rdx
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printCombInstance@plt>

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

LLVM IR (-O2):
define void @printComb(i8* %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = icmp eq i32 %3, 0
br i1 %6, label %16, label %7
7: ; preds = %5
%8 = add nsw i32 %3, -1
%9 = sext i32 %2 to i64
%10 = sext i32 %1 to i64
%11 = sext i32 %3 to i64
%12 = icmp eq i32 %1, %2
%13 = sub nsw i64 %10, %9
%14 = icmp slt i64 %13, %11
%15 = select i1 %12, i1 true, i1 %14
br i1 %15, label %27, label %18
16: ; preds = %5
%17 = tail call i32 @printCombInstance(i8* %0, i32 %1, i32* %4)
br label %27
18: ; preds = %7, %18
%19 = phi i64 [ %21, %18 ], [ %9, %7 ]
%20 = getelementptr inbounds i32, i32* %4, i64 %19
store i32 1, i32* %20
%21 = add nsw i64 %19, 1
%22 = trunc i64 %21 to i32
tail call void @printComb(i8* %0, i32 %1, i32 %22, i32 %8, i32* %4)
store i32 0, i32* %20
%23 = icmp eq i64 %21, %10
%24 = sub nsw i64 %10, %21
%25 = icmp slt i64 %24, %11
%26 = select i1 %23, i1 true, i1 %25
br i1 %26, label %27, label %18
27: ; preds = %18, %7, %16
ret void
}