// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0xc8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq -0xa8(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %cl, (%rax)
movb %cl, (%rdx)
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0x400(%rbp), %rdi
callq 0x3350
movq 0x137ef(%rip), %rdi     # 0x30fc8
leaq 0x6a47(%rip), %rsi      # 0x24227
callq 0x31f0
movq %rax, %rdi
callq 0x3110
movq 0x137ec(%rip), %rdi     # 0x30fe0
leaq -0x30(%rbp), %rsi
callq 0x3150
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x1e650
movq %rax, -0x40(%rbp)
leaq 0x8(%rbx), %r15
cmpq %r15, -0x40(%rbp)
je 0x1dae5
movq 0x137a6(%rip), %rdi     # 0x30fc8
leaq 0x6a14(%rip), %rsi      # 0x2423d
callq 0x31f0
movq %rax, %rdi
callq 0x3110
movq 0x1378b(%rip), %rdi     # 0x30fc8
leaq 0x6ae8(%rip), %rsi      # 0x2432c
callq 0x31f0
movq %rax, %rdi
callq 0x3110
movq 0x13788(%rip), %rdi     # 0x30fe0
callq 0x3380
movq 0x1377c(%rip), %rdi     # 0x30fe0
leaq -0x78(%rbp), %rsi
callq 0x3060
movq %rbx, -0x50(%rbp)
movq -0x78(%rbp), %rbx
movq -0x70(%rbp), %r14
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x1d894
movsbl (%rbx,%r12), %edi
callq 0x33a0
movb %al, (%rbx,%r12)
incq %r12
jmp 0x1d87c
movq 0x1372d(%rip), %rdi     # 0x30fc8
leaq 0x6a9a(%rip), %rsi      # 0x2433c
callq 0x31f0
movq %rax, %rdi
callq 0x3110
movq 0x1372a(%rip), %rdi     # 0x30fe0
leaq -0x58(%rbp), %rsi
callq 0x3210
movq 0x13702(%rip), %rdi     # 0x30fc8
leaq 0x5ef5(%rip), %rsi      # 0x237c2
callq 0x31f0
movq %rax, %rdi
callq 0x3110
movq 0x136ff(%rip), %rdi     # 0x30fe0
leaq -0x34(%rbp), %rsi
callq 0x3150
movq 0x136d7(%rip), %rdi     # 0x30fc8
leaq 0x5f08(%rip), %rsi      # 0x23800
callq 0x31f0
movq %rax, %rdi
callq 0x3110
movq 0x136d4(%rip), %rdi     # 0x30fe0
leaq -0x98(%rbp), %rsi
callq 0x3260
movq 0x136a9(%rip), %rdi     # 0x30fc8
leaq 0x5f24(%rip), %rsi      # 0x2384a
callq 0x31f0
movq %rax, %rdi
callq 0x3110
movq 0x136a6(%rip), %rdi     # 0x30fe0
leaq -0x29(%rbp), %rsi
callq 0x3280
movq 0x1367e(%rip), %rdi     # 0x30fc8
leaq 0x5f2f(%rip), %rsi      # 0x23880
callq 0x31f0
movq %rax, %rdi
callq 0x3110
movq 0x1367b(%rip), %rdi     # 0x30fe0
callq 0x3380
movq 0x1366f(%rip), %rdi     # 0x30fe0
leaq -0xd8(%rbp), %rsi
callq 0x3060
movq 0x13644(%rip), %rdi     # 0x30fc8
leaq 0x5f3f(%rip), %rsi      # 0x238ca
callq 0x31f0
movq %rax, %rdi
callq 0x3110
movq 0x13641(%rip), %rdi     # 0x30fe0
leaq -0xb8(%rbp), %rsi
callq 0x3060
movl -0x30(%rbp), %r12d
leaq -0x138(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3290
movq -0x58(%rbp), %rax
movq %rax, -0x48(%rbp)
movl -0x34(%rbp), %r13d
leaq -0x118(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3290
movb -0x29(%rbp), %bl
leaq -0xf8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x3290
leaq -0x158(%rbp), %r14
leaq -0xb8(%rbp), %rsi
movq %r14, %rdi
callq 0x3290
subq $0x8, %rsp
movsbl %bl, %eax
leaq -0x200(%rbp), %rdi
leaq -0x138(%rbp), %rdx
leaq -0x118(%rbp), %r9
movl %r12d, %esi
movq -0x48(%rbp), %rcx
movl %r13d, %r8d
pushq %r14
leaq -0xf8(%rbp), %r10
pushq %r10
pushq %rax
callq 0xaac4
addq $0x20, %rsp
movq -0x40(%rbp), %rdi
addq $0x28, %rdi
leaq -0x200(%rbp), %rbx
movq %rbx, %rsi
callq 0x1e164
movq %rbx, %rdi
callq 0x42b4
leaq -0x158(%rbp), %rdi
callq 0x3100
leaq -0xf8(%rbp), %rdi
callq 0x3100
leaq -0x118(%rbp), %rdi
callq 0x3100
leaq -0x138(%rbp), %rdi
callq 0x3100
leaq 0x5eb5(%rip), %rsi      # 0x23950
leaq -0x400(%rbp), %rdi
pushq $0x10
popq %rdx
callq 0x3040
movq -0x50(%rbp), %rax
movq 0x18(%rax), %r14
leaq -0x400(%rbp), %rbx
cmpq %r15, %r14
je 0x1dad7
leaq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0xad8a
movq %r14, %rdi
callq 0x3160
movq %rax, %r14
jmp 0x1dab9
leaq -0x400(%rbp), %rdi
callq 0x32a0
jmp 0x1db00
movq 0x134dc(%rip), %rdi     # 0x30fc8
leaq 0x6858(%rip), %rsi      # 0x2434b
callq 0x31f0
movq %rax, %rdi
callq 0x3110
leaq -0x400(%rbp), %rdi
callq 0x32e0
leaq -0x98(%rbp), %rdi
callq 0x3100
leaq -0xb8(%rbp), %rdi
callq 0x3100
leaq -0xd8(%rbp), %rdi
callq 0x3100
leaq -0x78(%rbp), %rdi
callq 0x3100
addq $0x3d8, %rsp            # imm = 0x3D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x3100
jmp 0x1db5f
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x3100
jmp 0x1db70
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x3100
jmp 0x1db81
movq %rax, %rbx
leaq -0x138(%rbp), %rdi
callq 0x3100
jmp 0x1db9d
jmp 0x1db9a
movq %rax, %rbx
jmp 0x1dba9
jmp 0x1db9a
jmp 0x1db9a
movq %rax, %rbx
leaq -0x400(%rbp), %rdi
callq 0x32e0
leaq -0x98(%rbp), %rdi
callq 0x3100
leaq -0xb8(%rbp), %rdi
callq 0x3100
leaq -0xd8(%rbp), %rdi
callq 0x3100
leaq -0x78(%rbp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3370