#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 *, ...);
int totalNQueens(int);
int main(int argc, char *argv[]) {
  if (!(totalNQueens(4) == 2)) {
    printf("assert fail: %s\n", "size == 2");
  };
  if (!(totalNQueens(5) == 10)) {
    printf("assert fail: %s\n", "size == 2");
  };
  printf("everything is fine!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <totalNQueens@plt>
cmp    $0x2,%eax
je     115e <main+0x3e>
lea    0xeb0(%rip),%rdi
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x5,%edi
call   1030 <totalNQueens@plt>
cmp    $0xa,%eax
je     1186 <main+0x66>
lea    0xe88(%rip),%rdi
lea    0xe92(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <totalNQueens@plt>
cmp    $0x2,%eax
je     1155 <main+0x25>
lea    0xeb9(%rip),%rdi
lea    0xec3(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5,%edi
call   1030 <totalNQueens@plt>
cmp    $0xa,%eax
je     1179 <main+0x49>
lea    0xe95(%rip),%rdi
lea    0xe9f(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"assert fail: %s\0A\00"
@.str.1 = [10 x i8] c"size == 2\00"
@.str.2 = [21 x i8] c"everything is fine!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @totalNQueens(i32 4)
%7 = icmp eq i32 %6, 2
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = call i32 @totalNQueens(i32 5)
%12 = icmp eq i32 %11, 10
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"assert fail: %s\0A\00"
@.str.1 = [10 x i8] c"size == 2\00"
@str = [20 x i8] c"everything is fine!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @totalNQueens(i32 4)
%4 = icmp eq i32 %3, 2
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @totalNQueens(i32 5)
%9 = icmp eq i32 %8, 10
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}