// File: 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
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x3f4e0
movq -0xd0(%rbp), %rsi
movq 0x18(%rsi), %rax
movq %rax, -0xc8(%rbp)
addq $0x20, %rsi
leaq -0x20(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x19880
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x3cd50
jmp 0x3ed2a
leaq -0x20(%rbp), %rdi
callq 0x19640
movl $0x0, -0x30(%rbp)
movq -0xd0(%rbp), %rdi
movl -0x30(%rbp), %eax
movl %eax, -0xd4(%rbp)
addq $0x20, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x19850
movq %rax, %rcx
movl -0xd4(%rbp), %eax
cmpl (%rcx), %eax
jge 0x3f4cb
movl $0x0, -0x34(%rbp)
movq -0xd0(%rbp), %rdi
movl -0x34(%rbp), %eax
movl %eax, -0xd8(%rbp)
addq $0x20, %rdi
movl $0x1, %esi
callq 0x19850
movq %rax, %rcx
movl -0xd8(%rbp), %eax
cmpl (%rcx), %eax
jge 0x3f4bb
cmpl $0x0, -0x30(%rbp)
jle 0x3ee5a
movq -0xd0(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x40630
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x2da40
movq %rax, %rdi
callq 0x19df0
movq -0xd0(%rbp), %rdi
movq %rax, -0xe8(%rbp)
movl -0x30(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x40630
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x2da40
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x19e60
movq -0xe8(%rbp), %rdi
movq -0xe0(%rbp), %rsi
callq 0x2c850
jmp 0x3ee1b
leaq -0x48(%rbp), %rdi
callq 0x199a0
jmp 0x3ee5a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x19640
jmp 0x3f4d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x199a0
jmp 0x3f4d4
cmpl $0x0, -0x34(%rbp)
jle 0x3eefc
movq -0xd0(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x40630
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x2da40
movq %rax, %rdi
callq 0x19df0
movq -0xd0(%rbp), %rdi
movq %rax, -0xf8(%rbp)
movslq -0x30(%rbp), %rsi
callq 0x40630
movq %rax, %rdi
movl -0x34(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x2da40
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x19e60
movq -0xf8(%rbp), %rdi
movq -0xf0(%rbp), %rsi
callq 0x2c850
jmp 0x3eed7
leaq -0x58(%rbp), %rdi
callq 0x199a0
jmp 0x3eefc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x199a0
jmp 0x3f4d4
movq -0xd0(%rbp), %rdi
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
addq $0x20, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x19850
movq %rax, %rcx
movl -0xfc(%rbp), %eax
cmpl (%rcx), %eax
jge 0x3efc5
movq -0xd0(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x40630
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x2da40
movq %rax, %rdi
callq 0x19df0
movq -0xd0(%rbp), %rdi
movq %rax, -0x110(%rbp)
movl -0x30(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x40630
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x2da40
movq %rax, %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x19e60
movq -0x110(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x2c850
jmp 0x3efa0
leaq -0x68(%rbp), %rdi
callq 0x199a0
jmp 0x3efc5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x199a0
jmp 0x3f4d4
movq -0xd0(%rbp), %rdi
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
addq $0x20, %rdi
movl $0x1, %esi
callq 0x19850
movq %rax, %rcx
movl -0x114(%rbp), %eax
cmpl (%rcx), %eax
jge 0x3f08f
movq -0xd0(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x40630
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x2da40
movq %rax, %rdi
callq 0x19df0
movq -0xd0(%rbp), %rdi
movq %rax, -0x128(%rbp)
movslq -0x30(%rbp), %rsi
callq 0x40630
movq %rax, %rdi
movl -0x34(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x2da40
movq %rax, %rsi
leaq -0x78(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x19e60
movq -0x128(%rbp), %rdi
movq -0x120(%rbp), %rsi
callq 0x2c850
jmp 0x3f06a
leaq -0x78(%rbp), %rdi
callq 0x199a0
jmp 0x3f08f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x199a0
jmp 0x3f4d4
cmpl $0x0, -0x30(%rbp)
jle 0x3f148
cmpl $0x0, -0x34(%rbp)
jle 0x3f148
movq -0xd0(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x40630
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x2da40
movq %rax, %rdi
callq 0x19df0
movq -0xd0(%rbp), %rdi
movq %rax, -0x138(%rbp)
movl -0x30(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x40630
movq %rax, %rdi
movl -0x34(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x2da40
movq %rax, %rsi
leaq -0x88(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x19e60
movq -0x138(%rbp), %rdi
movq -0x130(%rbp), %rsi
callq 0x2c850
jmp 0x3f11d
leaq -0x88(%rbp), %rdi
callq 0x199a0
jmp 0x3f148
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x199a0
jmp 0x3f4d4
cmpl $0x0, -0x30(%rbp)
jle 0x3f229
movq -0xd0(%rbp), %rdi
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
addq $0x20, %rdi
movl $0x1, %esi
callq 0x19850
movq %rax, %rcx
movl -0x13c(%rbp), %eax
cmpl (%rcx), %eax
jge 0x3f229
movq -0xd0(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x40630
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x2da40
movq %rax, %rdi
callq 0x19df0
movq -0xd0(%rbp), %rdi
movq %rax, -0x150(%rbp)
movl -0x30(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x40630
movq %rax, %rdi
movl -0x34(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x2da40
movq %rax, %rsi
leaq -0x98(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x19e60
movq -0x150(%rbp), %rdi
movq -0x148(%rbp), %rsi
callq 0x2c850
jmp 0x3f1fe
leaq -0x98(%rbp), %rdi
callq 0x199a0
jmp 0x3f229
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x199a0
jmp 0x3f4d4
movq -0xd0(%rbp), %rdi
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
addq $0x20, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x19850
movq %rax, %rcx
movl -0x154(%rbp), %eax
cmpl (%rcx), %eax
jge 0x3f309
cmpl $0x0, -0x34(%rbp)
jle 0x3f309
movq -0xd0(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x40630
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x2da40
movq %rax, %rdi
callq 0x19df0
movq -0xd0(%rbp), %rdi
movq %rax, -0x168(%rbp)
movl -0x30(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x40630
movq %rax, %rdi
movl -0x34(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x2da40
movq %rax, %rsi
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x19e60
movq -0x168(%rbp), %rdi
movq -0x160(%rbp), %rsi
callq 0x2c850
jmp 0x3f2de
leaq -0xa8(%rbp), %rdi
callq 0x199a0
jmp 0x3f309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x199a0
jmp 0x3f4d4
movq -0xd0(%rbp), %rdi
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x16c(%rbp)
addq $0x20, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x19850
movq %rax, %rcx
movl -0x16c(%rbp), %eax
cmpl (%rcx), %eax
jge 0x3f411
movq -0xd0(%rbp), %rdi
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x170(%rbp)
addq $0x20, %rdi
movl $0x1, %esi
callq 0x19850
movq %rax, %rcx
movl -0x170(%rbp), %eax
cmpl (%rcx), %eax
jge 0x3f411
movq -0xd0(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x40630
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x2da40
movq %rax, %rdi
callq 0x19df0
movq -0xd0(%rbp), %rdi
movq %rax, -0x180(%rbp)
movl -0x30(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x40630
movq %rax, %rdi
movl -0x34(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x2da40
movq %rax, %rsi
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x19e60
movq -0x180(%rbp), %rdi
movq -0x178(%rbp), %rsi
callq 0x2c850
jmp 0x3f3e6
leaq -0xb8(%rbp), %rdi
callq 0x199a0
jmp 0x3f411
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x199a0
jmp 0x3f4d4
movq -0xd0(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x40630
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x2da40
movq %rax, %rdi
callq 0x19df0
movq %rax, %rdi
movq -0xd0(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x3b6e0
movq -0xd0(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x40630
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x2da40
movq %rax, %rdi
callq 0x19df0
movq -0xd0(%rbp), %rdi
movq %rax, -0x188(%rbp)
movslq -0x30(%rbp), %rsi
callq 0x40630
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x2da40
movq %rax, %rdi
callq 0x19df0
movq %rax, %rdi
callq 0x2cc40
movq -0x188(%rbp), %rdi
movl %eax, %esi
callq 0x2c7f0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x3ed6f
jmp 0x3f4bd
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x3ed3a
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x6550
nopl (%rax)