// File: /workspace/github_cpp_makefile_star2_O1/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 0x1d2be
movq 0x18(%rbx), %r15
leaq 0x20(%rbx), %r13
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x11fd4
movq %r15, %rdi
movq %r12, %rsi
callq 0x1c462
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x1ce18
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x5280
movq (%r13), %rax
cmpl $0x0, (%rax)
jle 0x1d223
xorl %ebp, %ebp
movq 0xc17a(%rip), %r14      # 0x28fa8
movq (%r13), %rax
cmpl $0x0, 0x4(%rax)
jle 0x1d210
leaq 0x1(%rbp), %r15
leaq (,%rbp,2), %rax
addq %rbp, %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 %rbp, %rbp
je 0x1ced1
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 0x1ceb2
cmpb $0x0, (%r14)
je 0x1ceae
incl 0x8(%rax)
jmp 0x1ceb2
lock
incl 0x8(%rax)
leaq 0x88(%rsp), %rsi
callq 0x14db8
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x1ced1
callq 0x12250
testq %r12, %r12
je 0x1cf2c
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 0x1cf10
cmpb $0x0, (%r14)
je 0x1cf0c
incl 0x8(%rax)
jmp 0x1cf10
lock
incl 0x8(%rax)
leaq 0x78(%rsp), %rsi
callq 0x14db8
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x1cf2c
callq 0x12250
movq (%r13), %rax
movslq (%rax), %rax
cmpq %rax, %r15
jge 0x1cf90
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 0x1cf77
cmpb $0x0, (%r14)
je 0x1cf73
incl 0x8(%rax)
jmp 0x1cf77
lock
incl 0x8(%rax)
leaq 0x68(%rsp), %rsi
callq 0x14db8
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1cf90
callq 0x12250
movq 0x8(%rsp), %rdx
incq %rdx
movq (%r13), %rax
movslq 0x4(%rax), %rax
movq %rdx, 0x8(%rsp)
cmpq %rax, %rdx
jge 0x1cffa
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 0x1cfe1
cmpb $0x0, (%r14)
je 0x1cfdd
incl 0x8(%rax)
jmp 0x1cfe1
lock
incl 0x8(%rax)
leaq 0x58(%rsp), %rsi
callq 0x14db8
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1cffa
callq 0x12250
testq %r12, %r12
sete %al
testq %rbp, %rbp
sete %cl
orb %al, %cl
jne 0x1d05f
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 0x1d046
cmpb $0x0, (%r14)
je 0x1d042
incl 0x8(%rax)
jmp 0x1d046
lock
incl 0x8(%rax)
leaq 0x48(%rsp), %rsi
callq 0x14db8
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1d05f
callq 0x12250
testq %rbp, %rbp
je 0x1d0c8
movq (%r13), %rax
movslq 0x4(%rax), %rax
cmpq %rax, 0x8(%rsp)
jge 0x1d0c8
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 0x1d0af
cmpb $0x0, (%r14)
je 0x1d0ab
incl 0x8(%rax)
jmp 0x1d0af
lock
incl 0x8(%rax)
leaq 0x38(%rsp), %rsi
callq 0x14db8
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1d0c8
callq 0x12250
testq %r12, %r12
je 0x1d132
movq (%r13), %rax
movslq (%rax), %rax
cmpq %rax, %r15
jge 0x1d132
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 0x1d119
cmpb $0x0, (%r14)
je 0x1d115
incl 0x8(%rax)
jmp 0x1d119
lock
incl 0x8(%rax)
leaq 0x28(%rsp), %rsi
callq 0x14db8
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1d132
callq 0x12250
movq (%r13), %rax
movslq (%rax), %rcx
cmpq %rcx, %r15
jge 0x1d1a2
movslq 0x4(%rax), %rax
cmpq %rax, 0x8(%rsp)
jge 0x1d1a2
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 0x1d189
cmpb $0x0, (%r14)
je 0x1d185
incl 0x8(%rax)
jmp 0x1d189
lock
incl 0x8(%rax)
leaq 0x18(%rsp), %rsi
callq 0x14db8
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1d1a2
callq 0x12250
leaq (,%rbp,8), %rax
movq %r14, %r15
movq %rbp, %r14
movq %r13, %rbp
leaq (%rax,%rax,2), %r13
movq (%rbx), %rax
movq 0x18(%rbx), %rsi
movq (%rax,%r13), %rax
movq (%rax,%r12), %rdi
callq 0x1bf48
movq (%rbx), %rax
movq (%rax,%r13), %rax
movq (%rax,%r12), %r13
movq %r13, %rdi
callq 0x14f2c
movq %r13, %rdi
movq %rbp, %r13
movq %r14, %rbp
movq %r15, %r14
movq 0x98(%rsp), %r15
movl %eax, %esi
callq 0x14da6
movq 0x20(%rbx), %rax
movslq 0x4(%rax), %rax
addq $0x10, %r12
cmpq %rax, 0x8(%rsp)
jl 0x1ce6c
incq %rbp
movq (%r13), %rax
movslq (%rax), %rax
cmpq %rax, %rbp
jl 0x1ce2e
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 0x1d2b5
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x5280
jmp 0x1d2b5
movq %rax, %rbx
movq 0x20(%rsp), %rdi
jmp 0x1d2ab
movq %rax, %rbx
movq 0x40(%rsp), %rdi
jmp 0x1d2ab
movq %rax, %rbx
movq 0x30(%rsp), %rdi
jmp 0x1d2ab
movq %rax, %rbx
movq 0x60(%rsp), %rdi
jmp 0x1d2ab
movq %rax, %rbx
movq 0x70(%rsp), %rdi
jmp 0x1d2ab
movq %rax, %rbx
movq 0x50(%rsp), %rdi
jmp 0x1d2ab
movq %rax, %rbx
movq 0x90(%rsp), %rdi
jmp 0x1d2ab
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x1d2b5
callq 0x12250
movq %rbx, %rdi
callq 0x53e0
nop