#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 assignShip(int **, int);
void *calloc(int, int);
int /*<<< orphan*/ dispGrid(int **);
int /*<<< orphan*/ printIntro(int);
int /*<<< orphan*/ printStudInfo();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strcmp(char *, char *);
int main(void) {
  int **board;
  int i;
  int j;
  char level[10] = "";
  int maxTries;
  int validLoc = 0;
  printStudInfo();
  printf("\n                Welcome to Battleship!                    \n\n");
  while ((strcmp(level, "easy")) && (strcmp(level, "normal")) &&
         (strcmp(level, "hard"))) {
    printf("Enter difficulty level of game (easy, normal, hard): ");
    scanf("%s", level);
    if ((strcmp(level, "easy")) && (strcmp(level, "normal")) &&
        (strcmp(level, "hard"))) {
      printf(
          "Invalid input. Response is case sensitive. Please select again.\n");
    }
  }
  if (!strcmp(level, "easy")) {
    maxTries = 30;
  } else if (!strcmp(level, "normal")) {
    maxTries = 25;
  } else {
    maxTries = 20;
  }
  printIntro(maxTries);
  printf("Initializing board... ");
  board = calloc(10, sizeof(int *));
  for (i = 0; i < 10; i++) {
    board[i] = calloc(10, sizeof(int));
  }
  printf("now let's begin!\n\n");
  while (!validLoc) {
    validLoc = assignShip(board, 4);
  }
  validLoc = 0;
  while (!validLoc) {
    validLoc = assignShip(board, 5);
  }
  dispGrid(board);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x22(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <memset@plt>
movl   $0x0,-0x2c(%rbp)
mov    $0x0,%al
call   10a0 <printStudInfo@plt>
lea    0xe3c(%rip),%rdi
call   1040 <printf@plt>
lea    -0x22(%rbp),%rdi
lea    0xe6a(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2d(%rbp)
je     1227 <main+0x97>
lea    -0x22(%rbp),%rdi
lea    0xe4d(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2d(%rbp)
je     1227 <main+0x97>
lea    -0x22(%rbp),%rdi
lea    0xe32(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
test   $0x1,%al
jne    1237 <main+0xa7>
jmp    12b2 <main+0x122>
lea    0xe11(%rip),%rdi
call   1040 <printf@plt>
lea    -0x22(%rbp),%rsi
lea    0xe37(%rip),%rdi
call   1090 <scanf@plt>
lea    -0x22(%rbp),%rdi
lea    0xde0(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     12ad <main+0x11d>
lea    -0x22(%rbp),%rdi
lea    0xdcb(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     12ad <main+0x11d>
lea    -0x22(%rbp),%rdi
lea    0xdb8(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     12ad <main+0x11d>
lea    0xde0(%rip),%rdi
call   1040 <printf@plt>
jmp    11c9 <main+0x39>
lea    -0x22(%rbp),%rdi
lea    0xd81(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12d8 <main+0x148>
movl   $0x1e,-0x28(%rbp)
jmp    130a <main+0x17a>
lea    -0x22(%rbp),%rdi
lea    0xd60(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12fe <main+0x16e>
movl   $0x19,-0x28(%rbp)
jmp    1305 <main+0x175>
movl   $0x14,-0x28(%rbp)
jmp    130a <main+0x17a>
mov    -0x28(%rbp),%edi
call   1030 <printIntro@plt>
lea    0xdb0(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    136e <main+0x1de>
mov    $0xa,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1338 <main+0x1a8>
lea    0xd6b(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x2c(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1390 <main+0x200>
jmp    13a6 <main+0x216>
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1080 <assignShip@plt>
mov    %eax,-0x2c(%rbp)
jmp    137a <main+0x1ea>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13c3 <main+0x233>
jmp    13d9 <main+0x249>
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1080 <assignShip@plt>
mov    %eax,-0x2c(%rbp)
jmp    13ad <main+0x21d>
mov    -0x10(%rbp),%rdi
call   10b0 <dispGrid@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movw   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
xor    %eax,%eax
call   10a0 <printStudInfo@plt>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
lea    0xe38(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1294 <main+0x104>
lea    0xe23(%rip),%r14
lea    0x8(%rsp),%rbx
lea    0xe1e(%rip),%r15
lea    0xe1c(%rip),%r12
lea    0xe4b(%rip),%r13
lea    0xdfd(%rip),%rbp
jmp    1220 <main+0x90>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1294 <main+0x104>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1294 <main+0x104>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1294 <main+0x104>
mov    %r12,%rdi
call   1050 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1210 <main+0x80>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1210 <main+0x80>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1210 <main+0x80>
lea    0xe26(%rip),%rdi
call   1030 <puts@plt>
jmp    1210 <main+0x80>
lea    0xd65(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12cb <main+0x13b>
lea    0xd54(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1070 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rcx,%rcx,4),%edi
add    $0x14,%edi
jmp    12d0 <main+0x140>
mov    $0x1e,%edi
call   1040 <printIntro@plt>
lea    0xd6e(%rip),%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,%rbx
mov    $0xa,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,(%rbx)
mov    $0xa,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,0x8(%rbx)
mov    $0xa,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,0x10(%rbx)
mov    $0xa,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,0x18(%rbx)
mov    $0xa,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,0x20(%rbx)
mov    $0xa,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,0x28(%rbx)
mov    $0xa,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,0x30(%rbx)
mov    $0xa,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,0x38(%rbx)
mov    $0xa,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,0x40(%rbx)
mov    $0xa,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,0x48(%rbx)
lea    0xce7(%rip),%rdi
call   1030 <puts@plt>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x4,%esi
call   1080 <assignShip@plt>
test   %eax,%eax
je     13c0 <main+0x230>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x5,%esi
call   1080 <assignShip@plt>
test   %eax,%eax
je     13e0 <main+0x250>
mov    %rbx,%rdi
call   10b0 <dispGrid@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [62 x i8] c"\0A Welcome to Battleship! \0A\0A\00"
@.str.1 = [5 x i8] c"easy\00"
@.str.2 = [7 x i8] c"normal\00"
@.str.3 = [5 x i8] c"hard\00"
@.str.4 = [54 x i8] c"Enter difficulty level of game (easy, normal, hard): \00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [65 x i8] c"Invalid input. Response is case sensitive. Please select again.\0A\00"
@.str.7 = [23 x i8] c"Initializing board... \00"
@.str.8 = [19 x i8] c"now let's begin!\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32**
%3 = alloca i32
%4 = alloca i32
%5 = alloca [10 x i8]
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [10 x i8]* %5 to i8*
store i32 0, i32* %7
%9 = call i32 (...) @printStudInfo()
%10 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %42, %0
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%22 = icmp ne i64 %21, 0
br label %23
23: ; preds = %19, %15, %11
%24 = phi i1 [ false, %15 ], [ false, %11 ], [ %22, %19 ]
br i1 %24, label %25, label %43
25: ; preds = %23
%26 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0))
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %27)
%29 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %42
32: ; preds = %25
%33 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %42
36: ; preds = %32
%37 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.6, i64 0, i64 0))
br label %42
42: ; preds = %40, %36, %32, %25
br label %11
43: ; preds = %23
%44 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%45 = call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%46 = icmp ne i64 %45, 0
br i1 %46, label %48, label %47
47: ; preds = %43
store i32 30, i32* %6
br label %55
48: ; preds = %43
%49 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%50 = call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%51 = icmp ne i64 %50, 0
br i1 %51, label %53, label %52
52: ; preds = %48
store i32 25, i32* %6
br label %54
53: ; preds = %48
store i32 20, i32* %6
br label %54
54: ; preds = %53, %52
br label %55
55: ; preds = %54, %47
%56 = load i32, i32* %6
%57 = call i32 @printIntro(i32 %56)
%58 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%59 = call i8* @calloc(i32 10, i32 8)
%60 = bitcast i8* %59 to i32**
store i32** %60, i32*** %2
store i32 0, i32* %3
br label %61
61: ; preds = %71, %55
%62 = load i32, i32* %3
%63 = icmp slt i32 %62, 10
br i1 %63, label %64, label %74
64: ; preds = %61
%65 = call i8* @calloc(i32 10, i32 4)
%66 = bitcast i8* %65 to i32*
%67 = load i32**, i32*** %2
%68 = load i32, i32* %3
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i32*, i32** %67, i64 %69
store i32* %66, i32** %70
br label %71
71: ; preds = %64
%72 = load i32, i32* %3
%73 = add nsw i32 %72, 1
store i32 %73, i32* %3
br label %61
74: ; preds = %61
%75 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %76
76: ; preds = %80, %74
%77 = load i32, i32* %7
%78 = icmp ne i32 %77, 0
%79 = xor i1 %78, true
br i1 %79, label %80, label %83
80: ; preds = %76
%81 = load i32**, i32*** %2
%82 = call i32 @assignShip(i32** %81, i32 4)
store i32 %82, i32* %7
br label %76
83: ; preds = %76
store i32 0, i32* %7
br label %84
84: ; preds = %88, %83
%85 = load i32, i32* %7
%86 = icmp ne i32 %85, 0
%87 = xor i1 %86, true
br i1 %87, label %88, label %91
88: ; preds = %84
%89 = load i32**, i32*** %2
%90 = call i32 @assignShip(i32** %89, i32 5)
store i32 %90, i32* %7
br label %84
91: ; preds = %84
%92 = load i32**, i32*** %2
%93 = call i32 @dispGrid(i32** %92)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"easy\00"
@.str.2 = [7 x i8] c"normal\00"
@.str.3 = [5 x i8] c"hard\00"
@.str.4 = [54 x i8] c"Enter difficulty level of game (easy, normal, hard): \00"
@.str.5 = [3 x i8] c"%s\00"
@.str.7 = [23 x i8] c"Initializing board... \00"
@str = [61 x i8] c"\0A Welcome to Battleship! \0A\00"
@str.9 = [18 x i8] c"now let's begin!\0A\00"
@str.10 = [64 x i8] c"Invalid input. Response is case sensitive. Please select again.\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @printStudInfo()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %29, label %7
7: ; preds = %0, %26
%8 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %29, label %10
10: ; preds = %7
%11 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %29, label %13
13: ; preds = %10
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%16 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %26, label %18
18: ; preds = %13
%19 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %26, label %21
21: ; preds = %18
%22 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %21
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.10, i64 0, i64 0))
br label %26
26: ; preds = %24, %21, %18, %13
%27 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %7
29: ; preds = %10, %7, %26, %0
%30 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %29
%33 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
%35 = select i1 %34, i32 25, i32 20
br label %36
36: ; preds = %32, %29
%37 = phi i32 [ 30, %29 ], [ %35, %32 ]
%38 = call i32 @printIntro(i32 %37)
%39 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%40 = call dereferenceable_or_null(80) i8* @calloc(i32 10, i32 8)
%41 = bitcast i8* %40 to i32**
%42 = call dereferenceable_or_null(40) i8* @calloc(i32 10, i32 4)
%43 = bitcast i8* %40 to i8**
store i8* %42, i8** %43
%44 = call dereferenceable_or_null(40) i8* @calloc(i32 10, i32 4)
%45 = getelementptr inbounds i32*, i32** %41, i64 1
%46 = bitcast i32** %45 to i8**
store i8* %44, i8** %46
%47 = call dereferenceable_or_null(40) i8* @calloc(i32 10, i32 4)
%48 = getelementptr inbounds i32*, i32** %41, i64 2
%49 = bitcast i32** %48 to i8**
store i8* %47, i8** %49
%50 = call dereferenceable_or_null(40) i8* @calloc(i32 10, i32 4)
%51 = getelementptr inbounds i32*, i32** %41, i64 3
%52 = bitcast i32** %51 to i8**
store i8* %50, i8** %52
%53 = call dereferenceable_or_null(40) i8* @calloc(i32 10, i32 4)
%54 = getelementptr inbounds i32*, i32** %41, i64 4
%55 = bitcast i32** %54 to i8**
store i8* %53, i8** %55
%56 = call dereferenceable_or_null(40) i8* @calloc(i32 10, i32 4)
%57 = getelementptr inbounds i32*, i32** %41, i64 5
%58 = bitcast i32** %57 to i8**
store i8* %56, i8** %58
%59 = call dereferenceable_or_null(40) i8* @calloc(i32 10, i32 4)
%60 = getelementptr inbounds i32*, i32** %41, i64 6
%61 = bitcast i32** %60 to i8**
store i8* %59, i8** %61
%62 = call dereferenceable_or_null(40) i8* @calloc(i32 10, i32 4)
%63 = getelementptr inbounds i32*, i32** %41, i64 7
%64 = bitcast i32** %63 to i8**
store i8* %62, i8** %64
%65 = call dereferenceable_or_null(40) i8* @calloc(i32 10, i32 4)
%66 = getelementptr inbounds i32*, i32** %41, i64 8
%67 = bitcast i32** %66 to i8**
store i8* %65, i8** %67
%68 = call dereferenceable_or_null(40) i8* @calloc(i32 10, i32 4)
%69 = getelementptr inbounds i32*, i32** %41, i64 9
%70 = bitcast i32** %69 to i8**
store i8* %68, i8** %70
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.9, i64 0, i64 0))
br label %72
72: ; preds = %36, %72
%73 = call i32 @assignShip(i32** %41, i32 4)
%74 = icmp eq i32 %73, 0
br i1 %74, label %72, label %75
75: ; preds = %72, %75
%76 = call i32 @assignShip(i32** %41, i32 5)
%77 = icmp eq i32 %76, 0
br i1 %77, label %75, label %78
78: ; preds = %75
%79 = call i32 @dispGrid(i32** %41)
ret i32 0
}