#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 printCombInstance(char *str, int size, int *selectionMark) {
  int id;
  for (id = 0; id < size; id++)
    if (selectionMark[id])
      printf("%c", str[id]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printCombInstance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1175 <printCombInstance+0x65>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1162 <printCombInstance+0x52>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1167 <printCombInstance+0x57>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <printCombInstance+0x1a>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCombInstance>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    114c <printCombInstance+0x3c>
mov    %rdx,%r15
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
jmp    1139 <printCombInstance+0x29>
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    %rbx,%r12
je     114c <printCombInstance+0x3c>
cmpl   $0x0,(%r15,%rbx,4)
je     1130 <printCombInstance+0x20>
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
jmp    1130 <printCombInstance+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printCombInstance(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i32 0, i32* %7
br label %8
8: ; preds = %28, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %31
12: ; preds = %8
%13 = load i32*, i32** %6
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %27
19: ; preds = %12
%20 = load i8*, i8** %4
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %19, %12
br label %28
28: ; preds = %27
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %8
31: ; preds = %8
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printCombInstance(i8* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %20
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %17
%8 = phi i64 [ 0, %5 ], [ %18, %17 ]
%9 = getelementptr inbounds i32, i32* %2, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %0, i64 %8
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = tail call i32 @putchar(i32 %15)
br label %17
17: ; preds = %7, %12
%18 = add nuw nsw i64 %8, 1
%19 = icmp eq i64 %18, %6
br i1 %19, label %20, label %7
20: ; preds = %17, %3
%21 = tail call i32 @putchar(i32 10)
ret void
}