// File: /workspace/github_cpp_makefile_star2_O1/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 $0xd8, %rsp
movq %rdx, 0x40(%rsp)
movq %rsi, %r13
movq %rdi, %r14
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %r12d, %r12d
leaq 0xb8(%rsp), %rbx
movq 0x21a1e(%rip), %r15     # 0x33fc0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %edx
movq %r13, %rdi
leaq 0x20(%rsp), %rsi
callq 0x5350
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x127d9
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r13,%rax)
jne 0x127d9
movq %r12, 0x50(%rsp)
movq %rbx, %r12
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rbp
testq %rbp, %rbp
je 0x12611
cmpb $0x0, (%r15)
je 0x1260d
incl 0x8(%rbp)
jmp 0x12611
lock
incl 0x8(%rbp)
leaq 0x10(%rsp), %rdi
callq 0x17c54
movq 0x10(%rsp), %r15
leaq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rbx
movq %r12, %rdi
callq 0xb6a4
movq %rsp, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xe936
movq (%rsp), %r15
movq 0x8(%rsp), %rax
movq %rax, 0x48(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1267a
callq 0xb634
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x12689
callq 0xb634
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x126ae
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x126bd
callq 0xb634
testq %rbp, %rbp
je 0x126ca
movq %rbp, %rdi
callq 0xb634
movq (%r15), %rax
movq %rsp, %rdi
movq %r15, %rsi
callq *0x50(%rax)
movq (%rsp), %rdi
movq 0x8(%r14), %rax
movq %rax, 0x88(%rsp)
movq 0x10(%r14), %rax
movq %rax, 0x90(%rsp)
testq %rax, %rax
movq 0x218c4(%rip), %r15     # 0x33fc0
movq %r12, %rbx
je 0x12710
cmpb $0x0, (%r15)
je 0x1270c
incl 0x8(%rax)
jmp 0x12710
lock
incl 0x8(%rax)
leaq 0x88(%rsp), %rsi
callq 0xe896
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x1272f
callq 0xb634
movq 0x8(%r14), %rsi
movq 0x10(%r14), %r12
testq %r12, %r12
je 0x1274f
cmpb $0x0, (%r15)
je 0x12749
incl 0x8(%r12)
jmp 0x1274f
lock
incl 0x8(%r12)
leaq 0x10(%rsp), %rdi
callq 0x17c28
movq 0x10(%rsp), %rdi
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x78(%rsp)
movq %rax, 0x80(%rsp)
testq %rax, %rax
je 0x12788
cmpb $0x0, (%r15)
je 0x12784
incl 0x8(%rax)
jmp 0x12788
lock
incl 0x8(%rax)
leaq 0x78(%rsp), %rsi
callq 0xf714
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x127a4
callq 0xb634
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x127b3
callq 0xb634
testq %r12, %r12
je 0x127c0
movq %r12, %rdi
callq 0xb634
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x127cf
callq 0xb634
movq 0x48(%rsp), %r12
jmp 0x125a2
leaq 0x98(%rsp), %rbp
movq 0x40(%rsp), %r13
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %edx
movq %r13, %rdi
leaq 0x20(%rsp), %rsi
callq 0x5350
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x12a01
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r13,%rax)
jne 0x12a01
movq 0x18(%r14), %rsi
movq 0x20(%r14), %r13
testq %r13, %r13
je 0x1284f
cmpb $0x0, (%r15)
je 0x1284a
incl 0x8(%r13)
jmp 0x1284f
lock
incl 0x8(%r13)
leaq 0x10(%rsp), %rdi
callq 0x17c54
movq 0x10(%rsp), %r15
leaq 0xa8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0xb6a4
movq %rsp, %rdi
movq %r15, %rsi
movq %rbp, %rbx
movq %rbp, %rdx
callq 0xe936
movq (%rsp), %r15
movq 0x8(%rsp), %rbp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
testq %r12, %r12
je 0x128b1
movq %r12, %rdi
callq 0xb634
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x128c0
callq 0xb634
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x128e5
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x128f4
callq 0xb634
testq %r13, %r13
je 0x12901
movq %r13, %rdi
callq 0xb634
movq (%r15), %rax
movq %rsp, %rdi
movq %r15, %rsi
callq *0x50(%rax)
movq (%rsp), %rdi
movq 0x18(%r14), %rax
movq %rax, 0x68(%rsp)
movq 0x20(%r14), %rax
movq %rax, 0x70(%rsp)
testq %rax, %rax
movq 0x21693(%rip), %r15     # 0x33fc0
movq 0x40(%rsp), %r13
je 0x12943
cmpb $0x0, (%r15)
je 0x1293f
incl 0x8(%rax)
jmp 0x12943
lock
incl 0x8(%rax)
leaq 0x68(%rsp), %rsi
callq 0xe896
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1295c
callq 0xb634
movq 0x18(%r14), %rsi
movq 0x20(%r14), %r12
testq %r12, %r12
je 0x1297c
cmpb $0x0, (%r15)
je 0x12976
incl 0x8(%r12)
jmp 0x1297c
lock
incl 0x8(%r12)
leaq 0x10(%rsp), %rdi
callq 0x17c28
movq 0x10(%rsp), %rdi
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x58(%rsp)
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x129b2
cmpb $0x0, (%r15)
je 0x129ae
incl 0x8(%rax)
jmp 0x129b2
lock
incl 0x8(%rax)
leaq 0x58(%rsp), %rsi
callq 0xf714
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x129cb
callq 0xb634
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x129da
callq 0xb634
testq %r12, %r12
je 0x129e7
movq %r12, %rdi
callq 0xb634
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x129f6
callq 0xb634
movq %rbp, %r12
movq %rbx, %rbp
jmp 0x127e6
testq %r12, %r12
je 0x12a0e
movq %r12, %rdi
callq 0xb634
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x12a2a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x51f0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x12ae6
movq %rax, %rbx
jmp 0x12ad7
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x12a5e
callq 0xb634
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x12a72
callq 0xb634
jmp 0x12a72
movq %rax, %rbx
testq %r12, %r12
je 0x12a93
movq %r12, %rdi
jmp 0x12a8e
movq %rax, %rbx
jmp 0x12aa2
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x12a93
callq 0xb634
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x12aa2
callq 0xb634
leaq 0x30(%rsp), %r14
movq %rbp, %rdi
jmp 0x12bcc
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x12ad7
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x12ae6
callq 0xb634
testq %r13, %r13
je 0x12bc4
movq %r13, %rdi
callq 0xb634
jmp 0x12bc4
movq %rax, %rbx
jmp 0x12bab
movq %rax, %rbx
jmp 0x12b9c
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x12b21
callq 0xb634
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x12b35
callq 0xb634
jmp 0x12b35
movq %rax, %rbx
testq %r12, %r12
je 0x12b59
movq %r12, %rdi
jmp 0x12b54
movq %rax, %rbx
jmp 0x12b68
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x12b59
callq 0xb634
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x12b68
callq 0xb634
leaq 0x30(%rsp), %r14
movq 0x48(%rsp), %rdi
jmp 0x12bcc
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x12b9c
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x12bab
callq 0xb634
testq %rbp, %rbp
je 0x12bb8
movq %rbp, %rdi
callq 0xb634
movq 0x50(%rsp), %rdi
jmp 0x12bc7
jmp 0x12bc1
movq %rax, %rbx
movq %r12, %rdi
leaq 0x30(%rsp), %r14
testq %rdi, %rdi
je 0x12bd6
callq 0xb634
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x12bed
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x51f0
movq %rbx, %rdi
callq 0x5320
nop