// File: /workspace/github_cpp_makefile_star2_O3/nataly-enne[P]pet-fera/pet_fera_checagem.cpp
// Function: check_tratador(bool, std::map<int, TRATADOR, std::less<int>, std::allocator<std::pair<int const, TRATADOR>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char)
bool check_tratador(bool venenoso, map <int, TRATADOR> &tratadores, string nome, char tipo){
	int cont_nome = 0; // cont_nivel = 0;
	transform(nome.begin(), nome.end(), nome.begin(), ::toupper); // Converte a string nome para caracteres maiúsculos.
	if(tipo == 'v'){
		for(auto it = tratadores.begin(); it != tratadores.end();it++){
			if(it->second.getNome() == nome && (it->second.getNivel_seguranca() == 0 || it->second.getNivel_seguranca() == 1)){
				cont_nome++;
			}
		}
		if(cont_nome == 1){
			return 1;
		}
		else return 0;
	}
	else if(tipo == 'r' && venenoso == 1){ 
		for(auto it = tratadores.begin(); it != tratadores.end();it++){
			if(it->second.getNome() == nome && it->second.getNivel_seguranca() == 2){
				cont_nome++;
			}
		}
		if(cont_nome == 1){
			return 1;
		}
		else return 0;


	}
	else{
		for(auto it = tratadores.begin(); it != tratadores.end();it++){
			if(it->second.getNome() == nome &&(it->second.getNivel_seguranca() == 1)){
				cont_nome++;
			}
		}
		if(cont_nome == 1 ){ 
			return 1;
		}
		else return 0;
	}		
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, -0x2c(%rbp)
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, -0x54(%rbp)
movq 0x8(%rdx), %r13
testq %r13, %r13
je 0x36e17
movq (%rbx), %r15
xorl %r12d, %r12d
movsbl (%r15,%r12), %edi
callq 0x33d0
movb %al, (%r15,%r12)
incq %r12
cmpq %r12, %r13
jne 0x36e01
movsbl -0x2c(%rbp), %eax
cmpl $0x72, %eax
je 0x36eed
cmpl $0x76, %eax
jne 0x36f9a
movq 0x18(%r14), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0x3703a
movl $0x0, -0x2c(%rbp)
leaq 0x28(%r15), %r13
leaq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0xf224
movq -0x48(%rbp), %rdx
cmpq 0x8(%rbx), %rdx
jne 0x36ea8
testq %rdx, %rdx
je 0x36e77
movq (%rbx), %rsi
movq -0x50(%rbp), %r12
movq %r12, %rdi
callq 0x3230
testl %eax, %eax
jne 0x36eac
movq %r13, %rdi
callq 0xfaee
testl %eax, %eax
je 0x36ebf
movq %r13, %rdi
callq 0xfaee
movl %eax, %r12d
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x36ea0
callq 0x31d0
cmpl $0x1, %r12d
je 0x36ed1
jmp 0x36ed4
movq -0x50(%rbp), %r12
leaq -0x40(%rbp), %rax
cmpq %rax, %r12
je 0x36ed4
movq %r12, %rdi
callq 0x31d0
jmp 0x36ed4
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x36ed1
callq 0x31d0
incl -0x2c(%rbp)
movq %r15, %rdi
callq 0x3140
movq %rax, %r15
cmpq %r14, %rax
jne 0x36e45
jmp 0x37041
cmpb $0x0, -0x54(%rbp)
je 0x36f9a
movq 0x18(%r14), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0x3703a
movl $0x0, -0x2c(%rbp)
leaq 0x28(%r15), %r13
leaq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0xf224
movq -0x48(%rbp), %rdx
cmpq 0x8(%rbx), %rdx
jne 0x36f6c
testq %rdx, %rdx
je 0x36f41
movq (%rbx), %rsi
movq -0x50(%rbp), %r12
movq %r12, %rdi
callq 0x3230
testl %eax, %eax
jne 0x36f70
movq %r13, %rdi
callq 0xfaee
movl %eax, %r12d
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x36f5e
callq 0x31d0
xorl %eax, %eax
cmpl $0x2, %r12d
sete %al
addl %eax, -0x2c(%rbp)
jmp 0x36f81
movq -0x50(%rbp), %r12
leaq -0x40(%rbp), %rax
cmpq %rax, %r12
je 0x36f81
movq %r12, %rdi
callq 0x31d0
movq %r15, %rdi
callq 0x3140
movq %rax, %r15
cmpq %r14, %rax
jne 0x36f0f
jmp 0x37041
movq 0x18(%r14), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0x3703a
movl $0x0, -0x2c(%rbp)
leaq 0x28(%r15), %r13
leaq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0xf224
movq -0x48(%rbp), %rdx
cmpq 0x8(%rbx), %rdx
jne 0x3700f
testq %rdx, %rdx
je 0x36fe4
movq (%rbx), %rsi
movq -0x50(%rbp), %r12
movq %r12, %rdi
callq 0x3230
testl %eax, %eax
jne 0x37013
movq %r13, %rdi
callq 0xfaee
movl %eax, %r12d
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x37001
callq 0x31d0
xorl %eax, %eax
cmpl $0x1, %r12d
sete %al
addl %eax, -0x2c(%rbp)
jmp 0x37024
movq -0x50(%rbp), %r12
leaq -0x40(%rbp), %rax
cmpq %rax, %r12
je 0x37024
movq %r12, %rdi
callq 0x31d0
movq %r15, %rdi
callq 0x3140
movq %rax, %r15
cmpq %r14, %rax
jne 0x36fb2
jmp 0x37041
movl $0x0, -0x2c(%rbp)
cmpl $0x1, -0x2c(%rbp)
sete %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3705b
jmp 0x3705b
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x37070
callq 0x31d0
movq %rbx, %rdi
callq 0x3380