// File: menhits[P]phplus/src/Type.cpp
// Function: TypeBase::matches(std::shared_ptr<TypeBase>)
bool TypeBase::matches(Type other)
{
	if (other==shared_from_this())
		return true;
	
	if (getType()==WHATEV || other->getType()==WHATEV)
		return true;
		
	if (getType()==TUPLE)
	{
		auto subTypes=getAllSubTypes();
		
		if (subTypes->size()==1)
		{
			if ((*subTypes)[0].type->matches(other))
				return true;
		}
	}
	
	if (other->getType()==TUPLE)
	{
		auto subTypes=other->getAllSubTypes();
		
		if (subTypes->size()==1)
		{
			if ((*subTypes)[0].type->matches(shared_from_this()))
				return true;
		}
	}
	
	if (other->getType()!=getType())
		return false;
	
	return matchesSameTypeType(other);
}

// Assembly:
subq $0xd8, %rsp
movq %rsi, 0x50(%rsp)
movq %rdi, 0xc8(%rsp)
movq %rsi, 0xc0(%rsp)
movq 0xc8(%rsp), %rsi
movq %rsi, 0x48(%rsp)
addq $0x8, %rsi
leaq 0xb0(%rsp), %rdi
callq 0xa0440
movq 0x50(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x9b670
movb %al, 0x5f(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x1a950
movb 0x5f(%rsp), %al
testb $0x1, %al
jne 0x9f207
jmp 0x9f214
movb $0x1, 0xd7(%rsp)
jmp 0x9f4a4
movq 0x48(%rsp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x8, %eax
je 0x9f23c
movq 0x50(%rsp), %rdi
callq 0x1a660
movq %rax, %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x8, %eax
jne 0x9f249
movb $0x1, 0xd7(%rsp)
jmp 0x9f4a4
movq 0x48(%rsp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x7, %eax
jne 0x9f323
movq 0x48(%rsp), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x2df40
cmpq $0x1, %rax
jne 0x9f321
movq 0xa8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2df60
movq %rax, %rdi
addq $0x20, %rdi
callq 0x1a660
movq 0x50(%rsp), %rsi
movq %rax, 0x30(%rsp)
leaq 0x98(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x1a920
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x9f1a0
movb %al, 0x47(%rsp)
jmp 0x9f2d5
leaq 0x98(%rsp), %rdi
callq 0x1a950
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x9f2ec
jmp 0x9f31f
movb $0x1, 0xd7(%rsp)
jmp 0x9f4a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x1a950
jmp 0x9f4b5
jmp 0x9f321
jmp 0x9f323
movq 0x50(%rsp), %rdi
callq 0x1a660
movq %rax, %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x7, %eax
jne 0x9f408
movq 0x50(%rsp), %rdi
callq 0x1a660
movq %rax, %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rdi
callq 0x2df40
cmpq $0x1, %rax
jne 0x9f406
movq 0x80(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2df60
movq %rax, %rdi
addq $0x20, %rdi
callq 0x1a660
movq 0x48(%rsp), %rsi
movq %rax, 0x18(%rsp)
addq $0x8, %rsi
leaq 0x70(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xa0440
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x9f1a0
movb %al, 0x2f(%rsp)
jmp 0x9f3c0
leaq 0x70(%rsp), %rdi
callq 0x1a950
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0x9f3d4
jmp 0x9f404
movb $0x1, 0xd7(%rsp)
jmp 0x9f4a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x1a950
jmp 0x9f4b5
jmp 0x9f406
jmp 0x9f408
movq 0x50(%rsp), %rdi
callq 0x1a660
movq %rax, %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq 0x48(%rsp), %rdi
movl %eax, 0x14(%rsp)
movq (%rdi), %rax
callq *0x40(%rax)
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
je 0x9f43e
movb $0x0, 0xd7(%rsp)
jmp 0x9f4a4
movq 0x50(%rsp), %rsi
leaq 0x60(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1a920
movq 0x48(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq (%rdi), %rax
movq 0x60(%rax), %rax
callq *%rax
movb %al, 0x13(%rsp)
jmp 0x9f46b
movb 0x13(%rsp), %al
andb $0x1, %al
movb %al, 0xd7(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x1a950
jmp 0x9f4a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x1a950
jmp 0x9f4b5
movb 0xd7(%rsp), %al
andb $0x1, %al
addq $0xd8, %rsp
retq
movq 0x90(%rsp), %rdi
callq 0xb680
nopw %cs:(%rax,%rax)