#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 *, ...);
size_t PowerSetDispositionRipetitionR(size_t pos, int *val, int *sol, size_t k,
                                      size_t count) {
  size_t i;
  if (pos >= k) {
    printf("{ ");
    for (i = 0; i < k; i++)
      if (sol[i] != 0)
        printf("%d ", val[i]);
    printf("} \n");
    return (count + 1);
  }
  sol[pos] = 0;
  count = PowerSetDispositionRipetitionR(pos + 1, val, sol, k, count);
  sol[pos] = 1;
  count = PowerSetDispositionRipetitionR(pos + 1, val, sol, k, count);
  return (count);
}


x86 assembly (clang, -O0):
<PowerSetDispositionRipetitionR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x28(%rbp),%rax
jb     11ce <PowerSetDispositionRipetitionR+0xae>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    11af <PowerSetDispositionRipetitionR+0x8f>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1199 <PowerSetDispositionRipetitionR+0x79>
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    119e <PowerSetDispositionRipetitionR+0x7e>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1160 <PowerSetDispositionRipetitionR+0x40>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1236 <PowerSetDispositionRipetitionR+0x116>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1030 <PowerSetDispositionRipetitionR@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1030 <PowerSetDispositionRipetitionR@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PowerSetDispositionRipetitionR>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r15
mov    %rcx,%r14
mov    %rdx,%r13
mov    %rsi,%r12
cmp    %rcx,%rdi
jae    119b <PowerSetDispositionRipetitionR+0x6b>
mov    %rdi,%rbx
add    $0x1,%rbx
mov    %r14,%rbp
neg    %rbp
nopl   0x0(%rax)
movl   $0x0,-0x4(%r13,%rbx,4)
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <PowerSetDispositionRipetitionR@plt>
mov    %rax,%r15
movl   $0x1,-0x4(%r13,%rbx,4)
lea    (%rbx,%rbp,1),%rax
add    $0x1,%rax
add    $0x1,%rbx
cmp    $0x1,%rax
jne    1160 <PowerSetDispositionRipetitionR+0x30>
lea    0xe5e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r14,%r14
je     11e1 <PowerSetDispositionRipetitionR+0xb1>
lea    0xe4e(%rip),%rbx
xor    %ebp,%ebp
jmp    11c9 <PowerSetDispositionRipetitionR+0x99>
nopl   0x0(%rax)
add    $0x1,%rbp
cmp    %rbp,%r14
je     11e1 <PowerSetDispositionRipetitionR+0xb1>
cmpl   $0x0,0x0(%r13,%rbp,4)
je     11c0 <PowerSetDispositionRipetitionR+0x90>
mov    (%r12,%rbp,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11c0 <PowerSetDispositionRipetitionR+0x90>
lea    0xe1f(%rip),%rdi
call   1040 <puts@plt>
add    $0x1,%r15
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"{ \00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [4 x i8] c"} \0A\00"
define i64 @PowerSetDispositionRipetitionR(i64 %0, i32* %1, i32* %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i64 %0, i64* %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i64 %3, i64* %10
store i64 %4, i64* %11
%13 = load i64, i64* %7
%14 = load i64, i64* %10
%15 = icmp uge i64 %13, %14
br i1 %15, label %16, label %42
16: ; preds = %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i64 0, i64* %12
br label %18
18: ; preds = %35, %16
%19 = load i64, i64* %12
%20 = load i64, i64* %10
%21 = icmp ult i64 %19, %20
br i1 %21, label %22, label %38
22: ; preds = %18
%23 = load i32*, i32** %9
%24 = load i64, i64* %12
%25 = getelementptr inbounds i32, i32* %23, i64 %24
%26 = load i32, i32* %25
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %22
%29 = load i32*, i32** %8
%30 = load i64, i64* %12
%31 = getelementptr inbounds i32, i32* %29, i64 %30
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %28, %22
br label %35
35: ; preds = %34
%36 = load i64, i64* %12
%37 = add i64 %36, 1
store i64 %37, i64* %12
br label %18
38: ; preds = %18
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%40 = load i64, i64* %11
%41 = add i64 %40, 1
store i64 %41, i64* %6
br label %64
42: ; preds = %5
%43 = load i32*, i32** %9
%44 = load i64, i64* %7
%45 = getelementptr inbounds i32, i32* %43, i64 %44
store i32 0, i32* %45
%46 = load i64, i64* %7
%47 = add i64 %46, 1
%48 = load i32*, i32** %8
%49 = load i32*, i32** %9
%50 = load i64, i64* %10
%51 = load i64, i64* %11
%52 = call i64 @PowerSetDispositionRipetitionR(i64 %47, i32* %48, i32* %49, i64 %50, i64 %51)
store i64 %52, i64* %11
%53 = load i32*, i32** %9
%54 = load i64, i64* %7
%55 = getelementptr inbounds i32, i32* %53, i64 %54
store i32 1, i32* %55
%56 = load i64, i64* %7
%57 = add i64 %56, 1
%58 = load i32*, i32** %8
%59 = load i32*, i32** %9
%60 = load i64, i64* %10
%61 = load i64, i64* %11
%62 = call i64 @PowerSetDispositionRipetitionR(i64 %57, i32* %58, i32* %59, i64 %60, i64 %61)
store i64 %62, i64* %11
%63 = load i64, i64* %11
store i64 %63, i64* %6
br label %64
64: ; preds = %42, %38
%65 = load i64, i64* %6
ret i64 %65
}

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