// File: /workspace/github_cpp_makefile_star2_O2/BohangZhang[P]Sorcery-C-Project/game.cc
// Function: Game::loadDecks(std::basic_ifstream<char, std::char_traits<char>>&, std::basic_ifstream<char, std::char_traits<char>>&)
void Game::loadDecks(ifstream &deck1, ifstream &deck2) {
    string cardname;
    shared_ptr<Card> newcard{nullptr};
    while (getline(deck1, cardname)) {
        if (deck1.fail()) {break;}
        newcard = this->get1()->getDatabase()->getCard(cardname);
        shared_ptr<Card> c = newcard->clone();
        c->setMaster(player1);
        this->get1()->getDeck()->push(c);
    }
    while (getline(deck2, cardname)) {
        if (deck2.fail()) {break;}
        newcard = this->get2()->getDatabase()->getCard(cardname);
        shared_ptr<Card> c = newcard->clone();
        c->setMaster(player2);
        this->get2()->getDeck()->push(c);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdx, 0x50(%rsp)
movq %rsi, %r15
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rax
movaps %xmm0, (%rax)
movq %rdi, 0x48(%rsp)
leaq 0x8(%rdi), %rbp
leaq 0xd8(%rsp), %r14
leaq 0x20(%rsp), %r12
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x5050
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xea8e
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r15,%rax)
jne 0xea8e
movq %rsp, %rdi
movq %rbp, %rsi
callq 0x8e60
movq (%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x121a8
movq 0x10(%rsp), %r13
movq %r14, %rbx
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
callq 0x5290
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0xb4ee
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0xc690
leaq 0x28(%rsp), %rdi
callq 0x8ea0
movq %rbx, %rdi
callq 0x5378
leaq 0x18(%rsp), %rdi
callq 0x8ea0
leaq 0x8(%rsp), %rdi
callq 0x8ea0
movq 0x30(%rsp), %rsi
movq (%rsi), %rax
movq %r12, %rdi
callq *0x50(%rax)
movq 0x20(%rsp), %r13
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x8e60
movq %r13, %rdi
movq %rbx, %rsi
callq 0xb452
leaq 0xb0(%rsp), %rdi
callq 0x8ea0
movq %rsp, %rdi
movq %rbp, %rsi
callq 0x8e60
movq (%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x12196
movq 0x10(%rsp), %r13
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb86e
movq %r13, %rdi
movq %rbx, %rsi
callq 0xc2d8
leaq 0xa0(%rsp), %rdi
callq 0x8ea0
leaq 0x18(%rsp), %rdi
callq 0x8ea0
leaq 0x8(%rsp), %rdi
callq 0x8ea0
leaq 0x28(%rsp), %rdi
callq 0x8ea0
jmp 0xe943
movq 0x48(%rsp), %r14
addq $0x18, %r14
leaq 0xb8(%rsp), %rbp
leaq 0x20(%rsp), %r12
movq 0x50(%rsp), %rbx
movq %rbx, %rdi
leaq 0x58(%rsp), %rsi
callq 0x5050
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xebed
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rbx,%rax)
jne 0xebed
movq %rsp, %rdi
movq %r14, %rsi
callq 0x8e60
movq (%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x121a8
movq 0x10(%rsp), %r13
movq %rbp, %rdi
leaq 0x58(%rsp), %rsi
callq 0x5290
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0xb4ee
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0xc690
leaq 0x28(%rsp), %rdi
callq 0x8ea0
movq %rbp, %rdi
callq 0x5378
leaq 0x18(%rsp), %rdi
callq 0x8ea0
leaq 0x8(%rsp), %rdi
callq 0x8ea0
movq 0x30(%rsp), %rsi
movq (%rsi), %rax
movq %r12, %rdi
callq *0x50(%rax)
movq 0x20(%rsp), %r13
leaq 0x88(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x8e60
movq %r13, %rdi
movq %r15, %rsi
callq 0xb452
leaq 0x90(%rsp), %rdi
callq 0x8ea0
movq %rsp, %rdi
movq %r14, %rsi
callq 0x8e60
movq (%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x12196
movq 0x10(%rsp), %r13
leaq 0x78(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0xb86e
movq %r13, %rdi
movq %r15, %rsi
callq 0xc2d8
leaq 0x80(%rsp), %rdi
callq 0x8ea0
leaq 0x18(%rsp), %rdi
callq 0x8ea0
leaq 0x8(%rsp), %rdi
callq 0x8ea0
leaq 0x28(%rsp), %rdi
callq 0x8ea0
jmp 0xeaa9
leaq 0x38(%rsp), %rdi
callq 0x8ea0
leaq 0x58(%rsp), %rdi
callq 0x5378
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xec45
jmp 0xec4a
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
jmp 0xec5a
jmp 0xec6b
jmp 0xecb6
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
jmp 0xec82
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0xec99
movq %rax, %rbx
jmp 0xeca8
movq %rax, %rbx
jmp 0xec9e
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x8ea0
leaq 0x18(%rsp), %rdi
callq 0x8ea0
jmp 0xec6e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0xec82
jmp 0xecb6
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x8ea0
leaq 0x28(%rsp), %rdi
jmp 0xecad
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x5378
leaq 0x18(%rsp), %rdi
callq 0x8ea0
leaq 0x8(%rsp), %rdi
callq 0x8ea0
jmp 0xecb9
jmp 0xecb6
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x8ea0
leaq 0x58(%rsp), %rdi
callq 0x5378
movq %rbx, %rdi
callq 0x5330
nop