// File: menhits[P]phplus/src/Namespace.cpp
// Function: NamespaceData::addNode(std::unique_ptr<AstNodeBase, std::default_delete<AstNodeBase>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void NamespaceData::addNode(AstNode node, string id)
{
	if (node->nameHint.empty())
	{
		node->nameHint=id;
		node->nameHintSet();
	}
	
	if (node->isType())
	{
		types.add(id, move(node));
	}
	/*
	else if (id=="__destroy__")
	{
		Action action=node->getAction();
		if (action->getInRightType()->isVoid() || !action->getInLeftType()->isVoid() || !action->getReturnType()->isVoid())
		{
			throw PhplusError("incorrect type signiture for destroyer", SOURCE_ERROR, node->getToken());
		}
		destructors.add(str::ptrToUniqueStr(&*action->getInRightType(), 6), move(node));
	}
	else if (id=="__copy__")
	{
		Action action=node->getAction();
		if (action->getInRightType()->isVoid() || !action->getInLeftType()->isVoid() || action->getReturnType()!=action->getInRightType())
		{
			throw PhplusError("incorrect type signiture for copier", SOURCE_ERROR, node->getToken());
		}
		copiers.add(str::ptrToUniqueStr(&*action->getReturnType(), 6), move(node));
	}
	*/
	else
	{
		// if the left or the right is a Whatev and the types match up
		if (node->canBeWhatev())
		{
			whatevActions.add(id, move(node));
		}
		else
		{
			actions.add(id, move(node));
		}
	}
}

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movq %rsi, 0x48(%rsp)
movq %rdi, %rax
movq 0x48(%rsp), %rdi
movq %rdi, 0x50(%rsp)
movq %rdx, 0x58(%rsp)
movq %rax, 0x100(%rsp)
movq %rdi, 0xf8(%rsp)
movq %rdx, 0xf0(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0x60(%rsp)
callq 0x1a5f0
movq %rax, %rdi
addq $0x8, %rdi
callq 0xb610
testb $0x1, %al
jne 0x3b1aa
jmp 0x3b1d8
movq 0x50(%rsp), %rdi
callq 0x1a5f0
movq 0x58(%rsp), %rsi
movq %rax, %rdi
addq $0x8, %rdi
callq 0xb050
movq 0x50(%rsp), %rdi
callq 0x1a5f0
movq %rax, %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq 0x50(%rsp), %rdi
callq 0x1a5f0
movq %rax, %rdi
movq (%rdi), %rax
callq *0x8(%rax)
testb $0x1, %al
jne 0x3b1f4
jmp 0x3b29a
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rax
addq $0xf8, %rax
movq %rax, 0x30(%rsp)
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xb1a0
movq 0x50(%rsp), %rsi
leaq 0xc8(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x1b710
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x399a0
jmp 0x3b248
leaq 0xc8(%rsp), %rdi
callq 0x1b3f0
leaq 0xd0(%rsp), %rdi
callq 0xb6e8
jmp 0x3b3e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x1b3f0
leaq 0xd0(%rsp), %rdi
callq 0xb6e8
jmp 0x3b3f0
movq 0x50(%rsp), %rdi
callq 0x1a5f0
movq %rax, %rdi
movq (%rdi), %rax
callq *0x28(%rax)
testb $0x1, %al
jne 0x3b2b6
jmp 0x3b35c
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rax
addq $0xc0, %rax
movq %rax, 0x18(%rsp)
leaq 0x98(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xb1a0
movq 0x50(%rsp), %rsi
leaq 0x90(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x1b710
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x399a0
jmp 0x3b30a
leaq 0x90(%rsp), %rdi
callq 0x1b3f0
leaq 0x98(%rsp), %rdi
callq 0xb6e8
jmp 0x3b3e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x1b3f0
leaq 0x98(%rsp), %rdi
callq 0xb6e8
jmp 0x3b3f0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rax
addq $0x50, %rax
movq %rax, (%rsp)
leaq 0x70(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xb1a0
movq 0x50(%rsp), %rsi
leaq 0x68(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x1b710
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x399a0
jmp 0x3b3a6
leaq 0x68(%rsp), %rdi
callq 0x1b3f0
leaq 0x70(%rsp), %rdi
callq 0xb6e8
jmp 0x3b3e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x1b3f0
leaq 0x70(%rsp), %rdi
callq 0xb6e8
jmp 0x3b3f0
jmp 0x3b3e8
addq $0x108, %rsp            # imm = 0x108
retq
movq 0xc0(%rsp), %rdi
callq 0xb680
nopl (%rax)