// File: /workspace/github_cpp_makefile_star2_O2/MatthewZMD[P]TetrisDual/concreteboard.cc
// Function: ConcreteBoard::ConcreteBoard(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
ConcreteBoard::ConcreteBoard(int boardNum, std::string fileName, int l): boardNum { boardNum }, score{ 0 }, countTurn{ 0 }, boardInfo{} {
    countD = 0;
    level = std::make_shared<Level0>(fileName);
    while(l > 0){
        level = level->levelUp();
        --l;
    }
    allCells.clear();
    std::vector<Cell> temp;
    for (int i = 0; i < 18; ++i) {
        for (int j = 0; j < 11; ++j) {
            Coordinate pos{i, j};
            temp.emplace_back(Cell(pos));
        }
        allCells.emplace_back(temp);
        temp.clear();
    }
    for (int i = 0; i < 18; ++i) {
        for (int j = 0; j < 11; ++j) {
            if (i != 17) {
                allCells[i][j].attach(&(allCells[i + 1][j]));
            }
            if (i != 0) {
                allCells[i][j].attach(&(allCells[i - 1][j]));
            }
        }
    }

    nextType = level->genBlock();
    genThis();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %ecx, %ebp
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
andq $0x0, 0x28(%rdi)
movups %xmm0, 0x8(%rdi)
leaq 0x13289(%rip), %rax     # 0x1b478
movq %rax, (%rdi)
addq $0x30, %rdi
movq %rdi, 0x18(%rsp)
callq 0x8184
movl %r15d, 0x44(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rbx)
leaq 0x78(%rbx), %r15
andq $0x0, 0x6c(%rbx)
leaq 0x98(%rbx), %rdi
movups %xmm0, 0x5c(%rbx)
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x81(%rbx)
movq %rdi, 0x10(%rsp)
movq %rbx, 0x8(%rsp)
callq 0x7b28
andl $0x0, 0x40(%rbx)
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
callq 0x985a
addq $0x60, %rbx
leaq 0x48(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9d84
leaq 0x50(%rsp), %rdi
callq 0x5c18
leaq 0x50(%rsp), %r12
testl %ebp, %ebp
jle 0x8294
movq (%rbx), %rsi
movq (%rsi), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9db2
movq %r12, %rdi
callq 0x5c18
decl %ebp
jmp 0x826d
movq %rbx, 0x20(%rsp)
movq %r15, %rdi
callq 0x9878
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rbp
movaps %xmm0, (%rbp)
andq $0x0, 0x10(%rbp)
xorl %r12d, %r12d
leaq 0x48(%rsp), %r14
movabsq $0x100000000, %r13      # imm = 0x100000000
cmpq $0x12, %r12
je 0x8318
movq %r12, 0x28(%rsp)
pushq $0xb
popq %rbx
subq $0x1, %rbx
jb 0x82fb
movq %r14, %rdi
movq %r12, %rsi
callq 0x7da0
movq %rbp, %rdi
movq %r14, %rsi
callq 0x9880
movq %r14, %rdi
callq 0x98c0
addq %r13, %r12
jmp 0x82d2
movq %r15, %rdi
movq %rbp, %rsi
callq 0x9912
movq %rbp, %rdi
callq 0x994e
movq 0x28(%rsp), %r12
incq %r12
jmp 0x82c4
xorl %ebx, %ebx
pushq $0x8
popq %r14
cmpq $0x12, %rbx
je 0x8385
imulq $0x18, %rbx, %r12
movq %r14, %r13
cmpq $0x638, %r13            # imm = 0x638
je 0x8380
cmpq $0x11, %rbx
je 0x835b
movq (%r15), %rax
movq (%rax,%r12), %rdi
addq %r13, %rdi
movq 0x18(%rax,%r12), %rax
leaq (%rax,%r13), %rsi
addq $-0x8, %rsi
callq 0xda5c
testq %rbx, %rbx
je 0x8377
movq (%r15), %rax
movq (%rax,%r12), %rdi
addq %r13, %rdi
movq -0x18(%rax,%r12), %rax
leaq (%rax,%r13), %rsi
addq $-0x8, %rsi
callq 0xda5c
addq $0x90, %r13
jmp 0x832b
incq %rbx
jmp 0x831e
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
callq *(%rax)
movq 0x8(%rsp), %rdi
movl %eax, 0x58(%rdi)
movq (%rdi), %rax
callq *0x40(%rax)
leaq 0x30(%rsp), %rdi
callq 0x9956
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x83cc
movq %rax, %r13
jmp 0x83f9
movq %rax, %r13
jmp 0x8422
jmp 0x83e2
jmp 0x83e2
movq %rax, %r13
jmp 0x83ef
jmp 0x83e2
movq %rax, %r13
leaq 0x48(%rsp), %rdi
callq 0x98c0
jmp 0x83e5
movq %rax, %r13
leaq 0x30(%rsp), %rdi
callq 0x9956
movq 0x10(%rsp), %rdi
callq 0x7b98
movq %r15, %rdi
callq 0x9978
movq 0x8(%rsp), %rbx
leaq 0x68(%rbx), %rdi
callq 0x5c18
leaq 0x50(%rbx), %rdi
callq 0x5c18
movq 0x18(%rsp), %rdi
callq 0xda50
movq %rbx, %rdi
callq 0x72fa
movq %r13, %rdi
callq 0x54b0