#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*/ printSequence(int *, int);
void backtrackSequences(int A[], int k, int n) {
  if (k == n) {
    printSequence(A, n);
  } else {
    int i;
    for (i = 0; i < n; i++) {
      A[k] = i;
      backtrackSequences(A, k + 1, n);
    }
  }
}


x86 assembly (clang, -O0):
<backtrackSequences>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    114f <backtrackSequences+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <printSequence@plt>
jmp    1195 <backtrackSequences+0x75>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1190 <backtrackSequences+0x70>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <backtrackSequences@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1156 <backtrackSequences+0x36>
jmp    1195 <backtrackSequences+0x75>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backtrackSequences>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r12
cmp    %edx,%esi
jne    1145 <backtrackSequences+0x25>
mov    %r12,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printSequence@plt>
mov    %edx,%ebp
test   %edx,%edx
jle    1178 <backtrackSequences+0x58>
movslq %r14d,%r15
add    $0x1,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,(%r12,%r15,4)
mov    %r12,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
call   1040 <backtrackSequences@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1160 <backtrackSequences+0x40>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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