// File: /workspace/github_cpp_makefile_star2_O3/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 -0x50(%rbp), %r13
movq %r13, -0x10(%r13)
xorl %eax, %eax
movq %rax, -0x8(%r13)
movb %al, (%r13)
leaq -0xa0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x80(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x3a8(%rbp), %rdi
callq 0x3360
movq 0x15631(%rip), %r14     # 0x47fd0
leaq 0x88c1(%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 0x155ff(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x155fb(%rip), %rdi     # 0x47fe0
leaq -0x30(%rbp), %rsi
callq 0x3120
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x32a2a
leaq 0x8(%rbx), %r12
movl -0x30(%rbp), %ecx
movq %r12, %r15
xorl %edx, %edx
cmpl %ecx, 0x20(%rax)
setl %dl
cmovgeq %rax, %r15
movq 0x10(%rax,%rdx,8), %rax
testq %rax, %rax
jne 0x32a01
cmpq %r12, %r15
je 0x32a2a
cmpl 0x20(%r15), %ecx
cmovlq %r12, %r15
jge 0x32af3
movq 0x1559f(%rip), %rbx     # 0x47fd0
leaq 0x8953(%rip), %rsi      # 0x3b38b
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x3250
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq 0x1556d(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15551(%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 0x32abb
callq 0x31d0
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x32ad3
callq 0x31d0
movq -0x60(%rbp), %rdi
cmpq %r13, %rdi
je 0x32ae1
callq 0x31d0
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x154d6(%rip), %r14     # 0x47fd0
leaq 0x877c(%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 0x154a4(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15490(%rip), %r14     # 0x47fd0
leaq 0x8825(%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 0x1545e(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x1545a(%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 0x15434(%rip), %rdi     # 0x47fe0
leaq -0x60(%rbp), %rsi
callq 0x33c0
movq %rbx, -0x70(%rbp)
movq -0x58(%rbp), %rbx
testq %rbx, %rbx
je 0x32bdf
movq -0x60(%rbp), %r14
xorl %r13d, %r13d
movsbl (%r14,%r13), %edi
callq 0x33d0
movb %al, (%r14,%r13)
incq %r13
cmpq %r13, %rbx
jne 0x32bc9
movq 0x153ea(%rip), %r14     # 0x47fd0
leaq 0x878f(%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 0x153b8(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x153b4(%rip), %rdi     # 0x47fe0
leaq -0xb8(%rbp), %rsi
callq 0x3210
movq 0x15391(%rip), %r14     # 0x47fd0
leaq 0x7bbc(%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 0x1535f(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x1535b(%rip), %rdi     # 0x47fe0
leaq -0x3c(%rbp), %rsi
callq 0x3120
movq 0x1533b(%rip), %r14     # 0x47fd0
leaq 0x7ba4(%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 0x15309(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15305(%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 0x152df(%rip), %rdi     # 0x47fe0
leaq -0x90(%rbp), %rsi
callq 0x33c0
movq 0x152bc(%rip), %r14     # 0x47fd0
leaq 0x7b6f(%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 0x1528a(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15286(%rip), %rdi     # 0x47fe0
leaq -0x29(%rbp), %rsi
callq 0x3280
movq 0x15266(%rip), %r14     # 0x47fd0
leaq 0x7b4f(%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 0x15234(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15230(%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 0x1520a(%rip), %rdi     # 0x47fe0
leaq -0xb0(%rbp), %rsi
callq 0x33c0
movq 0x151e7(%rip), %r14     # 0x47fd0
leaq 0x85b9(%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 0x151b5(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x151b1(%rip), %rdi     # 0x47fe0
leaq -0x38(%rbp), %rsi
callq 0x3120
movl -0x30(%rbp), %r14d
leaq -0xe8(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf8(%rbp), %rdi
callq 0x4574
movq -0xb8(%rbp), %rax
movq %rax, -0x68(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x34(%rbp)
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), %bl
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 -0x38(%rbp), %eax
subq $0x8, %rsp
movsbl %bl, %r10d
leaq -0x1a8(%rbp), %rdi
leaq -0xf8(%rbp), %rdx
leaq -0xd8(%rbp), %r9
movl %r14d, %esi
movq -0x68(%rbp), %rcx
movl -0x34(%rbp), %r8d
pushq %rax
pushq %r13
pushq %r10
callq 0xfb04
addq $0x20, %rsp
leaq -0x198(%rbp), %r14
movl -0x8(%r14), %eax
movl %eax, 0x30(%r15)
leaq 0x38(%r15), %rdi
movq %r14, %rsi
callq 0x3260
movq 0x20(%r14), %rax
movq %rax, 0x58(%r15)
movl 0x28(%r14), %eax
movl %eax, 0x60(%r15)
leaq 0x68(%r15), %rdi
leaq -0x168(%rbp), %r14
movq %r14, %rsi
callq 0x3260
movb 0x20(%r14), %al
movb %al, 0x88(%r15)
leaq 0x90(%r15), %rdi
leaq -0x140(%rbp), %r14
movq %r14, %rsi
callq 0x3260
movl 0x20(%r14), %eax
movl %eax, 0xb0(%r15)
leaq 0x148c9(%rip), %rax     # 0x47838
movq %rax, -0x68(%r14)
movq (%r14), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
leaq -0x50(%rbp), %r13
movq -0x70(%rbp), %rbx
je 0x32f8f
callq 0x31d0
leaq -0x158(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x32fa4
callq 0x31d0
leaq -0x188(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x32fb9
callq 0x31d0
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x32fd1
callq 0x31d0
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x32fe9
callq 0x31d0
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0x33001
callq 0x31d0
leaq 0x7a40(%rip), %rsi      # 0x3aa48
leaq -0x3a8(%rbp), %rdi
movl $0x10, %edx
callq 0x3050
movq 0x18(%rbx), %rbx
cmpq %r12, %rbx
je 0x33045
leaq -0x3a8(%rbp), %r14
leaq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0xffb8
movq %rbx, %rdi
callq 0x3140
movq %rax, %rbx
cmpq %r12, %rax
jne 0x33029
leaq -0x3a8(%rbp), %rdi
callq 0x32a0
jmp 0x32a70
movq %rax, %rbx
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x33076
callq 0x31d0
jmp 0x33076
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x33093
callq 0x31d0
jmp 0x33093
movq %rax, %rbx
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0x330bb
callq 0x31d0
jmp 0x330bb
jmp 0x330b8
movq %rax, %rbx
jmp 0x330c7
jmp 0x330b8
jmp 0x330b8
movq %rax, %rbx
leaq -0x3a8(%rbp), %rdi
callq 0x32e0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x330dc
callq 0x31d0
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x330f4
callq 0x31d0
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x33106
callq 0x31d0
movq %rbx, %rdi
callq 0x3380
nop