// File: /workspace/github_cpp_makefile_star2_O1/MatthewZMD[P]TetrisDual/concreteboard.cc
// Function: ConcreteBoard::right(int)
int ConcreteBoard::right(int time){
    bool exist = false;
    bool isValidMove = true;
    while (time != 0){
        for (auto &i : thisBlock->cells){
            for (auto &j : thisBlock->cells){
                if (i->pos.col + 1 == j->pos.col && i->pos.row == j->pos.row){
                    exist = true;
                }
            }
            if (!exist){
                if (i->pos.col == 10 || !allCells[i->pos.row][i->pos.col + 1].isEmpty()){
                    isValidMove = false;
                }
            }
            exist = false;
        }
        if (isValidMove) {
            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][i->pos.col + 1]));
                i->restore();
            }
            thisBlock = std::make_shared<Block>(curType, curLevel, temp);
            thisBlock->recaliBtmLft();
            --time;
        } else {
            break;
        }
    }
    if (level->heavyOffset()){
        down(1);
    }
    notifyObservers();
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movl %esi, 0x24(%rsp)
testl %esi, %esi
je 0x8f8d
movb $0x1, %r13b
leaq 0x30(%rsp), %r12
movl $0x1, %r14d
movq 0x48(%rbx), %rax
movq (%rax), %rbp
movq 0x8(%rax), %r15
cmpq %r15, %rbp
je 0x8e84
movq 0x48(%rbx), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
cmpq %rcx, %rax
je 0x8e3e
movq (%rbp), %rdx
movl 0x5c(%rdx), %esi
incl %esi
xorl %edi, %edi
movq (%rax), %r8
cmpl 0x5c(%r8), %esi
jne 0x8e2f
movl 0x58(%rdx), %r9d
cmpl 0x58(%r8), %r9d
movzbl %dil, %edi
cmovel %r14d, %edi
addq $0x8, %rax
cmpq %rcx, %rax
jne 0x8e16
testb $0x1, %dil
jne 0x8e7b
movq (%rbp), %rcx
movslq 0x5c(%rcx), %rax
cmpq $0xa, %rax
je 0x8e78
movslq 0x58(%rcx), %rcx
movq 0x78(%rbx), %rdx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
leaq (%rax,%rax,8), %rax
shlq $0x4, %rax
leaq (%rcx,%rax), %rdi
addq $0x90, %rdi
callq 0x8784
testb %al, %al
jne 0x8e7b
xorl %r13d, %r13d
addq $0x8, %rbp
jmp 0x8df2
testb $0x1, %r13b
je 0x8f8d
movq 0x48(%rbx), %rax
movq (%rax), %rcx
movq (%rcx), %rcx
movl 0x64(%rcx), %edx
movl %edx, 0x2c(%rsp)
movl 0x60(%rcx), %ecx
movl %ecx, 0x28(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq (%rax), %r15
movq 0x8(%rax), %rbp
cmpq %rbp, %r15
je 0x8f0b
movq (%r15), %rax
movslq 0x58(%rax), %rcx
movq 0x78(%rbx), %rdx
leaq (%rcx,%rcx,2), %rcx
movslq 0x5c(%rax), %rax
movq (%rdx,%rcx,8), %rcx
leaq (%rax,%rax,8), %rax
shlq $0x4, %rax
addq %rcx, %rax
addq $0x90, %rax
movq %rax, 0x10(%rsp)
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0xadec
movq (%r15), %rdi
callq 0x85dc
addq $0x8, %r15
jmp 0x8ebe
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0xf(%rsp), %rdx
leaq 0x2c(%rsp), %rcx
leaq 0x28(%rsp), %r8
movq %r12, %r9
callq 0xbb34
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x50(%rbx), %rdi
movups %xmm0, 0x48(%rbx)
testq %rdi, %rdi
je 0x8f54
callq 0x5f3e
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x8f63
callq 0x5f3e
movq 0x48(%rbx), %rdi
callq 0x7ae0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x8f83
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x52e0
decl 0x24(%rsp)
jne 0x8de7
movq 0x60(%rbx), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testl %eax, %eax
je 0x8fa9
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x1, %esi
callq *0x20(%rax)
movq %rbx, %rdi
callq 0xedfe
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8fc8
jmp 0x8fc8
jmp 0x8fc8
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x8fe2
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x52e0
movq %rbx, %rdi
callq 0x54e0