// File: /workspace/github_cpp_makefile_star2_O1/nataly-enne[P]pet-fera/pet_fera_editar.cpp
// Function: editar(std::map<int, TRATADOR, std::less<int>, std::allocator<std::pair<int const, TRATADOR>>>&)
void editar(map <int, TRATADOR> &tratadores){
	int id_buscado, idade,nivel_seg;
	long int cpf;
	string nome, especialidade, tipo_sang;
	char fator_rh, sucesso;
	ofstream tratador;

	cout << "Insira o ID buscado: " << endl;
	cin >> id_buscado;

	auto result = tratadores.find(id_buscado);
	
	if(result != tratadores.end()){
		cout << "ID existe!" << endl;

		cout << "Digite o nome: " << endl;
		cin.ignore();
		getline(cin, nome); 
		transform(nome.begin(), nome.end(), nome.begin(), ::toupper); //Converte a string nome para caracteres maiusculos
		cout << "Digite o cpf: " << endl;
		cin >> cpf;
		cout << "Digite a idade: " << endl;
		cin >> idade;
		cout << "Insira o tipo sanguineo: " << endl;
		cin.ignore();
		getline(cin, tipo_sang);
		cout << "Insira o fator RH: " << endl;
		cin >> fator_rh;
		cout << "Digite a especialidade: " << endl;
		cin.ignore();
		getline(cin, especialidade);
		cout << "Digite o nivel de seguranca: "<< endl;
		cin >> nivel_seg;

		(*result).second = TRATADOR(id_buscado, nome, cpf, idade, tipo_sang, fator_rh, especialidade, nivel_seg);
		sucesso = 's';
	}
	else{
		cout << "Funcionario não cadastrado!!" << endl;
		sucesso = 'n';
	}

	if(sucesso == 's'){
		tratador.open("tratadores.txt");
		for(auto it = tratadores.begin(); it != tratadores.end(); it++){
			tratador << (*it).second;
		}
		tratador.close();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
movq %rdi, %rbx
leaq -0x48(%rbp), %r12
movq %r12, -0x10(%r12)
xorl %eax, %eax
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq -0xa0(%rbp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
leaq -0x80(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x3a8(%rbp), %rdi
callq 0x3360
movq 0x1561a(%rip), %r14     # 0x47fd0
leaq 0x88aa(%rip), %rsi      # 0x3b267
movl $0x15, %edx
movq %r14, %rdi
callq 0x3250
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq 0x155e8(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x155e4(%rip), %rdi     # 0x47fe0
leaq -0x30(%rbp), %rsi
callq 0x3120
movq 0x10(%rbx), %rcx
movq %rbx, -0x70(%rbp)
leaq 0x8(%rbx), %r15
movq %r15, %rax
testq %rcx, %rcx
je 0x32a36
movl -0x30(%rbp), %edx
movq %r15, %rax
xorl %esi, %esi
cmpl %edx, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x32a1f
movq %r15, %rbx
cmpq %r15, %rax
je 0x32a4b
movl -0x30(%rbp), %ecx
cmpl 0x20(%rax), %ecx
cmovlq %r15, %rax
movq %rax, %rbx
cmpq %r15, %rbx
je 0x32f63
movq 0x15575(%rip), %r14     # 0x47fd0
leaq 0x881b(%rip), %rsi      # 0x3b27d
movl $0xa, %edx
movq %r14, %rdi
callq 0x3250
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq 0x15543(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x1552f(%rip), %r14     # 0x47fd0
leaq 0x88c4(%rip), %rsi      # 0x3b36c
movl $0xf, %edx
movq %r14, %rdi
callq 0x3250
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq 0x154fd(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x154f9(%rip), %r14     # 0x47fe0
movq %r14, %rdi
callq 0x33a0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %edx
movq 0x154d3(%rip), %rdi     # 0x47fe0
leaq -0x58(%rbp), %rsi
callq 0x33c0
movq %rbx, -0x68(%rbp)
movq -0x50(%rbp), %rbx
testq %rbx, %rbx
je 0x32b40
movq -0x58(%rbp), %r14
xorl %r12d, %r12d
movsbl (%r14,%r12), %edi
callq 0x33d0
movb %al, (%r14,%r12)
incq %r12
cmpq %r12, %rbx
jne 0x32b2a
movq 0x15489(%rip), %r14     # 0x47fd0
leaq 0x882e(%rip), %rsi      # 0x3b37c
movl $0xe, %edx
movq %r14, %rdi
callq 0x3250
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq 0x15457(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15453(%rip), %rdi     # 0x47fe0
leaq -0xb8(%rbp), %rsi
callq 0x3210
movq 0x15430(%rip), %r14     # 0x47fd0
leaq 0x7c5b(%rip), %rsi      # 0x3a802
movl $0x10, %edx
movq %r14, %rdi
callq 0x3250
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq 0x153fe(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x153fa(%rip), %rdi     # 0x47fe0
leaq -0x38(%rbp), %rsi
callq 0x3120
movq 0x153da(%rip), %r14     # 0x47fd0
leaq 0x7c43(%rip), %rsi      # 0x3a840
movl $0x19, %edx
movq %r14, %rdi
callq 0x3250
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq 0x153a8(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x153a4(%rip), %r14     # 0x47fe0
movq %r14, %rdi
callq 0x33a0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %edx
movq 0x1537e(%rip), %rdi     # 0x47fe0
leaq -0x90(%rbp), %rsi
callq 0x33c0
movq 0x1535b(%rip), %r14     # 0x47fd0
leaq 0x7c0e(%rip), %rsi      # 0x3a88a
movl $0x13, %edx
movq %r14, %rdi
callq 0x3250
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq 0x15329(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15325(%rip), %rdi     # 0x47fe0
leaq -0x29(%rbp), %rsi
callq 0x3280
movq 0x15305(%rip), %r14     # 0x47fd0
leaq 0x7bee(%rip), %rsi      # 0x3a8c0
movl $0x18, %edx
movq %r14, %rdi
callq 0x3250
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq 0x152d3(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x152cf(%rip), %r14     # 0x47fe0
movq %r14, %rdi
callq 0x33a0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %edx
movq 0x152a9(%rip), %rdi     # 0x47fe0
leaq -0xb0(%rbp), %rsi
callq 0x33c0
movq 0x15286(%rip), %r14     # 0x47fd0
leaq 0x8658(%rip), %rsi      # 0x3b3a9
movl $0x1d, %edx
movq %r14, %rdi
callq 0x3250
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq 0x15254(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15250(%rip), %rdi     # 0x47fe0
leaq -0x34(%rbp), %rsi
callq 0x3120
movl -0x30(%rbp), %ebx
leaq -0xe8(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf8(%rbp), %rdi
callq 0x4574
movq -0xb8(%rbp), %rax
movq %rax, -0x60(%rbp)
movl -0x38(%rbp), %r12d
leaq -0xc8(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0xd8(%rbp), %rdi
callq 0x4574
movb -0x29(%rbp), %r14b
leaq -0x108(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x118(%rbp), %r13
movq %r13, %rdi
callq 0x4574
movl -0x34(%rbp), %eax
subq $0x8, %rsp
movsbl %r14b, %r10d
leaq -0x1a8(%rbp), %rdi
leaq -0xf8(%rbp), %rdx
leaq -0xd8(%rbp), %r9
movl %ebx, %esi
movq -0x60(%rbp), %rcx
movl %r12d, %r8d
pushq %rax
pushq %r13
pushq %r10
callq 0xfb00
addq $0x20, %rsp
leaq -0x198(%rbp), %r14
movl -0x8(%r14), %eax
movq -0x68(%rbp), %rbx
movl %eax, 0x30(%rbx)
leaq 0x38(%rbx), %rdi
movq %r14, %rsi
callq 0x3260
movq 0x20(%r14), %rax
movq %rax, 0x58(%rbx)
movl 0x28(%r14), %eax
movl %eax, 0x60(%rbx)
leaq 0x68(%rbx), %rdi
leaq -0x168(%rbp), %r14
movq %r14, %rsi
callq 0x3260
movb 0x20(%r14), %al
movb %al, 0x88(%rbx)
leaq 0x90(%rbx), %rdi
leaq -0x140(%rbp), %r14
movq %r14, %rsi
callq 0x3260
movl 0x20(%r14), %eax
movl %eax, 0xb0(%rbx)
leaq 0x1496c(%rip), %rax     # 0x47838
movq %rax, -0x68(%r14)
movq (%r14), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
leaq -0x48(%rbp), %r12
leaq -0xa0(%rbp), %r13
je 0x32eef
callq 0x31d0
leaq -0x158(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
leaq -0xe8(%rbp), %r14
je 0x32f0b
callq 0x31d0
leaq -0x188(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x32f20
callq 0x31d0
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x32f38
callq 0x31d0
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x32f50
callq 0x31d0
movq -0xf8(%rbp), %rdi
cmpq %r14, %rdi
je 0x32fa9
callq 0x31d0
jmp 0x32fa9
movq 0x15066(%rip), %r14     # 0x47fd0
leaq 0x841a(%rip), %rsi      # 0x3b38b
movl $0x1d, %edx
movq %r14, %rdi
callq 0x3250
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq 0x15034(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
cmpq %r15, %rbx
je 0x33002
leaq 0x7a93(%rip), %rsi      # 0x3aa48
leaq -0x3a8(%rbp), %rdi
movl $0x10, %edx
callq 0x3050
movq -0x70(%rbp), %rax
movq 0x18(%rax), %rbx
cmpq %r15, %rbx
je 0x32ff6
leaq -0x3a8(%rbp), %r14
leaq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0xffb4
movq %rbx, %rdi
callq 0x3140
movq %rax, %rbx
cmpq %r15, %rax
jne 0x32fda
leaq -0x3a8(%rbp), %rdi
callq 0x32a0
movq 0x14fbf(%rip), %rax     # 0x47fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x3a0(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x3a8(%rbp,%rcx)
callq 0x3190
leaq -0x2b0(%rbp), %rdi
callq 0x30d0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x3304d
callq 0x31d0
movq -0xb0(%rbp), %rdi
cmpq %r13, %rdi
je 0x3305e
callq 0x31d0
movq -0x58(%rbp), %rdi
cmpq %r12, %rdi
je 0x3306c
callq 0x31d0
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x3309e
callq 0x31d0
jmp 0x3309e
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x330bb
callq 0x31d0
jmp 0x330bb
movq %rax, %rbx
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0x330e3
callq 0x31d0
jmp 0x330e3
jmp 0x330e0
movq %rax, %rbx
jmp 0x330ef
jmp 0x330e0
jmp 0x330e0
movq %rax, %rbx
leaq -0x3a8(%rbp), %rdi
callq 0x32e0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x33104
callq 0x31d0
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x3311c
callq 0x31d0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x3312e
callq 0x31d0
movq %rbx, %rdi
callq 0x3380
nop