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

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

	auto result = vets.find(id_buscado);
	
	if(result != vets.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 >> tipo_sang;
		cout << "Insira o fator RH: " << endl;
		cin >> fator_rh;
		cout << "Digite a especialidade: " << endl;
		cin.ignore();
		getline(cin, especialidade);
		cout << "Digite o crmv: "<< endl;
		getline(cin, crmv);

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3d8, %rsp            # imm = 0x3D8
movq %rdi, -0x38(%rbp)
leaq -0x50(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xb8(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x98(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x78(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x3f8(%rbp), %rdi
callq 0x3360
movq 0x15eb2(%rip), %rbx     # 0x47fd0
leaq 0x9142(%rip), %rsi      # 0x3b267
movl $0x15, %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 0x15e80(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15e7c(%rip), %rdi     # 0x47fe0
leaq -0x30(%rbp), %rsi
callq 0x3120
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x321b1
movq -0x38(%rbp), %rcx
leaq 0x8(%rcx), %r12
movl -0x30(%rbp), %ecx
movq %r12, %r14
xorl %edx, %edx
cmpl %ecx, 0x20(%rax)
setl %dl
cmovgeq %rax, %r14
movq 0x10(%rax,%rdx,8), %rax
testq %rax, %rax
jne 0x32188
cmpq %r12, %r14
je 0x321b1
cmpl 0x20(%r14), %ecx
cmovlq %r12, %r14
jge 0x32296
movq 0x15e18(%rip), %rbx     # 0x47fd0
leaq 0x91cc(%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 0x15de6(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15dca(%rip), %rax     # 0x47fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x3f0(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x3f8(%rbp,%rcx)
callq 0x3190
leaq -0x300(%rbp), %rdi
callq 0x30d0
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x32242
callq 0x31d0
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x3225a
callq 0x31d0
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x32272
callq 0x31d0
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x32284
callq 0x31d0
addq $0x3d8, %rsp            # imm = 0x3D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x15d33(%rip), %rbx     # 0x47fd0
leaq 0x8fd9(%rip), %rsi      # 0x3b27d
movl $0xa, %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 0x15d01(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15ced(%rip), %rbx     # 0x47fd0
leaq 0x9082(%rip), %rsi      # 0x3b36c
movl $0xf, %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 0x15cbb(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15cb7(%rip), %rbx     # 0x47fe0
movq %rbx, %rdi
callq 0x33a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %edx
movq 0x15c91(%rip), %rdi     # 0x47fe0
leaq -0x60(%rbp), %rsi
callq 0x33c0
movq -0x58(%rbp), %rbx
testq %rbx, %rbx
je 0x3237e
movq -0x60(%rbp), %r15
xorl %r13d, %r13d
movsbl (%r15,%r13), %edi
callq 0x33d0
movb %al, (%r15,%r13)
incq %r13
cmpq %r13, %rbx
jne 0x32368
movq 0x15c4b(%rip), %rbx     # 0x47fd0
leaq 0x8ff0(%rip), %rsi      # 0x3b37c
movl $0xe, %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 0x15c19(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15c15(%rip), %rdi     # 0x47fe0
leaq -0xd0(%rbp), %rsi
callq 0x3210
movq 0x15bf2(%rip), %rbx     # 0x47fd0
leaq 0x841d(%rip), %rsi      # 0x3a802
movl $0x10, %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 0x15bc0(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15bbc(%rip), %rdi     # 0x47fe0
leaq -0x40(%rbp), %rsi
callq 0x3120
movq 0x15b9c(%rip), %rbx     # 0x47fd0
leaq 0x8405(%rip), %rsi      # 0x3a840
movl $0x19, %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 0x15b6a(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15b66(%rip), %rdi     # 0x47fe0
leaq -0x88(%rbp), %rsi
callq 0x3270
movq 0x15b43(%rip), %rbx     # 0x47fd0
leaq 0x83f6(%rip), %rsi      # 0x3a88a
movl $0x13, %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 0x15b11(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15b0d(%rip), %rdi     # 0x47fe0
leaq -0x29(%rbp), %rsi
callq 0x3280
movq 0x15aed(%rip), %rbx     # 0x47fd0
leaq 0x83d6(%rip), %rsi      # 0x3a8c0
movl $0x18, %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 0x15abb(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x15ab7(%rip), %rbx     # 0x47fe0
movq %rbx, %rdi
callq 0x33a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %edx
movq 0x15a91(%rip), %r15     # 0x47fe0
leaq -0xc8(%rbp), %rsi
movq %r15, %rdi
callq 0x33c0
movq 0x15a6b(%rip), %rbx     # 0x47fd0
leaq 0x839e(%rip), %rsi      # 0x3a90a
movl $0xf, %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 0x15a39(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %edx
movq 0x15a1e(%rip), %rdi     # 0x47fe0
leaq -0xa8(%rbp), %rsi
callq 0x33c0
movl -0x30(%rbp), %ebx
leaq -0x120(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0x130(%rbp), %rdi
callq 0x4574
movq -0xd0(%rbp), %r15
movl -0x40(%rbp), %eax
movl %eax, -0x3c(%rbp)
leaq -0x100(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
addq %rsi, %rdx
leaq -0x110(%rbp), %rdi
callq 0x4574
movq %r15, -0x68(%rbp)
movb -0x29(%rbp), %r13b
leaq -0xe0(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf0(%rbp), %rdi
callq 0x4574
leaq -0x140(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x150(%rbp), %r15
movq %r15, %rdi
callq 0x4574
subq $0x8, %rsp
movsbl %r13b, %eax
leaq -0x1f8(%rbp), %rdi
leaq -0x130(%rbp), %rdx
leaq -0x110(%rbp), %r9
movl %ebx, %esi
movq -0x68(%rbp), %rcx
movl -0x3c(%rbp), %r8d
pushq %r15
leaq -0xf0(%rbp), %r10
pushq %r10
pushq %rax
callq 0xf31c
addq $0x20, %rsp
leaq -0x1e8(%rbp), %rbx
movl -0x8(%rbx), %eax
movl %eax, 0x30(%r14)
leaq 0x38(%r14), %rdi
movq %rbx, %rsi
callq 0x3260
movq 0x20(%rbx), %rax
movq %rax, 0x58(%r14)
movl 0x28(%rbx), %eax
movl %eax, 0x60(%r14)
leaq 0x68(%r14), %rdi
leaq -0x1b8(%rbp), %rbx
movq %rbx, %rsi
callq 0x3260
movb 0x20(%rbx), %al
movb %al, 0x88(%r14)
leaq 0x90(%r14), %rdi
leaq -0x190(%rbp), %rbx
movq %rbx, %rsi
callq 0x3260
addq $0xb0, %r14
leaq -0x170(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x3260
leaq 0x15378(%rip), %rax     # 0x47ab0
addq $0x10, %rax
movq %rax, -0x68(%rbx)
movq (%r15), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0x32754
callq 0x31d0
leaq 0x150dd(%rip), %rax     # 0x47838
leaq -0x180(%rbp), %rcx
movq %rax, -0x78(%rcx)
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
leaq -0x120(%rbp), %rbx
leaq -0x100(%rbp), %r14
je 0x32782
callq 0x31d0
leaq -0x1a8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x32797
callq 0x31d0
leaq -0x1d8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x327ac
callq 0x31d0
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0x327c4
callq 0x31d0
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x327dc
callq 0x31d0
movq -0x110(%rbp), %rdi
cmpq %r14, %rdi
je 0x327ed
callq 0x31d0
movq -0x130(%rbp), %rdi
cmpq %rbx, %rdi
je 0x327fe
callq 0x31d0
leaq 0x818b(%rip), %rsi      # 0x3a990
leaq -0x3f8(%rbp), %rdi
movl $0x10, %edx
callq 0x3050
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rbx
cmpq %r12, %rbx
je 0x32846
leaq -0x3f8(%rbp), %r14
leaq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0xf835
movq %rbx, %rdi
callq 0x3140
movq %rax, %rbx
cmpq %r12, %rax
jne 0x3282a
leaq -0x3f8(%rbp), %rdi
callq 0x32a0
jmp 0x321f7
movq %rax, %rbx
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0x32877
callq 0x31d0
jmp 0x32877
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x32894
callq 0x31d0
jmp 0x32894
movq %rax, %rbx
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0x328b1
callq 0x31d0
jmp 0x328b1
movq %rax, %rbx
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0x328d9
callq 0x31d0
jmp 0x328d9
jmp 0x328d6
movq %rax, %rbx
jmp 0x328e5
jmp 0x328d6
jmp 0x328d6
movq %rax, %rbx
leaq -0x3f8(%rbp), %rdi
callq 0x32e0
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x328fa
callq 0x31d0
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x32912
callq 0x31d0
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x3292a
callq 0x31d0
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x3293c
callq 0x31d0
movq %rbx, %rdi
callq 0x3380