// File: /workspace/github_cpp_makefile_star2_O1/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, %r13
movq %rsi, %r12
movq %rdi, -0x48(%rbp)
movb $0x6e, (%rdx)
movq 0x8(%rsi), %rbx
testq %rbx, %rbx
je 0x38b92
movq (%r12), %r14
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
callq 0x33d0
movb %al, (%r14,%r15)
incq %r15
cmpq %r15, %rbx
jne 0x38b7c
movq 0x8(%r12), %rcx
testl %ecx, %ecx
movq %r12, %rax
setg %r12b
movq %rax, -0x38(%rbp)
jle 0x38c0d
movq %r13, -0x30(%rbp)
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq %rcx, -0x40(%rbp)
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq %rcx, -0x50(%rbp)
xorl %r15d, %r15d
xorl %r14d, %r14d
movl %r14d, %r13d
movq -0x58(%rbp), %rax
movsbl (%rax,%r15), %ebx
xorl %r14d, %r14d
cmpl $0x2d, %ebx
sete %r14b
movl %ebx, %edi
callq 0x3220
addl %r13d, %r14d
testl %eax, %eax
jne 0x38bf6
movzbl %bl, %eax
cmpl $0x20, %eax
je 0x38bf6
cmpl $0x2d, %eax
jne 0x38c15
incq %r15
cmpq -0x50(%rbp), %r15
setb %r12b
jne 0x38bc5
movq -0x30(%rbp), %r13
movq -0x40(%rbp), %r15
jmp 0x38c8a
xorl %r15d, %r15d
xorl %r14d, %r14d
jmp 0x38c8a
movq -0x30(%rbp), %r13
movb $0x6e, (%r13)
movq 0xf3ab(%rip), %rbx      # 0x47fd0
leaq 0x2a57(%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
testb $0x1, %r12b
je 0x38c98
xorl %r12d, %r12d
jmp 0x38d6c
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rbx
movb $0x1, %r12b
movb $0x73, %al
cmpl %ebx, %r15d
jne 0x38d68
testl %r14d, %r14d
jle 0x38d68
testq %rbx, %rbx
je 0x38cdc
movq -0x38(%rbp), %rax
movq (%rax), %r14
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
callq 0x32c0
movb %al, (%r14,%r15)
incq %r15
cmpq %r15, %rbx
jne 0x38cc6
movq -0x48(%rbp), %r14
cmpq $0x0, 0x28(%r14)
je 0x38d66
movq %r13, -0x30(%rbp)
movq 0x18(%r14), %r13
addq $0x8, %r14
cmpq %r14, %r13
je 0x38d62
leaq -0x78(%rbp), %rbx
leaq 0x28(%r13), %rsi
movq %rbx, %rdi
callq 0xf2da
movq -0x70(%rbp), %rdx
movq -0x38(%rbp), %rax
cmpq 0x8(%rax), %rdx
jne 0x38d33
testq %rdx, %rdx
je 0x38d38
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movq -0x78(%rbp), %rdi
callq 0x3230
testl %eax, %eax
sete %r15b
jmp 0x38d3b
xorl %r15d, %r15d
jmp 0x38d3b
movb $0x1, %r15b
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x38d4d
callq 0x31d0
testb %r15b, %r15b
jne 0x38d7e
movq %r13, %rdi
callq 0x3140
movq %rax, %r13
cmpq %r14, %rax
jne 0x38cfc
movq -0x30(%rbp), %r13
movb $0x73, %al
movb %al, (%r13)
movl %r12d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xf24b(%rip), %rbx      # 0x47fd0
leaq 0x295a(%rip), %rsi      # 0x3b6e6
movl $0x1a, %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
movb $0x6e, %al
xorl %r12d, %r12d
movq -0x30(%rbp), %r13
jmp 0x38d68