// File: 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
movq %rsp, %rbp
subq $0x470, %rsp            # imm = 0x470
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x3c8(%rbp)
addq $0x10, %rsi
leaq -0x208(%rbp), %rdi
movl $0x10, %edx
callq 0x6630
movq -0x208(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x208(%rbp,%rax), %rdi
callq 0x65d0
movb %al, -0x3bd(%rbp)
jmp 0x74cf
movb -0x3bd(%rbp), %al
testb $0x1, %al
jne 0x7507
jmp 0x74db
movq -0x208(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x208(%rbp,%rax), %rdi
callq 0x6030
movb %al, -0x3c9(%rbp)
jmp 0x74fb
movb -0x3c9(%rbp), %al
testb $0x1, %al
jne 0x7507
jmp 0x754a
movl $0x8, %edi
callq 0x61e0
movq %rax, %rdi
leaq 0x38bc7(%rip), %rax     # 0x400e2
movq %rax, (%rdi)
movq 0x5ba83(%rip), %rsi     # 0x62fa8
xorl %eax, %eax
movl %eax, %edx
callq 0x6570
jmp 0x7c09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x7bf1
movq -0x3c8(%rbp), %rdi
callq 0xb090
movq %rax, %rsi
leaq -0x238(%rbp), %rdi
callq 0x217a0
jmp 0x7567
leaq -0x238(%rbp), %rax
movq %rax, -0x220(%rbp)
movq -0x220(%rbp), %rdi
callq 0xb0b0
movq %rax, -0x240(%rbp)
movq -0x220(%rbp), %rdi
callq 0xb0e0
movq %rax, -0x248(%rbp)
leaq -0x240(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0xb110
testb $0x1, %al
jne 0x75c3
leaq -0x238(%rbp), %rdi
callq 0xb1b0
jmp 0x781d
leaq -0x240(%rbp), %rdi
callq 0xb150
movq %rax, -0x250(%rbp)
leaq 0x38b3f(%rip), %rsi     # 0x4011c
leaq -0x208(%rbp), %rdi
callq 0x6310
movq %rax, -0x3d8(%rbp)
jmp 0x75f2
movq -0x250(%rbp), %rdi
callq 0xb170
movq %rax, %rsi
leaq -0x270(%rbp), %rdi
callq 0x27920
jmp 0x760f
movq -0x3d8(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x6300
movq %rax, -0x3e0(%rbp)
jmp 0x762b
movq -0x3e0(%rbp), %rdi
movl $0x3b, %esi
callq 0x63f0
movq %rax, -0x3e8(%rbp)
jmp 0x7645
movq -0x250(%rbp), %rdi
callq 0xb170
movq %rax, %rsi
leaq -0x290(%rbp), %rdi
callq 0x27ab0
jmp 0x7662
movq -0x3e8(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x6300
movq %rax, -0x3f0(%rbp)
jmp 0x767e
movq -0x3f0(%rbp), %rdi
movl $0x3b, %esi
callq 0x63f0
movq %rax, -0x3f8(%rbp)
jmp 0x7698
movq -0x250(%rbp), %rdi
callq 0xb170
movq %rax, %rsi
leaq -0x2b0(%rbp), %rdi
callq 0x27c40
jmp 0x76b5
movq -0x3f8(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x6300
movq %rax, -0x400(%rbp)
jmp 0x76d1
movq -0x400(%rbp), %rdi
movl $0x3b, %esi
callq 0x63f0
movq %rax, -0x408(%rbp)
jmp 0x76eb
movq -0x250(%rbp), %rdi
callq 0xb170
movq %rax, %rsi
leaq -0x2d0(%rbp), %rdi
callq 0x28be0
jmp 0x7708
movq -0x408(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x6300
movq %rax, -0x410(%rbp)
jmp 0x7724
movq -0x410(%rbp), %rdi
movq 0x5b86e(%rip), %rsi     # 0x62fa0
callq 0x6360
jmp 0x7739
leaq -0x2d0(%rbp), %rdi
callq 0x6678
leaq -0x2b0(%rbp), %rdi
callq 0x6678
leaq -0x290(%rbp), %rdi
callq 0x6678
leaq -0x270(%rbp), %rdi
callq 0x6678
leaq -0x240(%rbp), %rdi
callq 0xb190
jmp 0x759b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x780c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x7800
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x77f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x77e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x6678
leaq -0x2b0(%rbp), %rdi
callq 0x6678
leaq -0x290(%rbp), %rdi
callq 0x6678
leaq -0x270(%rbp), %rdi
callq 0x6678
leaq -0x238(%rbp), %rdi
callq 0xb1b0
jmp 0x7bf1
movq -0x3c8(%rbp), %rdi
callq 0xb090
movq %rax, %rsi
leaq -0x2f0(%rbp), %rdi
callq 0x217d0
jmp 0x783a
leaq -0x2f0(%rbp), %rax
movq %rax, -0x2d8(%rbp)
movq -0x2d8(%rbp), %rdi
callq 0xb210
movq %rax, -0x2f8(%rbp)
movq -0x2d8(%rbp), %rdi
callq 0xb240
movq %rax, -0x300(%rbp)
leaq -0x2f8(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0xb270
testb $0x1, %al
jne 0x7896
leaq -0x2f0(%rbp), %rdi
callq 0xb310
jmp 0x7ac2
leaq -0x2f8(%rbp), %rdi
callq 0xb2b0
movq %rax, -0x308(%rbp)
leaq 0x38871(%rip), %rsi     # 0x40121
leaq -0x208(%rbp), %rdi
callq 0x6310
movq %rax, -0x418(%rbp)
jmp 0x78c5
movq -0x308(%rbp), %rdi
callq 0xb2d0
movq %rax, %rsi
leaq -0x328(%rbp), %rdi
callq 0x27920
jmp 0x78e2
movq -0x418(%rbp), %rdi
leaq -0x328(%rbp), %rsi
callq 0x6300
movq %rax, -0x420(%rbp)
jmp 0x78fe
movq -0x420(%rbp), %rdi
movl $0x3b, %esi
callq 0x63f0
movq %rax, -0x428(%rbp)
jmp 0x7918
movq -0x308(%rbp), %rdi
callq 0xb2d0
movq %rax, %rsi
leaq -0x348(%rbp), %rdi
callq 0x27ab0
jmp 0x7935
movq -0x428(%rbp), %rdi
leaq -0x348(%rbp), %rsi
callq 0x6300
movq %rax, -0x430(%rbp)
jmp 0x7951
movq -0x430(%rbp), %rdi
movl $0x3b, %esi
callq 0x63f0
movq %rax, -0x438(%rbp)
jmp 0x796b
movq -0x308(%rbp), %rdi
callq 0xb2d0
movq %rax, %rsi
leaq -0x368(%rbp), %rdi
callq 0x27c40
jmp 0x7988
movq -0x438(%rbp), %rdi
leaq -0x368(%rbp), %rsi
callq 0x6300
movq %rax, -0x440(%rbp)
jmp 0x79a4
movq -0x440(%rbp), %rdi
movl $0x3b, %esi
callq 0x63f0
movq %rax, -0x448(%rbp)
jmp 0x79be
movq -0x308(%rbp), %rdi
callq 0xb2d0
movq %rax, %rdi
callq 0x280c0
movl %eax, -0x44c(%rbp)
jmp 0x79da
movl -0x44c(%rbp), %esi
movq -0x448(%rbp), %rdi
callq 0x6580
movq %rax, -0x458(%rbp)
jmp 0x79f5
movq -0x458(%rbp), %rdi
movq 0x5b59d(%rip), %rsi     # 0x62fa0
callq 0x6360
jmp 0x7a0a
leaq -0x368(%rbp), %rdi
callq 0x6678
leaq -0x348(%rbp), %rdi
callq 0x6678
leaq -0x328(%rbp), %rdi
callq 0x6678
leaq -0x2f8(%rbp), %rdi
callq 0xb2f0
jmp 0x786e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x7ab1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x7aa5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x7a99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
leaq -0x368(%rbp), %rdi
callq 0x6678
leaq -0x348(%rbp), %rdi
callq 0x6678
leaq -0x328(%rbp), %rdi
callq 0x6678
leaq -0x2f0(%rbp), %rdi
callq 0xb310
jmp 0x7bf1
leaq -0x208(%rbp), %rdi
callq 0x64a0
jmp 0x7ad0
movq -0x3c8(%rbp), %rsi
addq $0x10, %rsi
leaq -0x390(%rbp), %rdi
movl $0x2, %edx
callq 0xaea0
jmp 0x7aee
leaq -0x390(%rbp), %rdi
callq 0x6610
movb %al, -0x459(%rbp)
jmp 0x7b02
leaq -0x390(%rbp), %rdi
callq 0xaf80
movb -0x459(%rbp), %al
testb $0x1, %al
jne 0x7b1d
jmp 0x7ba1
movq -0x3c8(%rbp), %rsi
addq $0x10, %rsi
leaq -0x3b8(%rbp), %rdi
movl $0x2, %edx
callq 0xaea0
jmp 0x7b3b
leaq -0x3b8(%rbp), %rdi
callq 0x62c0
jmp 0x7b49
leaq -0x3b8(%rbp), %rdi
callq 0xaf80
movl $0x1, -0x3bc(%rbp)
jmp 0x7bdc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
leaq -0x390(%rbp), %rdi
callq 0xaf80
jmp 0x7bf1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
leaq -0x3b8(%rbp), %rdi
callq 0xaf80
jmp 0x7bf1
movq 0x5b420(%rip), %rdi     # 0x62fc8
leaq 0x38577(%rip), %rsi     # 0x40126
callq 0x6310
movq %rax, -0x468(%rbp)
jmp 0x7bbd
movq -0x468(%rbp), %rdi
movq 0x5b3d5(%rip), %rsi     # 0x62fa0
callq 0x6360
jmp 0x7bd2
movl $0x0, -0x3bc(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x64e0
addq $0x470, %rsp            # imm = 0x470
popq %rbp
retq
leaq -0x208(%rbp), %rdi
callq 0x64e0
movq -0x210(%rbp), %rdi
callq 0x6590
nopl (%rax)