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

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

    cout << endl << "Veterinários registrados: " << endl;
    this->listarVeterinarios();
    cout << endl << "Digite o ID do veterinário a ser removido: ";
    getline(cin, idPessoa);
    num = stoi(idPessoa);
    if(num >= 0 && num < this->veterinarios.size())
        veterinario = this->veterinarios[num];
    else
        throw "Veterinário não existe!";

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

    string error = "O veterinário 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->excluirVeterinario(veterinario))
            cout << "Operação concluída" << endl;
        else
            throw "Erro ao excluir veterinário, 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 0x21bf0
movq -0x128(%rbp), %rdi
callq 0x21b40
cmpq $0x0, %rax
jne 0x20664
movl $0x8, %edi
callq 0x61e0
movq %rax, %rdi
leaq 0x210ad(%rip), %rax     # 0x416e8
movq %rax, (%rdi)
movq 0x42963(%rip), %rsi     # 0x62fa8
xorl %eax, %eax
movl %eax, %edx
callq 0x6570
jmp 0x20b55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x20b31
movq 0x4295d(%rip), %rdi     # 0x62fc8
movq 0x4292e(%rip), %rsi     # 0x62fa0
callq 0x6360
movq %rax, -0x130(%rbp)
jmp 0x20680
movq -0x130(%rbp), %rdi
leaq 0x2108a(%rip), %rsi     # 0x41718
callq 0x6310
movq %rax, -0x138(%rbp)
jmp 0x2069c
movq -0x138(%rbp), %rdi
movq 0x428f6(%rip), %rsi     # 0x62fa0
callq 0x6360
jmp 0x206b1
movq -0x128(%rbp), %rdi
callq 0x1c820
jmp 0x206bf
movq 0x42902(%rip), %rdi     # 0x62fc8
movq 0x428d3(%rip), %rsi     # 0x62fa0
callq 0x6360
movq %rax, -0x140(%rbp)
jmp 0x206db
movq -0x140(%rbp), %rdi
leaq 0x21305(%rip), %rsi     # 0x419ee
callq 0x6310
jmp 0x206f0
movq 0x428e9(%rip), %rdi     # 0x62fe0
leaq -0x28(%rbp), %rsi
callq 0x6090
jmp 0x20702
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
movl $0xa, %edx
callq 0xbdc0
movl %eax, -0x144(%rbp)
jmp 0x2071c
movl -0x144(%rbp), %eax
cltq
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jb 0x20773
movq -0x128(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0x150(%rbp)
callq 0x21b40
movq %rax, %rcx
movq -0x150(%rbp), %rax
cmpq %rcx, %rax
jae 0x20773
movq -0x128(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x21bb0
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x21c10
jmp 0x2079f
movl $0x8, %edi
callq 0x61e0
movq %rax, %rdi
leaq 0x20ba1(%rip), %rax     # 0x41328
movq %rax, (%rdi)
movq 0x42817(%rip), %rsi     # 0x62fa8
xorl %eax, %eax
movl %eax, %edx
callq 0x6570
jmp 0x20b55
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 0x207e8
jmp 0x2085c
leaq -0x80(%rbp), %rdi
callq 0xb410
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rdi
callq 0xb480
movq %rax, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x29c70
jmp 0x20815
leaq -0x58(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x21e20
movb %al, -0x151(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xb4c0
movb -0x151(%rbp), %al
testb $0x1, %al
jne 0x20843
jmp 0x2084c
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x2084e
leaq -0x80(%rbp), %rdi
callq 0xbac0
jmp 0x207d2
movl -0x70(%rbp), %esi
leaq -0x100(%rbp), %rdi
callq 0x21f00
jmp 0x2086d
leaq 0x211a7(%rip), %rsi     # 0x41a1b
leaq -0xe0(%rbp), %rdi
leaq -0x100(%rbp), %rdx
callq 0x21eb0
jmp 0x20889
leaq 0x211a4(%rip), %rdx     # 0x41a34
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x21e60
jmp 0x208a5
leaq -0xe0(%rbp), %rdi
callq 0x6678
leaq -0x100(%rbp), %rdi
callq 0x6678
cmpl $0x0, -0x70(%rbp)
jle 0x2094e
movl $0x20, %edi
callq 0x61e0
movq %rax, %rdi
movq %rdi, -0x160(%rbp)
leaq -0xc0(%rbp), %rsi
callq 0x6210
movq -0x160(%rbp), %rdi
leaq 0x416fb(%rip), %rsi     # 0x61ff0
movq 0x426b4(%rip), %rdx     # 0x62fb0
callq 0x6570
jmp 0x20b55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x2092c
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 0x20b31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x20b25
movq 0x42673(%rip), %rdi     # 0x62fc8
movq 0x42644(%rip), %rsi     # 0x62fa0
callq 0x6360
movq %rax, -0x168(%rbp)
jmp 0x2096a
movq -0x168(%rbp), %rdi
leaq 0x21119(%rip), %rsi     # 0x41a91
callq 0x6310
movq %rax, -0x170(%rbp)
jmp 0x20986
movq -0x170(%rbp), %rdi
movq 0x4260c(%rip), %rsi     # 0x62fa0
callq 0x6360
jmp 0x2099b
movq 0x4263e(%rip), %rdi     # 0x62fe0
leaq -0x48(%rbp), %rsi
callq 0x6090
jmp 0x209ad
xorl %eax, %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x6660
movq %rax, -0x178(%rbp)
jmp 0x209c3
movq -0x178(%rbp), %rax
movsbl (%rax), %edi
callq 0x6600
cmpl $0x53, %eax
jne 0x20ac2
leaq -0x120(%rbp), %rdi
movq %rdi, -0x180(%rbp)
leaq -0x58(%rbp), %rsi
callq 0xc060
movq -0x128(%rbp), %rsi
movq -0x180(%rbp), %rdx
leaq -0x110(%rbp), %rdi
callq 0x20b60
jmp 0x20a0e
leaq -0x110(%rbp), %rdi
callq 0x22020
movb %al, -0x181(%rbp)
leaq -0x110(%rbp), %rdi
callq 0xb4c0
leaq -0x120(%rbp), %rdi
callq 0xb4c0
movb -0x181(%rbp), %al
testb $0x1, %al
jne 0x20a44
jmp 0x20a94
movq 0x4257d(%rip), %rdi     # 0x62fc8
leaq 0x21067(%rip), %rsi     # 0x41ab9
callq 0x6310
movq %rax, -0x190(%rbp)
jmp 0x20a60
movq -0x190(%rbp), %rdi
movq 0x42532(%rip), %rsi     # 0x62fa0
callq 0x6360
jmp 0x20a75
jmp 0x20ac0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0xb4c0
jmp 0x20b25
movl $0x8, %edi
callq 0x61e0
movq %rax, %rdi
leaq 0x21027(%rip), %rax     # 0x41acf
movq %rax, (%rdi)
movq 0x424f6(%rip), %rsi     # 0x62fa8
xorl %eax, %eax
movl %eax, %edx
callq 0x6570
jmp 0x20b55
jmp 0x20af5
movq 0x424ff(%rip), %rdi     # 0x62fc8
leaq 0x20e5f(%rip), %rsi     # 0x4192f
callq 0x6310
movq %rax, -0x198(%rbp)
jmp 0x20ade
movq -0x198(%rbp), %rdi
movq 0x424b4(%rip), %rsi     # 0x62fa0
callq 0x6360
jmp 0x20af3
jmp 0x20af5
leaq -0xc0(%rbp), %rdi
callq 0x6678
leaq -0x58(%rbp), %rdi
callq 0xb4c0
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 0xb4c0
leaq -0x48(%rbp), %rdi
callq 0x6678
leaq -0x28(%rbp), %rdi
callq 0x6678
movq -0x68(%rbp), %rdi
callq 0x6590
nopw %cs:(%rax,%rax)