// File: /workspace/github_cpp_makefile_star2_O1/kaiming[P]Chamber-Crawler-3k/Board/board.cc
// Function: Board::assignChambers()
void Board::assignChambers() {
    // Iterate through floor
    for (auto it_y = floors[floorNum-1].begin(); it_y != floors[floorNum-1].end(); ++it_y) {
        for (auto it_x = it_y->begin(); it_x != it_y->end(); ++it_x) {
            // Check if walkable tile and unidentified chamber floor
            if (std::dynamic_pointer_cast<WalkableTile>(*it_x) && (*it_x)->getType() == '.' && std::static_pointer_cast<WalkableTile>(*it_x)->getRoom() < 0) {
                // Begin depth first search algorithm, call helper function
                // Determine current chamber
                int chamberNum = static_cast<int>(chambers.size()) + 1;
                std::vector<std::shared_ptr<WalkableTile>> chamber; 
                
                // Enter recursive function
                tileDFS((*it_x)->getCoord().first, (*it_x)->getCoord().second, chamberNum, chamber);
                
                // Store current chamber
                chambers.emplace_back(chamber);
            } 

        }
    } // Finished identifying tiles to their chambers
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movslq 0x108(%rdi), %rax
movq %rdi, 0x10(%rsp)
movq (%rdi), %rcx
leaq (%rax,%rax,2), %rax
movq -0x18(%rcx,%rax,8), %rbx
cmpq -0x10(%rcx,%rax,8), %rbx
je 0xd8f0
movq 0x10(%rsp), %rax
addq $0xe0, %rax
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %r15
movq (%rbx), %r12
cmpq 0x8(%rbx), %r12
je 0xd8ce
movq (%r12), %rdi
testq %rdi, %rdi
je 0xd7a5
leaq 0x185d1(%rip), %rsi     # 0x25d60
leaq 0x17d02(%rip), %rdx     # 0x25498
xorl %ecx, %ecx
callq 0x5240
testq %rax, %rax
sete %al
jmp 0xd7a7
movb $0x1, %al
testb %al, %al
je 0xd7b0
xorl %r13d, %r13d
jmp 0xd7d1
movq 0x8(%r12), %r13
testq %r13, %r13
je 0xd7d1
movq 0x187ff(%rip), %rcx     # 0x25fc0
cmpb $0x0, (%rcx)
je 0xd7cc
incl 0x8(%r13)
jmp 0xd7d1
lock
incl 0x8(%r13)
movb $0x1, %r14b
testb %al, %al
jne 0xd80e
movq (%r12), %rdi
callq 0x1ad92
cmpb $0x2e, %al
jne 0xd80e
movq (%r12), %rdi
movq 0x8(%r12), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0xd81b
movq 0x187c1(%rip), %rax     # 0x25fc0
cmpb $0x0, (%rax)
je 0xd812
movq 0x8(%rsp), %rax
incl 0x8(%rax)
jmp 0xd81b
xorl %ebp, %ebp
jmp 0xd828
movq 0x8(%rsp), %rax
lock
incl 0x8(%rax)
callq 0x1af18
movl %eax, %ebp
shrl $0x1f, %ebp
xorl %r14d, %r14d
testb %r14b, %r14b
jne 0xd83f
cmpq $0x0, 0x8(%rsp)
je 0xd83f
movq 0x8(%rsp), %rdi
callq 0x78e4
testq %r13, %r13
je 0xd84c
movq %r13, %rdi
callq 0x78e4
testb %bpl, %bpl
je 0xd8c5
movq 0x10(%rsp), %rax
movq 0xe8(%rax), %r14
subq 0xe0(%rax), %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq (%r12), %rdi
callq 0x1ad96
movq %rax, %r13
movq (%r12), %rdi
callq 0x1ad96
movq %r15, %rbp
shrq $0x3, %r14
imull $0xaaaaaaab, %r14d, %ecx # imm = 0xAAAAAAAB
incl %ecx
shrq $0x20, %rax
movq 0x10(%rsp), %rdi
movl %r13d, %esi
movl %eax, %edx
movq %r15, %r8
callq 0xf064
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x15f38
movq %rbp, %rdi
callq 0x7700
addq $0x10, %r12
jmp 0xd775
addq $0x18, %rbx
movq 0x10(%rsp), %rcx
movslq 0x108(%rcx), %rax
movq (%rcx), %rcx
leaq (%rax,%rax,2), %rax
cmpq -0x10(%rcx,%rax,8), %rbx
jne 0xd772
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xd91a
callq 0x78e4
jmp 0xd91a
jmp 0xd929
jmp 0xd929
movq %rax, %rbx
testq %r13, %r13
je 0xd936
movq %r13, %rdi
callq 0x78e4
jmp 0xd936
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x7700
movq %rbx, %rdi
callq 0x5390