// File: /workspace/github_cpp_makefile_star2_O3/MatthewZMD[P]TetrisDual/concreteboard.cc
// Function: ConcreteBoard::down(int)
bool ConcreteBoard::down(int time){
    while (time != 0) {
        bool exist = false;
        for (auto &i : thisBlock->cells){
            for (auto &j : thisBlock->cells){
                if (i->pos.row + 1 == j->pos.row && i->pos.col == j->pos.col)
                    {
                        exist = true;
                    }
            }
            if (!exist){
                if (i->pos.row == 17 || !allCells[i->pos.row + 1][i->pos.col].isEmpty())
                    {
                        return false;
                    }
            }
            exist = false;
        }
        CellType curType = thisBlock->cells[0]->type;
        int curLevel = thisBlock->cells[0]->blockLevel;
        std::vector<Cell*> temp;
        for (auto &i : thisBlock->cells){
            temp.emplace_back(&(allCells[i->pos.row + 1][i->pos.col]));
            i->restore();
        }
        thisBlock = std::make_shared<Block>(curType, curLevel, temp);
        thisBlock->recaliBtmLft();
        --time;
        notifyObservers();
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movb $0x1, %al
testl %esi, %esi
je 0x97cf
movl %esi, %ebp
movq %rdi, %r14
leaq 0x10(%rsp), %r12
leaq 0x20(%rsp), %r15
movq 0x48(%r14), %rax
movq (%rax), %r13
movq 0x8(%rax), %rbx
cmpq %rbx, %r13
je 0x96cf
movq 0x48(%r14), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rsi
movq (%r13), %rax
movslq 0x58(%rax), %rcx
cmpq %rsi, %rdx
je 0x969a
leal 0x1(%rcx), %r8d
xorl %edi, %edi
movq (%rdx), %r9
cmpl 0x58(%r9), %r8d
jne 0x968b
movl 0x5c(%rax), %r10d
cmpl 0x5c(%r9), %r10d
sete %r9b
orb %r9b, %dil
addq $0x8, %rdx
cmpq %rsi, %rdx
jne 0x9673
testb $0x1, %dil
jne 0x96c9
cmpl $0x11, %ecx
je 0x97cd
movq 0x78(%r14), %rdx
leaq (%rcx,%rcx,2), %rcx
movslq 0x5c(%rax), %rax
leaq (%rax,%rax,8), %rdi
shlq $0x4, %rdi
addq 0x18(%rdx,%rcx,8), %rdi
callq 0x8760
testb %al, %al
je 0x97cd
addq $0x8, %r13
jmp 0x9650
movq 0x48(%r14), %rax
movq (%rax), %rcx
movq (%rcx), %rcx
movl 0x64(%rcx), %edx
movl %edx, 0xc(%rsp)
movl 0x60(%rcx), %ecx
movl %ecx, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq (%rax), %rbx
movq 0x8(%rax), %r13
cmpq %r13, %rbx
je 0x9742
movq (%rbx), %rax
movslq 0x58(%rax), %rcx
movq 0x78(%r14), %rdx
leaq (%rcx,%rcx,2), %rcx
movslq 0x5c(%rax), %rax
leaq (%rax,%rax,8), %rax
shlq $0x4, %rax
addq 0x18(%rdx,%rcx,8), %rax
movq %rax, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xaca0
movq (%rbx), %rdi
callq 0x85bc
addq $0x8, %rbx
jmp 0x96ff
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
leaq 0x7(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x8(%rsp), %r8
movq %r15, %r9
callq 0xb9d4
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x50(%r14), %rdi
movups %xmm0, 0x48(%r14)
testq %rdi, %rdi
je 0x9799
callq 0x5f5e
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x9799
callq 0x5f5e
movq 0x48(%r14), %rdi
callq 0x7ad0
movq %r14, %rdi
callq 0xeb4e
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x97c1
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x52e0
decl %ebp
jne 0x9645
movb $0x1, %al
jmp 0x97cf
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x97e4
jmp 0x97e4
jmp 0x97e4
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x97fe
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x52e0
movq %rbx, %rdi
callq 0x54e0