#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*/ construct_candidates(int *, int, int *, int *);
scalar_t__ is_a_solution(int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ process_solution(int *, int);
void backtrack(int bisp[], int iker) {
  printf("backtrack(iker %d)\n", iker);
  int possib[(8 * 8)];
  int n_possib;
  int i;
  if (is_a_solution(bisp, iker)) {
    process_solution(bisp, iker);
  } else {
    iker++;
    construct_candidates(bisp, iker, possib, &n_possib);
    for (i = 0; i < n_possib; i++) {
      bisp[iker] = possib[i];
      backtrack(bisp, iker);
    }
  }
}


x86 assembly (clang, -O0):
<backtrack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1060 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <is_a_solution@plt>
cmp    $0x0,%rax
je     1198 <backtrack+0x48>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <process_solution@plt>
jmp    1215 <backtrack+0xc5>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x110(%rbp),%rdx
lea    -0x114(%rbp),%rcx
call   1040 <construct_candidates@plt>
movl   $0x0,-0x118(%rbp)
mov    -0x118(%rbp),%eax
cmp    -0x114(%rbp),%eax
jge    1210 <backtrack+0xc0>
movslq -0x118(%rbp),%rax
mov    -0x110(%rbp,%rax,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <backtrack@plt>
mov    -0x118(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x118(%rbp)
jmp    11c5 <backtrack+0x75>
jmp    1215 <backtrack+0xc5>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backtrack>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x118,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xe96(%rip),%rdi
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <is_a_solution@plt>
test   %rax,%rax
je     1197 <backtrack+0x47>
mov    %rbx,%rdi
mov    %r14d,%esi
add    $0x118,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <process_solution@plt>
add    $0x1,%r14d
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <construct_candidates@plt>
cmpl   $0x0,0xc(%rsp)
jle    11e1 <backtrack+0x91>
movslq %r14d,%r15
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    0x10(%rsp,%rbp,4),%eax
mov    %eax,(%rbx,%r15,4)
mov    %rbx,%rdi
mov    %r14d,%esi
call   1070 <backtrack@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
cmp    %rax,%rbp
jl     11c0 <backtrack+0x70>
add    $0x118,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"backtrack(iker %d)\0A\00"
define void @backtrack(i32* %0, i32 %1) {
%3 = alloca [64 x i32]
%4 = alloca i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = bitcast [64 x i32]* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = tail call i64 @is_a_solution(i32* %0, i32 %1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = tail call i32 @process_solution(i32* %0, i32 %1)
br label %29
12: ; preds = %2
%13 = add nsw i32 %1, 1
%14 = getelementptr inbounds [64 x i32], [64 x i32]* %3, i64 0, i64 0
%15 = call i32 @construct_candidates(i32* %0, i32 %13, i32* %14, i32* %4)
%16 = load i32, i32* %4
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %29
18: ; preds = %12
%19 = sext i32 %13 to i64
%20 = getelementptr inbounds i32, i32* %0, i64 %19
br label %21
21: ; preds = %18, %21
%22 = phi i64 [ 0, %18 ], [ %25, %21 ]
%23 = getelementptr inbounds [64 x i32], [64 x i32]* %3, i64 0, i64 %22
%24 = load i32, i32* %23
store i32 %24, i32* %20
%25 = add nuw nsw i64 %22, 1
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %25, %27
br i1 %28, label %21, label %29
29: ; preds = %21, %12, %10
ret void
}