#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 print_board(int *board) {
  for (int i = 0; i < 10; i = i + 1) {
    for (int j = 0; j < 10; j = j + 1) {
      if (board[i * 10 + j]) {
        printf("Q ");
      } else {
        printf(". ");
      }
    }
    printf("\n");
  }
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<print_board>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11a0 <print_board+0x90>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1186 <print_board+0x76>
mov    -0x8(%rbp),%rax
imul   $0xa,-0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1167 <print_board+0x57>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    1173 <print_board+0x63>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
jmp    1178 <print_board+0x68>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <print_board+0x24>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_board+0x13>
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_board>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x24,%ebx
lea    0xebc(%rip),%r15
lea    0xeb2(%rip),%r12
xchg   %ax,%ax
cmpl   $0x0,-0x24(%r14,%rbx,1)
mov    %r12,%rdi
cmove  %r15,%rdi
call   1050 <printf@plt>
cmpl   $0x0,-0x20(%r14,%rbx,1)
mov    %r12,%rdi
cmove  %r15,%rdi
call   1050 <printf@plt>
cmpl   $0x0,-0x1c(%r14,%rbx,1)
mov    %r12,%rdi
cmove  %r15,%rdi
call   1050 <printf@plt>
cmpl   $0x0,-0x18(%r14,%rbx,1)
mov    %r12,%rdi
cmove  %r15,%rdi
call   1050 <printf@plt>
cmpl   $0x0,-0x14(%r14,%rbx,1)
mov    %r12,%rdi
cmove  %r15,%rdi
call   1050 <printf@plt>
cmpl   $0x0,-0x10(%r14,%rbx,1)
mov    %r12,%rdi
cmove  %r15,%rdi
call   1050 <printf@plt>
cmpl   $0x0,-0xc(%r14,%rbx,1)
mov    %r12,%rdi
cmove  %r15,%rdi
call   1050 <printf@plt>
cmpl   $0x0,-0x8(%r14,%rbx,1)
mov    %r12,%rdi
cmove  %r15,%rdi
call   1050 <printf@plt>
cmpl   $0x0,-0x4(%r14,%rbx,1)
mov    %r12,%rdi
cmove  %r15,%rdi
call   1050 <printf@plt>
cmpl   $0x0,(%r14,%rbx,1)
mov    %r12,%rdi
cmove  %r15,%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x28,%rbx
cmp    $0x1b4,%rbx
jne    1150 <print_board+0x20>
lea    0xde1(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"Q \00"
@.str.1 = [3 x i8] c". \00"
@str = [2 x i8] c"\0A\00"
define i32 @print_board(i32* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %65, %2 ]
%4 = mul nuw nsw i64 %3, 10
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%9 = tail call i32 @printf(i8* dereferenceable(1) %8)
%10 = or i64 %4, 1
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%15 = tail call i32 @printf(i8* dereferenceable(1) %14)
%16 = add nuw nsw i64 %4, 2
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 0
%20 = select i1 %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%21 = tail call i32 @printf(i8* dereferenceable(1) %20)
%22 = add nuw nsw i64 %4, 3
%23 = getelementptr inbounds i32, i32* %0, i64 %22
%24 = load i32, i32* %23
%25 = icmp eq i32 %24, 0
%26 = select i1 %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%27 = tail call i32 @printf(i8* dereferenceable(1) %26)
%28 = add nuw nsw i64 %4, 4
%29 = getelementptr inbounds i32, i32* %0, i64 %28
%30 = load i32, i32* %29
%31 = icmp eq i32 %30, 0
%32 = select i1 %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%33 = tail call i32 @printf(i8* dereferenceable(1) %32)
%34 = add nuw nsw i64 %4, 5
%35 = getelementptr inbounds i32, i32* %0, i64 %34
%36 = load i32, i32* %35
%37 = icmp eq i32 %36, 0
%38 = select i1 %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%39 = tail call i32 @printf(i8* dereferenceable(1) %38)
%40 = add nuw nsw i64 %4, 6
%41 = getelementptr inbounds i32, i32* %0, i64 %40
%42 = load i32, i32* %41
%43 = icmp eq i32 %42, 0
%44 = select i1 %43, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%45 = tail call i32 @printf(i8* dereferenceable(1) %44)
%46 = add nuw nsw i64 %4, 7
%47 = getelementptr inbounds i32, i32* %0, i64 %46
%48 = load i32, i32* %47
%49 = icmp eq i32 %48, 0
%50 = select i1 %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%51 = tail call i32 @printf(i8* dereferenceable(1) %50)
%52 = add nuw nsw i64 %4, 8
%53 = getelementptr inbounds i32, i32* %0, i64 %52
%54 = load i32, i32* %53
%55 = icmp eq i32 %54, 0
%56 = select i1 %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%57 = tail call i32 @printf(i8* dereferenceable(1) %56)
%58 = add nuw nsw i64 %4, 9
%59 = getelementptr inbounds i32, i32* %0, i64 %58
%60 = load i32, i32* %59
%61 = icmp eq i32 %60, 0
%62 = select i1 %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%63 = tail call i32 @printf(i8* dereferenceable(1) %62)
%64 = tail call i32 @putchar(i32 10)
%65 = add nuw nsw i64 %3, 1
%66 = icmp eq i64 %65, 10
br i1 %66, label %67, label %2
67: ; preds = %2
%68 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}