// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movslq 0x108(%rdi), %rax
movq %rdi, (%rsp)
movq (%rdi), %rcx
leaq (%rax,%rax,2), %rdx
movq -0x18(%rcx,%rdx,8), %rbx
cmpq -0x10(%rcx,%rdx,8), %rbx
je 0xd732
movq (%rsp), %rdx
addq $0xe0, %rdx
movq %rdx, 0x8(%rsp)
leaq 0x17797(%rip), %r14     # 0x24d60
movq (%rbx), %r15
cmpq 0x8(%rbx), %r15
je 0xd71c
movq (%r15), %rdi
testq %rdi, %rdi
je 0xd701
movq %r14, %rsi
leaq 0x16eac(%rip), %rdx     # 0x24498
xorl %ecx, %ecx
callq 0x5230
testq %rax, %rax
je 0xd701
movq 0x8(%r15), %rbp
testq %rbp, %rbp
je 0xd61a
movq 0x179b4(%rip), %rax     # 0x24fc0
cmpb $0x0, (%rax)
je 0xd616
incl 0x8(%rbp)
jmp 0xd61a
lock
incl 0x8(%rbp)
movq (%r15), %rdi
callq 0x1a8d2
cmpb $0x2e, %al
jne 0xd647
movq %r14, %r12
movq (%r15), %rdi
movq 0x8(%r15), %r14
testq %r14, %r14
je 0xd662
movq 0x17984(%rip), %rax     # 0x24fc0
cmpb $0x0, (%rax)
je 0xd65d
incl 0x8(%r14)
jmp 0xd662
testq %rbp, %rbp
je 0xd701
movq %rbp, %rdi
callq 0x7828
jmp 0xd701
lock
incl 0x8(%r14)
callq 0x1aa58
movl %eax, %r13d
testq %r14, %r14
je 0xd677
movq %r14, %rdi
callq 0x7828
testq %rbp, %rbp
je 0xd684
movq %rbp, %rdi
callq 0x7828
testl %r13d, %r13d
movq %r12, %r14
jns 0xd701
movq (%rsp), %rax
movq 0xe8(%rax), %r13
subq 0xe0(%rax), %r13
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq (%r15), %rdi
callq 0x1a8d6
movq %rax, %r14
movq (%r15), %rdi
callq 0x1a8d6
leaq 0x10(%rsp), %rbp
shrq $0x3, %r13
imull $0xaaaaaaab, %r13d, %ecx # imm = 0xAAAAAAAB
incl %ecx
shrq $0x20, %rax
movq (%rsp), %rdi
movl %r14d, %esi
movl %eax, %edx
movq %rbp, %r8
callq 0xec3e
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x15b32
movq %rbp, %rdi
callq 0x7636
movq %r12, %r14
addq $0x10, %r15
cmpq 0x8(%rbx), %r15
jne 0xd5d6
movq (%rsp), %rcx
movl 0x108(%rcx), %eax
movq (%rcx), %rcx
addq $0x18, %rbx
movslq %eax, %rdx
leaq (%rdx,%rdx,2), %rdx
cmpq -0x10(%rcx,%rdx,8), %rbx
jne 0xd5c9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd745
jmp 0xd745
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x7636
jmp 0xd776
movq %rax, %rbx
testq %r14, %r14
je 0xd769
movq %r14, %rdi
callq 0x7828
jmp 0xd769
movq %rax, %rbx
testq %rbp, %rbp
je 0xd776
movq %rbp, %rdi
callq 0x7828
movq %rbx, %rdi
callq 0x5380