// File: /workspace/github_cpp_makefile_star2_O1/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 0xaacc
movq %r14, %rdi
callq 0x6120
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
callq 0xab4c
cmpb $-0x1, %r14b
je 0x85bc
movzbl %r14b, %eax
testl %eax, %eax
jne 0x864b
movq 0x25a0d(%rip), %rbx     # 0x2dfd0
leaq 0x18bc0(%rip), %rsi     # 0x2118a
movl $0x2a, %edx
movq %rbx, %rdi
callq 0x6310
movq (%rbx), %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
leaq 0x18bb0(%rip), %rsi     # 0x211b5
movl $0x14, %edx
movq %rbx, %rdi
callq 0x6310
movq (%rbx), %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
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 0xaacc
movq %r14, %rdi
callq 0x64a0
movl %eax, %ebp
leaq 0xe8(%rsp), %rdi
callq 0xab4c
testb %bpl, %bpl
je 0x8697
movq 0x2594a(%rip), %rbx     # 0x2dfd0
leaq 0x18b3d(%rip), %rsi     # 0x211ca
movl $0x1e, %edx
jmp 0x85cf
leaq 0xe8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x6410
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x108(%rsp,%rax)
jne 0x8bd8
leaq 0xd8(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %ecx, %ecx
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
leaq 0xb8(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
movq $0x0, 0x40(%rsp)
movq %rcx, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0xe8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x108(%rsp,%rax)
jne 0x8a32
movq $0x0, 0x10(%rsp)
leaq 0x2f0(%rsp), %rbp
leaq 0x88(%rsp), %r15
leaq 0x20(%rsp), %rbx
movq $0x0, 0x40(%rsp)
movq 0x20(%rsp), %r14
movq 0x28(%rsp), %r12
cmpq %r14, %r12
je 0x8799
leaq 0x10(%r14), %r13
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0x877c
movq (%r13), %rsi
incq %rsi
callq 0x62b0
leaq 0x20(%r13), %rax
addq $0x10, %r13
cmpq %r12, %r13
movq %rax, %r13
jne 0x8767
movq %r14, 0x28(%rsp)
leaq 0xe8(%rsp), %r13
movq 0xe8(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x6280
leaq 0xa8(%rsp), %r14
movsbl %al, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x6480
movq %rbp, %rdi
movq %r14, %rsi
movl $0x18, %edx
callq 0x6400
leaq 0x70(%rsp), %r12
movq %rbp, %rdi
movq %r15, %rsi
movl $0x3b, %edx
callq 0x6480
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x8808
movq %rbx, %rdi
movq %r15, %rsi
callq 0xac5c
jmp 0x87dd
movq 0x20(%rsp), %rdi
cmpq %rdi, 0x28(%rsp)
je 0x89fc
leaq 0x189fd(%rip), %rsi     # 0x2121c
callq 0x60d0
testl %eax, %eax
jne 0x88bc
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
movq %rcx, %rdx
sarq $0x5, %rdx
cmpq $0x2, %rdx
jb 0x8b82
cmpq $0x40, %rcx
je 0x8b7b
cmpq $0x4, %rdx
jb 0x8b89
cmpq $0x80, %rcx
je 0x8bbb
movq 0x58(%rsp), %rcx
movq (%rcx), %r14
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 %r12, %rsi
leaq 0x48(%rsp), %rdx
callq 0xb94c
movq %r14, %rdi
movq %r12, %rsi
callq 0xe01c
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x88bc
callq 0xafa0
movq 0x20(%rsp), %rdi
cmpq %rdi, 0x28(%rsp)
je 0x8b77
leaq 0x1894d(%rip), %rsi     # 0x21220
callq 0x60d0
testl %eax, %eax
jne 0x89f0
movq 0x20(%rsp), %r12
movq 0x28(%rsp), %rax
subq %r12, %rax
movq %rax, %rdx
sarq $0x5, %rdx
cmpq $0x2, %rdx
jb 0x8b82
cmpq $0x40, %rax
je 0x8b7b
cmpq $0x3, %rdx
jbe 0x8b89
cmpq $0x80, %rax
je 0x8ba8
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%r12), %r13
callq 0x6050
movq %rax, %r14
movl (%rax), %eax
movl %eax, 0x1c(%rsp)
movl $0x0, (%r14)
movq %r13, %rdi
leaq 0x48(%rsp), %rsi
movl $0xa, %edx
callq 0x6380
cmpq %r13, 0x48(%rsp)
je 0x8b9c
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x8b90
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x8b90
testl %ecx, %ecx
leaq 0xe8(%rsp), %r13
jne 0x8993
movl 0x1c(%rsp), %ecx
movl %ecx, (%r14)
leaq 0x20(%r12), %rcx
leaq 0x40(%r12), %r8
addq $0x60, %r12
movl %eax, 0x54(%rsp)
movq $0x0, 0x60(%rsp)
leaq 0x54(%rsp), %rax
movq %rax, (%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %r14
movq %r14, %rsi
leaq 0x48(%rsp), %rdx
movq %r12, %r9
callq 0xbbe6
movq 0x80(%rsp), %rdi
movq %r14, %rsi
callq 0xe026
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x89f0
callq 0xafa0
movq 0x40(%rsp), %rax
incl %eax
movq %rax, 0x40(%rsp)
movq %rbp, %rdi
movq 0x25592(%rip), %rsi     # 0x2df98
callq 0x6200
leaq 0x370(%rsp), %rdi
callq 0x60f0
movq 0xe8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x108(%rsp,%rax)
je 0x8754
leaq 0xe8(%rsp), %rdi
callq 0x6080
movq 0x2558a(%rip), %rbx     # 0x2dfd0
leaq 0x187d7(%rip), %rsi     # 0x21224
movl $0x2f, %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 0x25558(%rip), %rdi     # 0x2dfd0
callq 0x6030
movq %rax, %rdi
callq 0x61c0
movq 0x25544(%rip), %rdi     # 0x2dfd0
leaq 0x187c1(%rip), %rsi     # 0x21254
movl $0x11, %edx
callq 0x6310
movq 0x2552c(%rip), %rdi     # 0x2dfd0
movq 0x40(%rsp), %rsi
callq 0x6450
movq %rax, %rbx
leaq 0x185dc(%rip), %rsi     # 0x21094
movl $0xf, %edx
movq %rax, %rdi
callq 0x6310
movq (%rbx), %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
leaq 0x20(%rsp), %rdi
callq 0xac9a
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x8b1b
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x8b40
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x8b65
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x62b0
leaq 0xe8(%rsp), %rdi
callq 0x6090
jmp 0x8639
xorl %edx, %edx
jmp 0x8bc5
movl $0x2, %eax
jmp 0x8bc0
movl $0x1, %eax
jmp 0x8bc0
movl $0x3, %eax
jmp 0x8bc0
leaq 0x18849(%rip), %rdi     # 0x213e0
callq 0x63a0
leaq 0x1883d(%rip), %rdi     # 0x213e0
callq 0x61b0
leaq 0x18850(%rip), %rdi     # 0x213ff
movl $0x4, %esi
xorl %eax, %eax
callq 0x63d0
movl $0x4, %eax
movq %rax, 0x10(%rsp)
leaq 0x18833(%rip), %rdi     # 0x213ff
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x63d0
movl $0x8, %edi
callq 0x6170
leaq 0x18600(%rip), %rcx     # 0x211e9
movq %rcx, (%rax)
movq 0x253bd(%rip), %rsi     # 0x2dfb0
movq %rax, %rdi
xorl %edx, %edx
callq 0x6440
movq %rax, %rbx
jmp 0x8cfa
jmp 0x8c2b
movq %rax, %rbx
movq 0x68(%rsp), %rdi
jmp 0x8c1b
jmp 0x8c5d
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x8c60
callq 0xafa0
jmp 0x8c60
jmp 0x8c5d
jmp 0x8c5d
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0xab4c
jmp 0x8d07
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x8c60
movl 0x1c(%rsp), %eax
movl %eax, (%r14)
jmp 0x8c60
jmp 0x8c56
jmp 0x8c56
movq %rax, %rbx
jmp 0x8c81
jmp 0x8c5d
movq %rax, %rbx
movq 0x25331(%rip), %rsi     # 0x2df98
leaq 0x2f0(%rsp), %rdi
callq 0x6200
leaq 0x370(%rsp), %rdi
callq 0x60f0
leaq 0x20(%rsp), %rdi
callq 0xac9a
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x8cb0
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x8cd5
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x62b0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x8cfa
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x62b0
leaq 0xe8(%rsp), %rdi
callq 0x6090
movq %rbx, %rdi
callq 0x6460
nop