// File: IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::createStartBoard()
Chessman*** Board::createStartBoard() {
  Chessman *** array2d = new Chessman **[8];

  for (int i = 0; i < 8; i++) {
    array2d[i] = new Chessman*[8];
    for (int j = 0; j < 8; j++) {
      array2d[i][j] = nullptr;
    }
  }
  for (int i = 0; i < 8; i++) {
    array2d[1][i] = new Pawn(Chessman::Colour::White, Position(1, i));
    array2d[6][i] = new Pawn(Chessman::Colour::Black, Position(6, i));
  }

  array2d[0][0] = new Rook(Chessman::Colour::White, Position(0, 0));
  array2d[0][7] = new Rook(Chessman::Colour::White, Position(0, 7));
  array2d[7][0] = new Rook(Chessman::Colour::Black, Position(7, 0));
  array2d[7][7] = new Rook(Chessman::Colour::Black, Position(7, 7));
  array2d[0][1] = new Knight(Chessman::Colour::White, Position(0, 1));
  array2d[0][6] = new Knight(Chessman::Colour::White, Position(0, 6));
  array2d[7][1] = new Knight(Chessman::Colour::Black, Position(7, 1));
  array2d[7][6] = new Knight(Chessman::Colour::Black, Position(7, 6));
  array2d[0][2] = new Bishop(Chessman::Colour::White, Position(0, 2));
  array2d[0][5] = new Bishop(Chessman::Colour::White, Position(0, 5));
  array2d[7][2] = new Bishop(Chessman::Colour::Black, Position(7, 2));
  array2d[7][5] = new Bishop(Chessman::Colour::Black, Position(7, 5));
  array2d[0][3] = new Queen(Chessman::Colour::White, Position(0, 3));
  array2d[0][4] = new King(Chessman::Colour::White, Position(0, 4));
  array2d[7][3] = new Queen(Chessman::Colour::Black, Position(7, 3));
  array2d[7][4] = new King(Chessman::Colour::Black, Position(7, 4));
  return array2d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movl $0x40, %edi
callq 0x2030
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x8, -0x14(%rbp)
jge 0x6c70
movl $0x40, %edi
callq 0x2030
movq %rax, %rdx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x18(%rbp)
cmpl $0x8, -0x18(%rbp)
jge 0x6c63
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6c3a
jmp 0x6c65
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6c14
movl $0x0, -0x1c(%rbp)
cmpl $0x8, -0x1c(%rbp)
jge 0x6d6a
movl $0x18, %edi
callq 0x2160
movq %rax, -0xc8(%rbp)
movl -0x1c(%rbp), %edx
leaq -0x24(%rbp), %rdi
movl $0x1, %esi
callq 0x2e50
jmp 0x6ca5
movq -0xc8(%rbp), %rdi
movq -0x24(%rbp), %rdx
movl $0x1, %esi
callq 0x4a70
jmp 0x6cbc
movq -0xc8(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x18, %edi
callq 0x2160
movq %rax, -0xd0(%rbp)
movl -0x1c(%rbp), %edx
leaq -0x3c(%rbp), %rdi
movl $0x6, %esi
callq 0x2e50
jmp 0x6cf7
movq -0xd0(%rbp), %rdi
movq -0x3c(%rbp), %rdx
xorl %esi, %esi
callq 0x4a70
jmp 0x6d0b
movq -0xd0(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6c77
movq -0xc8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0xd0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movl $0x18, %edi
callq 0x2160
movq %rax, -0xd8(%rbp)
leaq -0x44(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x2e50
jmp 0x6d8a
movq -0xd8(%rbp), %rdi
movq -0x44(%rbp), %rdx
movl $0x1, %esi
callq 0x54b0
jmp 0x6da1
movq -0xd8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, (%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0xe0(%rbp)
leaq -0x4c(%rbp), %rdi
xorl %esi, %esi
movl $0x7, %edx
callq 0x2e50
jmp 0x6dd5
movq -0xe0(%rbp), %rdi
movq -0x4c(%rbp), %rdx
movl $0x1, %esi
callq 0x54b0
jmp 0x6dec
movq -0xe0(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x38(%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0xe8(%rbp)
leaq -0x54(%rbp), %rdi
movl $0x7, %esi
xorl %edx, %edx
callq 0x2e50
jmp 0x6e21
movq -0xe8(%rbp), %rdi
movq -0x54(%rbp), %rdx
xorl %esi, %esi
callq 0x54b0
jmp 0x6e35
movq -0xe8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, (%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0xf0(%rbp)
leaq -0x5c(%rbp), %rdi
movl $0x7, %edx
movl %edx, %esi
callq 0x2e50
jmp 0x6e6a
movq -0xf0(%rbp), %rdi
movq -0x5c(%rbp), %rdx
xorl %esi, %esi
callq 0x54b0
jmp 0x6e7e
movq -0xf0(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, 0x38(%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0xf8(%rbp)
leaq -0x64(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x2e50
jmp 0x6eb4
movq -0xf8(%rbp), %rdi
movq -0x64(%rbp), %rdx
movl $0x1, %esi
callq 0x36a0
jmp 0x6ecb
movq -0xf8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0x100(%rbp)
leaq -0x6c(%rbp), %rdi
xorl %esi, %esi
movl $0x6, %edx
callq 0x2e50
jmp 0x6f00
movq -0x100(%rbp), %rdi
movq -0x6c(%rbp), %rdx
movl $0x1, %esi
callq 0x36a0
jmp 0x6f17
movq -0x100(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x30(%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0x108(%rbp)
leaq -0x74(%rbp), %rdi
movl $0x7, %esi
movl $0x1, %edx
callq 0x2e50
jmp 0x6f4f
movq -0x108(%rbp), %rdi
movq -0x74(%rbp), %rdx
xorl %esi, %esi
callq 0x36a0
jmp 0x6f63
movq -0x108(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, 0x8(%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0x110(%rbp)
leaq -0x7c(%rbp), %rdi
movl $0x7, %esi
movl $0x6, %edx
callq 0x2e50
jmp 0x6f9c
movq -0x110(%rbp), %rdi
movq -0x7c(%rbp), %rdx
xorl %esi, %esi
callq 0x36a0
jmp 0x6fb0
movq -0x110(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, 0x30(%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0x118(%rbp)
leaq -0x84(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x2e50
jmp 0x6fe9
movq -0x118(%rbp), %rdi
movq -0x84(%rbp), %rdx
movl $0x1, %esi
callq 0x2fd0
jmp 0x7003
movq -0x118(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x10(%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0x120(%rbp)
leaq -0x8c(%rbp), %rdi
xorl %esi, %esi
movl $0x5, %edx
callq 0x2e50
jmp 0x703b
movq -0x120(%rbp), %rdi
movq -0x8c(%rbp), %rdx
movl $0x1, %esi
callq 0x2fd0
jmp 0x7055
movq -0x120(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x28(%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0x128(%rbp)
leaq -0x94(%rbp), %rdi
movl $0x7, %esi
movl $0x2, %edx
callq 0x2e50
jmp 0x7090
movq -0x128(%rbp), %rdi
movq -0x94(%rbp), %rdx
xorl %esi, %esi
callq 0x2fd0
jmp 0x70a7
movq -0x128(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, 0x10(%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0x130(%rbp)
leaq -0x9c(%rbp), %rdi
movl $0x7, %esi
movl $0x5, %edx
callq 0x2e50
jmp 0x70e3
movq -0x130(%rbp), %rdi
movq -0x9c(%rbp), %rdx
xorl %esi, %esi
callq 0x2fd0
jmp 0x70fa
movq -0x130(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, 0x28(%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0x138(%rbp)
leaq -0xa4(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x2e50
jmp 0x7133
movq -0x138(%rbp), %rdi
movq -0xa4(%rbp), %rdx
movl $0x1, %esi
callq 0x6560
jmp 0x714d
movq -0x138(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x18(%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0x140(%rbp)
leaq -0xac(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x2e50
jmp 0x7185
movq -0x140(%rbp), %rdi
movq -0xac(%rbp), %rdx
movl $0x1, %esi
callq 0x5a40
jmp 0x719f
movq -0x140(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x20(%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0x148(%rbp)
leaq -0xb4(%rbp), %rdi
movl $0x7, %esi
movl $0x3, %edx
callq 0x2e50
jmp 0x71da
movq -0x148(%rbp), %rdi
movq -0xb4(%rbp), %rdx
xorl %esi, %esi
callq 0x6560
jmp 0x71f1
movq -0x148(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, 0x18(%rax)
movl $0x18, %edi
callq 0x2160
movq %rax, -0x150(%rbp)
leaq -0xbc(%rbp), %rdi
movl $0x7, %esi
movl $0x4, %edx
callq 0x2e50
jmp 0x722d
movq -0x150(%rbp), %rdi
movq -0xbc(%rbp), %rdx
xorl %esi, %esi
callq 0x5a40
jmp 0x7244
movq -0x150(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0xd8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0xe0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0xe8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0xf0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0xf8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0x100(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0x108(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0x110(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0x118(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0x120(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0x128(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0x130(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0x138(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0x140(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0x148(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
jmp 0x7423
movq -0x150(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x2140
movq -0x30(%rbp), %rdi
callq 0x2260
nopl (%rax)