// File: /workspace/github_cpp_makefile_star2_O2/XxAdi101xX[P]ChamberCrawler/Floor/Floor.cc
// Function: Floor::initialize()
void Floor::initialize() {
    clearFloor();

    //theDisplay = std::make_shared<TextDisplay>(floorDimensions);
    theDisplay->setGridSize(floorDimensions);


    for (int i = 0; i < floorDimensions[0]; ++i) {
        for (int j = 0; j < floorDimensions[1]; ++j) {
            if (i > 0) {
                theFloor[i][j]->addNeighbour(theFloor[i - 1][j]);
            }
            if (j > 0) {
                theFloor[i][j]->addNeighbour(theFloor[i][j - 1]);
            }
            if (i + 1 < floorDimensions[0]) {
                theFloor[i][j]->addNeighbour(theFloor[i + 1][j]);
            }
            if (j + 1 < floorDimensions[1]) {
                theFloor[i][j]->addNeighbour(theFloor[i][j + 1]);
            }
            if (i > 0 && j > 0) {
                theFloor[i][j]->addNeighbour(theFloor[i- 1][j - 1]);
            }
            if (i > 0 && j + 1 < floorDimensions[1]) {
                theFloor[i][j]->addNeighbour(theFloor[i - 1][j + 1]);
            }
            if (i + 1 < floorDimensions[0] && j > 0) {
                theFloor[i][j]->addNeighbour(theFloor[i + 1][j - 1]);
            }
            if (i + 1 < floorDimensions[0] && j + 1 < floorDimensions[1]) {
                theFloor[i][j]->addNeighbour(theFloor[i + 1][j + 1]);
            }
            theFloor[i][j]->attach(theDisplay);

            //Just so it triggers neighbor events
            theFloor[i][j]->setCellType(theFloor[i][j]->getCellType());
        }
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %rbx
callq 0x1641a
movq 0x18(%rbx), %r15
leaq 0x20(%rbx), %r14
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0xcef6
movq %r15, %rdi
movq %r12, %rsi
callq 0x1590c
leaq 0xa0(%rsp), %rdi
callq 0xd484
movq %r14, 0x10(%rsp)
movq (%r14), %rax
xorl %edx, %edx
movslq (%rax), %rcx
cmpq %rcx, %rdx
jge 0x16395
leaq 0x1(%rdx), %r12
movq %rdx, 0x18(%rsp)
imulq $0x18, %rdx, %rbp
pushq $-0x10
popq %r13
xorl %r14d, %r14d
movq %r12, 0x8(%rsp)
movslq 0x4(%rax), %rcx
cmpq %rcx, %r14
jge 0x1638d
cmpq $0x0, 0x18(%rsp)
je 0x16112
movq (%rbx), %rax
movq -0x18(%rax,%rbp), %rcx
movq (%rax,%rbp), %rax
movq 0x10(%rax,%r13), %r15
leaq (%rcx,%r13), %rsi
addq $0x10, %rsi
leaq 0x90(%rsp), %r12
movq %r12, %rdi
callq 0xd360
movq %r15, %rdi
movq %r12, %rsi
callq 0x10806
leaq 0x98(%rsp), %rdi
callq 0xd24a
movq 0x8(%rsp), %r12
cmpq $-0x10, %r13
je 0x16154
movq (%rbx), %rax
movq (%rax,%rbp), %rsi
movq 0x10(%rsi,%r13), %r15
addq %r13, %rsi
leaq 0x80(%rsp), %r12
movq %r12, %rdi
callq 0xd360
movq %r15, %rdi
movq %r12, %rsi
callq 0x10806
leaq 0x88(%rsp), %rdi
callq 0xd24a
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %rax
movq (%rax), %rax
cmpl %r12d, (%rax)
jle 0x161ac
movq (%rbx), %rax
movq (%rax,%rbp), %rcx
movq 0x10(%rcx,%r13), %r15
imulq $0x18, %r12, %rcx
movq (%rax,%rcx), %rax
leaq (%rax,%r13), %rsi
addq $0x10, %rsi
leaq 0x70(%rsp), %r12
movq %r12, %rdi
callq 0xd360
movq %r15, %rdi
movq %r12, %rsi
callq 0x10806
leaq 0x78(%rsp), %rdi
callq 0xd24a
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rsp), %r12
incq %r14
cmpl %r14d, 0x4(%rax)
jle 0x161ef
movq (%rbx), %rax
movq (%rax,%rbp), %rax
leaq (%rax,%r13), %rsi
addq $0x20, %rsi
movq -0x10(%rsi), %r15
leaq 0x60(%rsp), %r12
movq %r12, %rdi
callq 0xd360
movq %r15, %rdi
movq %r12, %rsi
callq 0x10806
leaq 0x68(%rsp), %rdi
callq 0xd24a
movq 0x8(%rsp), %r12
cmpq $-0x10, %r13
sete %al
movq 0x18(%rsp), %rdx
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x16247
movq (%rbx), %rax
movq (%rax,%rbp), %rcx
movq 0x10(%rcx,%r13), %r15
movq -0x18(%rax,%rbp), %rsi
addq %r13, %rsi
leaq 0x50(%rsp), %r12
movq %r12, %rdi
callq 0xd360
movq %r15, %rdi
movq %r12, %rsi
callq 0x10806
leaq 0x58(%rsp), %rdi
callq 0xd24a
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %r12
jmp 0x16251
testq %rdx, %rdx
movq 0x10(%rsp), %rcx
je 0x1629f
movq (%rcx), %rax
cmpl %r14d, 0x4(%rax)
jle 0x1629f
movq (%rbx), %rax
movq -0x18(%rax,%rbp), %rcx
movq (%rax,%rbp), %rax
movq 0x10(%rax,%r13), %r15
leaq (%rcx,%r13), %rsi
addq $0x20, %rsi
leaq 0x40(%rsp), %r12
movq %r12, %rdi
callq 0xd360
movq %r15, %rdi
movq %r12, %rsi
callq 0x10806
leaq 0x48(%rsp), %rdi
callq 0xd24a
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %r12
cmpq $-0x10, %r13
sete %dl
movq (%rcx), %rax
movl (%rax), %ecx
cmpl %r12d, %ecx
setle %sil
orb %dl, %sil
jne 0x162ff
movq (%rbx), %rax
movq (%rax,%rbp), %rcx
movq 0x10(%rcx,%r13), %r15
imulq $0x18, %r12, %rcx
movq (%rax,%rcx), %rsi
addq %r13, %rsi
leaq 0x30(%rsp), %r12
movq %r12, %rdi
callq 0xd360
movq %r15, %rdi
movq %r12, %rsi
callq 0x10806
leaq 0x38(%rsp), %rdi
callq 0xd24a
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl (%rax), %ecx
movq 0x8(%rsp), %r12
cmpl %r12d, %ecx
jle 0x1634d
cmpl %r14d, 0x4(%rax)
jle 0x1634d
movq (%rbx), %rax
movq (%rax,%rbp), %rcx
movq 0x10(%rcx,%r13), %r15
imulq $0x18, %r12, %rcx
movq (%rax,%rcx), %rax
leaq (%rax,%r13), %rsi
addq $0x20, %rsi
leaq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0xd360
movq %r15, %rdi
movq %r12, %rsi
callq 0x10806
leaq 0x28(%rsp), %rdi
callq 0xd24a
movq 0x8(%rsp), %r12
movq (%rbx), %rax
movq 0x18(%rbx), %rsi
movq (%rax,%rbp), %rax
movq 0x10(%rax,%r13), %rdi
callq 0x15408
movq (%rbx), %rax
movq (%rax,%rbp), %rax
movq 0x10(%rax,%r13), %r15
movq %r15, %rdi
callq 0x108f0
movq %r15, %rdi
movl %eax, %esi
callq 0x107f4
movq 0x20(%rbx), %rax
addq $0x10, %r13
jmp 0x160b7
movq %r12, %rdx
jmp 0x16092
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xd484
jmp 0x16412
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x1640d
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x1640d
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
jmp 0x1640d
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0x1640d
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
jmp 0x1640d
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0x1640d
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x1640d
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xd24a
movq %rbx, %rdi
callq 0x53c0