// File: /workspace/github_cpp_makefile_star2_O1/brashi[P]PetFera/src/./banco_dados.cpp
// Function: BancoDados::salvarFuncionarios()
void BancoDados::salvarFuncionarios() {
    /*if(petshop->getTratadores().size() == 0 && petshop->getVeterinarios().size() == 0) {
        throw "Nenhum funcionário registrado. Geração de arquivo cancelada.";
    } */
    ofstream arqDados(funcArq);

    if(arqDados.bad() || arqDados.fail()) {
        throw "Algo deu errado na criação do arquivo de funcionários.";
    }

    for(auto& vet : petshop->getVeterinarios())
        arqDados << "vet;" << vet->getNome() << ';' << vet->getTelefone() << ';' << vet->getEmail() <<
        ';' << vet->getCRMV() << endl;

    for(auto& trt : petshop->getTratadores())
        arqDados << "trt;" << trt->getNome() << ';' << trt->getTelefone() << ';' << trt->getEmail()
            << ';' << trt->getUniforme() << endl;

    
    arqDados.close();
    if(fs::is_empty(funcArq)) {
        fs::remove(funcArq);
        return;
    }

    cout << "Arquivo de funcionários salvo com sucesso." << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rdi, %r14
leaq 0x10(%rdi), %rsi
leaq 0xb8(%rsp), %rbx
movq %rbx, %rdi
movq %rsi, 0x90(%rsp)
movl $0x10, %edx
callq 0x64c0
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xd8(%rsp,%rax)
jne 0x74c5
movq %r14, 0xb0(%rsp)
movq (%r14), %rsi
leaq 0x98(%rsp), %rdi
callq 0x14b38
movq 0x98(%rsp), %r13
movq 0xa0(%rsp), %r12
cmpq %r12, %r13
je 0x721f
leaq 0x50(%rsp), %rbp
leaq 0x30(%rsp), %rbx
leaq 0x70(%rsp), %r14
movl $0x4, %edx
leaq 0xb8(%rsp), %rdi
leaq 0x19ffe(%rip), %rsi     # 0x210a4
callq 0x6310
movq (%r13), %rsi
leaq 0x8(%rsp), %rdi
callq 0x159d2
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0xb8(%rsp), %rdi
callq 0x6310
movb $0x3b, 0x50(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x6310
movq %rax, %r15
movq (%r13), %rsi
movq %rbp, %rdi
callq 0x15b52
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r15, %rdi
callq 0x6310
movb $0x3b, 0x30(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x6310
movq %rax, %r15
movq (%r13), %rsi
movq %rbx, %rdi
callq 0x15cd2
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r15, %rdi
callq 0x6310
movb $0x3b, 0x70(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x6310
movq %rax, %r15
movq (%r13), %rsi
movq %r14, %rdi
callq 0x16caa
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq %r15, %rdi
callq 0x6310
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x6280
movsbl %al, %esi
movq %r15, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x61c0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x71be
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x71da
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x71f6
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x7212
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x62b0
addq $0x10, %r13
cmpq %r12, %r13
jne 0x7092
leaq 0x98(%rsp), %rdi
callq 0xab84
movq 0xb0(%rsp), %rax
movq (%rax), %rsi
leaq 0x70(%rsp), %rdi
callq 0x14b46
movq 0x70(%rsp), %r15
movq 0x78(%rsp), %rbp
cmpq %rbp, %r15
je 0x73c0
leaq 0xb8(%rsp), %r14
leaq 0x50(%rsp), %r12
leaq 0x30(%rsp), %r13
movl $0x4, %edx
movq %r14, %rdi
leaq 0x19e34(%rip), %rsi     # 0x210a9
callq 0x6310
movq (%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x159d2
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x6310
movb $0x3b, 0x50(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x6310
movq %rax, %rbx
movq (%r15), %rsi
movq %r12, %rdi
callq 0x15b52
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %rbx, %rdi
callq 0x6310
movb $0x3b, 0x30(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x6310
movq %rax, %rbx
movq (%r15), %rsi
movq %r13, %rdi
callq 0x15cd2
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %rbx, %rdi
callq 0x6310
movb $0x3b, 0x98(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x98(%rsp), %rsi
callq 0x6310
movq %rax, %rbx
movq (%r15), %rdi
callq 0x160d4
movq %rbx, %rdi
movl %eax, %esi
callq 0x6450
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x6280
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x61c0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x737b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x7397
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x73b3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x62b0
addq $0x10, %r15
cmpq %rbp, %r15
jne 0x7266
leaq 0x70(%rsp), %rdi
callq 0xabcc
leaq 0xb8(%rsp), %rdi
callq 0x6390
leaq 0x8(%rsp), %rdi
movq 0x90(%rsp), %rsi
movl $0x2, %edx
callq 0xaacc
leaq 0x8(%rsp), %rdi
callq 0x64a0
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0xab4c
testb %bl, %bl
je 0x7435
leaq 0x8(%rsp), %rdi
movq 0x90(%rsp), %rsi
movl $0x2, %edx
callq 0xaacc
leaq 0x8(%rsp), %rdi
callq 0x6230
leaq 0x8(%rsp), %rdi
callq 0xab4c
jmp 0x747b
movq 0x26b94(%rip), %rbx     # 0x2dfd0
leaq 0x19c6b(%rip), %rsi     # 0x210ae
movl $0x2b, %edx
movq %rbx, %rdi
callq 0x6310
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x6280
movsbl %al, %esi
movq 0x26b62(%rip), %rdi     # 0x2dfd0
callq 0x6030
movq %rax, %rdi
callq 0x61c0
movq 0x26b3e(%rip), %rax     # 0x2dfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0xc0(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0xb8(%rsp,%rcx)
callq 0x6250
leaq 0x1b0(%rsp), %rdi
callq 0x60f0
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, %edi
callq 0x6170
leaq 0x19b94(%rip), %rcx     # 0x2106a
movq %rcx, (%rax)
movq 0x26ad0(%rip), %rsi     # 0x2dfb0
movq %rax, %rdi
xorl %edx, %edx
callq 0x6440
jmp 0x74ee
jmp 0x7506
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xab4c
jmp 0x7634
jmp 0x7506
jmp 0x7506
jmp 0x7506
movq %rax, %rbx
jmp 0x7634
jmp 0x7510
movq %rax, %rbx
jmp 0x762a
jmp 0x752c
jmp 0x7534
jmp 0x751e
movq %rax, %rbx
jmp 0x75c4
jmp 0x7541
jmp 0x7546
jmp 0x753c
movq %rax, %rbx
jmp 0x760e
movq %rax, %rbx
jmp 0x75f2
movq %rax, %rbx
jmp 0x7570
movq %rax, %rbx
jmp 0x75a8
movq %rax, %rbx
jmp 0x758c
movq %rax, %rbx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x7570
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x758c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x75a8
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x75c4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x62b0
leaq 0x98(%rsp), %rdi
callq 0xab84
jmp 0x7634
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x75f2
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x760e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x762a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x62b0
leaq 0x70(%rsp), %rdi
callq 0xabcc
leaq 0xb8(%rsp), %rdi
callq 0x63c0
movq %rbx, %rdi
callq 0x6460
nop