// File: 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
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdx, -0x130(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0xe840
movq -0x128(%rbp), %rdi
leaq 0x32a72(%rip), %rax     # 0x43480
movq %rax, (%rdi)
addq $0x30, %rdi
movq %rdi, -0x120(%rbp)
callq 0x10900
jmp 0x10a23
movq -0x128(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, 0x44(%rdi)
addq $0x48, %rdi
movq %rdi, -0x150(%rbp)
callq 0x139f0
movq -0x128(%rbp), %rdi
movl $0x0, 0x5c(%rdi)
addq $0x60, %rdi
movq %rdi, -0x148(%rbp)
callq 0x13a10
movq -0x128(%rbp), %rdi
movl $0x0, 0x70(%rdi)
addq $0x78, %rdi
movq %rdi, -0x140(%rbp)
callq 0x13a30
movq -0x128(%rbp), %rdi
movb $0x0, 0x90(%rdi)
addq $0x98, %rdi
movq %rdi, -0x138(%rbp)
callq 0xed00
jmp 0x10a9f
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rax
movl $0x0, 0x40(%rax)
leaq -0x40(%rbp), %rdi
callq 0x13a50
jmp 0x10abf
movq -0x128(%rbp), %rdi
addq $0x60, %rdi
leaq -0x40(%rbp), %rsi
callq 0x13ac0
leaq -0x40(%rbp), %rdi
callq 0x13af0
cmpl $0x0, -0x1c(%rbp)
jle 0x10b5f
movq -0x128(%rbp), %rdi
addq $0x60, %rdi
callq 0x13b10
movq %rax, %rsi
movq (%rsi), %rax
movq 0x10(%rax), %rax
leaq -0x50(%rbp), %rdi
callq *%rax
jmp 0x10b04
movq -0x128(%rbp), %rdi
addq $0x60, %rdi
leaq -0x50(%rbp), %rsi
callq 0x13b30
leaq -0x50(%rbp), %rdi
callq 0x13b60
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x10adc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x10e2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x10dfd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x10df1
movq -0x128(%rbp), %rdi
addq $0x78, %rdi
callq 0x13b80
leaq -0x68(%rbp), %rdi
callq 0x13ba0
movl $0x0, -0x6c(%rbp)
cmpl $0x12, -0x6c(%rbp)
jge 0x10c4a
movl $0x0, -0x70(%rbp)
cmpl $0xb, -0x70(%rbp)
jge 0x10c1d
movl -0x6c(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x74(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0xfbc0
jmp 0x10bc6
leaq -0x68(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x13bc0
jmp 0x10bd8
leaq -0x108(%rbp), %rdi
callq 0x13c40
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x10b90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x10de8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x13c40
jmp 0x10de8
movq -0x128(%rbp), %rdi
addq $0x78, %rdi
leaq -0x68(%rbp), %rsi
callq 0x13cb0
jmp 0x10c33
leaq -0x68(%rbp), %rdi
callq 0x13d30
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x10b7f
movl $0x0, -0x114(%rbp)
cmpl $0x12, -0x114(%rbp)
jge 0x10d98
movl $0x0, -0x118(%rbp)
cmpl $0xb, -0x118(%rbp)
jge 0x10d82
cmpl $0x11, -0x114(%rbp)
je 0x10cf2
movq -0x128(%rbp), %rdi
addq $0x78, %rdi
movq %rdi, -0x160(%rbp)
movslq -0x114(%rbp), %rsi
callq 0x13d50
movq %rax, %rdi
movslq -0x118(%rbp), %rsi
callq 0x13d70
movq -0x160(%rbp), %rdi
addq $0x8, %rax
movq %rax, -0x158(%rbp)
movl -0x114(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x13d50
movq %rax, %rdi
movslq -0x118(%rbp), %rsi
callq 0x13d70
movq -0x158(%rbp), %rdi
movq %rax, %rsi
callq 0x25400
jmp 0x10cf0
jmp 0x10cf2
cmpl $0x0, -0x114(%rbp)
je 0x10d6c
movq -0x128(%rbp), %rdi
addq $0x78, %rdi
movq %rdi, -0x170(%rbp)
movslq -0x114(%rbp), %rsi
callq 0x13d50
movq %rax, %rdi
movslq -0x118(%rbp), %rsi
callq 0x13d70
movq -0x170(%rbp), %rdi
addq $0x8, %rax
movq %rax, -0x168(%rbp)
movl -0x114(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x13d50
movq %rax, %rdi
movslq -0x118(%rbp), %rsi
callq 0x13d70
movq -0x168(%rbp), %rdi
movq %rax, %rsi
callq 0x25400
jmp 0x10d6a
jmp 0x10d6c
jmp 0x10d6e
movl -0x118(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x118(%rbp)
jmp 0x10c6b
jmp 0x10d84
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0x10c54
movq -0x128(%rbp), %rdi
addq $0x60, %rdi
callq 0x13b10
movq %rax, %rdi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movl %eax, -0x174(%rbp)
jmp 0x10dbb
movq -0x128(%rbp), %rdi
movl -0x174(%rbp), %eax
movl %eax, 0x58(%rdi)
movq (%rdi), %rax
movq 0x40(%rax), %rax
callq *%rax
jmp 0x10dd6
leaq -0x68(%rbp), %rdi
callq 0x13d90
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
leaq -0x68(%rbp), %rdi
callq 0x13d90
movq -0x138(%rbp), %rdi
callq 0xee00
movq -0x140(%rbp), %rdi
callq 0x13df0
movq -0x148(%rbp), %rdi
callq 0x13b60
movq -0x150(%rbp), %rdi
callq 0x13e50
movq -0x120(%rbp), %rdi
callq 0x10300
movq -0x128(%rbp), %rdi
callq 0xc540
movq -0x28(%rbp), %rdi
callq 0x6630
nopw %cs:(%rax,%rax)