// File: /workspace/github_cpp_makefile_star2_O1/nataly-enne[P]pet-fera/pet_fera_checagem.cpp
// Function: verifica_ID(std::map<int, VETERINARIO, std::less<int>, std::allocator<std::pair<int const, VETERINARIO>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char&)
bool verifica_ID(map <int, VETERINARIO> &vets, string id_string, char &sucesso){
	int cont = 0, id, verificacao;
	char c;
	sucesso = 'n';
	for(int i = 0; i < (int)id_string.size(); i++){
		c = id_string[i];
		verificacao = isdigit(c);
		if(!verificacao){
			cout << "ERRO: valor inválido!" << endl << endl;
			return 0;
		}
		else cont++;
	}

	if(cont == (int) id_string.size()){
		stringstream ss(id_string);
		ss >> id;
		if(vets.empty()){
			sucesso = 's';
			return 1;
		}
		else{
			for(auto it = vets.begin(); it != vets.end();it++){
				if(it->second.getId() == id){
					sucesso = 'n';
					cout << "ERRO: id já cadastrado!" << endl << endl;
					return 0;				
				}
			}		
		}		
	}
	else{
		cout << "ERRO: valor inválido!" << endl << endl;
		return 0;
	}

	sucesso = 's';
	return 1;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rdx, %rbx
movq %rdi, %r14
movb $0x6e, (%rdx)
movq 0x8(%rsi), %rax
testl %eax, %eax
jle 0x37155
movq (%rsi), %rcx
movl %eax, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %edi, %edi
movsbl (%rcx,%rdi), %r8d
addl $-0x30, %r8d
cmpl $0xa, %r8d
jae 0x371be
incq %rdi
cmpq %rdi, %rdx
jne 0x3713c
jmp 0x37157
xorl %eax, %eax
cmpl 0x8(%rsi), %eax
jne 0x371be
leaq -0x1b0(%rbp), %r15
movq %r15, %rdi
movl $0x18, %edx
callq 0x3310
leaq -0x24(%rbp), %rsi
movq %r15, %rdi
callq 0x3120
cmpq $0x0, 0x28(%r14)
je 0x37252
movq 0x18(%r14), %r15
addq $0x8, %r14
cmpq %r14, %r15
sete %r12b
je 0x3722e
leaq 0x28(%r15), %rdi
callq 0xf30e
cmpl -0x24(%rbp), %eax
je 0x37286
movq %r15, %rdi
callq 0x3140
movq %rax, %r15
cmpq %r14, %rax
jmp 0x37192
movq 0x10e0b(%rip), %rbx     # 0x47fd0
leaq 0x44b7(%rip), %rsi      # 0x3b683
movl $0x16, %edx
movq %rbx, %rdi
callq 0x3250
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
xorl %eax, %eax
jmp 0x37276
movq 0x10d7b(%rip), %rsi     # 0x47fb0
leaq -0x1b0(%rbp), %rdi
callq 0x3160
leaq -0x130(%rbp), %rdi
callq 0x30d0
movb $0x73, (%rbx)
jmp 0x37274
movb $0x73, (%rbx)
movq 0x10d54(%rip), %rsi     # 0x47fb0
leaq -0x1b0(%rbp), %rdi
callq 0x3160
leaq -0x130(%rbp), %rdi
callq 0x30d0
movb $0x1, %al
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movb $0x6e, (%rbx)
movq 0x10d40(%rip), %r14     # 0x47fd0
leaq 0x4403(%rip), %rsi      # 0x3b69a
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 0x10d0e(%rip), %rdi     # 0x47fd0
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq 0x10cb0(%rip), %rsi     # 0x47fb0
leaq -0x1b0(%rbp), %rdi
callq 0x3160
leaq -0x130(%rbp), %rdi
callq 0x30d0
testb $0x1, %r12b
je 0x3722a
jmp 0x3724d
jmp 0x3732b
jmp 0x3732b
movq %rax, %rbx
movq 0x10c7b(%rip), %rsi     # 0x47fb0
leaq -0x1b0(%rbp), %rdi
callq 0x3160
leaq -0x130(%rbp), %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x3380