// File: brashi[P]PetFera/src/./petshop.cpp
// Function: Petshop::excluirTratador()
void Petshop::excluirTratador() {
    string idPessoa, s;
    shared_ptr<Tratador> tratador;
    long unsigned int num;

    if(this->tratadores.size() == 0)
        throw "Não há tratadores para remover no sistema!";

    
    cout << endl << "Tratadores registrados: " << endl;
    this->listarTratadores();
    cout << endl << "Digite o ID do tratador a ser removido: ";
    getline(cin, idPessoa);
    num = stoi(idPessoa);
    if(num >= 0 && num < this->tratadores.size())
        tratador = this->tratadores[num];
    else
        throw "Tratador não existe!";


    int animais = 0;
    for(auto& animal : this->animais)
        if(tratador == animal->getTratador())
            animais++;

    string error = "O tratador cuida de " + std::to_string(animais) + " animais !\n Portando, ele não pode se removido, verifique nas listagens e tente novamente !";
    if(animais > 0)
        throw error;
    cout << endl << "Tem certeza que deseja excluir? (S/N): " << endl;
    getline(cin, s);

    if(toupper(s[0]) == 'S')
        if(this->excluirTratador(tratador))
            cout << "Operação concluída" << endl;
        else
            throw "Erro ao excluir tratador, tente novamente";
    else
        cout << "Operação cancelada" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x6480
leaq -0x48(%rbp), %rdi
callq 0x6480
leaq -0x58(%rbp), %rdi
callq 0x21c40
movq -0x128(%rbp), %rdi
addq $0x18, %rdi
callq 0x21b60
cmpq $0x0, %rax
jne 0x20d58
movl $0x8, %edi
callq 0x61e0
movq %rax, %rdi
leaq 0x20a32(%rip), %rax     # 0x41761
movq %rax, (%rdi)
movq 0x4226f(%rip), %rsi     # 0x62fa8
xorl %eax, %eax
movl %eax, %edx
callq 0x6570
jmp 0x21251
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x2122d
movq 0x42269(%rip), %rdi     # 0x62fc8
movq 0x4223a(%rip), %rsi     # 0x62fa0
callq 0x6360
movq %rax, -0x130(%rbp)
jmp 0x20d74
movq -0x130(%rbp), %rdi
leaq 0x20a0c(%rip), %rsi     # 0x4178e
callq 0x6310
movq %rax, -0x138(%rbp)
jmp 0x20d90
movq -0x138(%rbp), %rdi
movq 0x42202(%rip), %rsi     # 0x62fa0
callq 0x6360
jmp 0x20da5
movq -0x128(%rbp), %rdi
callq 0x1cb60
jmp 0x20db3
movq 0x4220e(%rip), %rdi     # 0x62fc8
movq 0x421df(%rip), %rsi     # 0x62fa0
callq 0x6360
movq %rax, -0x140(%rbp)
jmp 0x20dcf
movq -0x140(%rbp), %rdi
leaq 0x20d20(%rip), %rsi     # 0x41afd
callq 0x6310
jmp 0x20de4
movq 0x421f5(%rip), %rdi     # 0x62fe0
leaq -0x28(%rbp), %rsi
callq 0x6090
jmp 0x20df6
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
movl $0xa, %edx
callq 0xbdc0
movl %eax, -0x144(%rbp)
jmp 0x20e10
movl -0x144(%rbp), %eax
cltq
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jb 0x20e6f
movq -0x128(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0x150(%rbp)
addq $0x18, %rdi
callq 0x21b60
movq %rax, %rcx
movq -0x150(%rbp), %rax
cmpq %rcx, %rax
jae 0x20e6f
movq -0x128(%rbp), %rdi
addq $0x18, %rdi
movq -0x60(%rbp), %rsi
callq 0x21bd0
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x21ca0
jmp 0x20e9b
movl $0x8, %edi
callq 0x61e0
movq %rax, %rdi
leaq 0x20647(%rip), %rax     # 0x414ca
movq %rax, (%rdi)
movq 0x4211b(%rip), %rsi     # 0x62fa8
xorl %eax, %eax
movl %eax, %edx
callq 0x6570
jmp 0x21251
movq -0x128(%rbp), %rax
movl $0x0, -0x70(%rbp)
addq $0x30, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
callq 0xb370
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rdi
callq 0xb3a0
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xb3d0
testb $0x1, %al
jne 0x20ee4
jmp 0x20f58
leaq -0x80(%rbp), %rdi
callq 0xb410
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rdi
callq 0xb480
movq %rax, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x29cd0
jmp 0x20f11
leaq -0x58(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x21d40
movb %al, -0x151(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xb4a0
movb -0x151(%rbp), %al
testb $0x1, %al
jne 0x20f3f
jmp 0x20f48
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x20f4a
leaq -0x80(%rbp), %rdi
callq 0xbac0
jmp 0x20ece
movl -0x70(%rbp), %esi
leaq -0x100(%rbp), %rdi
callq 0x21f00
jmp 0x20f69
leaq 0x20bb6(%rip), %rsi     # 0x41b26
leaq -0xe0(%rbp), %rdi
leaq -0x100(%rbp), %rdx
callq 0x21eb0
jmp 0x20f85
leaq 0x20aa8(%rip), %rdx     # 0x41a34
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x21e60
jmp 0x20fa1
leaq -0xe0(%rbp), %rdi
callq 0x6678
leaq -0x100(%rbp), %rdi
callq 0x6678
cmpl $0x0, -0x70(%rbp)
jle 0x2104a
movl $0x20, %edi
callq 0x61e0
movq %rax, %rdi
movq %rdi, -0x160(%rbp)
leaq -0xc0(%rbp), %rsi
callq 0x6210
movq -0x160(%rbp), %rdi
leaq 0x40fff(%rip), %rsi     # 0x61ff0
movq 0x41fb8(%rip), %rdx     # 0x62fb0
callq 0x6570
jmp 0x21251
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x21028
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x6678
leaq -0x100(%rbp), %rdi
callq 0x6678
jmp 0x2122d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x21221
movq 0x41f77(%rip), %rdi     # 0x62fc8
movq 0x41f48(%rip), %rsi     # 0x62fa0
callq 0x6360
movq %rax, -0x168(%rbp)
jmp 0x21066
movq -0x168(%rbp), %rdi
leaq 0x20a1d(%rip), %rsi     # 0x41a91
callq 0x6310
movq %rax, -0x170(%rbp)
jmp 0x21082
movq -0x170(%rbp), %rdi
movq 0x41f10(%rip), %rsi     # 0x62fa0
callq 0x6360
jmp 0x21097
movq 0x41f42(%rip), %rdi     # 0x62fe0
leaq -0x48(%rbp), %rsi
callq 0x6090
jmp 0x210a9
xorl %eax, %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x6660
movq %rax, -0x178(%rbp)
jmp 0x210bf
movq -0x178(%rbp), %rax
movsbl (%rax), %edi
callq 0x6600
cmpl $0x53, %eax
jne 0x211be
leaq -0x120(%rbp), %rdi
movq %rdi, -0x180(%rbp)
leaq -0x58(%rbp), %rsi
callq 0xc090
movq -0x128(%rbp), %rsi
movq -0x180(%rbp), %rdx
leaq -0x110(%rbp), %rdi
callq 0x21260
jmp 0x2110a
leaq -0x110(%rbp), %rdi
callq 0x22040
movb %al, -0x181(%rbp)
leaq -0x110(%rbp), %rdi
callq 0xb4a0
leaq -0x120(%rbp), %rdi
callq 0xb4a0
movb -0x181(%rbp), %al
testb $0x1, %al
jne 0x21140
jmp 0x21190
movq 0x41e81(%rip), %rdi     # 0x62fc8
leaq 0x2096b(%rip), %rsi     # 0x41ab9
callq 0x6310
movq %rax, -0x190(%rbp)
jmp 0x2115c
movq -0x190(%rbp), %rdi
movq 0x41e36(%rip), %rsi     # 0x62fa0
callq 0x6360
jmp 0x21171
jmp 0x211bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0xb4a0
jmp 0x21221
movl $0x8, %edi
callq 0x61e0
movq %rax, %rdi
leaq 0x20997(%rip), %rax     # 0x41b3b
movq %rax, (%rdi)
movq 0x41dfa(%rip), %rsi     # 0x62fa8
xorl %eax, %eax
movl %eax, %edx
callq 0x6570
jmp 0x21251
jmp 0x211f1
movq 0x41e03(%rip), %rdi     # 0x62fc8
leaq 0x20763(%rip), %rsi     # 0x4192f
callq 0x6310
movq %rax, -0x198(%rbp)
jmp 0x211da
movq -0x198(%rbp), %rdi
movq 0x41db8(%rip), %rsi     # 0x62fa0
callq 0x6360
jmp 0x211ef
jmp 0x211f1
leaq -0xc0(%rbp), %rdi
callq 0x6678
leaq -0x58(%rbp), %rdi
callq 0xb4a0
leaq -0x48(%rbp), %rdi
callq 0x6678
leaq -0x28(%rbp), %rdi
callq 0x6678
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
leaq -0xc0(%rbp), %rdi
callq 0x6678
leaq -0x58(%rbp), %rdi
callq 0xb4a0
leaq -0x48(%rbp), %rdi
callq 0x6678
leaq -0x28(%rbp), %rdi
callq 0x6678
movq -0x68(%rbp), %rdi
callq 0x6590
nopw %cs:(%rax,%rax)