// File: /workspace/github_cpp_makefile_star2_O3/nataly-enne[P]pet-fera/pet_fera_checagem.cpp
// Function: verifica_CRMV(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_CRMV(map <int, VETERINARIO> &vets, string crmv, char &sucesso){
	int cont = 0, verificacao, contador_de_traco = 0;
	char c;
	sucesso = 'n';
	transform(crmv.begin(), crmv.end(), crmv.begin(), ::toupper);
	for(int i = 0; i < (int) crmv.size(); i++){
		c = crmv[i];
		verificacao = isalnum(c);
		if(c == '-'){
			contador_de_traco++;
		}
		if(!verificacao && c != ' ' && c != '-'){
			sucesso = 'n';
			cout << "ERRO: valor inválido!" << endl << endl;
			return 0;
		}
		else cont++;	
	}
	
	if((cont == (int)crmv.size()) && (contador_de_traco >= 1)){
		transform(crmv.begin(), crmv.end(), crmv.begin(), ::tolower);
		if(vets.empty()){
			sucesso = 's';
			return 1;
		}
		else{
			for(auto it = vets.begin(); it != vets.end();it++){
				if(it->second.getCrmv() == crmv){
					cout << "ERRO: Crmv já cadastrado!" << endl << endl;
					sucesso = 'n';
					return 0;				
				}
			}
		}
	}
	sucesso = 's';
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, -0x30(%rbp)
movb $0x6e, (%rdx)
movq 0x8(%rsi), %rbx
testq %rbx, %rbx
je 0x38ad8
movq %rdi, -0x48(%rbp)
movq %rsi, -0x38(%rbp)
movq (%rsi), %r14
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
callq 0x33d0
movb %al, (%r14,%r15)
incq %r15
cmpq %r15, %rbx
jne 0x389a7
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
testl %ecx, %ecx
jle 0x38ad8
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq %rcx, -0x40(%rbp)
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq %rcx, -0x50(%rbp)
xorl %r14d, %r14d
xorl %r15d, %r15d
movq -0x58(%rbp), %rax
movsbl (%rax,%r14), %r12d
xorl %ebx, %ebx
cmpl $0x2d, %r12d
sete %r13b
movl %r12d, %edi
callq 0x3220
testl %eax, %eax
jne 0x38a19
movzbl %r12b, %eax
cmpl $0x20, %eax
je 0x38a19
cmpl $0x2d, %eax
jne 0x38af0
movb %r13b, %bl
addl %ebx, %r15d
incq %r14
cmpq %r14, -0x50(%rbp)
jne 0x389e8
testl %r15d, %r15d
movq -0x38(%rbp), %r15
movq -0x40(%rbp), %r12
je 0x38ad8
testq %r12, %r12
je 0x38a5a
movq (%r15), %rbx
xorl %r14d, %r14d
movsbl (%rbx,%r14), %edi
callq 0x32c0
movb %al, (%rbx,%r14)
incq %r14
cmpq %r14, %r12
jne 0x38a44
movq -0x48(%rbp), %r14
cmpq $0x0, 0x28(%r14)
je 0x38ad8
movq 0x18(%r14), %r12
addq $0x8, %r14
cmpq %r14, %r12
je 0x38ad8
leaq 0x28(%r12), %rsi
leaq -0x78(%rbp), %rdi
callq 0xf2de
movq -0x70(%rbp), %rdx
cmpq 0x8(%r15), %rdx
jne 0x38aa5
movq -0x78(%rbp), %r13
testq %rdx, %rdx
je 0x38aad
movq (%r15), %rsi
movq %r13, %rdi
callq 0x3230
testl %eax, %eax
sete %bl
jmp 0x38aaf
movq -0x78(%rbp), %r13
xorl %ebx, %ebx
jmp 0x38aaf
movb $0x1, %bl
leaq -0x68(%rbp), %rax
cmpq %rax, %r13
je 0x38ac0
movq %r13, %rdi
callq 0x31d0
testb %bl, %bl
jne 0x38b65
movq %r12, %rdi
callq 0x3140
movq %rax, %r12
cmpq %r14, %rax
jne 0x38a72
movq -0x30(%rbp), %rax
movb $0x73, (%rax)
movb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %rax
movb $0x6e, (%rax)
movq 0xf4d2(%rip), %rbx      # 0x47fd0
leaq 0x2b7e(%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
jmp 0x38bd8
movq 0xf464(%rip), %r14      # 0x47fd0
leaq 0x2b73(%rip), %rsi      # 0x3b6e6
movl $0x1a, %edx
movq %r14, %rdi
callq 0x3250
movq (%r14), %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 %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 -0x30(%rbp), %rax
movb $0x6e, (%rax)
xorl %eax, %eax
jmp 0x38ae1