// File: /workspace/github_cpp_makefile_star2_O1/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, 0x28(%rsp)
movl $0x0, 0x44(%rdi)
leaq 0x8(%rsp), %rcx
movl $0x2, (%rcx)
leaq 0x4(%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 0xf(%rsp), %rdx
movq %r12, %rsi
callq 0xcfdc
movaps (%r12), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r12)
movq 0x28(%rbx), %rdi
movups %xmm0, 0x20(%rbx)
testq %rdi, %rdi
je 0xc36a
callq 0x5f3e
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc379
callq 0x5f3e
testb %bpl, %bpl
jne 0xc3e2
leaq 0x8(%rsp), %rcx
movl $0x24e, (%rcx)          # imm = 0x24E
leaq 0x4(%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 0xd16e
movaps (%r12), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r12)
movq 0x38(%rbx), %rdi
movups %xmm0, 0x30(%rbx)
testq %rdi, %rdi
je 0xc3d3
callq 0x5f3e
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc3e2
callq 0x5f3e
leaq 0x8(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r12
leaq 0x4(%rsp), %rdx
leaq 0x28(%rsp), %r9
movq %r12, %rsi
movq %r15, %r8
callq 0xd254
movq (%r12), %rsi
movq %r12, %rdi
callq 0xd2e8
movaps (%r12), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r12)
movq 0x8(%rbx), %rdi
movups %xmm0, (%rbx)
testq %rdi, %rdi
je 0xc43e
callq 0x5f3e
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc44d
callq 0x5f3e
movq (%rbx), %rdi
movq 0x20(%rbx), %rsi
callq 0xede8
testb %bpl, %bpl
jne 0xc46a
movq (%rbx), %rdi
movq 0x30(%rbx), %rsi
callq 0xede8
leaq 0x8(%rsp), %rcx
movl $0x1, (%rcx)
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r15
leaq 0x4(%rsp), %rdx
leaq 0x28(%rsp), %r9
movq %r15, %rsi
movq %r14, %r8
callq 0xd254
movq (%r15), %rsi
movq %r15, %rdi
callq 0xd2e8
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq 0x18(%rbx), %rdi
movups %xmm0, 0x10(%rbx)
testq %rdi, %rdi
je 0xc4c4
callq 0x5f3e
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc4d3
callq 0x5f3e
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq 0xede8
testb %bpl, %bpl
jne 0xc4f2
movq 0x10(%rbx), %rdi
movq 0x30(%rbx), %rsi
callq 0xede8
movq (%rbx), %rdi
callq 0xedfe
movq 0x10(%rbx), %rdi
callq 0xedfe
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
nop