// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x579a6
movq (%r14), %r13
movq (%r12), %rbp
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x5490c
callq 0xdcba
movb $0x1, %r12b
cmpq %rbp, %r13
je 0x54a7b
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x40(%rax)
cmpl $0x8, %eax
je 0x54a7b
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x8, %eax
je 0x54a7b
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x40(%rax)
cmpl $0x7, %eax
jne 0x549b6
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x58(%rax)
movq (%rax), %rcx
movq 0x8(%rax), %rax
subq %rcx, %rax
cmpq $0x30, %rax
jne 0x549b6
movq 0x20(%rcx), %rdi
movq (%r14), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%r14), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x54992
movq 0x44624(%rip), %rcx     # 0x98fa8
cmpb $0x0, (%rcx)
je 0x5498e
incl 0x8(%rax)
jmp 0x54992
lock
incl 0x8(%rax)
leaq 0x18(%rsp), %rsi
callq 0x548ce
movl %eax, %ebp
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x549ad
callq 0xdcba
testb %bpl, %bpl
jne 0x54a7b
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x7, %eax
jne 0x54a13
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq (%rax), %rcx
movq 0x8(%rax), %rax
subq %rcx, %rax
cmpq $0x30, %rax
jne 0x54a13
movq 0x20(%rcx), %rbp
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x579a6
movq %rbp, %rdi
movq %r13, %rsi
callq 0x548ce
movl %eax, %r15d
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x54a0e
callq 0xdcba
testb %r15b, %r15b
jne 0x54a7b
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movl %eax, %ebp
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x40(%rax)
cmpl %eax, %ebp
jne 0x54a52
movq (%r14), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%r14), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x54a5b
movq 0x44560(%rip), %rcx     # 0x98fa8
cmpb $0x0, (%rcx)
je 0x54a57
incl 0x8(%rax)
jmp 0x54a5b
xorl %r12d, %r12d
jmp 0x54a7b
lock
incl 0x8(%rax)
movq (%rbx), %rax
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq *0x60(%rax)
movl %eax, %r12d
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x54a7b
callq 0xdcba
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x30(%rsp), %rdi
jmp 0x54aa9
movq %rax, %rbx
movq 0x20(%rsp), %rdi
jmp 0x54aa9
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x54ab3
callq 0xdcba
movq %rbx, %rdi
callq 0xa510
nop