#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 isBoardFull(int **board, int board_size) {
  int i, j;
  for (i = 0; i < board_size; i++) {
    for (j = 0; j < board_size; j++) {
      if (board[i][j] == 0) {
        return 0;
      }
    }
  }
  printf("-----DRAW!-----");
  return 1;
}


x86 assembly (clang, -O0):
<isBoardFull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1191 <isBoardFull+0x81>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    117e <isBoardFull+0x6e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    116b <isBoardFull+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    11a4 <isBoardFull+0x94>
jmp    1170 <isBoardFull+0x60>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1139 <isBoardFull+0x29>
jmp    1183 <isBoardFull+0x73>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <isBoardFull+0x16>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBoardFull>:
push   %rax
test   %esi,%esi
jle    1138 <isBoardFull+0x28>
mov    %esi,%eax
xor    %ecx,%ecx
mov    (%rdi,%rcx,8),%rdx
xor    %esi,%esi
nop
cmpl   $0x0,(%rdx,%rsi,4)
je     114b <isBoardFull+0x3b>
add    $0x1,%rsi
cmp    %rsi,%rax
jne    1120 <isBoardFull+0x10>
add    $0x1,%rcx
cmp    %rax,%rcx
jne    1119 <isBoardFull+0x9>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

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