#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 *, ...);
void printBoard(int n, int board[n][n]) {
  int i, j;
  for (i = 0; i < n; ++i) {
    printf("\n\t\t");
    for (j = 0; j < n; ++j)
      printf("%d ", board[i][j]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printBoard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11b0 <printBoard+0xa0>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1194 <printBoard+0x84>
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114e <printBoard+0x3e>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <printBoard+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBoard>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    119d <printBoard+0x7d>
mov    %rsi,%rbx
mov    %edi,%r12d
lea    0x0(,%r12,4),%r13
lea    0xec0(%rip),%r15
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%r14,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14,%r12
jne    1170 <printBoard+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
add    %r13,%rbx
cmp    %r12,%rbp
jne    1150 <printBoard+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A\09\09\00"
@.str.1 = [4 x i8] c"%d \00"
define void @printBoard(i32 %0, i32* nocapture %1) {
%3 = zext i32 %0 to i64
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %21
5: ; preds = %2, %17
%6 = phi i64 [ %19, %17 ], [ 0, %2 ]
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = mul nuw nsw i64 %6, %3
%9 = getelementptr inbounds i32, i32* %1, i64 %8
br label %10
10: ; preds = %5, %10
%11 = phi i64 [ 0, %5 ], [ %15, %10 ]
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = add nuw nsw i64 %11, 1
%16 = icmp eq i64 %15, %3
br i1 %16, label %17, label %10
17: ; preds = %10
%18 = tail call i32 @putchar(i32 10)
%19 = add nuw nsw i64 %6, 1
%20 = icmp eq i64 %19, %3
br i1 %20, label %21, label %5
21: ; preds = %17, %2
ret void
}