// File: /workspace/github_cpp_makefile_star2_O3/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 0x20c82(%rip), %r15     # 0x32fc0
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 0x12575
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r13,%rax)
jne 0x12575
movq %r12, 0x50(%rsp)
movq %rbx, %r12
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rbp
testq %rbp, %rbp
je 0x123ad
cmpb $0x0, (%r15)
je 0x123a9
incl 0x8(%rbp)
jmp 0x123ad
lock
incl 0x8(%rbp)
leaq 0x10(%rsp), %rdi
callq 0x17b18
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 0xb4e8
movq %rsp, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xe71a
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 0x12425
callq 0xb478
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x12425
callq 0xb478
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x1244a
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x12459
callq 0xb478
testq %rbp, %rbp
je 0x12466
movq %rbp, %rdi
callq 0xb478
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 0x20b28(%rip), %r15     # 0x32fc0
movq %r12, %rbx
je 0x124ac
cmpb $0x0, (%r15)
je 0x124a8
incl 0x8(%rax)
jmp 0x124ac
lock
incl 0x8(%rax)
leaq 0x88(%rsp), %rsi
callq 0xe676
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x124cb
callq 0xb478
movq 0x8(%r14), %rsi
movq 0x10(%r14), %r12
testq %r12, %r12
je 0x124eb
cmpb $0x0, (%r15)
je 0x124e5
incl 0x8(%r12)
jmp 0x124eb
lock
incl 0x8(%r12)
leaq 0x10(%rsp), %rdi
callq 0x17aec
movq 0x10(%rsp), %rdi
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x78(%rsp)
movq %rax, 0x80(%rsp)
testq %rax, %rax
je 0x12524
cmpb $0x0, (%r15)
je 0x12520
incl 0x8(%rax)
jmp 0x12524
lock
incl 0x8(%rax)
leaq 0x78(%rsp), %rsi
callq 0xf4f8
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x12540
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1254f
callq 0xb478
testq %r12, %r12
je 0x1255c
movq %r12, %rdi
callq 0xb478
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1256b
callq 0xb478
movq 0x48(%rsp), %r12
jmp 0x1233e
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 0x1279d
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r13,%rax)
jne 0x1279d
movq 0x18(%r14), %rsi
movq 0x20(%r14), %r13
testq %r13, %r13
je 0x125eb
cmpb $0x0, (%r15)
je 0x125e6
incl 0x8(%r13)
jmp 0x125eb
lock
incl 0x8(%r13)
leaq 0x10(%rsp), %rdi
callq 0x17b18
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 0xb4e8
movq %rsp, %rdi
movq %r15, %rsi
movq %rbp, %rbx
movq %rbp, %rdx
callq 0xe71a
movq (%rsp), %r15
movq 0x8(%rsp), %rbp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
testq %r12, %r12
je 0x1265c
movq %r12, %rdi
callq 0xb478
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1265c
callq 0xb478
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x12681
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x12690
callq 0xb478
testq %r13, %r13
je 0x1269d
movq %r13, %rdi
callq 0xb478
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 0x208f7(%rip), %r15     # 0x32fc0
movq 0x40(%rsp), %r13
je 0x126df
cmpb $0x0, (%r15)
je 0x126db
incl 0x8(%rax)
jmp 0x126df
lock
incl 0x8(%rax)
leaq 0x68(%rsp), %rsi
callq 0xe676
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x126f8
callq 0xb478
movq 0x18(%r14), %rsi
movq 0x20(%r14), %r12
testq %r12, %r12
je 0x12718
cmpb $0x0, (%r15)
je 0x12712
incl 0x8(%r12)
jmp 0x12718
lock
incl 0x8(%r12)
leaq 0x10(%rsp), %rdi
callq 0x17aec
movq 0x10(%rsp), %rdi
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x58(%rsp)
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x1274e
cmpb $0x0, (%r15)
je 0x1274a
incl 0x8(%rax)
jmp 0x1274e
lock
incl 0x8(%rax)
leaq 0x58(%rsp), %rsi
callq 0xf4f8
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x12767
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x12776
callq 0xb478
testq %r12, %r12
je 0x12783
movq %r12, %rdi
callq 0xb478
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x12792
callq 0xb478
movq %rbp, %r12
movq %rbx, %rbp
jmp 0x12582
testq %r12, %r12
je 0x127aa
movq %r12, %rdi
callq 0xb478
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x127c6
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 0x12882
movq %rax, %rbx
jmp 0x12873
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x127fa
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1280e
callq 0xb478
jmp 0x1280e
movq %rax, %rbx
testq %r12, %r12
je 0x1282f
movq %r12, %rdi
jmp 0x1282a
movq %rax, %rbx
jmp 0x1283e
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1282f
callq 0xb478
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1283e
callq 0xb478
leaq 0x30(%rsp), %r14
movq %rbp, %rdi
jmp 0x12968
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x12873
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x12882
callq 0xb478
testq %r13, %r13
je 0x12960
movq %r13, %rdi
callq 0xb478
jmp 0x12960
movq %rax, %rbx
jmp 0x12947
movq %rax, %rbx
jmp 0x12938
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x128bd
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x128d1
callq 0xb478
jmp 0x128d1
movq %rax, %rbx
testq %r12, %r12
je 0x128f5
movq %r12, %rdi
jmp 0x128f0
movq %rax, %rbx
jmp 0x12904
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x128f5
callq 0xb478
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x12904
callq 0xb478
leaq 0x30(%rsp), %r14
movq 0x48(%rsp), %rdi
jmp 0x12968
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x12938
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x12947
callq 0xb478
testq %rbp, %rbp
je 0x12954
movq %rbp, %rdi
callq 0xb478
movq 0x50(%rsp), %rdi
jmp 0x12963
jmp 0x1295d
movq %rax, %rbx
movq %r12, %rdi
leaq 0x30(%rsp), %r14
testq %rdi, %rdi
je 0x12972
callq 0xb478
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x12989
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x51f0
movq %rbx, %rdi
callq 0x5320
nop