#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 EXIT_SUCCESS;
int /*<<< orphan*/ place_next_queen(int *, int, int *, int *, int *);
int main() {
  int queens[8] = {0};
  int column_j = 0;
  int column[8];
  int diagonal_up[15];
  int diagonal_down[15];
  for (int index = 0; index < 8; ++index) {
    column[index] = 1;
    diagonal_up[index] = 1;
    diagonal_down[index] = 1;
  }
  for (int index = 8; index < 15; ++index) {
    diagonal_up[index] = 1;
    diagonal_down[index] = 1;
  }
  place_next_queen(queens, column_j, column, diagonal_up, diagonal_down);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0xe4(%rbp)
cmpl   $0x8,-0xe4(%rbp)
jge    11a7 <main+0x87>
movslq -0xe4(%rbp),%rax
movl   $0x1,-0x60(%rbp,%rax,4)
movslq -0xe4(%rbp),%rax
movl   $0x1,-0xa0(%rbp,%rax,4)
movslq -0xe4(%rbp),%rax
movl   $0x1,-0xe0(%rbp,%rax,4)
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    1153 <main+0x33>
movl   $0x8,-0xe8(%rbp)
cmpl   $0xf,-0xe8(%rbp)
jge    11f6 <main+0xd6>
movslq -0xe8(%rbp),%rax
movl   $0x1,-0xa0(%rbp,%rax,4)
movslq -0xe8(%rbp),%rax
movl   $0x1,-0xe0(%rbp,%rax,4)
mov    -0xe8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe8(%rbp)
jmp    11b1 <main+0x91>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
lea    -0x60(%rbp),%rdx
lea    -0xa0(%rbp),%rcx
lea    -0xe0(%rbp),%r8
call   1040 <place_next_queen@plt>
mov    0x2dc5(%rip),%rax
mov    (%rax),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xc8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x20(%rsp)
movl   $0x1,0x70(%rsp)
movl   $0x1,0x30(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x74(%rsp)
mov    %rax,0x34(%rsp)
lea    0xa0(%rsp),%rdi
lea    0x80(%rsp),%rdx
lea    0x40(%rsp),%rcx
mov    %rsp,%r8
xor    %esi,%esi
call   1030 <place_next_queen@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%eax
add    $0xc8,%rsp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
%4 = alloca [8 x i32]
%5 = alloca [15 x i32]
%6 = alloca [15 x i32]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = bitcast [8 x i32]* %2 to i8*
store i32 0, i32* %3
store i32 0, i32* %7
br label %10
10: ; preds = %23, %0
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 8
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %15
store i32 1, i32* %16
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [15 x i32], [15 x i32]* %5, i64 0, i64 %18
store i32 1, i32* %19
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [15 x i32], [15 x i32]* %6, i64 0, i64 %21
store i32 1, i32* %22
br label %23
23: ; preds = %13
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
br label %10
26: ; preds = %10
store i32 8, i32* %8
br label %27
27: ; preds = %37, %26
%28 = load i32, i32* %8
%29 = icmp slt i32 %28, 15
br i1 %29, label %30, label %40
30: ; preds = %27
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [15 x i32], [15 x i32]* %5, i64 0, i64 %32
store i32 1, i32* %33
%34 = load i32, i32* %8
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [15 x i32], [15 x i32]* %6, i64 0, i64 %35
store i32 1, i32* %36
br label %37
37: ; preds = %30
%38 = load i32, i32* %8
%39 = add nsw i32 %38, 1
store i32 %39, i32* %8
br label %27
40: ; preds = %27
%41 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%42 = load i32, i32* %3
%43 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 0
%44 = getelementptr inbounds [15 x i32], [15 x i32]* %5, i64 0, i64 0
%45 = getelementptr inbounds [15 x i32], [15 x i32]* %6, i64 0, i64 0
%46 = call i32 @place_next_queen(i32* %41, i32 %42, i32* %43, i32* %44, i32* %45)
%47 = load i32, i32* @EXIT_SUCCESS
ret i32 %47
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [8 x i32]
%2 = alloca [8 x i32]
%3 = alloca [15 x i32]
%4 = alloca [15 x i32]
%5 = bitcast [8 x i32]* %1 to i8*
%6 = bitcast [8 x i32]* %2 to i8*
%7 = bitcast [15 x i32]* %3 to i8*
%8 = bitcast [15 x i32]* %4 to i8*
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%10 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 0
%11 = getelementptr inbounds [15 x i32], [15 x i32]* %4, i64 0, i64 0
%12 = bitcast [8 x i32]* %2 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %12
%13 = bitcast [15 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %13
%14 = bitcast [15 x i32]* %4 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %14
%15 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 4
%16 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 4
%17 = getelementptr inbounds [15 x i32], [15 x i32]* %4, i64 0, i64 4
%18 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %18
%19 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %19
%20 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %20
%21 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 8
%22 = getelementptr inbounds [15 x i32], [15 x i32]* %4, i64 0, i64 8
%23 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %23
%24 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %24
%25 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 12
store i32 1, i32* %25
%26 = getelementptr inbounds [15 x i32], [15 x i32]* %4, i64 0, i64 12
store i32 1, i32* %26
%27 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 13
store i32 1, i32* %27
%28 = getelementptr inbounds [15 x i32], [15 x i32]* %4, i64 0, i64 13
store i32 1, i32* %28
%29 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 14
store i32 1, i32* %29
%30 = getelementptr inbounds [15 x i32], [15 x i32]* %4, i64 0, i64 14
store i32 1, i32* %30
%31 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%32 = call i32 @place_next_queen(i32* %31, i32 0, i32* %9, i32* %10, i32* %11)
%33 = load i32, i32* @EXIT_SUCCESS
ret i32 %33
}