// File: MatthewZMD[P]TetrisDual/game.cc
// Function: Game::init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, bool)
void Game::init(std::string fileName1, std::string fileName2, int l, bool isTextOnly){
    playerTurn = 0;
    display = std::make_shared<TextDisplay>(2, 18, 11);
    if(!isTextOnly){
        window = std::make_shared<GraphicsDisplay>(590, 520);
    }
    board1 = std::make_shared<ConcreteBoard>(0, fileName1, l);
    board1->attach(display.get());
    if(!isTextOnly){
        board1->attach(window.get());
    }
    board2 = std::make_shared<ConcreteBoard>(1, fileName2, l);
    board2->attach(display.get());
    if(!isTextOnly){
        board2->attach(window.get());
    }
    board1->notifyObservers();
    board2->notifyObservers();

    // start from player 1
    board1->setNext(board1->genNext());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdx, -0xa0(%rbp)
movq %rsi, -0x98(%rbp)
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
andb $0x1, %al
movb %al, -0x1d(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movl $0x0, 0x44(%rax)
movl $0x2, -0x34(%rbp)
movl $0x12, -0x38(%rbp)
movl $0xb, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x34(%rbp), %rsi
leaq -0x38(%rbp), %rdx
leaq -0x3c(%rbp), %rcx
callq 0x1bad0
movq -0x90(%rbp), %rdi
addq $0x20, %rdi
leaq -0x30(%rbp), %rsi
callq 0x1bb50
leaq -0x30(%rbp), %rdi
callq 0xaf00
testb $0x1, -0x1d(%rbp)
jne 0x1a8cb
movl $0x24e, -0x54(%rbp)     # imm = 0x24E
movl $0x208, -0x58(%rbp)     # imm = 0x208
leaq -0x50(%rbp), %rdi
leaq -0x54(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x1bb80
movq -0x90(%rbp), %rdi
addq $0x30, %rdi
leaq -0x50(%rbp), %rsi
callq 0x1bc00
leaq -0x50(%rbp), %rdi
callq 0xaee0
movq -0x98(%rbp), %rdx
movl $0x0, -0x6c(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x6c(%rbp), %rsi
leaq -0x1c(%rbp), %rcx
callq 0x1bc30
movq -0x90(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x1bcb0
leaq -0x68(%rbp), %rdi
callq 0x1bce0
movq -0x90(%rbp), %rdi
callq 0xc1e0
movq -0x90(%rbp), %rdi
movq %rax, -0xa8(%rbp)
addq $0x20, %rdi
callq 0x88f0
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0x25400
testb $0x1, -0x1d(%rbp)
jne 0x1a96d
movq -0x90(%rbp), %rdi
callq 0xc1e0
movq -0x90(%rbp), %rdi
movq %rax, -0xb0(%rbp)
addq $0x30, %rdi
callq 0x1bd00
movq -0xb0(%rbp), %rdi
movq %rax, %rsi
callq 0x25400
movq -0xa0(%rbp), %rdx
movl $0x1, -0x84(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x84(%rbp), %rsi
leaq -0x1c(%rbp), %rcx
callq 0x1bc30
movq -0x90(%rbp), %rdi
addq $0x10, %rdi
leaq -0x80(%rbp), %rsi
callq 0x1bcb0
leaq -0x80(%rbp), %rdi
callq 0x1bce0
movq -0x90(%rbp), %rdi
addq $0x10, %rdi
callq 0xc1e0
movq -0x90(%rbp), %rdi
movq %rax, -0xb8(%rbp)
addq $0x20, %rdi
callq 0x88f0
movq -0xb8(%rbp), %rdi
movq %rax, %rsi
callq 0x25400
testb $0x1, -0x1d(%rbp)
jne 0x1aa21
movq -0x90(%rbp), %rdi
addq $0x10, %rdi
callq 0xc1e0
movq -0x90(%rbp), %rdi
movq %rax, -0xc0(%rbp)
addq $0x30, %rdi
callq 0x1bd00
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x25400
movq -0x90(%rbp), %rdi
callq 0xc1e0
movq %rax, %rdi
callq 0x25430
movq -0x90(%rbp), %rdi
addq $0x10, %rdi
callq 0xc1e0
movq %rax, %rdi
callq 0x25430
movq -0x90(%rbp), %rdi
callq 0xc1e0
movq -0x90(%rbp), %rdi
movq %rax, -0xc8(%rbp)
callq 0xc1e0
movq %rax, %rdi
movq (%rdi), %rax
callq *0x48(%rax)
movq -0xc8(%rbp), %rdi
movl %eax, %esi
movq (%rdi), %rax
callq *0x68(%rax)
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax)