// File: /workspace/github_cpp_makefile_star2_O3/brashi[P]PetFera/src/./banco_dados.cpp
// Function: BancoDados::lerFuncionarios()
void BancoDados::lerFuncionarios() {
    if(!fs::exists(funcArq)) {
        cout << "Arquivo de funcionarios ainda não criado." << endl;
        cout << "Leitura cancelada..." << endl;
        return;
    }
    if(fs::is_empty(funcArq)) {
        cout << "Arquivo de funcionarios vazio." << endl;
        cout << "Leitura cancelada..." << endl;
        return;
    }

    ifstream arqDados(funcArq);
    if(arqDados.bad() || arqDados.fail()){
        throw "Arquivo de funcionarios inexistente ou corrompido.";
    }
    int count = 0;
    string temp;
    string linha;
    string palavra;
    vector<string> tokens;

    while(!arqDados.eof()) {
        tokens.clear();

        getline(arqDados, linha);
        stringstream s(linha);
        while(getline(s, palavra, ';')) {
            tokens.push_back(palavra);
        }

        if(tokens.size()) {
            if(tokens.at(0) == "vet") {
                petshop->adicionarVeterinario(make_shared<Veterinario>(
                    tokens.at(1),
                    tokens.at(2),
                    tokens.at(3),
                    tokens.at(4))
                );
            }
            if(tokens.at(0) == "trt") {
                petshop->adicionarTratador(make_shared<Tratador>(
                    tokens.at(1),
                    tokens.at(2),
                    tokens.at(3),
                    static_cast<Uniforme>(stoi(tokens.at(4)))
                ));
            }
            count++;
        }
    }

    arqDados.close();
    cout << "Arquivo de funcionários carregado com sucesso." << endl;
    cout << "Foram carregados " << count << " funcionários." << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x478, %rsp            # imm = 0x478
movq %rdi, 0x58(%rsp)
leaq 0x10(%rdi), %rbx
leaq 0xe8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq 0x9a64
movq %r14, %rdi
callq 0x5120
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
callq 0x9ae4
cmpb $-0x1, %r14b
je 0x753c
movzbl %r14b, %eax
testl %eax, %eax
jne 0x75cb
movq 0x23a8d(%rip), %rbx     # 0x2afd0
leaq 0x17c40(%rip), %rsi     # 0x1f18a
movl $0x2a, %edx
movq %rbx, %rdi
callq 0x5310
movq (%rbx), %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
leaq 0x17c30(%rip), %rsi     # 0x1f1b5
movl $0x14, %edx
movq %rbx, %rdi
callq 0x5310
movq (%rbx), %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
addq $0x478, %rsp            # imm = 0x478
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq 0x9a64
movq %r14, %rdi
callq 0x54a0
movl %eax, %ebp
leaq 0xe8(%rsp), %rdi
callq 0x9ae4
testb %bpl, %bpl
je 0x7617
movq 0x239ca(%rip), %rbx     # 0x2afd0
leaq 0x17bbd(%rip), %rsi     # 0x1f1ca
movl $0x1e, %edx
jmp 0x754f
leaq 0xe8(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x5410
movq (%rbp), %rax
movq -0x18(%rax), %rcx
testb $0x5, 0x108(%rsp,%rcx)
jne 0x7b4d
leaq 0xd8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %edx, %edx
movq %rdx, -0x8(%rcx)
movb %dl, (%rcx)
leaq 0xb8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rdx, -0x8(%rcx)
movb %dl, (%rcx)
leaq 0x98(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rdx, -0x8(%rcx)
movb %dl, (%rcx)
movq $0x0, 0x40(%rsp)
movq %rdx, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq -0x18(%rax), %rcx
testb $0x2, 0x108(%rsp,%rcx)
jne 0x79a7
movq $0x0, 0x10(%rsp)
leaq 0x2f0(%rsp), %r12
leaq 0x88(%rsp), %rbx
leaq 0x20(%rsp), %r14
movq $0x0, 0x40(%rsp)
movq 0x20(%rsp), %r15
movq 0x28(%rsp), %r13
cmpq %r15, %r13
je 0x7719
leaq 0x10(%r15), %rbp
movq -0x10(%rbp), %rdi
cmpq %rdi, %rbp
je 0x76f4
movq (%rbp), %rsi
incq %rsi
callq 0x52b0
leaq 0x20(%rbp), %rax
addq $0x10, %rbp
cmpq %r13, %rbp
movq %rax, %rbp
jne 0x76df
movq %r15, 0x28(%rsp)
movq 0xe8(%rsp), %rax
leaq 0xe8(%rsp), %rbp
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x5280
leaq 0xa8(%rsp), %r15
movsbl %al, %edx
movq %rbp, %rdi
movq %r15, %rsi
callq 0x5480
movq %r12, %rdi
movq %r15, %rsi
movl $0x18, %edx
callq 0x5400
leaq 0x70(%rsp), %r13
movq %r12, %rdi
movq %rbx, %rsi
movl $0x3b, %edx
callq 0x5480
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7780
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9c06
jmp 0x7755
movq 0x20(%rsp), %rdi
cmpq %rdi, 0x28(%rsp)
je 0x7971
leaq 0x17a85(%rip), %rsi     # 0x1f21c
callq 0x50d0
testl %eax, %eax
jne 0x7834
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
movq %rcx, %rdx
sarq $0x5, %rdx
cmpq $0x2, %rdx
jb 0x7af7
cmpq $0x40, %rcx
je 0x7af0
cmpq $0x4, %rdx
jb 0x7afe
cmpq $0x80, %rcx
je 0x7b30
movq 0x58(%rsp), %rcx
movq (%rcx), %r15
leaq 0x20(%rax), %rcx
leaq 0x40(%rax), %r8
leaq 0x60(%rax), %r9
subq $-0x80, %rax
movq $0x0, 0x70(%rsp)
movq %rax, (%rsp)
leaq 0x78(%rsp), %rdi
movq %r13, %rsi
leaq 0x48(%rsp), %rdx
callq 0xa8c0
movq %r15, %rdi
movq %r13, %rsi
callq 0xce84
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x7834
callq 0x9f52
movq 0x20(%rsp), %rdi
cmpq %rdi, 0x28(%rsp)
je 0x7aec
leaq 0x179d5(%rip), %rsi     # 0x1f220
callq 0x50d0
testl %eax, %eax
jne 0x7965
movq 0x20(%rsp), %r13
movq 0x28(%rsp), %rax
subq %r13, %rax
movq %rax, %rdx
sarq $0x5, %rdx
cmpq $0x2, %rdx
jb 0x7af7
cmpq $0x40, %rax
je 0x7af0
cmpq $0x3, %rdx
jbe 0x7afe
cmpq $0x80, %rax
je 0x7b1d
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%r13), %rbp
callq 0x5050
movq %rax, %r15
movl (%rax), %eax
movl %eax, 0x1c(%rsp)
movl $0x0, (%r15)
movq %rbp, %rdi
leaq 0x48(%rsp), %rsi
movl $0xa, %edx
callq 0x5380
cmpq %rbp, 0x48(%rsp)
je 0x7b11
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x7b05
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x7b05
testl %ecx, %ecx
leaq 0xe8(%rsp), %rbp
jne 0x790a
movl 0x1c(%rsp), %ecx
movl %ecx, (%r15)
leaq 0x20(%r13), %rcx
leaq 0x40(%r13), %r8
addq $0x60, %r13
movl %eax, 0x54(%rsp)
movq $0x0, 0x60(%rsp)
leaq 0x54(%rsp), %rax
movq %rax, (%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %r15
movq %r15, %rsi
leaq 0x48(%rsp), %rdx
movq %r13, %r9
callq 0xab4c
movq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0xce8e
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x7965
callq 0x9f52
movq 0x40(%rsp), %rax
incl %eax
movq %rax, 0x40(%rsp)
movq %r12, %rdi
movq 0x2361d(%rip), %rsi     # 0x2af98
callq 0x5200
leaq 0x370(%rsp), %rdi
callq 0x50f0
movq 0xe8(%rsp), %rax
movq -0x18(%rax), %rcx
testb $0x2, 0x108(%rsp,%rcx)
je 0x76cc
leaq 0xe8(%rsp), %rdi
callq 0x5080
movq 0x23615(%rip), %rbx     # 0x2afd0
leaq 0x17862(%rip), %rsi     # 0x1f224
movl $0x2f, %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 0x235e3(%rip), %rdi     # 0x2afd0
callq 0x5030
movq %rax, %rdi
callq 0x51c0
movq 0x235cf(%rip), %rdi     # 0x2afd0
leaq 0x1784c(%rip), %rsi     # 0x1f254
movl $0x11, %edx
callq 0x5310
movq 0x235b7(%rip), %rdi     # 0x2afd0
movq 0x40(%rsp), %rsi
callq 0x5450
movq %rax, %rbx
leaq 0x17667(%rip), %rsi     # 0x1f094
movl $0xf, %edx
movq %rax, %rdi
callq 0x5310
movq (%rbx), %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
leaq 0x20(%rsp), %rdi
callq 0x9c44
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x7a90
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x7ab5
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x7ada
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x52b0
leaq 0xe8(%rsp), %rdi
callq 0x5090
jmp 0x75b9
xorl %edx, %edx
jmp 0x7b3a
movl $0x2, %eax
jmp 0x7b35
movl $0x1, %eax
jmp 0x7b35
movl $0x3, %eax
jmp 0x7b35
leaq 0x178d4(%rip), %rdi     # 0x1f3e0
callq 0x53a0
leaq 0x178c8(%rip), %rdi     # 0x1f3e0
callq 0x51b0
leaq 0x178db(%rip), %rdi     # 0x1f3ff
movl $0x4, %esi
xorl %eax, %eax
callq 0x53d0
movl $0x4, %eax
movq %rax, 0x10(%rsp)
leaq 0x178be(%rip), %rdi     # 0x1f3ff
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x53d0
movl $0x8, %edi
callq 0x5170
leaq 0x1768b(%rip), %rcx     # 0x1f1e9
movq %rcx, (%rax)
movq 0x23448(%rip), %rsi     # 0x2afb0
movq %rax, %rdi
xorl %edx, %edx
callq 0x5440
movq %rax, %rbx
jmp 0x7c6f
jmp 0x7ba0
movq %rax, %rbx
movq 0x68(%rsp), %rdi
jmp 0x7b90
jmp 0x7bd2
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x7bd5
callq 0x9f52
jmp 0x7bd5
jmp 0x7bd2
jmp 0x7bd2
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x9ae4
jmp 0x7c7c
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x7bd5
movl 0x1c(%rsp), %eax
movl %eax, (%r15)
jmp 0x7bd5
jmp 0x7bcb
jmp 0x7bcb
movq %rax, %rbx
jmp 0x7bf6
jmp 0x7bd2
movq %rax, %rbx
movq 0x233bc(%rip), %rsi     # 0x2af98
leaq 0x2f0(%rsp), %rdi
callq 0x5200
leaq 0x370(%rsp), %rdi
callq 0x50f0
leaq 0x20(%rsp), %rdi
callq 0x9c44
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x7c25
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x7c4a
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x52b0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x7c6f
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x52b0
leaq 0xe8(%rsp), %rdi
callq 0x5090
movq %rbx, %rdi
callq 0x5460