// File: /workspace/github_cpp_makefile_star2_O2/BohangZhang[P]Sorcery-C-Project/act_minion.cc
// Function: Act_Minion::use()
void Act_Minion::use() {
    if (getSilent()) throw 1; // Number; The minion has been silented
    if (getMaster()->isSlotFull()) throw 2; // You have already own 5 Minions!
    if (name == "Apprentice Summoner") {
        shared_ptr<Minion> m = this->master->getDatabase()->getMinion("Air Elemental")->cloneMinion();
        shared_ptr<Card> p = m;
        p->setMaster(master);
        this->getMaster()->getSlot()->push(m);
        this->getMaster()->getGame()->notify("Enter", m);
    }
    if (name == "Master Summoner") {
        int i = this->master->getSlot()->getSize();
        int count = 0;
        while (!(getMaster()->isSlotFull()) && (count < 3)) {
            shared_ptr<Minion> m = this->master->getDatabase()->getMinion("Air Elemental")->cloneMinion();
            shared_ptr<Card> p = m;
            p->setMaster(master);
            this->getMaster()->getSlot()->push(m);
            this->getMaster()->getGame()->notify("Enter", m);
            ++count;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x60(%rax)
testb %al, %al
jne 0x98e4
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb45c
movq (%r14), %rdi
callq 0x12230
movl %eax, %ebp
leaq 0x38(%rsp), %rdi
callq 0x8ea0
testb %bpl, %bpl
jne 0x98f4
leaq 0x8(%rbx), %r14
leaq 0x142da(%rip), %rsi     # 0x1d7b2
movq %r14, %rdi
callq 0x8dc3
testb %al, %al
je 0x96a9
movq 0x70(%rbx), %rsi
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x121a8
movq (%r15), %r15
leaq 0x142c3(%rip), %rsi     # 0x1d7c6
leaq 0xd8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x8d88
leaq 0x40(%rsp), %rdi
leaq 0xd8(%rsp), %rdx
movq %r15, %rsi
callq 0xb50e
movq 0x40(%rsp), %rsi
movq (%rsi), %rax
leaq 0x30(%rsp), %rdi
callq *0x100(%rax)
leaq 0x70(%rbx), %r15
leaq 0x48(%rsp), %rdi
callq 0x8ea0
leaq 0xd8(%rsp), %rdi
callq 0x5378
leaq 0x18(%rsp), %rdi
callq 0x8ea0
leaq 0x40(%rsp), %r12
leaq 0x30(%rsp), %rsi
movq %r12, %rdi
callq 0x9ef8
movq (%r12), %r12
leaq 0xa8(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x8e60
movq %r12, %rdi
movq %r13, %rsi
callq 0xb452
leaq 0xb0(%rsp), %rdi
callq 0x8ea0
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0xb45c
movq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x12172
movq 0x10(%rsp), %r15
leaq 0x98(%rsp), %r12
leaq 0x30(%rsp), %rsi
movq %r12, %rdi
callq 0x8f30
movq %r15, %rdi
movq %r12, %rsi
callq 0x1b320
leaq 0xa0(%rsp), %rdi
callq 0x8ea0
leaq 0x18(%rsp), %rdi
callq 0x8ea0
leaq 0x28(%rsp), %rdi
callq 0x8ea0
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0xb45c
movq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x1215c
movq 0x10(%rsp), %r15
leaq 0x1537d(%rip), %rsi     # 0x1e9aa
leaq 0xb8(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x8d88
leaq 0x88(%rsp), %r12
leaq 0x30(%rsp), %rsi
movq %r12, %rdi
callq 0x8f30
leaq 0xb8(%rsp), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0xe740
leaq 0x90(%rsp), %rdi
callq 0x8ea0
leaq 0xb8(%rsp), %rdi
callq 0x5378
leaq 0x18(%rsp), %rdi
callq 0x8ea0
leaq 0x28(%rsp), %rdi
callq 0x8ea0
leaq 0x48(%rsp), %rdi
callq 0x8ea0
leaq 0x38(%rsp), %rdi
callq 0x8ea0
leaq 0x14124(%rip), %rsi     # 0x1d7d4
movq %r14, %rdi
callq 0x8dc3
testb %al, %al
je 0x98d2
movq 0x70(%rbx), %rsi
leaq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x12172
movq (%r14), %rdi
callq 0x1b2e6
leaq 0x70(%rbx), %rax
movq %rax, 0x50(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x8ea0
xorl %r13d, %r13d
leaq 0x30(%rsp), %r14
leaq 0xf8(%rsp), %rbp
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb45c
movq 0x30(%rsp), %rdi
callq 0x12230
movl %eax, %r12d
cmpl $0x3, %r13d
setae %al
orb %al, %r12b
leaq 0x38(%rsp), %rdi
callq 0x8ea0
testb %r12b, %r12b
jne 0x98d2
movq %rbp, %r15
movq 0x50(%rsp), %rax
movq (%rax), %rsi
leaq 0x10(%rsp), %rdi
callq 0x121a8
movq 0x10(%rsp), %r12
leaq 0x118(%rsp), %rbp
movq %rbp, %rdi
leaq 0x14069(%rip), %rsi     # 0x1d7c6
leaq 0x20(%rsp), %rdx
callq 0x8d88
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0xb50e
movq 0x40(%rsp), %rsi
movq (%rsi), %rax
movq %r14, %rdi
callq *0x100(%rax)
leaq 0x48(%rsp), %rdi
callq 0x8ea0
movq %rbp, %rdi
callq 0x5378
leaq 0x18(%rsp), %rdi
callq 0x8ea0
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x9ef8
movq 0x40(%rsp), %r12
leaq 0x78(%rsp), %rbp
movq %rbp, %rdi
movq 0x50(%rsp), %rsi
callq 0x8e60
movq %r12, %rdi
movq %rbp, %rsi
callq 0xb452
leaq 0x80(%rsp), %rdi
callq 0x8ea0
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0xb45c
movq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x12172
movq 0x10(%rsp), %r12
leaq 0x68(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0x8f30
movq %r12, %rdi
movq %rbp, %rsi
callq 0x1b320
leaq 0x70(%rsp), %rdi
callq 0x8ea0
leaq 0x18(%rsp), %rdi
callq 0x8ea0
leaq 0x28(%rsp), %rdi
callq 0x8ea0
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0xb45c
movq %r15, %rbp
movq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x1215c
movq 0x10(%rsp), %r12
movq %rbp, %rdi
leaq 0x15142(%rip), %rsi     # 0x1e9aa
leaq 0xf(%rsp), %rdx
callq 0x8d88
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x8f30
movq %r12, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0xe740
leaq 0x60(%rsp), %rdi
callq 0x8ea0
movq %rbp, %rdi
callq 0x5378
leaq 0x18(%rsp), %rdi
callq 0x8ea0
leaq 0x28(%rsp), %rdi
callq 0x8ea0
incl %r13d
leaq 0x48(%rsp), %rdi
callq 0x8ea0
leaq 0x38(%rsp), %rdi
callq 0x8ea0
jmp 0x96fc
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x4
popq %rdi
callq 0x5120
movl $0x1, (%rax)
jmp 0x9902
pushq $0x4
popq %rdi
callq 0x5120
movl $0x2, (%rax)
movq 0x21697(%rip), %rsi     # 0x2afa0
movq %rax, %rdi
xorl %edx, %edx
callq 0x5310
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x8ea0
leaq 0xb8(%rsp), %rdi
jmp 0x99b4
jmp 0x9995
jmp 0x99eb
jmp 0x9a13
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
jmp 0x99f8
jmp 0x9a32
jmp 0x99eb
jmp 0x9a13
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
jmp 0x9a0c
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x8ea0
jmp 0x997d
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
jmp 0x99d0
jmp 0x9990
jmp 0x9a32
jmp 0x99eb
movq %rax, %rbx
jmp 0x99d5
movq %rax, %rbx
jmp 0x99fd
movq %rax, %rbx
jmp 0x99c8
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x8ea0
leaq 0xf8(%rsp), %rdi
callq 0x5378
jmp 0x99fd
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x8ea0
leaq 0x118(%rsp), %rdi
callq 0x5378
leaq 0x18(%rsp), %rdi
jmp 0x9a25
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
jmp 0x9a0c
jmp 0x9a13
movq %rax, %rbx
jmp 0x9a07
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x8ea0
leaq 0x18(%rsp), %rdi
callq 0x8ea0
leaq 0x28(%rsp), %rdi
callq 0x8ea0
jmp 0x9a16
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x8ea0
leaq 0x38(%rsp), %rdi
callq 0x8ea0
movq %rbx, %rdi
callq 0x5330
movq %rax, %rbx
jmp 0x9a20
nop