// File: 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
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x90(%rbp)
movl 0x108(%rdi), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x11e20
movq %rax, %rdi
callq 0x170c0
movq %rax, -0x10(%rbp)
movq -0x90(%rbp), %rdi
movl 0x108(%rdi), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x11e20
movq %rax, %rdi
callq 0x16f30
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x2e190
testb $0x1, %al
jne 0x23531
jmp 0x2379c
leaq -0x10(%rbp), %rdi
callq 0x2e1d0
movq %rax, %rdi
callq 0x17940
movq %rax, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x2e1d0
movq %rax, %rdi
callq 0x177c0
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x2e1f0
testb $0x1, %al
jne 0x23571
jmp 0x2378c
leaq -0x20(%rbp), %rdi
callq 0x2e230
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
callq 0x2e100
leaq -0x38(%rbp), %rdi
callq 0x1ed00
movb %al, %cl
movb $0x0, -0x59(%rbp)
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x91(%rbp)
jne 0x235a7
jmp 0x2362c
leaq -0x20(%rbp), %rdi
callq 0x2e230
movq %rax, %rdi
callq 0x2e250
movq %rax, %rdi
callq 0x3be20
movb %al, -0x92(%rbp)
jmp 0x235c8
movb -0x92(%rbp), %al
movsbl %al, %ecx
xorl %eax, %eax
cmpl $0x2e, %ecx
movb %al, -0x91(%rbp)
jne 0x2362c
leaq -0x20(%rbp), %rdi
callq 0x2e230
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x128c0
movq -0xa0(%rbp), %rdi
movb $0x1, -0x59(%rbp)
callq 0x2e040
movq %rax, %rdi
callq 0x3c0c0
movl %eax, -0x98(%rbp)
jmp 0x2361a
movl -0x98(%rbp), %eax
cmpl $0x0, %eax
setl %al
movb %al, -0x91(%rbp)
movb -0x91(%rbp), %al
movb %al, -0xa1(%rbp)
testb $0x1, -0x59(%rbp)
jne 0x23640
jmp 0x23649
leaq -0x58(%rbp), %rdi
callq 0x99e0
leaq -0x38(%rbp), %rdi
callq 0x99e0
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x23661
jmp 0x2377c
movq -0x90(%rbp), %rdi
addq $0xe0, %rdi
callq 0xd5e0
incl %eax
movl %eax, -0x60(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x8990
leaq -0x20(%rbp), %rdi
callq 0x2e230
movq %rax, %rdi
callq 0x2e250
movq %rax, %rdi
callq 0x3be40
movq %rax, -0xb0(%rbp)
jmp 0x236a4
movq -0xb0(%rbp), %rax
movq %rax, -0x80(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0xbc(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x2e230
movq %rax, %rdi
callq 0x2e250
movq %rax, %rdi
callq 0x3be40
movq %rax, -0xb8(%rbp)
jmp 0x236da
movl -0xbc(%rbp), %esi
movq -0x90(%rbp), %rdi
movq -0xb8(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x84(%rbp), %edx
movl -0x60(%rbp), %ecx
leaq -0x78(%rbp), %r8
callq 0x25970
jmp 0x23709
movq -0x90(%rbp), %rdi
addq $0xe0, %rdi
leaq -0x78(%rbp), %rsi
callq 0x2e270
jmp 0x23722
leaq -0x78(%rbp), %rdi
callq 0x9230
jmp 0x2377c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2375a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0x59(%rbp)
jne 0x2374f
jmp 0x23758
leaq -0x58(%rbp), %rdi
callq 0x99e0
jmp 0x2375a
leaq -0x38(%rbp), %rdi
callq 0x99e0
jmp 0x237a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x9230
jmp 0x237a5
jmp 0x2377e
leaq -0x20(%rbp), %rdi
callq 0x2e2f0
jmp 0x23546
jmp 0x2378e
leaq -0x10(%rbp), %rdi
callq 0x2e310
jmp 0x234f7
addq $0xc0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x6540
nop