// File: /workspace/github_cpp_makefile_star2_O3/Nallantli[P]Rossa/main/rossa/node_parser/node_parser.cpp
// Function: node_parser_t::parseCallNode(std::vector<node_scope_t, std::allocator<node_scope_t>>*, std::shared_ptr<Node> const&)
ptr_node_t node_parser_t::parseCallNode(std::vector<node_scope_t> *scopes, const ptr_node_t &a)
{
	auto marker = tokens.at(index - 2);
	nextToken();
	std::vector<ptr_node_t> args;
	int i = 0;
	while (currentToken.type != NULL_TOK && currentToken.type != ')')
	{
		if (i > 0)
		{
			if (currentToken.type != ',')
				return logErrorN(util::format(_EXPECTED_ERROR_, {","}), currentToken);
			nextToken();
		}
		i++;
		if (auto b = parseEquNode(scopes))
			args.push_back(b);
		else
			return logErrorN(_EXPECTED_FUNCTION_PARAM_, currentToken);
		if (currentToken.type == NULL_TOK)
			return logErrorN(util::format(_EXPECTED_ERROR_, {")"}), currentToken);
	}

	nextToken();

	ptr_node_t ret;
	if (a->getType() == Node::type_t::INS_NODE)
	{
		auto a_a = reinterpret_cast<InsNode *>(a.get())->getCallee();
		auto a_b = reinterpret_cast<InsNode *>(a.get())->getArg();
		if (a_b->getType() == Node::type_t::BID_NODE)
		{
			auto nkey = reinterpret_cast<BIDNode *>(a_b.get());
			std::string key = nkey->getKey();
			/*if (!args.empty())
				return logErrorN("Built in functions take a single argument", currentToken);*/

			if (key == KEYWORD_LENGTH)
			{
				ret = std::make_shared<CallBuiltNode>(*scopes, TOK_LENGTH, a_a, marker);
			}
			if (key == KEYWORD_ALLOC)
			{
				ret = std::make_shared<CallBuiltNode>(*scopes, TOK_ALLOC, a_a, marker);
			}
			if (key == KEYWORD_PARSE)
			{
				ret = std::make_shared<CallBuiltNode>(*scopes, TOK_PARSE, a_a, marker);
			}
			if (key == KEYWORD_CHAR_N)
			{
				ret = std::make_shared<CallBuiltNode>(*scopes, TOK_CHARN, a_a, marker);
			}
			if (key == KEYWORD_CHAR_S)
			{
				ret = std::make_shared<CallBuiltNode>(*scopes, TOK_CHARS, a_a, marker);
			}

			ret = parseTrailingNode(scopes, ret, true);
		}
		else
		{
			ret = std::make_shared<CallNode>(*scopes, std::make_shared<InsNode>(*scopes, a_a, a_b, currentToken), args, marker);
		}
		return parseTrailingNode(scopes, ret, true);
	}

	ret = std::make_shared<CallNode>(*scopes, a, args, marker);
	return parseTrailingNode(scopes, ret, true);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdx, %r15
movq %rdi, 0xa8(%rsp)
movl 0x50(%rsi), %ebp
addl $-0x2, %ebp
movq 0x10(%rsi), %r14
movq 0x18(%rsi), %rdx
subq %r14, %rdx
sarq $0x7, %rdx
cmpq %rbp, %rdx
jbe 0x289f4
movq %rcx, %r13
movq %rsi, %rbx
shlq $0x7, %rbp
leaq (%r14,%rbp), %r12
leaq 0xc8(%rsp), %rdi
movq %r12, %rsi
callq 0x1e566
leaq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x28(%r14,%rbp), %rsi
movq 0x30(%r14,%rbp), %rdx
addq %rsi, %rdx
callq 0x1ded4
movups 0x48(%r12), %xmm0
leaq 0x120(%rsp), %rdi
movups %xmm0, -0x10(%rdi)
leaq 0x130(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x58(%r12), %rsi
movq 0x60(%r12), %rdx
addq %rsi, %rdx
callq 0x1ded4
movl 0x78(%r12), %eax
movl %eax, 0x140(%rsp)
movq %rbx, %rdi
callq 0x2549e
xorps %xmm0, %xmm0
leaq 0xb0(%rsp), %rbp
movaps %xmm0, (%rbp)
movq $0x0, 0x10(%rbp)
movl 0xd0(%rbx), %eax
xorl %r14d, %r14d
leaq 0x50(%rsp), %r12
testl %eax, %eax
je 0x283b6
cmpl $0x29, %eax
je 0x283b6
subl $0x1, %r14d
jb 0x282e9
cmpl $0x2c, %eax
jne 0x28965
movq %rbx, %rdi
callq 0x2549e
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2946a
cmpq $0x0, 0x50(%rsp)
je 0x28933
movq %rbp, %rdi
movq %r12, %rsi
callq 0x36d3e
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x2831d
callq 0x1e5bc
movl 0xd0(%rbx), %eax
testl %eax, %eax
jne 0x282c1
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
movabsq $0x6465746365707845, %rax # imm = 0x6465746365707845
movq %rax, (%r14)
movabsq $0x607d307b60206465, %rax # imm = 0x607D307B60206465
movq %rax, 0x6(%r14)
movq $0xe, -0x8(%r14)
movb $0x0, 0xe(%r14)
leaq 0x80(%rsp), %r15
movq %r15, -0x10(%r15)
movw $0x29, (%r15)
movq $0x1, -0x8(%r15)
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x10(%rsp), %rcx
movl $0x1, %edx
callq 0x20b38
leaq 0x30(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x47db4
leaq 0x58(%rbx), %rcx
leaq 0x30(%rsp), %rdx
movq %rbx, %rsi
callq 0x29658
movq %rbx, %rdi
callq 0x2549e
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq (%r13), %rdi
callq 0x59438
cmpl $0x5, %eax
jne 0x28507
movq (%r13), %rsi
leaq 0x70(%rsp), %rdi
callq 0x61cd6
movq (%r13), %rsi
leaq 0x90(%rsp), %rdi
callq 0x61d08
movq 0x90(%rsp), %rdi
callq 0x59438
movq 0xa8(%rsp), %r14
leaq 0xc8(%rsp), %r12
cmpl $0x19, %eax
jne 0x28596
movq 0x90(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x5a8be
leaq 0x5aeec(%rip), %rsi     # 0x83322
leaq 0x30(%rsp), %rdi
callq 0x10110
testl %eax, %eax
je 0x286fe
leaq 0x5b0fd(%rip), %rsi     # 0x8354c
leaq 0x30(%rsp), %rdi
callq 0x10110
testl %eax, %eax
je 0x2876f
leaq 0x5b136(%rip), %rsi     # 0x8359e
leaq 0x30(%rsp), %rdi
callq 0x10110
testl %eax, %eax
je 0x287e0
leaq 0x5b10c(%rip), %rsi     # 0x8358d
leaq 0x30(%rsp), %rdi
callq 0x10110
testl %eax, %eax
je 0x28851
leaq 0x5b0f9(%rip), %rsi     # 0x83593
leaq 0x30(%rsp), %rdi
callq 0x10110
testl %eax, %eax
je 0x288c2
leaq 0x2c(%rsp), %r8
movb $0x1, (%r8)
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rcx
movq %rbx, %rsi
movq %r15, %rdx
callq 0x28002
movq 0x58(%rsp), %rdi
movaps 0x10(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
testq %rdi, %rdi
je 0x284e3
callq 0x1e5bc
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28639
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x28639
leaq 0x38(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0xc8(%rsp), %rax
movq %rax, (%rsp)
leaq 0x30(%rsp), %rsi
leaq 0x70(%rsp), %rdx
leaq 0xb0(%rsp), %r9
movq %r15, %rcx
movq %r13, %r8
callq 0x38734
movaps 0x30(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x30(%rsp)
movq 0x58(%rsp), %rdi
movaps %xmm0, 0x50(%rsp)
testq %rdi, %rdi
movq 0xa8(%rsp), %r14
je 0x28575
callq 0x1e5bc
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x28575
callq 0x1e5bc
leaq 0x30(%rsp), %r8
movb $0x1, (%r8)
leaq 0x50(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x28002
jmp 0x28676
leaq 0x58(%rbx), %rax
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %rax, (%rsp)
leaq 0x10(%rsp), %rsi
leaq 0x2c(%rsp), %rdx
leaq 0x70(%rsp), %r8
leaq 0x90(%rsp), %r9
movq %r15, %rcx
callq 0x383dc
leaq 0x38(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %r12, (%rsp)
leaq 0x30(%rsp), %rsi
leaq 0x2c(%rsp), %rdx
leaq 0x10(%rsp), %r8
leaq 0xb0(%rsp), %r9
movq %r15, %rcx
callq 0x38558
movaps 0x30(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x30(%rsp)
movq 0x58(%rsp), %rdi
movaps %xmm0, 0x50(%rsp)
testq %rdi, %rdi
je 0x2862a
callq 0x1e5bc
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2862a
callq 0x1e5bc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x28639
callq 0x1e5bc
leaq 0x30(%rsp), %r8
movb $0x1, (%r8)
leaq 0x50(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x28002
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x28667
callq 0x1e5bc
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x28676
callq 0x1e5bc
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x28685
callq 0x1e5bc
leaq 0xb0(%rsp), %rdi
callq 0x36cf0
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x286b7
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x286dc
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x103d0
leaq 0xc8(%rsp), %rdi
callq 0x1d5ee
movq %r14, %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2c(%rsp), %r8
movl $0xffffffe6, (%r8)      # imm = 0xFFFFFFE6
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %r12, (%rsp)
leaq 0x10(%rsp), %rsi
leaq 0xf(%rsp), %rdx
leaq 0x70(%rsp), %r9
movq %r15, %rcx
callq 0x3834a
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x58(%rsp), %rdi
movaps %xmm0, 0x50(%rsp)
testq %rdi, %rdi
je 0x28448
callq 0x1e5bc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x28448
callq 0x1e5bc
jmp 0x28448
leaq 0x2c(%rsp), %r8
movl $0xffffffda, (%r8)      # imm = 0xFFFFFFDA
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %r12, (%rsp)
leaq 0x10(%rsp), %rsi
leaq 0xf(%rsp), %rdx
leaq 0x70(%rsp), %r9
movq %r15, %rcx
callq 0x3834a
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x58(%rsp), %rdi
movaps %xmm0, 0x50(%rsp)
testq %rdi, %rdi
je 0x28461
callq 0x1e5bc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x28461
callq 0x1e5bc
jmp 0x28461
leaq 0x2c(%rsp), %r8
movl $0xffffffc7, (%r8)      # imm = 0xFFFFFFC7
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %r12, (%rsp)
leaq 0x10(%rsp), %rsi
leaq 0xf(%rsp), %rdx
leaq 0x70(%rsp), %r9
movq %r15, %rcx
callq 0x3834a
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x58(%rsp), %rdi
movaps %xmm0, 0x50(%rsp)
testq %rdi, %rdi
je 0x2847a
callq 0x1e5bc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x2847a
callq 0x1e5bc
jmp 0x2847a
leaq 0x2c(%rsp), %r8
movl $0xffffffcc, (%r8)      # imm = 0xFFFFFFCC
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %r12, (%rsp)
leaq 0x10(%rsp), %rsi
leaq 0xf(%rsp), %rdx
leaq 0x70(%rsp), %r9
movq %r15, %rcx
callq 0x3834a
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x58(%rsp), %rdi
movaps %xmm0, 0x50(%rsp)
testq %rdi, %rdi
je 0x28493
callq 0x1e5bc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x28493
callq 0x1e5bc
jmp 0x28493
leaq 0x2c(%rsp), %r8
movl $0xffffffcb, (%r8)      # imm = 0xFFFFFFCB
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %r12, (%rsp)
leaq 0x10(%rsp), %rsi
leaq 0xf(%rsp), %rdx
leaq 0x70(%rsp), %r9
movq %r15, %rcx
callq 0x3834a
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x58(%rsp), %rdi
movaps %xmm0, 0x50(%rsp)
testq %rdi, %rdi
je 0x284ac
callq 0x1e5bc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x284ac
callq 0x1e5bc
jmp 0x284ac
leaq 0x40(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5af4f(%rip), %rsi     # 0x83892
leaq 0x5af63(%rip), %rdx     # 0x838ad
leaq 0x30(%rsp), %rdi
callq 0x1e698
leaq 0x58(%rbx), %rcx
leaq 0x30(%rsp), %rdx
movq %rbx, %rsi
callq 0x29658
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
movabsq $0x6465746365707845, %rax # imm = 0x6465746365707845
movq %rax, (%r14)
movabsq $0x607d307b60206465, %rax # imm = 0x607D307B60206465
movq %rax, 0x6(%r14)
movq $0xe, -0x8(%r14)
movb $0x0, 0xe(%r14)
leaq 0x80(%rsp), %r15
movq %r15, -0x10(%r15)
movw $0x2c, (%r15)
movq $0x1, -0x8(%r15)
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x10(%rsp), %rcx
movl $0x1, %edx
callq 0x20b38
leaq 0x30(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x47db4
leaq 0x58(%rbx), %rcx
leaq 0x30(%rsp), %rdx
movq %rbx, %rsi
callq 0x29658
leaq 0x5b0f3(%rip), %rdi     # 0x83aee
movq %rbp, %rsi
xorl %eax, %eax
callq 0x105d0
jmp 0x28a0f
jmp 0x28a0f
jmp 0x28a0f
jmp 0x28a0f
jmp 0x28a0f
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28a4c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x28a4c
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x28a4c
callq 0x1e5bc
jmp 0x28a4c
jmp 0x28a49
jmp 0x28a49
jmp 0x28a49
movq %rax, %rbx
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x28a68
callq 0x1e5bc
jmp 0x28a68
jmp 0x28b6e
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x28b71
callq 0x1e5bc
jmp 0x28b71
jmp 0x28b6e
jmp 0x28b6e
jmp 0x28b6e
jmp 0x28b69
movq %rax, %rbx
jmp 0x28b8d
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x28ac9
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x28ac9
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x1d5ee
jmp 0x28b9a
jmp 0x28adf
jmp 0x28aff
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28b02
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x28b02
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x1db60
jmp 0x28b34
jmp 0x28b31
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x28b71
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x28b71
jmp 0x28b6e
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x28b4e
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x28b80
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x28b80
jmp 0x28b69
movq %rax, %rbx
jmp 0x28b80
movq %rax, %rbx
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x28b80
callq 0x1e5bc
leaq 0xb0(%rsp), %rdi
callq 0x36cf0
leaq 0xc8(%rsp), %rdi
callq 0x2108a
movq %rbx, %rdi
callq 0x106f0