// File: /workspace/github_cpp_makefile_star2_O1/nataly-enne[P]pet-fera/pet_fera_checagem.cpp
// Function: verifica_autorizacao(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, char&)
bool verifica_autorizacao(string &autorizacao, char &sucesso){
	int cont = 0, cont_traco = 0, verificacao;
	char c;
	sucesso = 'n';
	transform(autorizacao.begin(), autorizacao.end(), autorizacao.begin(), ::toupper); // Converte a string nome para caracteres maiúsculos.
	for(int i = 0; i < (int)autorizacao.size(); i++){
		c = autorizacao[i];
		verificacao = isalnum(c);
		if(c == '-'){
			cont_traco++;
		}
		if(!verificacao && c != '-'){
			sucesso = 'n';
			cout << "ERRO: valor inválido!" << endl << endl;
			return 0;
		}
		else cont++;
		
	}
	if(cont == (int) autorizacao.size() && cont_traco == 1){
		transform(autorizacao.begin(), autorizacao.end(), autorizacao.begin(), ::tolower); // Converte a string autorizacao para valores minusculos.
		sucesso = 's';
		return 1;
	}
	else return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r12
movq %rsi, -0x48(%rbp)
movb $0x6e, (%rsi)
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x39204
movq (%r12), %r14
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
callq 0x33d0
movb %al, (%r14,%r15)
incq %r15
cmpq %r15, %rbx
jne 0x391ee
movq 0x8(%r12), %rax
testl %eax, %eax
setg %r14b
jle 0x3923f
movq %rax, -0x40(%rbp)
movq (%r12), %rax
movq %rax, -0x50(%rbp)
movsbl (%rax), %r15d
movl %r15d, %edi
callq 0x3220
xorl %ecx, %ecx
cmpl $0x2d, %r15d
sete %cl
je 0x39249
xorl %r13d, %r13d
testl %eax, %eax
jne 0x39249
movl %ecx, %ebx
jmp 0x392ab
xorl %r13d, %r13d
xorl %ecx, %ecx
jmp 0x39335
movq %r12, -0x38(%rbp)
movq -0x40(%rbp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, -0x30(%rbp)
leaq -0x1(%rax), %rbx
xorl %r13d, %r13d
cmpq %r13, %rbx
je 0x39322
movq -0x50(%rbp), %rax
movsbl 0x1(%rax,%r13), %r15d
xorl %r12d, %r12d
cmpl $0x2d, %r15d
sete %r12b
movl %r15d, %edi
movl %ecx, %r14d
callq 0x3220
movl %r14d, %ecx
addl %r12d, %ecx
incq %r13
cmpl $0x2d, %r15d
je 0x39261
testl %eax, %eax
jne 0x39261
movl %ecx, %ebx
cmpq -0x30(%rbp), %r13
setb %r14b
movq -0x38(%rbp), %r12
movq -0x48(%rbp), %rax
movb $0x6e, (%rax)
movq 0xed17(%rip), %r15      # 0x47fd0
leaq 0x23c3(%rip), %rsi      # 0x3b683
movl $0x16, %edx
movq %r15, %rdi
callq 0x3250
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x31f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
movl %ebx, %ecx
jmp 0x39335
incq %r13
cmpq -0x30(%rbp), %r13
setb %r14b
movq -0x38(%rbp), %r12
movq -0x40(%rbp), %r13
testb %r14b, %r14b
je 0x3933e
xorl %eax, %eax
jmp 0x3937a
movq 0x8(%r12), %rbx
xorl %eax, %eax
cmpl %ebx, %r13d
jne 0x3937a
cmpl $0x1, %ecx
jne 0x3937a
testq %rbx, %rbx
je 0x39371
movq (%r12), %r14
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
callq 0x32c0
movb %al, (%r14,%r15)
incq %r15
cmpq %r15, %rbx
jne 0x3935b
movq -0x48(%rbp), %rax
movb $0x73, (%rax)
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq