// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movl %esi, %r14d
movq %rdi, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x8(%rdi)
movq $0x0, 0x28(%rdi)
leaq 0x12afa(%rip), %rax     # 0x1b490
movq %rax, (%rdi)
addq $0x30, %rdi
movq %rdi, 0x30(%rsp)
movq %r15, (%rsp)
callq 0x8928
movl %r14d, 0x44(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%r15)
leaq 0x78(%r15), %rax
movq %rax, 0x8(%rsp)
leaq 0x98(%r15), %rdi
movups %xmm0, 0x5c(%r15)
movq $0x0, 0x6c(%r15)
movups %xmm0, 0x78(%r15)
movups %xmm0, 0x81(%r15)
movq %rdi, 0x28(%rsp)
callq 0x8220
movl $0x0, 0x40(%r15)
leaq 0x48(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x40(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rcx
callq 0xae7e
movaps 0x40(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x40(%rsp)
movq 0x68(%r15), %rdi
movups %xmm0, 0x60(%r15)
testq %rdi, %rdi
je 0x8a32
callq 0x5f3e
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x8a41
callq 0x5f3e
testl %ebp, %ebp
jle 0x8a93
incl %ebp
leaq 0x40(%rsp), %rbx
movq (%rsp), %r14
movq 0x60(%r14), %rsi
movq (%rsi), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movaps 0x40(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x40(%rsp)
movq 0x68(%r14), %rdi
movups %xmm0, 0x60(%r14)
testq %rdi, %rdi
je 0x8a7d
callq 0x5f3e
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x8a8c
callq 0x5f3e
decl %ebp
cmpl $0x1, %ebp
jg 0x8a50
movq (%rsp), %rax
movq 0x78(%rax), %r14
movq 0x80(%rax), %r15
cmpq %r14, %r15
je 0x8ac6
movq %r14, %rbx
movq %rbx, %rdi
callq 0xad1e
addq $0x18, %rbx
cmpq %r15, %rbx
jne 0x8aaa
movq (%rsp), %rax
movq %r14, 0x80(%rax)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
xorl %ebx, %ebx
leaq 0x40(%rsp), %r12
leaq 0x12891(%rip), %r15     # 0x1b378
leaq 0x10(%r15), %rbp
addq $0x30, %r15
movabsq $0x100000000, %r13      # imm = 0x100000000
movl $0xb, %r14d
movq %rbx, 0x38(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x84d0
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0xac48
movq %rbp, 0x40(%rsp)
movq %r15, 0x48(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xeddc
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x8b50
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x52e0
leaq 0x68(%rsp), %rdi
callq 0x88e4
leaq 0x1269f(%rip), %rax     # 0x1b200
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x8b7d
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x52e0
addq %r13, %rbx
decq %r14
jne 0x8b04
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0xace8
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xba28
movq 0x38(%rsp), %rbx
incq %rbx
cmpq $0x12, %rbx
jne 0x8af9
xorl %ebx, %ebx
leaq (%rbx,%rbx,2), %r14
xorl %r15d, %r15d
cmpq $0x11, %rbx
je 0x8bef
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rax,%r14,8), %rcx
leaq (%rcx,%r15), %rdi
addq $0x8, %rdi
movq 0x18(%rax,%r14,8), %rsi
addq %r15, %rsi
callq 0xede8
testq %rbx, %rbx
je 0x8c10
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rax,%r14,8), %rcx
leaq (%rcx,%r15), %rdi
addq $0x8, %rdi
movq -0x18(%rax,%r14,8), %rsi
addq %r15, %rsi
callq 0xede8
addq $0x90, %r15
cmpq $0x630, %r15            # imm = 0x630
jne 0x8bc3
incq %rbx
cmpq $0x12, %rbx
jne 0x8bbc
movq (%rsp), %rbx
movq 0x60(%rbx), %rdi
movq (%rdi), %rax
callq *(%rax)
movl %eax, 0x58(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x40(%rax)
leaq 0x10(%rsp), %rdi
callq 0xad1e
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8c6c
movq %rax, %r14
jmp 0x8c9b
movq %rax, %r14
jmp 0x8cd3
jmp 0x8c84
movq %rax, %r14
jmp 0x8c91
jmp 0x8c84
jmp 0x8c84
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0xac80
jmp 0x8c87
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0xad1e
movq 0x28(%rsp), %rdi
callq 0x8292
movq 0x8(%rsp), %rdi
callq 0xad4e
movq (%rsp), %rax
movq 0x68(%rax), %rdi
testq %rdi, %rdi
je 0x8cb7
callq 0x5f3e
movq (%rsp), %rax
movq 0x50(%rax), %rdi
testq %rdi, %rdi
je 0x8cc9
callq 0x5f3e
movq 0x30(%rsp), %rdi
callq 0xeddc
movq (%rsp), %rdi
callq 0xad90
movq %r14, %rdi
callq 0x54e0