// File: /workspace/github_cpp_makefile_star2_O3/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 0x54c0
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xd8(%rsp,%rax)
jne 0x6495
movq %r14, 0xb0(%rsp)
movq (%r14), %rsi
leaq 0x98(%rsp), %rdi
callq 0x13932
movq 0x98(%rsp), %r13
movq 0xa0(%rsp), %r12
cmpq %r12, %r13
je 0x61ef
leaq 0x50(%rsp), %rbp
leaq 0x30(%rsp), %rbx
leaq 0x70(%rsp), %r14
movl $0x4, %edx
leaq 0xb8(%rsp), %rdi
leaq 0x1902e(%rip), %rsi     # 0x1f0a4
callq 0x5310
movq (%r13), %rsi
leaq 0x8(%rsp), %rdi
callq 0x14736
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0xb8(%rsp), %rdi
callq 0x5310
movb $0x3b, 0x50(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x5310
movq %rax, %r15
movq (%r13), %rsi
movq %rbp, %rdi
callq 0x148b6
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r15, %rdi
callq 0x5310
movb $0x3b, 0x30(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5310
movq %rax, %r15
movq (%r13), %rsi
movq %rbx, %rdi
callq 0x14a36
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r15, %rdi
callq 0x5310
movb $0x3b, 0x70(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x5310
movq %rax, %r15
movq (%r13), %rsi
movq %r14, %rdi
callq 0x1599a
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq %r15, %rdi
callq 0x5310
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x5280
movsbl %al, %esi
movq %r15, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51c0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x618e
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x61aa
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x61c6
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x61e2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52b0
addq $0x10, %r13
cmpq %r12, %r13
jne 0x6062
leaq 0x98(%rsp), %rdi
callq 0x9b1c
movq 0xb0(%rsp), %rax
movq (%rax), %rsi
leaq 0x70(%rsp), %rdi
callq 0x13940
movq 0x70(%rsp), %r15
movq 0x78(%rsp), %rbp
cmpq %rbp, %r15
je 0x6390
leaq 0xb8(%rsp), %r14
leaq 0x50(%rsp), %r12
leaq 0x30(%rsp), %r13
movl $0x4, %edx
movq %r14, %rdi
leaq 0x18e64(%rip), %rsi     # 0x1f0a9
callq 0x5310
movq (%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x14736
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x5310
movb $0x3b, 0x50(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x5310
movq %rax, %rbx
movq (%r15), %rsi
movq %r12, %rdi
callq 0x148b6
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %rbx, %rdi
callq 0x5310
movb $0x3b, 0x30(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x5310
movq %rax, %rbx
movq (%r15), %rsi
movq %r13, %rdi
callq 0x14a36
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %rbx, %rdi
callq 0x5310
movb $0x3b, 0x98(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x98(%rsp), %rsi
callq 0x5310
movq %rax, %rbx
movq (%r15), %rdi
callq 0x14e54
movq %rbx, %rdi
movl %eax, %esi
callq 0x5450
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5280
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51c0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x634b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x6367
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6383
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52b0
addq $0x10, %r15
cmpq %rbp, %r15
jne 0x6236
leaq 0x70(%rsp), %rdi
callq 0x9b6a
leaq 0xb8(%rsp), %rdi
callq 0x5390
leaq 0x8(%rsp), %rdi
movq 0x90(%rsp), %rsi
movl $0x2, %edx
callq 0x9a64
leaq 0x8(%rsp), %rdi
callq 0x54a0
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0x9ae4
testb %bl, %bl
je 0x6405
leaq 0x8(%rsp), %rdi
movq 0x90(%rsp), %rsi
movl $0x2, %edx
callq 0x9a64
leaq 0x8(%rsp), %rdi
callq 0x5230
leaq 0x8(%rsp), %rdi
callq 0x9ae4
jmp 0x644b
movq 0x24bc4(%rip), %rbx     # 0x2afd0
leaq 0x18c9b(%rip), %rsi     # 0x1f0ae
movl $0x2b, %edx
movq %rbx, %rdi
callq 0x5310
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5280
movsbl %al, %esi
movq 0x24b92(%rip), %rdi     # 0x2afd0
callq 0x5030
movq %rax, %rdi
callq 0x51c0
movq 0x24b6e(%rip), %rax     # 0x2afc0
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 0x5250
leaq 0x1b0(%rsp), %rdi
callq 0x50f0
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, %edi
callq 0x5170
leaq 0x18bc4(%rip), %rcx     # 0x1f06a
movq %rcx, (%rax)
movq 0x24b00(%rip), %rsi     # 0x2afb0
movq %rax, %rdi
xorl %edx, %edx
callq 0x5440
jmp 0x64be
jmp 0x64d6
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x9ae4
jmp 0x6604
jmp 0x64d6
jmp 0x64d6
jmp 0x64d6
movq %rax, %rbx
jmp 0x6604
jmp 0x64e0
movq %rax, %rbx
jmp 0x65fa
jmp 0x64fc
jmp 0x6504
jmp 0x64ee
movq %rax, %rbx
jmp 0x6594
jmp 0x6511
jmp 0x6516
jmp 0x650c
movq %rax, %rbx
jmp 0x65de
movq %rax, %rbx
jmp 0x65c2
movq %rax, %rbx
jmp 0x6540
movq %rax, %rbx
jmp 0x6578
movq %rax, %rbx
jmp 0x655c
movq %rax, %rbx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x6540
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x655c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x6578
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6594
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52b0
leaq 0x98(%rsp), %rdi
callq 0x9b1c
jmp 0x6604
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x65c2
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x65de
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x65fa
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x52b0
leaq 0x70(%rsp), %rdi
callq 0x9b6a
leaq 0xb8(%rsp), %rdi
callq 0x53c0
movq %rbx, %rdi
callq 0x5460
nop