// File: 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
subq $0xd0, %rsp
movq %rsi, -0xc0(%rbp)
movq %rdi, %rax
movq -0xc0(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
movq %rax, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movb $0x6e, (%rax)
callq 0x31e0
movq -0xb8(%rbp), %rdi
movq %rax, -0x38(%rbp)
callq 0x3120
movq -0xb8(%rbp), %rdi
movq %rax, -0x40(%rbp)
callq 0x31e0
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x110e0(%rip), %rcx     # 0x50fe0
callq 0x1f5a0
movq %rax, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movq -0xb8(%rbp), %rdi
movl -0x54(%rbp), %eax
movl %eax, -0xc4(%rbp)
callq 0x31a0
movq %rax, %rcx
movl -0xc4(%rbp), %eax
cmpl %ecx, %eax
jge 0x3ffdb
movq -0xb8(%rbp), %rdi
movslq -0x54(%rbp), %rsi
callq 0x3430
movb (%rax), %al
movb %al, -0x2d(%rbp)
movsbl -0x2d(%rbp), %edi
callq 0x3260
movl %eax, -0x28(%rbp)
movsbl -0x2d(%rbp), %eax
cmpl $0x2d, %eax
jne 0x3ff69
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x3ffc2
movsbl -0x2d(%rbp), %eax
cmpl $0x20, %eax
je 0x3ffc2
movsbl -0x2d(%rbp), %eax
cmpl $0x2d, %eax
je 0x3ffc2
movq -0x20(%rbp), %rax
movb $0x6e, (%rax)
movq 0x11029(%rip), %rdi     # 0x50fb8
leaq 0x26ad(%rip), %rsi      # 0x42643
callq 0x3240
movq %rax, %rdi
movq 0x10ffb(%rip), %rsi     # 0x50fa0
callq 0x3280
movq %rax, %rdi
movq 0x10fec(%rip), %rsi     # 0x50fa0
callq 0x3280
movb $0x0, -0x1(%rbp)
jmp 0x4015f
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3ffcd
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x3ff10
movq -0xb8(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, -0xc8(%rbp)
callq 0x31a0
movq %rax, %rcx
movl -0xc8(%rbp), %eax
cmpl %ecx, %eax
jne 0x40154
cmpl $0x1, -0x2c(%rbp)
jl 0x40154
movq -0xb8(%rbp), %rdi
callq 0x31e0
movq -0xb8(%rbp), %rdi
movq %rax, -0x60(%rbp)
callq 0x3120
movq -0xb8(%rbp), %rdi
movq %rax, -0x68(%rbp)
callq 0x31e0
movq %rax, -0x70(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq 0x10f7a(%rip), %rcx     # 0x50fc8
callq 0x1f5a0
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1f6c0
testb $0x1, %al
jne 0x40066
jmp 0x40076
movq -0x20(%rbp), %rax
movb $0x73, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x4015f
movq -0x10(%rbp), %rdi
callq 0x1f6e0
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1f740
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x1f710
testb $0x1, %al
jne 0x400ac
jmp 0x40150
leaq -0x80(%rbp), %rdi
callq 0x3d600
movq %rax, %rsi
addq $0x8, %rsi
leaq -0xa8(%rbp), %rdi
callq 0x12560
movq -0xb8(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x3d540
movb %al, -0xc9(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3180
movb -0xc9(%rbp), %al
testb $0x1, %al
jne 0x400f9
jmp 0x40137
movq 0x10eb8(%rip), %rdi     # 0x50fb8
leaq 0x259f(%rip), %rsi      # 0x426a6
callq 0x3240
movq %rax, %rdi
movq 0x10e8a(%rip), %rsi     # 0x50fa0
callq 0x3280
movq %rax, %rdi
movq 0x10e7b(%rip), %rsi     # 0x50fa0
callq 0x3280
movq -0x20(%rbp), %rax
movb $0x6e, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x4015f
jmp 0x40139
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
callq 0x1f790
movq %rax, -0xb0(%rbp)
jmp 0x40083
jmp 0x40152
jmp 0x40154
movq -0x20(%rbp), %rax
movb $0x73, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax)