// File: /workspace/github_cpp_makefile_star2_O1/viniciu21[P]PetLolja/./src/PetFera.cpp
// Function: Petfera::atualizar_funcionario(std::shared_ptr<Funcionario>)
bool Petfera::atualizar_funcionario(std::shared_ptr<Funcionario> funcionario)
{
	string alterar_string;
	bool alterar_bool;
	short escolha;
	string escolha_str;
	stringstream ss;

	cout << "o que vc quer atualizar? "
			 << "\n"
			 << "# Temos as seguintes opcao : # "
			 << "\n"
			 << "    1 -> Alterar nome "
			 << "\n"
			 << "    2 -> Alterar cpf"
			 << "\n"
			 << "    3 -> Alterar numero do telefone"
			 << "\n"
			 << "    4 -> Alterar email"
			 << endl;

	if (funcionario->getClassicicacao() == Veterinario)
	{
		cout << "    5 -> Alterar inscricao no CRMV" << endl;
	}
	else if (funcionario->getClassicicacao() == Tratador)
	{
		cout << "    6 -> Alterar nivel de seguranca" << endl;
	}

	cin >> escolha_str;
	ss << escolha_str;
	ss >> escolha;

	cout << "Escolha uma opcao"
			 << "\n";

	if (escolha == 1)
	{
		cout << "Digite o novo nome \n";

		cin >> alterar_string;

		funcionario->setNome(alterar_string);
	}
	else if (escolha == 2)
	{
		cout << "Digite o novo cpf \n";

		cin >> alterar_string;

		funcionario->setCpf(alterar_string);
	}
	else if (escolha == 3)
	{
		cout << "Digite o novo cell \n";

		cin >> alterar_string;

		funcionario->setCelularProfissional(alterar_string);
	}
	else if (escolha == 4)
	{
		cout << "Digite o novo email \n";

		cin >> alterar_string;

		funcionario->setEmail(alterar_string);
	}
	else if (escolha == 5)
	{
		alterar_bool = leBool("Possui inscricao CRMV? [S/N]");

		shared_ptr<FuncionarioVeterinario> func_vet = dynamic_pointer_cast<FuncionarioVeterinario>(funcionario);

		func_vet->setIsInscritoCRMV(alterar_bool);
	}
	else if (escolha == 6)
	{
		cout << "Digite o novo nivel\n";

		nivelDeSeguranca seguranca = leNivelDeSeguranca();

		shared_ptr<FuncionarioTratador> func_trat = dynamic_pointer_cast<FuncionarioTratador>(funcionario);

		func_trat->setClassificacaoDeSeguranca(seguranca);
	}
	else if (escolha == 0 || escolha > 4)
	{
		cout << "Erro, escolha apenas entre os valores informados";
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rsi, %rbx
leaq -0x40(%rbp), %r12
movq %r12, -0x10(%r12)
xorl %eax, %eax
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
leaq -0x298(%rbp), %rdi
callq 0x4130
movq 0x1d874(%rip), %rdi     # 0x3afd0
leaq 0x11615(%rip), %rsi     # 0x2ed78
movl $0x19, %edx
callq 0x4210
movq 0x1d85c(%rip), %rdi     # 0x3afd0
leaq 0x102b6(%rip), %rsi     # 0x2da31
movl $0x1, %edx
callq 0x4210
movq 0x1d844(%rip), %rdi     # 0x3afd0
leaq 0x115ff(%rip), %rsi     # 0x2ed92
movl $0x1f, %edx
callq 0x4210
movq 0x1d82c(%rip), %rdi     # 0x3afd0
leaq 0x10286(%rip), %rsi     # 0x2da31
movl $0x1, %edx
callq 0x4210
movq 0x1d814(%rip), %rdi     # 0x3afd0
leaq 0x115ef(%rip), %rsi     # 0x2edb2
movl $0x16, %edx
callq 0x4210
movq 0x1d7fc(%rip), %rdi     # 0x3afd0
leaq 0x10256(%rip), %rsi     # 0x2da31
movl $0x1, %edx
callq 0x4210
movq 0x1d7e4(%rip), %rdi     # 0x3afd0
leaq 0x115d6(%rip), %rsi     # 0x2edc9
movl $0x14, %edx
callq 0x4210
movq 0x1d7cc(%rip), %rdi     # 0x3afd0
leaq 0x10226(%rip), %rsi     # 0x2da31
movl $0x1, %edx
callq 0x4210
movq 0x1d7b4(%rip), %rdi     # 0x3afd0
leaq 0x115bb(%rip), %rsi     # 0x2edde
movl $0x23, %edx
callq 0x4210
movq 0x1d79c(%rip), %rdi     # 0x3afd0
leaq 0x101f6(%rip), %rsi     # 0x2da31
movl $0x1, %edx
callq 0x4210
movq 0x1d784(%rip), %r14     # 0x3afd0
leaq 0x115af(%rip), %rsi     # 0x2ee02
movl $0x16, %edx
movq %r14, %rdi
callq 0x4210
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x41b0
movsbl %al, %esi
movq 0x1d752(%rip), %rdi     # 0x3afd0
callq 0x4030
movq %rax, %rdi
callq 0x4120
movq (%rbx), %rdi
callq 0xb7ea
testl %eax, %eax
je 0x1d8b2
movq (%rbx), %rdi
callq 0xb7ea
cmpl $0x1, %eax
jne 0x1d8f8
movl $0x23, %edx
leaq 0x1158c(%rip), %rsi     # 0x2ee3c
jmp 0x1d8be
movl $0x22, %edx
leaq 0x1155b(%rip), %rsi     # 0x2ee19
movq 0x1d70b(%rip), %r14     # 0x3afd0
movq %r14, %rdi
callq 0x4210
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x41b0
movsbl %al, %esi
movq 0x1d6e5(%rip), %rdi     # 0x3afd0
callq 0x4030
movq %rax, %rdi
callq 0x4120
movq 0x1d6e1(%rip), %rdi     # 0x3afe0
leaq -0x70(%rbp), %rsi
callq 0x4220
leaq -0x288(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0x4210
leaq -0x298(%rbp), %rdi
leaq -0x2a(%rbp), %rsi
callq 0x4050
movq 0x1d69d(%rip), %rdi     # 0x3afd0
leaq 0x11526(%rip), %rsi     # 0x2ee60
movl $0x11, %edx
callq 0x4210
movq 0x1d685(%rip), %rdi     # 0x3afd0
leaq 0x100df(%rip), %rsi     # 0x2da31
movl $0x1, %edx
callq 0x4210
movzwl -0x2a(%rbp), %eax
leal -0x1(%rax), %ecx
cmpl $0x5, %ecx
ja 0x1dc1d
leaq 0xff55(%rip), %rax      # 0x2d8c8
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x1d64d(%rip), %rdi     # 0x3afd0
leaq 0x114e8(%rip), %rsi     # 0x2ee72
movl $0x14, %edx
callq 0x4210
movq 0x1d645(%rip), %rdi     # 0x3afe0
leaq -0x50(%rbp), %rsi
callq 0x4220
movq (%rbx), %rbx
leaq -0x100(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x110(%rbp), %rdi
callq 0x4f18
leaq -0x110(%rbp), %rsi
movq %rbx, %rdi
callq 0xb852
movq -0x110(%rbp), %rdi
movb $0x1, %bl
cmpq %r14, %rdi
je 0x1dcb6
movq -0x100(%rbp), %rsi
jmp 0x1dbce
leaq -0x80(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x114c1(%rip), %rsi     # 0x2eec6
leaq 0x114d6(%rip), %rdx     # 0x2eee2
leaq -0x90(%rbp), %rdi
callq 0x1e03c
leaq -0x90(%rbp), %rsi
callq 0x14432
movl %eax, %r14d
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x1da3f
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x41d0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x1dc50
leaq 0x1cb4e(%rip), %rsi     # 0x3a5a0
leaq 0x1cb7f(%rip), %rdx     # 0x3a5d8
xorl %ecx, %ecx
callq 0x4200
movq %rax, %rdi
jmp 0x1dc52
movq 0x1d561(%rip), %rdi     # 0x3afd0
leaq 0x11425(%rip), %rsi     # 0x2ee9b
movl $0x14, %edx
callq 0x4210
movq 0x1d559(%rip), %rdi     # 0x3afe0
leaq -0x50(%rbp), %rsi
callq 0x4220
movq (%rbx), %rbx
leaq -0xc0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0xd0(%rbp), %rdi
callq 0x4f18
leaq -0xd0(%rbp), %rsi
movq %rbx, %rdi
callq 0xb878
movq -0xd0(%rbp), %rdi
movb $0x1, %bl
cmpq %r14, %rdi
je 0x1dcb6
movq -0xc0(%rbp), %rsi
jmp 0x1dbce
movq 0x1d4e7(%rip), %rdi     # 0x3afd0
leaq 0x113c0(%rip), %rsi     # 0x2eeb0
movl $0x15, %edx
callq 0x4210
movq 0x1d4df(%rip), %rdi     # 0x3afe0
leaq -0x50(%rbp), %rsi
callq 0x4220
movq (%rbx), %rbx
leaq -0xa0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x4f18
leaq -0xb0(%rbp), %rsi
movq %rbx, %rdi
callq 0xb886
movq -0xb0(%rbp), %rdi
movb $0x1, %bl
cmpq %r14, %rdi
je 0x1dcb6
movq -0xa0(%rbp), %rsi
jmp 0x1dbce
movq 0x1d470(%rip), %rdi     # 0x3afd0
leaq 0x11320(%rip), %rsi     # 0x2ee87
movl $0x13, %edx
callq 0x4210
movq 0x1d468(%rip), %rdi     # 0x3afe0
leaq -0x50(%rbp), %rsi
callq 0x4220
movq (%rbx), %rbx
leaq -0xe0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf0(%rbp), %rdi
callq 0x4f18
leaq -0xf0(%rbp), %rsi
movq %rbx, %rdi
callq 0xb860
movq -0xf0(%rbp), %rdi
movb $0x1, %bl
cmpq %r14, %rdi
je 0x1dcb6
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x41d0
jmp 0x1dcb6
movq 0x1d3ee(%rip), %rdi     # 0x3afd0
leaq 0x112fa(%rip), %rsi     # 0x2eee3
movl $0x14, %edx
callq 0x4210
callq 0x1c67e
movl %eax, %r14d
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x1dc6d
leaq 0x1c996(%rip), %rsi     # 0x3a5a0
leaq 0x1c977(%rip), %rdx     # 0x3a588
xorl %ecx, %ecx
callq 0x4200
movq %rax, %rdi
jmp 0x1dc6f
testw %ax, %ax
setne %cl
cmpw $0x5, %ax
setl %al
movb $0x1, %bl
testb %al, %cl
jne 0x1dcb6
movq 0x1d395(%rip), %rdi     # 0x3afd0
leaq 0x112b6(%rip), %rsi     # 0x2eef8
movl $0x30, %edx
callq 0x4210
xorl %ebx, %ebx
jmp 0x1dcb6
xorl %edi, %edi
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x1dc8f
movq 0x1d366(%rip), %rax     # 0x3afc8
cmpb $0x0, (%rax)
je 0x1dc8a
incl 0x8(%r15)
jmp 0x1dc8f
xorl %edi, %edi
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x1dc9f
movq 0x1d349(%rip), %rax     # 0x3afc8
cmpb $0x0, (%rax)
je 0x1dc9a
incl 0x8(%r15)
jmp 0x1dc9f
lock
incl 0x8(%r15)
movzbl %r14b, %esi
callq 0xafd4
jmp 0x1dca7
lock
incl 0x8(%r15)
movl %r14d, %esi
callq 0xa974
movb $0x1, %bl
testq %r15, %r15
je 0x1dcb6
movq %r15, %rdi
callq 0x4eac
movq 0x1d2eb(%rip), %rsi     # 0x3afa8
leaq -0x298(%rbp), %rdi
callq 0x4150
leaq -0x218(%rbp), %rdi
callq 0x40a0
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x1dcea
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x41d0
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x1dcff
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x41d0
movl %ebx, %eax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r14, %rdi
je 0x1ddb4
movq -0xe0(%rbp), %rsi
jmp 0x1dda0
movq %rax, %rbx
movq -0x110(%rbp), %rdi
cmpq %r14, %rdi
je 0x1ddb4
movq -0x100(%rbp), %rsi
jmp 0x1dda0
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
cmpq %r14, %rdi
je 0x1ddb4
movq -0xa0(%rbp), %rsi
jmp 0x1dda0
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
cmpq %r14, %rdi
je 0x1ddb4
movq -0xc0(%rbp), %rsi
jmp 0x1dda0
jmp 0x1dd79
movq %rax, %rbx
testq %r15, %r15
je 0x1ddb4
movq %r15, %rdi
callq 0x4eac
jmp 0x1ddb4
jmp 0x1ddb1
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x1ddb4
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x41d0
jmp 0x1ddb4
jmp 0x1ddb1
movq %rax, %rbx
jmp 0x1ddd3
movq %rax, %rbx
movq 0x1d1ed(%rip), %rsi     # 0x3afa8
leaq -0x298(%rbp), %rdi
callq 0x4150
leaq -0x218(%rbp), %rdi
callq 0x40a0
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x1dde8
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x41d0
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x1ddfd
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x41d0
movq %rbx, %rdi
callq 0x42f0
nop