// File: /workspace/github_cpp_makefile_star2_O3/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 0x1d210
movq 0x18(%rbx), %r15
leaq 0x20(%rbx), %r14
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x120b4
movq %r15, %rdi
movq %r12, %rsi
callq 0x1c412
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x1cd68
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x5280
movq (%r14), %rax
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x1d176
xorl %r13d, %r13d
movq 0xc229(%rip), %rbp      # 0x28fa8
cmpl $0x0, 0x4(%rax)
jle 0x1d164
leaq 0x1(%r13), %r15
leaq (,%r13,2), %rax
addq %r13, %rax
movq %rax, (%rsp)
leaq (%r15,%r15,2), %rax
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
movq $0x0, 0x8(%rsp)
movq %r15, 0x98(%rsp)
testq %r13, %r13
je 0x1ce1e
movq (%rbx), %rax
movq (%rsp), %rdx
movq -0x18(%rax,%rdx,8), %rcx
movq (%rax,%rdx,8), %rax
movq (%rax,%r12), %rdi
movq (%rcx,%r12), %rax
movq %rax, 0x88(%rsp)
movq 0x8(%rcx,%r12), %rax
movq %rax, 0x90(%rsp)
testq %rax, %rax
je 0x1cdff
cmpb $0x0, (%rbp)
je 0x1cdfb
incl 0x8(%rax)
jmp 0x1cdff
lock
incl 0x8(%rax)
leaq 0x88(%rsp), %rsi
callq 0x14ed0
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x1ce1e
callq 0x1235a
testq %r12, %r12
je 0x1ce79
movq (%rbx), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rax,%r12), %rcx
movq (%rax,%r12), %rdi
movq %rcx, 0x78(%rsp)
movq -0x8(%rax,%r12), %rax
movq %rax, 0x80(%rsp)
testq %rax, %rax
je 0x1ce5d
cmpb $0x0, (%rbp)
je 0x1ce59
incl 0x8(%rax)
jmp 0x1ce5d
lock
incl 0x8(%rax)
leaq 0x78(%rsp), %rsi
callq 0x14ed0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x1ce79
callq 0x1235a
movq (%r14), %rax
movslq (%rax), %rax
cmpq %rax, %r15
jge 0x1cedc
movq (%rbx), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq (%rcx,%r12), %rdi
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r12), %rcx
movq %rcx, 0x68(%rsp)
movq 0x8(%rax,%r12), %rax
movq %rax, 0x70(%rsp)
testq %rax, %rax
je 0x1cec3
cmpb $0x0, (%rbp)
je 0x1cebf
incl 0x8(%rax)
jmp 0x1cec3
lock
incl 0x8(%rax)
leaq 0x68(%rsp), %rsi
callq 0x14ed0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1cedc
callq 0x1235a
movq 0x8(%rsp), %rdx
incq %rdx
movq (%r14), %rax
movslq 0x4(%rax), %rax
movq %rdx, 0x8(%rsp)
cmpq %rax, %rdx
jge 0x1cf45
movq (%rbx), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r12), %rdi
movq 0x10(%rax,%r12), %rcx
movq %rcx, 0x58(%rsp)
movq 0x18(%rax,%r12), %rax
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x1cf2c
cmpb $0x0, (%rbp)
je 0x1cf28
incl 0x8(%rax)
jmp 0x1cf2c
lock
incl 0x8(%rax)
leaq 0x58(%rsp), %rsi
callq 0x14ed0
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1cf45
callq 0x1235a
testq %r12, %r12
sete %al
testq %r13, %r13
sete %cl
orb %al, %cl
jne 0x1cf8d
movq (%rbx), %rax
movq (%rsp), %rdx
movq -0x18(%rax,%rdx,8), %rcx
movq (%rax,%rdx,8), %rax
movq (%rax,%r12), %rdi
movq -0x10(%rcx,%r12), %rax
movq %rax, 0x48(%rsp)
movq -0x8(%rcx,%r12), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x1cf9b
cmpb $0x0, (%rbp)
je 0x1cf97
incl 0x8(%rax)
jmp 0x1cf9b
testq %r13, %r13
jne 0x1cfb4
jmp 0x1d017
lock
incl 0x8(%rax)
leaq 0x48(%rsp), %rsi
callq 0x14ed0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1cfb4
callq 0x1235a
movq (%r14), %rax
movslq 0x4(%rax), %rax
cmpq %rax, 0x8(%rsp)
jge 0x1d017
movq (%rbx), %rax
movq (%rsp), %rdx
movq -0x18(%rax,%rdx,8), %rcx
movq (%rax,%rdx,8), %rax
movq (%rax,%r12), %rdi
movq 0x10(%rcx,%r12), %rax
movq %rax, 0x38(%rsp)
movq 0x18(%rcx,%r12), %rax
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x1cffe
cmpb $0x0, (%rbp)
je 0x1cffa
incl 0x8(%rax)
jmp 0x1cffe
lock
incl 0x8(%rax)
leaq 0x38(%rsp), %rsi
callq 0x14ed0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1d017
callq 0x1235a
testq %r12, %r12
je 0x1d080
movq (%r14), %rax
movslq (%rax), %rax
cmpq %rax, %r15
jge 0x1d080
movq (%rbx), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq (%rcx,%r12), %rdi
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rax,%r12), %rcx
movq %rcx, 0x28(%rsp)
movq -0x8(%rax,%r12), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x1d067
cmpb $0x0, (%rbp)
je 0x1d063
incl 0x8(%rax)
jmp 0x1d067
lock
incl 0x8(%rax)
leaq 0x28(%rsp), %rsi
callq 0x14ed0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1d080
callq 0x1235a
movq (%r14), %rax
movslq (%rax), %rcx
cmpq %rcx, %r15
jge 0x1d0ef
movslq 0x4(%rax), %rax
cmpq %rax, 0x8(%rsp)
jge 0x1d0ef
movq (%rbx), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq (%rcx,%r12), %rdi
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax,%r12), %rcx
movq %rcx, 0x18(%rsp)
movq 0x18(%rax,%r12), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x1d0d6
cmpb $0x0, (%rbp)
je 0x1d0d2
incl 0x8(%rax)
jmp 0x1d0d6
lock
incl 0x8(%rax)
leaq 0x18(%rsp), %rsi
callq 0x14ed0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1d0ef
callq 0x1235a
leaq (,%r13,8), %rax
movq %rbp, %r15
movq %r14, %rbp
movq %r13, %r14
leaq (%rax,%rax,2), %r13
movq (%rbx), %rax
movq 0x18(%rbx), %rsi
movq (%rax,%r13), %rax
movq (%rax,%r12), %rdi
callq 0x1bee0
movq (%rbx), %rax
movq (%rax,%r13), %rax
movq (%rax,%r12), %r13
movq %r13, %rdi
callq 0x1501a
movq %r13, %rdi
movq %r14, %r13
movq %rbp, %r14
movq %r15, %rbp
movq 0x98(%rsp), %r15
movl %eax, %esi
callq 0x14ebe
movq 0x20(%rbx), %rax
movslq 0x4(%rax), %rcx
addq $0x10, %r12
cmpq %rcx, 0x8(%rsp)
jl 0x1cdb9
movl (%rax), %ecx
movq %r15, %r13
jmp 0x1d16a
incq %r13
movq %r13, %r15
movslq %ecx, %rdx
cmpq %rdx, %r15
jl 0x1cd7f
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x1d208
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x5280
jmp 0x1d208
movq %rax, %rbx
movq 0x20(%rsp), %rdi
jmp 0x1d1fe
movq %rax, %rbx
movq 0x40(%rsp), %rdi
jmp 0x1d1fe
movq %rax, %rbx
movq 0x70(%rsp), %rdi
jmp 0x1d1fe
movq %rax, %rbx
movq 0x50(%rsp), %rdi
jmp 0x1d1fe
movq %rax, %rbx
movq 0x30(%rsp), %rdi
jmp 0x1d1fe
movq %rax, %rbx
movq 0x60(%rsp), %rdi
jmp 0x1d1fe
movq %rax, %rbx
movq 0x90(%rsp), %rdi
jmp 0x1d1fe
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x1d208
callq 0x1235a
movq %rbx, %rdi
callq 0x53e0