#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 combination(int arr[], int nLen, int m, int out[], int outLen) {
  if (m == 0) {
    int j;
    for (j = 0; j < outLen; j++) {
      printf(" %d", out[j]);
    }
    printf("\n");
    return;
  }
  int i;
  for (i = nLen; i >= m; --i) {
    out[m - 1] = arr[i - 1];
    combination(arr, i - 1, m - 1, out, outLen);
  }
}


x86 assembly (clang, -O0):
<combination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1191 <combination+0x71>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    117e <combination+0x5e>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    114b <combination+0x2b>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ee <combination+0xce>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11ee <combination+0xce>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
sub    $0x1,%esi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1040 <combination@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1197 <combination+0x77>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<combination>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %rcx,%r15
test   %edx,%edx
je     11a8 <combination+0x78>
mov    %esi,%ebp
cmp    %edx,%esi
jl     1199 <combination+0x69>
mov    %rdi,%r12
lea    -0x1(%rdx),%eax
movslq %eax,%r13
movslq %ebp,%rbx
movslq %edx,%rax
mov    %rax,(%rsp)
add    $0x1,%rbx
add    $0xffffffff,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    -0x8(%r12,%rbx,4),%eax
mov    %eax,(%r15,%r13,4)
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r13d,%edx
mov    %r15,%rcx
mov    %r14d,%r8d
call   1050 <combination@plt>
add    $0xffffffffffffffff,%rbx
add    $0xffffffff,%ebp
cmp    (%rsp),%rbx
jg     1170 <combination+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %r14d,%r14d
jle    11d7 <combination+0xa7>
mov    %r14d,%ebp
lea    0xe49(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11c0 <combination+0x90>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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