#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 board_get_size();
int /*<<< orphan*/ print_char_board(int, int);
int /*<<< orphan*/ printf(char *, ...);
void board_print_raw(void) {
  int i, j, k, l, m;
  int board_size = board_get_size();
  printf("[INFO] Board: %d x %d\n", board_size, board_size);
  if (board_size == 3) {
    printf("     GAME BOARD\n");
  }
  if (board_size == 6) {
    printf("           GAME BOARD\n");
  }
  if (board_size == 12) {
    printf("                     GAME BOARD\n");
  }
  for (i = 0; i < board_size; i++) {
    printf("    ");
    for (k = 0; k < board_size; k++) {
      printf("+---");
    }
    printf("+\n");
    if (i > 8) {
      printf(" %d ", i + 1);
    } else {
      printf("  %d ", i + 1);
    }
    for (j = 0; j < board_size; j++) {
      printf("| ");
      print_char_board(i, j);
    }
    printf("|\n");
  }
  printf("    ");
  for (l = 0; l < board_size; l++) {
    printf("+---");
  }
  printf("+\n     ");
  char f = 65;
  for (m = 0; m < board_size; m++) {
    printf(" %c  ", f);
    f = f + 1;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<board_print_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <board_get_size@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x3,-0x18(%rbp)
jne    116e <board_print_raw+0x3e>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x6,-0x18(%rbp)
jne    1186 <board_print_raw+0x56>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0xc,-0x18(%rbp)
jne    119e <board_print_raw+0x6e>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1289 <board_print_raw+0x159>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11ee <board_print_raw+0xbe>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c6 <board_print_raw+0x96>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x8,-0x4(%rbp)
jle    121f <board_print_raw+0xef>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1233 <board_print_raw+0x103>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    126d <board_print_raw+0x13d>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <print_char_board@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    123a <board_print_raw+0x10a>
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11a5 <board_print_raw+0x75>
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    12c6 <board_print_raw+0x196>
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    129e <board_print_raw+0x16e>
lea    0xd7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x41,-0x19(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1315 <board_print_raw+0x1e5>
movsbl -0x19(%rbp),%esi
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x19(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x19(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12df <board_print_raw+0x1af>
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_print_raw>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <board_get_size@plt>
mov    %eax,%ebx
lea    0xe95(%rip),%rdi
mov    %eax,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x3,%ebx
je     1193 <board_print_raw+0x43>
cmp    $0xc,%ebx
je     11a1 <board_print_raw+0x51>
cmp    $0x6,%ebx
jne    11af <board_print_raw+0x5f>
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
jmp    11b7 <board_print_raw+0x67>
lea    0xead(%rip),%rdi
call   1040 <puts@plt>
jmp    11b7 <board_print_raw+0x67>
lea    0xe8f(%rip),%rdi
call   1040 <puts@plt>
jmp    11b7 <board_print_raw+0x67>
test   %ebx,%ebx
jle    12e0 <board_print_raw+0x190>
lea    0xe59(%rip),%r15
lea    0xe5d(%rip),%r13
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
lea    0xe51(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%ebp
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0xffffffff,%ebp
jne    11e0 <board_print_raw+0x90>
lea    0xe3d(%rip),%rdi
call   1040 <puts@plt>
lea    0x1(%r14),%r12d
cmp    $0x9,%r14d
lea    0xe12(%rip),%rdi
lea    0xe0c(%rip),%rax
cmovae %rax,%rdi
xor    %ebp,%ebp
mov    %r12d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14d,%edi
mov    %ebp,%esi
call   1050 <print_char_board@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1230 <board_print_raw+0xe0>
lea    0xde3(%rip),%rdi
call   1040 <puts@plt>
mov    %r12d,%r14d
cmp    %ebx,%r12d
jne    11d0 <board_print_raw+0x80>
lea    0xdbe(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd9f(%rip),%r14
mov    %ebx,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0xffffffff,%ebp
jne    1280 <board_print_raw+0x130>
lea    0xd8f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x41,%ebp
lea    0xd84(%rip),%r14
nopl   0x0(%rax)
movsbl %bpl,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
jne    12b0 <board_print_raw+0x160>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
lea    0xd41(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd30(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    12c8 <board_print_raw+0x178>

LLVM IR (-O0):
@.str = [23 x i8] c"[INFO] Board: %d x %d\0A\00"
@.str.1 = [17 x i8] c" GAME BOARD\0A\00"
@.str.2 = [23 x i8] c" GAME BOARD\0A\00"
@.str.3 = [33 x i8] c" GAME BOARD\0A\00"
@.str.4 = [5 x i8] c" \00"
@.str.5 = [5 x i8] c"+---\00"
@.str.6 = [3 x i8] c"+\0A\00"
@.str.7 = [5 x i8] c" %d \00"
@.str.8 = [6 x i8] c" %d \00"
@.str.9 = [3 x i8] c"| \00"
@.str.10 = [3 x i8] c"|\0A\00"
@.str.11 = [8 x i8] c"+\0A \00"
@.str.12 = [6 x i8] c" %c \00"
@.str.13 = [2 x i8] c"\0A\00"
define void @board_print_raw() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = call i32 (...) @board_get_size()
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 3
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %0
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 6
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %16
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, 12
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %26
26: ; preds = %24, %21
store i32 0, i32* %1
br label %27
27: ; preds = %69, %26
%28 = load i32, i32* %1
%29 = load i32, i32* %6
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %72
31: ; preds = %27
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %33
33: ; preds = %39, %31
%34 = load i32, i32* %3
%35 = load i32, i32* %6
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %42
37: ; preds = %33
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %39
39: ; preds = %37
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
store i32 %41, i32* %3
br label %33
42: ; preds = %33
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%44 = load i32, i32* %1
%45 = icmp sgt i32 %44, 8
br i1 %45, label %46, label %50
46: ; preds = %42
%47 = load i32, i32* %1
%48 = add nsw i32 %47, 1
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 %48)
br label %54
50: ; preds = %42
%51 = load i32, i32* %1
%52 = add nsw i32 %51, 1
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %50, %46
store i32 0, i32* %2
br label %55
55: ; preds = %64, %54
%56 = load i32, i32* %2
%57 = load i32, i32* %6
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %67
59: ; preds = %55
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%61 = load i32, i32* %1
%62 = load i32, i32* %2
%63 = call i32 @print_char_board(i32 %61, i32 %62)
br label %64
64: ; preds = %59
%65 = load i32, i32* %2
%66 = add nsw i32 %65, 1
store i32 %66, i32* %2
br label %55
67: ; preds = %55
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %69
69: ; preds = %67
%70 = load i32, i32* %1
%71 = add nsw i32 %70, 1
store i32 %71, i32* %1
br label %27
72: ; preds = %27
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %4
br label %74
74: ; preds = %80, %72
%75 = load i32, i32* %4
%76 = load i32, i32* %6
%77 = icmp slt i32 %75, %76
br i1 %77, label %78, label %83
78: ; preds = %74
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %80
80: ; preds = %78
%81 = load i32, i32* %4
%82 = add nsw i32 %81, 1
store i32 %82, i32* %4
br label %74
83: ; preds = %74
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
store i8 65, i8* %7
store i32 0, i32* %5
br label %85
85: ; preds = %97, %83
%86 = load i32, i32* %5
%87 = load i32, i32* %6
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %100
89: ; preds = %85
%90 = load i8, i8* %7
%91 = sext i8 %90 to i32
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 %91)
%93 = load i8, i8* %7
%94 = sext i8 %93 to i32
%95 = add nsw i32 %94, 1
%96 = trunc i32 %95 to i8
store i8 %96, i8* %7
br label %97
97: ; preds = %89
%98 = load i32, i32* %5
%99 = add nsw i32 %98, 1
store i32 %99, i32* %5
br label %85
100: ; preds = %85
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"[INFO] Board: %d x %d\0A\00"
@.str.4 = [5 x i8] c" \00"
@.str.5 = [5 x i8] c"+---\00"
@.str.7 = [5 x i8] c" %d \00"
@.str.8 = [6 x i8] c" %d \00"
@.str.9 = [3 x i8] c"| \00"
@.str.11 = [8 x i8] c"+\0A \00"
@.str.12 = [6 x i8] c" %c \00"
@str = [2 x i8] c"+\00"
@str.14 = [2 x i8] c"|\00"
@str.15 = [32 x i8] c" GAME BOARD\00"
@str.16 = [22 x i8] c" GAME BOARD\00"
@str.17 = [16 x i8] c" GAME BOARD\00"
define void @board_print_raw() {
%1 = tail call i32 (...) @board_get_size()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %1)
switch i32 %1, label %8 [
i32 3, label %5
i32 6, label %3
i32 12, label %4
]
3: ; preds = %0
br label %5
4: ; preds = %0
br label %5
5: ; preds = %0, %3, %4
%6 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0), %3 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @str.15, i64 0, i64 0), %4 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @str.17, i64 0, i64 0), %0 ]
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
br label %10
8: ; preds = %0
%9 = icmp sgt i32 %1, 0
br i1 %9, label %10, label %11
10: ; preds = %5, %8
br label %14
11: ; preds = %8
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
br label %56
14: ; preds = %10, %34
%15 = phi i32 [ %36, %34 ], [ 0, %10 ]
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %17
17: ; preds = %14, %17
%18 = phi i32 [ %20, %17 ], [ 0, %14 ]
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%20 = add nuw nsw i32 %18, 1
%21 = icmp eq i32 %20, %1
br i1 %21, label %22, label %17
22: ; preds = %17
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%24 = icmp ugt i32 %15, 8
%25 = add nuw nsw i32 %15, 1
%26 = select i1 %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %26, i32 %25)
br label %28
28: ; preds = %22, %28
%29 = phi i32 [ %32, %28 ], [ 0, %22 ]
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%31 = tail call i32 @print_char_board(i32 %15, i32 %29)
%32 = add nuw nsw i32 %29, 1
%33 = icmp eq i32 %32, %1
br i1 %33, label %34, label %28
34: ; preds = %28
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0))
%36 = add nuw nsw i32 %15, 1
%37 = icmp eq i32 %36, %1
br i1 %37, label %38, label %14
38: ; preds = %34
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %40
40: ; preds = %38, %40
%41 = phi i32 [ %43, %40 ], [ 0, %38 ]
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%43 = add nuw nsw i32 %41, 1
%44 = icmp eq i32 %43, %1
br i1 %44, label %45, label %40
45: ; preds = %40
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
br label %47
47: ; preds = %45, %47
%48 = phi i32 [ %53, %47 ], [ 65, %45 ]
%49 = phi i32 [ %54, %47 ], [ 0, %45 ]
%50 = shl i32 %48, 24
%51 = ashr exact i32 %50, 24
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 %51)
%53 = add nsw i32 %51, 1
%54 = add nuw nsw i32 %49, 1
%55 = icmp eq i32 %54, %1
br i1 %55, label %56, label %47
56: ; preds = %47, %11
%57 = tail call i32 @putchar(i32 10)
ret void
}