// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %r8d, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl %ecx, 0xc(%rsp)
movl $0x0, 0x44(%rdi)
leaq 0x4(%rsp), %rcx
movl $0x2, (%rcx)
movq %rsp, %r8
movl $0x12, (%r8)
leaq 0x2c(%rsp), %r9
movl $0xb, (%r9)
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r12
leaq 0xb(%rsp), %rdx
movq %r12, %rsi
callq 0xcd8e
movaps (%r12), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r12)
movq 0x28(%rbx), %rdi
movups %xmm0, 0x20(%rbx)
testq %rdi, %rdi
je 0xc1f7
callq 0x5f5e
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc1f7
callq 0x5f5e
testb %bpl, %bpl
jne 0xc25e
leaq 0x4(%rsp), %rcx
movl $0x24e, (%rcx)          # imm = 0x24E
movq %rsp, %r8
movl $0x208, (%r8)           # imm = 0x208
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r12
leaq 0x2c(%rsp), %rdx
movq %r12, %rsi
callq 0xcf20
movaps (%r12), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r12)
movq 0x38(%rbx), %rdi
movups %xmm0, 0x30(%rbx)
testq %rdi, %rdi
je 0xc25e
callq 0x5f5e
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc25e
callq 0x5f5e
leaq 0x4(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x10(%rsp), %r12
movq %rsp, %rsi
leaq 0xc(%rsp), %r8
movq %r12, %rdi
movq %r15, %rcx
callq 0xd000
movaps (%r12), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r12)
movq 0x8(%rbx), %rdi
movups %xmm0, (%rbx)
testq %rdi, %rdi
je 0xc2ae
callq 0x5f5e
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc2ae
callq 0x5f5e
movq (%rbx), %rdi
movq 0x20(%rbx), %rsi
callq 0xeb38
testb %bpl, %bpl
jne 0xc2cb
movq (%rbx), %rdi
movq 0x30(%rbx), %rsi
callq 0xeb38
leaq 0x4(%rsp), %rdx
movl $0x1, (%rdx)
leaq 0x10(%rsp), %r15
movq %rsp, %rsi
leaq 0xc(%rsp), %r8
movq %r15, %rdi
movq %r14, %rcx
callq 0xd000
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq 0x18(%rbx), %rdi
movups %xmm0, 0x10(%rbx)
testq %rdi, %rdi
je 0xc31a
callq 0x5f5e
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc31a
callq 0x5f5e
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq 0xeb38
testb %bpl, %bpl
jne 0xc339
movq 0x10(%rbx), %rdi
movq 0x30(%rbx), %rsi
callq 0xeb38
movq (%rbx), %rdi
callq 0xeb4e
movq 0x10(%rbx), %rdi
callq 0xeb4e
movq (%rbx), %rbx
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x48(%rax)
movq (%rbx), %rcx
movq %rbx, %rdi
movl %eax, %esi
callq *0x68(%rcx)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq