// File: 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
subq $0x4c0, %rsp            # imm = 0x4C0
movq %rdi, -0x8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3300
leaq -0x58(%rbp), %rdi
callq 0x3300
leaq -0x78(%rbp), %rdi
callq 0x3300
leaq -0x98(%rbp), %rdi
callq 0x3300
leaq -0x2a0(%rbp), %rdi
callq 0x33b0
jmp 0x368b4
movq 0x1a6fd(%rip), %rdi     # 0x50fb8
leaq 0xb965(%rip), %rsi      # 0x42227
callq 0x3240
movq %rax, -0x428(%rbp)
jmp 0x368d0
movq -0x428(%rbp), %rdi
movq 0x1a6c2(%rip), %rsi     # 0x50fa0
callq 0x3280
jmp 0x368e5
movq 0x1a6ec(%rip), %rdi     # 0x50fd8
leaq -0xc(%rbp), %rsi
callq 0x3170
jmp 0x368f7
movq -0x8(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0x37990
movq %rax, -0x430(%rbp)
jmp 0x3690d
movq -0x430(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1f740
movq %rax, -0x2c0(%rbp)
leaq -0x2b8(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x1f710
testb $0x1, %al
jne 0x36947
jmp 0x36dc4
movq 0x1a66a(%rip), %rdi     # 0x50fb8
leaq 0xb8e8(%rip), %rsi      # 0x4223d
callq 0x3240
movq %rax, -0x438(%rbp)
jmp 0x36963
movq -0x438(%rbp), %rdi
movq 0x1a62f(%rip), %rsi     # 0x50fa0
callq 0x3280
jmp 0x36978
movq 0x1a639(%rip), %rdi     # 0x50fb8
leaq 0xb9a6(%rip), %rsi      # 0x4232c
callq 0x3240
movq %rax, -0x440(%rbp)
jmp 0x36994
movq -0x440(%rbp), %rdi
movq 0x1a5fe(%rip), %rsi     # 0x50fa0
callq 0x3280
jmp 0x369a9
movq 0x1a628(%rip), %rdi     # 0x50fd8
callq 0x33f0
jmp 0x369b7
movq 0x1a61a(%rip), %rdi     # 0x50fd8
leaq -0x38(%rbp), %rsi
callq 0x3070
jmp 0x369c9
leaq -0x38(%rbp), %rdi
movq %rdi, -0x450(%rbp)
callq 0x31e0
movq -0x450(%rbp), %rdi
movq %rax, -0x2c8(%rbp)
callq 0x3120
movq -0x450(%rbp), %rdi
movq %rax, -0x2d0(%rbp)
callq 0x31e0
movq %rax, -0x2d8(%rbp)
movq -0x2c8(%rbp), %rdi
movq -0x2d0(%rbp), %rsi
movq -0x2d8(%rbp), %rdx
movq 0x1a5be(%rip), %rcx     # 0x50fe0
callq 0x1f5a0
movq %rax, -0x448(%rbp)
jmp 0x36a30
movq -0x448(%rbp), %rax
movq %rax, -0x2e0(%rbp)
movq 0x1a573(%rip), %rdi     # 0x50fb8
leaq 0xb8f0(%rip), %rsi      # 0x4233c
callq 0x3240
movq %rax, -0x458(%rbp)
jmp 0x36a5a
movq -0x458(%rbp), %rdi
movq 0x1a538(%rip), %rsi     # 0x50fa0
callq 0x3280
jmp 0x36a6f
movq 0x1a562(%rip), %rdi     # 0x50fd8
leaq -0x18(%rbp), %rsi
callq 0x3140
jmp 0x36a81
movq 0x1a530(%rip), %rdi     # 0x50fb8
leaq 0xad33(%rip), %rsi      # 0x417c2
callq 0x3240
movq %rax, -0x460(%rbp)
jmp 0x36a9d
movq -0x460(%rbp), %rdi
movq 0x1a4f5(%rip), %rsi     # 0x50fa0
callq 0x3280
jmp 0x36ab2
movq 0x1a51f(%rip), %rdi     # 0x50fd8
leaq -0x10(%rbp), %rsi
callq 0x3170
jmp 0x36ac4
movq 0x1a4ed(%rip), %rdi     # 0x50fb8
leaq 0xad2e(%rip), %rsi      # 0x41800
callq 0x3240
movq %rax, -0x468(%rbp)
jmp 0x36ae0
movq -0x468(%rbp), %rdi
movq 0x1a4b2(%rip), %rsi     # 0x50fa0
callq 0x3280
jmp 0x36af5
movq 0x1a4dc(%rip), %rdi     # 0x50fd8
leaq -0x98(%rbp), %rsi
callq 0x32c0
jmp 0x36b0a
movq 0x1a4a7(%rip), %rdi     # 0x50fb8
leaq 0xad32(%rip), %rsi      # 0x4184a
callq 0x3240
movq %rax, -0x470(%rbp)
jmp 0x36b26
movq -0x470(%rbp), %rdi
movq 0x1a46c(%rip), %rsi     # 0x50fa0
callq 0x3280
jmp 0x36b3b
movq 0x1a496(%rip), %rdi     # 0x50fd8
leaq -0x99(%rbp), %rsi
callq 0x32e0
jmp 0x36b50
movq 0x1a461(%rip), %rdi     # 0x50fb8
leaq 0xad22(%rip), %rsi      # 0x41880
callq 0x3240
movq %rax, -0x478(%rbp)
jmp 0x36b6c
movq -0x478(%rbp), %rdi
movq 0x1a426(%rip), %rsi     # 0x50fa0
callq 0x3280
jmp 0x36b81
movq 0x1a450(%rip), %rdi     # 0x50fd8
callq 0x33f0
jmp 0x36b8f
movq 0x1a442(%rip), %rdi     # 0x50fd8
leaq -0x58(%rbp), %rsi
callq 0x3070
jmp 0x36ba1
movq 0x1a410(%rip), %rdi     # 0x50fb8
leaq 0xad1b(%rip), %rsi      # 0x418ca
callq 0x3240
movq %rax, -0x480(%rbp)
jmp 0x36bbd
movq -0x480(%rbp), %rdi
movq 0x1a3d5(%rip), %rsi     # 0x50fa0
callq 0x3280
jmp 0x36bd2
movq 0x1a3ff(%rip), %rdi     # 0x50fd8
leaq -0x78(%rbp), %rsi
callq 0x3070
jmp 0x36be4
movl -0xc(%rbp), %eax
movl %eax, -0x484(%rbp)
leaq -0x3a8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3100
jmp 0x36bff
movq -0x18(%rbp), %rax
movq %rax, -0x490(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x488(%rbp)
leaq -0x3c8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3100
jmp 0x36c28
movb -0x99(%rbp), %al
movb %al, -0x491(%rbp)
leaq -0x3e8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3100
jmp 0x36c46
leaq -0x408(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3100
jmp 0x36c58
movl -0x488(%rbp), %r8d
movq -0x490(%rbp), %rcx
movl -0x484(%rbp), %esi
movb -0x491(%rbp), %dl
movq %rsp, %rax
leaq -0x408(%rbp), %rdi
movq %rdi, 0x10(%rax)
leaq -0x3e8(%rbp), %rdi
movq %rdi, 0x8(%rax)
movsbl %dl, %edx
movl %edx, (%rax)
leaq -0x388(%rbp), %rdi
leaq -0x3a8(%rbp), %rdx
leaq -0x3c8(%rbp), %r9
callq 0x125c0
jmp 0x36cac
leaq -0x2b8(%rbp), %rdi
callq 0x1f770
movq %rax, %rdi
addq $0x8, %rdi
leaq -0x388(%rbp), %rsi
callq 0x379c0
leaq -0x388(%rbp), %rdi
callq 0x5980
leaq -0x408(%rbp), %rdi
callq 0x3180
leaq -0x3e8(%rbp), %rdi
callq 0x3180
leaq -0x3c8(%rbp), %rdi
callq 0x3180
leaq -0x3a8(%rbp), %rdi
callq 0x3180
movb $0x73, -0x9a(%rbp)
jmp 0x36dfc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
jmp 0x36ef1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
jmp 0x36ee5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
jmp 0x36db3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
jmp 0x36da7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
jmp 0x36d9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
leaq -0x408(%rbp), %rdi
callq 0x3180
leaq -0x3e8(%rbp), %rdi
callq 0x3180
leaq -0x3c8(%rbp), %rdi
callq 0x3180
leaq -0x3a8(%rbp), %rdi
callq 0x3180
jmp 0x36ee5
movq 0x1a1ed(%rip), %rdi     # 0x50fb8
leaq 0xb579(%rip), %rsi      # 0x4234b
callq 0x3240
movq %rax, -0x4a0(%rbp)
jmp 0x36de0
movq -0x4a0(%rbp), %rdi
movq 0x1a1b2(%rip), %rsi     # 0x50fa0
callq 0x3280
jmp 0x36df5
movb $0x6e, -0x9a(%rbp)
movsbl -0x9a(%rbp), %eax
cmpl $0x73, %eax
jne 0x36ea9
leaq 0xab3d(%rip), %rsi      # 0x41950
leaq -0x2a0(%rbp), %rdi
movl $0x10, %edx
callq 0x3050
jmp 0x36e26
movq -0x8(%rbp), %rdi
callq 0x1f6e0
movq %rax, -0x410(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1f740
movq %rax, -0x418(%rbp)
leaq -0x410(%rbp), %rdi
leaq -0x418(%rbp), %rsi
callq 0x1f710
testb $0x1, %al
jne 0x36e5f
jmp 0x36e99
leaq -0x410(%rbp), %rdi
callq 0x1f770
movq %rax, %rsi
addq $0x8, %rsi
leaq -0x2a0(%rbp), %rdi
callq 0x12a50
jmp 0x36e80
jmp 0x36e82
leaq -0x410(%rbp), %rdi
xorl %esi, %esi
callq 0x1f790
movq %rax, -0x420(%rbp)
jmp 0x36e36
leaq -0x2a0(%rbp), %rdi
callq 0x3310
jmp 0x36ea7
jmp 0x36ea9
leaq -0x2a0(%rbp), %rdi
callq 0x3340
leaq -0x98(%rbp), %rdi
callq 0x3180
leaq -0x78(%rbp), %rdi
callq 0x3180
leaq -0x58(%rbp), %rdi
callq 0x3180
leaq -0x38(%rbp), %rdi
callq 0x3180
addq $0x4c0, %rsp            # imm = 0x4C0
popq %rbp
retq
leaq -0x2a0(%rbp), %rdi
callq 0x3340
leaq -0x98(%rbp), %rdi
callq 0x3180
leaq -0x78(%rbp), %rdi
callq 0x3180
leaq -0x58(%rbp), %rdi
callq 0x3180
leaq -0x38(%rbp), %rdi
callq 0x3180
movq -0x2a8(%rbp), %rdi
callq 0x33d0
nopw %cs:(%rax,%rax)