#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*/ free(char **);
char **newBoard(int);
int /*<<< orphan*/ solveRecursively(int /*<<< orphan*/, char **, int *, int *,
                                    int *, int *, int, char ****);
char ***solveNQueensR(int n, int *returnSize) {
  char ***result = NULL;
  *returnSize = 0;
  char **w = newBoard(n);
  int cf[64] = {0}, rdf[128] = {0}, ldf[128] = {0};
  solveRecursively(0, w, returnSize, cf, ldf, rdf, n, &result);
  free(w);
  return result;
}


x86 assembly (clang, -O0):
<solveNQueensR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x530,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x4(%rbp),%edi
call   1050 <newBoard@plt>
mov    %rax,-0x20(%rbp)
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x320(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1040 <memset@plt>
lea    -0x520(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1040 <memset@plt>
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x120(%rbp),%rcx
lea    -0x520(%rbp),%r8
lea    -0x320(%rbp),%r9
mov    -0x4(%rbp),%r10d
xor    %edi,%edi
lea    -0x18(%rbp),%rax
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1060 <solveRecursively@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x530,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solveNQueensR>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x510,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
movq   $0x0,0x8(%rsp)
movl   $0x0,(%rsi)
call   1050 <newBoard@plt>
mov    %rax,%r15
xorps  %xmm0,%xmm0
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0x310(%rsp),%r12
mov    $0x200,%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0x110(%rsp),%r13
mov    $0x200,%edx
mov    %r13,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0x8(%rsp),%rax
lea    0x10(%rsp),%rcx
xor    %edi,%edi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r13,%r8
mov    %r12,%r9
push   %rax
push   %r14
call   1060 <solveRecursively@plt>
add    $0x10,%rsp
mov    %r15,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rax
add    $0x510,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8*** @solveNQueensR(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8***
%6 = alloca i8**
%7 = alloca [64 x i32]
%8 = alloca [128 x i32]
%9 = alloca [128 x i32]
store i32 %0, i32* %3
store i32* %1, i32** %4
store i8*** null, i8**** %5
%10 = load i32*, i32** %4
store i32 0, i32* %10
%11 = load i32, i32* %3
%12 = call i8** @newBoard(i32 %11)
store i8** %12, i8*** %6
%13 = bitcast [64 x i32]* %7 to i8*
%14 = bitcast [128 x i32]* %8 to i8*
%15 = bitcast [128 x i32]* %9 to i8*
%16 = load i8**, i8*** %6
%17 = load i32*, i32** %4
%18 = getelementptr inbounds [64 x i32], [64 x i32]* %7, i64 0, i64 0
%19 = getelementptr inbounds [128 x i32], [128 x i32]* %9, i64 0, i64 0
%20 = getelementptr inbounds [128 x i32], [128 x i32]* %8, i64 0, i64 0
%21 = load i32, i32* %3
%22 = call i32 @solveRecursively(i32 0, i8** %16, i32* %17, i32* %18, i32* %19, i32* %20, i32 %21, i8**** %5)
%23 = load i8**, i8*** %6
%24 = call i32 @free(i8** %23)
%25 = load i8***, i8**** %5
ret i8*** %25
}

LLVM IR (-O2):
define i8*** @solveNQueensR(i32 %0, i32* %1) {
%3 = alloca i8***
%4 = alloca [64 x i32]
%5 = alloca [128 x i32]
%6 = alloca [128 x i32]
%7 = bitcast i8**** %3 to i8*
store i8*** null, i8**** %3
store i32 0, i32* %1
%8 = tail call i8** @newBoard(i32 %0)
%9 = bitcast [64 x i32]* %4 to i8*
%10 = bitcast [128 x i32]* %5 to i8*
%11 = bitcast [128 x i32]* %6 to i8*
%12 = getelementptr inbounds [64 x i32], [64 x i32]* %4, i64 0, i64 0
%13 = getelementptr inbounds [128 x i32], [128 x i32]* %6, i64 0, i64 0
%14 = getelementptr inbounds [128 x i32], [128 x i32]* %5, i64 0, i64 0
%15 = call i32 @solveRecursively(i32 0, i8** %8, i32* %1, i32* %12, i32* %13, i32* %14, i32 %0, i8**** %3)
%16 = call i32 @free(i8** %8)
%17 = load i8***, i8**** %3
ret i8*** %17
}