// File: /workspace/github_cpp_makefile_star2_O2/menhits[P]phplus/src/Namespace.cpp
// Function: NamespaceData::getActionForTokenWithInput(std::shared_ptr<TokenData>, std::shared_ptr<TypeBase>, std::shared_ptr<TypeBase>, bool, bool, std::shared_ptr<TokenData>)
Action NamespaceData::getActionForTokenWithInput(Token token, Type left, Type right, bool dynamic, bool throwSourceError, Token tokenForError)
{
	vector<Action> matches;
	vector<AstNodeBase*> nodes;
	bool foundNodes=false;
	AstNode tupleNode; // this is needed for memory management, so if a tuple node is needed it can be kept around until the function exits
	
	string searchText = (token->getOp() ? token->getOp()->getText() : token->getText());
	
	getNodes(nodes, searchText, true, dynamic, false);
	
	if (left->getType()==TypeBase::TUPLE && token->getType()==TokenData::IDENTIFIER)
	{
		auto match=left->getSubType(searchText);
		
		if (match.type)
		{
			if (right->isVoid())
			{
				tupleNode=AstActionWrapper::make(getElemFromTupleAction(left, searchText));
				nodes.push_back(&*tupleNode);
			}
		}
	}
	
	if (!nodes.empty())
		foundNodes=true;
	
	nodesToMatchingActions(matches, nodes, left, right);
	
	if (!matches.empty())
	{
		if (matches.size() == 1)
		{
			return matches[0];
		}
		else if (throwSourceError)
		{
			throw PhplusError("multiple matching instances of '"+token->getText()+"' found", SOURCE_ERROR, tokenForError);
		}
		else
		{
			return nullptr;
		}
	}
	
	nodes.clear();
	getNodes(nodes, searchText, false, false, true);
	
	if (!nodes.empty())
		foundNodes=true;
	
	for (auto i: nodes)
	{
		AstNode instance=i->makeCopyWithSpecificTypes(left, right);
		
		if (instance)
		{
			matches.push_back(instance->getAction());
			actions.add(token->getText(), move(instance));
		}
	}
	
	if (!matches.empty())
	{
		if (matches.size() == 1)
		{
			return matches[0];
		}
		else if (throwSourceError)
		{
			throw PhplusError("multiple whatev instances of '"+token->getText()+"' found", SOURCE_ERROR, tokenForError);
		}
		else
		{
			return nullptr;
		}
	}
	
	if (!foundNodes && dynamic && token->getType()==TokenData::IDENTIFIER && left->isVoid() && right->isCreatable())
	{
		return addVar(right, token->getText());
	}
	
	if (throwSourceError)
	{
		if (foundNodes)
			throw PhplusError("correct overload of '"+token->getText()+"' tidak ditemukan for types "+left->getString()+" and "+right->getString(), SOURCE_ERROR, tokenForError);
		else
			throw PhplusError("'"+token->getText()+"' tidak ditemukan", SOURCE_ERROR, tokenForError);
	}
	else
	{
		return nullptr;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
movl %r9d, 0x4c(%rsp)
movq %r8, 0x20(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, %r15
movq %rsi, %r14
andq $0x0, 0xa0(%rsp)
movq %rdi, %rbp
andq $0x0, 0x80(%rsp)
xorps %xmm0, %xmm0
andq $0x0, 0x88(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x70(%rsp)
movq (%rdx), %rsi
addq $0x40, %rsi
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0xc950
xorl %eax, %eax
cmpq %rax, (%rbx)
je 0x1d0b5
movq (%r15), %rsi
addq $0x40, %rsi
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0xc950
movq (%rbx), %rsi
leaq 0x108(%rsp), %rdi
callq 0xa3b0
leaq 0x30(%rsp), %rdi
callq 0xc984
jmp 0x1d0c5
movq (%r15), %rsi
leaq 0x108(%rsp), %rdi
callq 0xa3b0
leaq 0x58(%rsp), %rdi
callq 0xc984
leaq 0x228(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0xa3b0
movzbl 0x4c(%rsp), %r8d
leaq 0x70(%rsp), %rsi
leaq 0x228(%rsp), %rdx
pushq $0x1
popq %rcx
movq %r14, %rdi
xorl %r9d, %r9d
callq 0x1dce4
leaq 0x228(%rsp), %rdi
callq 0xa558
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x7, %eax
movq %r14, 0xb0(%rsp)
jne 0x1d260
movq (%r15), %rax
cmpl $0x2, 0x38(%rax)
jne 0x1d260
movq 0x10(%rsp), %rax
movq (%rax), %rbx
leaq 0x208(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0xa3b0
movq (%rbx), %rax
leaq 0x50(%rsp), %rdi
leaq 0x208(%rsp), %rdx
movq %rbx, %rsi
callq *0x50(%rax)
leaq 0x208(%rsp), %rdi
callq 0xa558
cmpq $0x0, 0x58(%rsp)
je 0x1d256
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
testb %al, %al
je 0x1d256
leaq 0xe8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x12c0a
leaq 0x1e8(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0xa3b0
leaq 0xf8(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x1e8(%rsp), %rdx
callq 0x4c006
leaq 0x28(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x1df64
leaq 0x28(%rsp), %rbx
movq (%rbx), %rsi
andq $0x0, (%rbx)
leaq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0x12dbe
movq %rbx, %rdi
callq 0x1e016
leaq 0x100(%rsp), %rdi
callq 0xc984
leaq 0x1e8(%rsp), %rdi
callq 0xa558
leaq 0xf0(%rsp), %rdi
callq 0xc984
movq (%r14), %rax
movq %rax, (%rbx)
leaq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x1e6fc
leaq 0x60(%rsp), %rdi
callq 0xc984
movq %r15, 0x18(%rsp)
leaq 0x70(%rsp), %rbx
movq (%rbx), %r12
movq 0x8(%rbx), %r13
leaq 0x158(%rsp), %r14
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x12c0a
leaq 0x148(%rsp), %r15
movq %r15, %rdi
movq 0x20(%rsp), %rsi
callq 0x12c0a
leaq 0x90(%rsp), %rsi
movq %rbx, %rdx
movq %r14, %rcx
movq %r15, %r8
callq 0x1de10
movq 0x3c8(%rsp), %r15
leaq 0x150(%rsp), %rdi
callq 0xc984
leaq 0x160(%rsp), %rdi
callq 0xc984
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rax
cmpq %rax, %rsi
je 0x1d39b
subq %rsi, %rax
cmpq $0x10, %rax
je 0x1d580
cmpb $0x0, 0x3c0(%rsp)
je 0x1d6f7
pushq $0x38
popq %rdi
callq 0xa1b0
movq %rax, %r14
movq 0x18(%rsp), %rax
movq (%rax), %rsi
leaq 0x28(%rsp), %rdi
callq 0xa3b0
leaq 0x3801b(%rip), %rsi     # 0x55346
leaq 0x50(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x11ff8
leaq 0x38026(%rip), %rdx     # 0x55367
leaq 0x348(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc882
leaq 0x1d8(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x12e2e
movb $0x1, %bpl
leaq 0x348(%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x19f06
xorl %ebp, %ebp
leaq 0x5a211(%rip), %rsi     # 0x77598
leaq -0xbcfc(%rip), %rdx     # 0x11692
movq %r14, %rdi
callq 0xa4e0
jmp 0x1d8e3
movq 0x70(%rsp), %rax
cmpq %rax, 0x78(%rsp)
je 0x1d3ac
movq %rax, 0x78(%rsp)
leaq 0x1b8(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0xa3b0
movq 0xb0(%rsp), %rbx
movq %rbp, 0xa8(%rsp)
leaq 0x70(%rsp), %rsi
leaq 0x1b8(%rsp), %rdx
pushq $0x1
popq %r9
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1dce4
xorq %r13, %r12
leaq 0x1b8(%rsp), %rdi
callq 0xa558
movq 0x70(%rsp), %rdx
movq 0x78(%rsp), %rcx
movq %rdx, %rax
movq %rcx, 0xc8(%rsp)
xorq %rcx, %rax
orq %r12, %rax
sete 0xf(%rsp)
leaq 0x50(%rbx), %rax
movq %rax, 0xc0(%rsp)
leaq 0x50(%rsp), %rbx
leaq 0x368(%rsp), %rbp
leaq 0xb8(%rsp), %r15
cmpq 0xc8(%rsp), %rdx
je 0x1d54a
movq %rbp, %r14
movq %rbx, %rbp
movq %rdx, 0xd0(%rsp)
movq (%rdx), %rbx
leaq 0x138(%rsp), %r12
movq %r12, %rdi
movq 0x10(%rsp), %rsi
callq 0x12c0a
leaq 0x128(%rsp), %r13
movq %r13, %rdi
movq 0x20(%rsp), %rsi
callq 0x12c0a
movq (%rbx), %rax
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq *0x30(%rax)
leaq 0x130(%rsp), %rdi
callq 0xc984
leaq 0x140(%rsp), %rdi
callq 0xc984
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
movq %rbp, %rbx
movq %r14, %rbp
je 0x1d52f
movq %rbx, %rdi
callq 0x1189c
leaq 0x90(%rsp), %rdi
movq %rbx, %rsi
callq 0x13ae2
leaq 0x58(%rsp), %rdi
callq 0xc984
movq 0x18(%rsp), %rax
movq (%rax), %rsi
movq %rbp, %rdi
callq 0xa3b0
movq 0x28(%rsp), %rax
movq %rax, 0xb8(%rsp)
andq $0x0, 0x28(%rsp)
movq 0xc0(%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x1b27c
movq %r15, %rdi
callq 0x11c58
movq %rbp, %rdi
callq 0xa558
leaq 0x28(%rsp), %rdi
callq 0x11c58
movq 0xd0(%rsp), %rdx
addq $0x8, %rdx
jmp 0x1d440
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rax
cmpq %rax, %rsi
je 0x1d58d
subq %rsi, %rax
cmpq $0x10, %rax
movq 0xa8(%rsp), %rbp
movq 0x18(%rsp), %rbx
movb 0x3c0(%rsp), %al
jne 0x1d6f3
movq %rbp, %rdi
callq 0x12c1e
jmp 0x1d6fe
movl 0x4c(%rsp), %eax
movb 0xf(%rsp), %r15b
andb %r15b, %al
cmpb $0x1, %al
movq 0xa8(%rsp), %rbp
movq 0x18(%rsp), %rbx
movb 0x3c0(%rsp), %r14b
jne 0x1d648
movq (%rbx), %rax
cmpl $0x2, 0x38(%rax)
jne 0x1d648
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
testb %al, %al
je 0x1d648
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
testb %al, %al
je 0x1d648
leaq 0xd8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x12c0a
movq (%rbx), %rsi
leaq 0x188(%rsp), %rdi
callq 0xa3b0
leaq 0xd8(%rsp), %rdx
leaq 0x188(%rsp), %rcx
movq %rbp, %rdi
movq 0xb0(%rsp), %rsi
callq 0x1c238
leaq 0x188(%rsp), %rdi
callq 0xa558
leaq 0xe0(%rsp), %rdi
callq 0xc984
jmp 0x1d6fe
testb %r14b, %r14b
je 0x1d6f7
pushq $0x38
popq %rdi
callq 0xa1b0
movq %rax, %r13
testb %r15b, %r15b
je 0x1d7d8
movq 0x18(%rsp), %rax
movq (%rax), %rsi
leaq 0x28(%rsp), %rdi
callq 0xa3b0
leaq 0x3bbd4(%rip), %rsi     # 0x59252
leaq 0x50(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x11ff8
leaq 0x37d33(%rip), %rdx     # 0x553c7
leaq 0x248(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc882
leaq 0x168(%rsp), %rbx
movq %rbx, %rdi
movq 0x3c8(%rsp), %rsi
callq 0x12e2e
movb $0x1, %bpl
leaq 0x248(%rsp), %rsi
movq %r13, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x19f06
xorl %ebp, %ebp
leaq 0x59eb9(%rip), %rsi     # 0x77598
leaq -0xc054(%rip), %rdx     # 0x11692
movq %r13, %rdi
callq 0xa4e0
jmp 0x1d8e3
testb %al, %al
jne 0x1d744
xorps %xmm0, %xmm0
movups %xmm0, (%rbp)
leaq 0x108(%rsp), %rdi
callq 0xa558
leaq 0x88(%rsp), %rdi
callq 0x11c58
leaq 0x70(%rsp), %rdi
callq 0x1ebda
leaq 0x90(%rsp), %rdi
callq 0x119e8
movq %rbp, %rax
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x38
popq %rdi
callq 0xa1b0
movq %rax, %r14
movq (%rbx), %rsi
leaq 0x28(%rsp), %rdi
callq 0xa3b0
leaq 0x37c0c(%rip), %rsi     # 0x5536f
leaq 0x50(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x11ff8
leaq 0x37bee(%rip), %rdx     # 0x55367
leaq 0x328(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc882
leaq 0x1a8(%rsp), %rbx
movq %rbx, %rdi
movq 0x3c8(%rsp), %rsi
callq 0x12e2e
movb $0x1, %bpl
leaq 0x328(%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x19f06
xorl %ebp, %ebp
leaq 0x59dd4(%rip), %rsi     # 0x77598
leaq -0xc139(%rip), %rdx     # 0x11692
movq %r14, %rdi
callq 0xa4e0
jmp 0x1d8e3
movq 0x18(%rsp), %rax
movq (%rax), %rsi
leaq 0x2a8(%rsp), %rdi
callq 0xa3b0
leaq 0x37b9a(%rip), %rsi     # 0x5538e
leaq 0x2c8(%rsp), %rdi
leaq 0x2a8(%rsp), %rdx
callq 0x11ff8
leaq 0x37b94(%rip), %rdx     # 0x553a4
leaq 0x2e8(%rsp), %rdi
leaq 0x2c8(%rsp), %rsi
callq 0xc882
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq (%rsi), %rax
leaq 0x288(%rsp), %rdi
callq *0x8(%rax)
leaq 0x28(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
leaq 0x288(%rsp), %rdx
callq 0x1205e
leaq 0x37b65(%rip), %rdx     # 0x553c1
leaq 0x50(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xc882
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movq (%rsi), %rax
leaq 0x268(%rsp), %rdi
callq *0x8(%rax)
leaq 0x308(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x268(%rsp), %rdx
callq 0x1205e
leaq 0x178(%rsp), %rbx
movq %rbx, %rdi
movq 0x3c8(%rsp), %rsi
callq 0x12e2e
movb $0x1, %bpl
leaq 0x308(%rsp), %rsi
movq %r13, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x19f06
xorl %ebp, %ebp
leaq 0x59cc4(%rip), %rsi     # 0x77598
leaq -0xc249(%rip), %rdx     # 0x11692
movq %r13, %rdi
callq 0xa4e0
movq %rax, %r15
leaq 0x180(%rsp), %rdi
callq 0xc984
leaq 0x308(%rsp), %rdi
callq 0xa558
jmp 0x1d908
movq %rax, %r15
movb $0x1, %bpl
leaq 0x268(%rsp), %rdi
callq 0xa558
jmp 0x1d91d
movq %rax, %r15
movb $0x1, %bpl
leaq 0x50(%rsp), %rdi
callq 0xa558
jmp 0x1d92f
movq %rax, %r15
movb $0x1, %bpl
leaq 0x28(%rsp), %rdi
callq 0xa558
jmp 0x1d941
movq %rax, %r15
movb $0x1, %bpl
leaq 0x288(%rsp), %rdi
callq 0xa558
jmp 0x1d956
movq %rax, %r15
movb $0x1, %bpl
leaq 0x2e8(%rsp), %rdi
callq 0xa558
jmp 0x1d96b
movq %rax, %r15
movb $0x1, %bpl
leaq 0x2c8(%rsp), %rdi
callq 0xa558
jmp 0x1d9ef
movq %rax, %r15
leaq 0x170(%rsp), %rdi
callq 0xc984
leaq 0x248(%rsp), %rdi
callq 0xa558
jmp 0x1d99f
movq %rax, %r15
movb $0x1, %bpl
leaq 0x50(%rsp), %rdi
callq 0xa558
jmp 0x1d9ff
movq %rax, %r15
leaq 0x188(%rsp), %rdi
callq 0xa558
jmp 0x1d9c0
movq %rax, %r15
leaq 0xe0(%rsp), %rdi
jmp 0x1db89
movq %rax, %r15
leaq 0x1b0(%rsp), %rdi
callq 0xc984
leaq 0x328(%rsp), %rdi
jmp 0x1da3a
jmp 0x1da41
movq %rax, %r15
movb $0x1, %bpl
leaq 0x2a8(%rsp), %rdi
jmp 0x1da04
movq %rax, %r15
movb $0x1, %bpl
leaq 0x28(%rsp), %rdi
callq 0xa558
testb %bpl, %bpl
jne 0x1da1a
jmp 0x1db8e
jmp 0x1da8d
jmp 0x1da17
movq %rax, %r15
movq %r13, %rdi
jmp 0x1daba
movq %rax, %r15
leaq 0x1e0(%rsp), %rdi
callq 0xc984
leaq 0x348(%rsp), %rdi
callq 0xa558
jmp 0x1da47
movq %rax, %r15
movb $0x1, %bpl
leaq 0x50(%rsp), %rdi
callq 0xa558
jmp 0x1da93
jmp 0x1dab4
jmp 0x1daa7
movq %rax, %r15
leaq 0x100(%rsp), %rdi
callq 0xc984
jmp 0x1da6c
movq %rax, %r15
leaq 0x1e8(%rsp), %rdi
callq 0xa558
jmp 0x1da7e
movq %rax, %r15
leaq 0xf0(%rsp), %rdi
callq 0xc984
jmp 0x1daaa
movq %rax, %r15
movb $0x1, %bpl
leaq 0x28(%rsp), %rdi
callq 0xa558
testb %bpl, %bpl
jne 0x1dab7
jmp 0x1db8e
movq %rax, %r15
leaq 0x60(%rsp), %rdi
jmp 0x1db89
movq %rax, %r15
movq %r14, %rdi
callq 0xa230
jmp 0x1db8e
movq %rax, %r15
leaq 0x208(%rsp), %rdi
jmp 0x1db26
jmp 0x1db2d
movq %rax, %r15
leaq 0x1b8(%rsp), %rdi
jmp 0x1db26
movq %rax, %r15
jmp 0x1daf2
movq %rax, %r15
leaq 0x30(%rsp), %rdi
callq 0xc984
leaq 0x58(%rsp), %rdi
callq 0xc984
jmp 0x1db9b
movq %rax, %r15
leaq 0x150(%rsp), %rdi
callq 0xc984
leaq 0x160(%rsp), %rdi
jmp 0x1db89
movq %rax, %r15
leaq 0x228(%rsp), %rdi
callq 0xa558
jmp 0x1db8e
movq %rax, %r15
jmp 0x1db8e
movq %rax, %r15
leaq 0xb8(%rsp), %rdi
callq 0x11c58
leaq 0x368(%rsp), %rdi
callq 0xa558
jmp 0x1db65
jmp 0x1db62
movq %rax, %r15
leaq 0x58(%rsp), %rdi
callq 0xc984
jmp 0x1db65
movq %rax, %r15
leaq 0x28(%rsp), %rdi
callq 0x11c58
jmp 0x1db8e
movq %rax, %r15
leaq 0x130(%rsp), %rdi
callq 0xc984
leaq 0x140(%rsp), %rdi
callq 0xc984
leaq 0x108(%rsp), %rdi
callq 0xa558
leaq 0x88(%rsp), %rdi
callq 0x11c58
leaq 0x70(%rsp), %rdi
callq 0x1ebda
leaq 0x90(%rsp), %rdi
callq 0x119e8
movq %r15, %rdi
callq 0xa500
nop