// File: /workspace/github_cpp_makefile_star2_O1/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 0x36ebc
movq (%rbx), %r15
xorl %r12d, %r12d
movsbl (%r15,%r12), %edi
callq 0x33d0
movb %al, (%r15,%r12)
incq %r12
cmpq %r12, %r13
jne 0x36ea6
movsbl -0x2c(%rbp), %eax
cmpl $0x72, %eax
je 0x36f8f
cmpl $0x76, %eax
jne 0x37035
movq 0x18(%r14), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0x370ce
movl $0x0, -0x2c(%rbp)
leaq -0x50(%rbp), %r12
leaq 0x28(%r15), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xf220
movq -0x48(%rbp), %rdx
cmpq 0x8(%rbx), %rdx
jne 0x36f1c
testq %rdx, %rdx
je 0x36f30
movq (%rbx), %rsi
movq -0x50(%rbp), %rdi
callq 0x3230
testl %eax, %eax
je 0x36f30
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x36f76
callq 0x31d0
jmp 0x36f76
movq %r13, %rdi
callq 0xfaea
testl %eax, %eax
je 0x36f61
movq %r13, %rdi
callq 0xfaea
movl %eax, %r13d
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x36f59
callq 0x31d0
cmpl $0x1, %r13d
je 0x36f73
jmp 0x36f76
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x36f73
callq 0x31d0
incl -0x2c(%rbp)
movq %r15, %rdi
callq 0x3140
movq %rax, %r15
cmpq %r14, %rax
jne 0x36eee
jmp 0x370d5
cmpb $0x0, -0x54(%rbp)
je 0x37035
movq 0x18(%r14), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0x370ce
movl $0x0, -0x2c(%rbp)
leaq -0x50(%rbp), %r12
leaq 0x28(%r15), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xf220
movq -0x48(%rbp), %rdx
cmpq 0x8(%rbx), %rdx
jne 0x36fe3
testq %rdx, %rdx
je 0x36ff7
movq (%rbx), %rsi
movq -0x50(%rbp), %rdi
callq 0x3230
testl %eax, %eax
je 0x36ff7
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x37020
callq 0x31d0
jmp 0x37020
movq %r13, %rdi
callq 0xfaea
movl %eax, %r13d
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x37014
callq 0x31d0
xorl %eax, %eax
cmpl $0x2, %r13d
sete %al
addl %eax, -0x2c(%rbp)
movq %r15, %rdi
callq 0x3140
movq %rax, %r15
cmpq %r14, %rax
jne 0x36fb5
jmp 0x370d5
movq 0x18(%r14), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0x370ce
movl $0x0, -0x2c(%rbp)
leaq -0x50(%rbp), %r12
leaq 0x28(%r15), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xf220
movq -0x48(%rbp), %rdx
cmpq 0x8(%rbx), %rdx
jne 0x3707f
testq %rdx, %rdx
je 0x37093
movq (%rbx), %rsi
movq -0x50(%rbp), %rdi
callq 0x3230
testl %eax, %eax
je 0x37093
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x370bc
callq 0x31d0
jmp 0x370bc
movq %r13, %rdi
callq 0xfaea
movl %eax, %r13d
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x370b0
callq 0x31d0
xorl %eax, %eax
cmpl $0x1, %r13d
sete %al
addl %eax, -0x2c(%rbp)
movq %r15, %rdi
callq 0x3140
movq %rax, %r15
cmpq %r14, %rax
jne 0x37051
jmp 0x370d5
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 0x370ef
jmp 0x370ef
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x37104
callq 0x31d0
movq %rbx, %rdi
callq 0x3380