#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*/ print_combination(int *, int, int, int *,
                                     int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  int chars[4];
  int visited[4];
  int i = 0;
  for (; i < 4; i++) {
    chars[i] = i + 1;
    visited[i] = i + 1;
  }
  print_combination(chars, 4, 2, visited, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x4,-0x34(%rbp)
jge    1161 <main+0x51>
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    112d <main+0x1d>
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rcx
mov    $0x4,%esi
mov    $0x2,%edx
xor    %r8d,%r8d
call   1030 <print_combination@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rcx
mov    $0x4,%esi
mov    $0x2,%edx
xor    %r8d,%r8d
call   1030 <print_combination@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca <4 x i32>
%4 = alloca <4 x i32>
%5 = bitcast <4 x i32>* %3 to i8*
%6 = bitcast <4 x i32>* %4 to i8*
%7 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 0
%8 = getelementptr inbounds <4 x i32>, <4 x i32>* %4, i64 0, i64 0
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %3
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %4
%9 = call i32 @print_combination(i32* %7, i32 4, i32 2, i32* %8, i32 0)
ret i32 0
}