// File: /workspace/github_cpp_makefile_star2_O3/Nallantli[P]Rossa/main/rossa/node_parser/node_parser.cpp
// Function: node_parser_t::parseExternCallNode(std::vector<node_scope_t, std::allocator<node_scope_t>>*)
ptr_node_t node_parser_t::parseExternCallNode(std::vector<node_scope_t> *scopes)
{
	nextToken();
	std::string libname = currentToken.valueString;
	nextToken();
	if (currentToken.type != TOK_INNER)
		return logErrorN(util::format(_EXPECTED_ERROR_, {"."}), currentToken);
	nextToken();
	std::string fname = currentToken.valueString;

	auto marker = currentToken;

	nextToken();

	if (currentToken.type != '(')
		return logErrorN(util::format(_EXPECTED_ERROR_, {"("}), currentToken);
	nextToken();

	std::vector<ptr_node_t> args;
	int i = 0;
	while (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();

	return std::make_shared<ExternCallNode>(*scopes, libname, fname, args, marker);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
callq 0x2549e
leaq 0xa8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0xb0(%rbx), %rsi
movq 0xb8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rdi
callq 0x1ded4
movq %rbx, %rdi
callq 0x2549e
leaq 0x58(%rbx), %rbp
cmpl $-0x27, 0xd0(%rbx)
jne 0x29b2a
movq %rbx, %rdi
callq 0x2549e
leaq 0x60(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0xb0(%rbx), %rsi
movq 0xb8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x1ded4
leaq 0xe8(%rsp), %rdi
movq %rbp, %rsi
callq 0x1e566
leaq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x80(%rbx), %rsi
movq 0x88(%rbx), %rdx
addq %rsi, %rdx
callq 0x1ded4
movups 0xa0(%rbx), %xmm0
leaq 0x140(%rsp), %rdi
movups %xmm0, -0x10(%rdi)
leaq 0x150(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0xb0(%rbx), %rsi
movq 0xb8(%rbx), %rdx
addq %rsi, %rdx
callq 0x1ded4
movl 0xd0(%rbx), %eax
movl %eax, 0x160(%rsp)
movq %rbx, %rdi
callq 0x2549e
cmpl $0x28, 0xd0(%rbx)
jne 0x29bb8
movq %rbx, %rdi
callq 0x2549e
movq %rbp, 0x70(%rsp)
xorps %xmm0, %xmm0
leaq 0xd0(%rsp), %rbp
movaps %xmm0, (%rbp)
movq $0x0, 0x10(%rbp)
movl 0xd0(%rbx), %eax
xorl %r13d, %r13d
leaq 0x30(%rsp), %r14
cmpl $0x29, %eax
je 0x29962
subl $0x1, %r13d
jb 0x29894
cmpl $0x2c, %eax
jne 0x29a9a
movq %rbx, %rdi
callq 0x2549e
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2946a
cmpq $0x0, 0x30(%rsp)
je 0x29a67
movq %rbp, %rdi
movq %r14, %rsi
callq 0x36d3e
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x298c8
callq 0x1e5bc
movl 0xd0(%rbx), %eax
testl %eax, %eax
jne 0x29874
leaq 0x40(%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 0x88(%rsp), %r15
movq %r15, -0x10(%r15)
movw $0x29, (%r15)
movq $0x1, -0x8(%r15)
leaq 0xb8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x20b38
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x47db4
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq 0x70(%rsp), %rcx
callq 0x29658
movq %rbx, %rdi
callq 0x2549e
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x98(%rsp), %r8
leaq 0x50(%rsp), %r9
movq %r12, %rcx
leaq 0xe8(%rsp), %rax
pushq %rax
pushq %rbp
leaq 0xb8(%rsp), %r14
leaq 0x70(%rsp), %r13
callq 0x387c6
addq $0x10, %rsp
movaps 0x10(%rsp), %xmm0
movups %xmm0, (%r15)
leaq 0xd0(%rsp), %rdi
callq 0x36cf0
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x299ec
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x29a11
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x103d0
leaq 0xe8(%rsp), %rdi
callq 0x1d5ee
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x29a35
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x29a52
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x103d0
movq %r15, %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x59e1b(%rip), %rsi     # 0x83892
leaq 0x59e2f(%rip), %rdx     # 0x838ad
leaq 0x10(%rsp), %rdi
callq 0x1e698
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq 0x70(%rsp), %rcx
callq 0x29658
leaq 0x40(%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 0x88(%rsp), %r15
movq %r15, -0x10(%r15)
movw $0x2c, (%r15)
movq $0x1, -0x8(%r15)
leaq 0xb8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x20b38
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x47db4
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq 0x70(%rsp), %rcx
callq 0x29658
movq %r14, %r12
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 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movw $0x2e, (%r15)
movq $0x1, -0x8(%r15)
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x78(%rsp), %rcx
movl $0x1, %edx
callq 0x20b38
leaq 0xe8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x47db4
leaq 0xe8(%rsp), %rdx
movq %rbx, %rsi
movq %rbp, %rcx
callq 0x29658
movq %r14, %r12
leaq 0x40(%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 0x88(%rsp), %r15
movq %r15, -0x10(%r15)
movw $0x28, (%r15)
movq $0x1, -0x8(%r15)
leaq 0xd0(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0xb8(%rsp), %rcx
movl $0x1, %edx
callq 0x20b38
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x47db4
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %rbp, %rcx
callq 0x29658
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29c6f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x29c6f
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x1db60
jmp 0x29cb6
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29ca7
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x29ca7
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x1db60
jmp 0x29cf2
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r15, %rdi
je 0x29cd0
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x29ce7
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x103d0
movq %r12, %r14
jmp 0x29e6e
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x29d09
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x29d20
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x103d0
movq %r12, %r14
jmp 0x29e92
movq %rax, %rbx
jmp 0x29e61
jmp 0x29e3d
movq %rax, %rbx
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x29d62
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x29d62
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x1d5ee
jmp 0x29e7b
movq %rax, %rbx
jmp 0x29e7b
jmp 0x29d86
movq %rax, %rbx
jmp 0x29e6e
movq %rax, %rbx
jmp 0x29e92
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29db1
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x29db1
movq %rax, %rbx
jmp 0x29dd8
jmp 0x29de7
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29dd3
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x29dd8
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x1db60
jmp 0x29dea
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r15, %rdi
je 0x29e04
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x29e54
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x29e54
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x29e45
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x29e45
jmp 0x29e42
jmp 0x29e3d
movq %rax, %rbx
jmp 0x29e54
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x29e54
callq 0x1e5bc
leaq 0xa8(%rsp), %r14
leaq 0x60(%rsp), %r13
leaq 0xd0(%rsp), %rdi
callq 0x36cf0
leaq 0xe8(%rsp), %rdi
callq 0x2108a
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x29e92
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x98(%rsp), %rdi
cmpq %r14, %rdi
je 0x29eaf
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x103d0
movq %rbx, %rdi
callq 0x106f0
nop