// File: /workspace/github_cpp_makefile_star2_O1/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 $0x48, %rsp
movq %rdi, %rbx
movl $0x1, %r12d
movl %esi, %eax
movq %rax, 0x10(%rsp)
testl %eax, %eax
je 0x9865
movq 0x48(%rbx), %rax
movq (%rax), %r13
movq 0x8(%rax), %r15
cmpq %r15, %r13
sete %bpl
je 0x9756
xorl %r14d, %r14d
movq 0x48(%rbx), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
cmpq %rcx, %rax
je 0x96ef
movq (%r13), %rdx
movl 0x58(%rdx), %esi
incl %esi
movq (%rax), %rdi
cmpl 0x58(%rdi), %esi
jne 0x96e6
movl 0x5c(%rdx), %r8d
cmpl 0x5c(%rdi), %r8d
movzbl %r14b, %r14d
cmovel %r12d, %r14d
addq $0x8, %rax
cmpq %rcx, %rax
jne 0x96ce
testb $0x1, %r14b
je 0x96fc
movb $0x1, %al
xorl %r14d, %r14d
jmp 0x972e
movq (%r13), %rax
movslq 0x58(%rax), %rcx
cmpq $0x11, %rcx
je 0x972c
movq 0x78(%rbx), %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 0x8784
testb %al, %al
jne 0x96f5
xorl %eax, %eax
testb %al, %al
je 0x9745
addq $0x8, %r13
cmpq %r15, %r13
sete %bpl
jne 0x96b5
jmp 0x9756
movq 0x10(%rsp), %rax
movl %eax, %esi
testb $0x1, %bpl
je 0x985b
movq 0x48(%rbx), %rax
movq (%rax), %rcx
movq (%rcx), %rcx
movl 0x64(%rcx), %edx
movl %edx, 0x1c(%rsp)
movl 0x60(%rcx), %ecx
movl %ecx, 0x18(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq (%rax), %r14
movq 0x8(%rax), %r15
cmpq %r15, %r14
leaq 0x20(%rsp), %r13
je 0x97d3
movq (%r14), %rax
movslq 0x58(%rax), %rcx
movq 0x78(%rbx), %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, 0x20(%rsp)
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0xadec
movq (%r14), %rdi
callq 0x85dc
addq $0x8, %r14
cmpq %r15, %r14
jne 0x9790
movq $0x0, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
leaq 0xf(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x30(%rsp), %r9
callq 0xbb34
movaps 0x20(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x20(%rsp)
movq 0x50(%rbx), %rdi
movups %xmm0, 0x48(%rbx)
testq %rdi, %rdi
je 0x981c
callq 0x5f3e
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x982b
callq 0x5f3e
movq 0x48(%rbx), %rdi
callq 0x7ae0
movq %rbx, %rdi
callq 0xedfe
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x9853
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x52e0
movq 0x10(%rsp), %rax
leal -0x1(%rax), %esi
testb $0x1, %bpl
jne 0x968b
cmpl $0x0, 0x10(%rsp)
sete %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9882
jmp 0x9882
jmp 0x9882
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x989c
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x52e0
movq %rbx, %rdi
callq 0x54e0