// File: /workspace/github_cpp_makefile_star2_O1/lhydave[P]SysYCompilerLab/front/node.cpp
// Function: sysY_AST::func_call_exp_node::func_call_exp_node(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, sysY_AST::exp_node*)
func_call_exp_node::func_call_exp_node(
	const string &func_name, exp_node *first_param) :
	exp_node(EXP_FUNC_CALL)
{
	sysy_func_name = func_name;
	// tackle marcos
	if (sysy_func_name == "starttime" || sysy_func_name == "stoptime")
	{
		sysy_func_name = "_sysy_" + sysy_func_name;
		if (first_param)
		{
			string msg =
				"too many arguments provided to function-like macro '" +
				func_name + "'";
			yyerror(msg.c_str());
		}
		first_param = new exp_node(EXP_NUM, "", yylineno);
	}
	dbg_printf("func call to %s \n", sysy_func_name.c_str());
	while (first_param)
	{
		params.push_back(first_param);
		first_param = first_param->next;
	}
	check_valid();
	reduce();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r12
movq %rdi, %rbx
movq %rdx, 0x8(%rsp)
leaq 0x20(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x19414(%rip), %rdx     # 0x298d9
leaq 0x10(%rsp), %rdi
movq %rdx, %rsi
callq 0x6ef6
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl $0x3, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xe4d0
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x10503
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5240
leaq 0x2409e(%rip), %rax     # 0x345a8
movq %rax, (%rbx)
leaq 0xa0(%rbx), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0xa0(%rbx)
xorl %eax, %eax
movq %rax, 0xb0(%rbx)
leaq 0xb8(%rbx), %r15
leaq 0xc8(%rbx), %rcx
movq %rcx, 0x30(%rsp)
movq %rcx, 0xb8(%rbx)
movq %rax, 0xc0(%rbx)
movb $0x0, 0xc8(%rbx)
movq %r15, %rdi
movq %r12, %rsi
callq 0x5140
leaq 0x18964(%rip), %rsi     # 0x28ec5
movq %r15, %rdi
callq 0x50a0
testl %eax, %eax
je 0x10584
leaq 0x18961(%rip), %rsi     # 0x28ed5
movq %r15, %rdi
callq 0x50a0
testl %eax, %eax
jne 0x106d7
leaq 0x185e8(%rip), %rsi     # 0x28b73
leaq 0x10(%rsp), %rdi
movq %r15, %rdx
callq 0x11eb4
leaq 0x10(%rsp), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x5310
movq (%r13), %rdi
cmpq %rbp, %rdi
je 0x105be
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5240
cmpq $0x0, 0x8(%rsp)
je 0x10676
leaq 0x185a9(%rip), %rsi     # 0x28b7a
leaq 0x38(%rsp), %rdi
movq %r12, %rdx
callq 0x11eb4
leaq 0x183e5(%rip), %rsi     # 0x289ca
leaq 0x38(%rsp), %rdi
callq 0x5510
movq %rbp, 0x10(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x10612
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x10619
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1064c
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x10(%rsp), %rdi
leaq 0x24c58(%rip), %rax     # 0x352b0
movl (%rax), %esi
callq 0x81dc
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x10676
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5240
movl $0xa0, %edi
callq 0x5220
movq %rax, %r13
leaq 0x10(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x19247(%rip), %rdx     # 0x298d9
movq %rdx, %rsi
callq 0x6ef6
leaq 0x24c0f(%rip), %rax     # 0x352b0
movl (%rax), %ecx
leaq 0x10(%rsp), %rdx
movq %r13, %rdi
movl $0x2, %esi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xe4d0
movq %r13, 0x8(%rsp)
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x106d7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0x10721
leaq 0x8(%rsp), %r12
movq 0xa8(%rbx), %rsi
cmpq 0xb0(%rbx), %rsi
je 0x10703
movq %rax, (%rsi)
addq $0x8, 0xa8(%rbx)
jmp 0x1070e
movq %r14, %rdi
movq %r12, %rdx
callq 0x12958
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x106e6
movq %rbx, %rdi
callq 0x107f6
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x107b4
movq 0x48(%rsp), %rsi
incq %rsi
jmp 0x10785
jmp 0x107b1
movq %rax, %r12
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1077d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x1077d
movq %rax, %r12
movl $0xa0, %esi
movq %r13, %rdi
callq 0x5240
jmp 0x107b4
jmp 0x107b1
movq %rax, %r12
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x107ed
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x107ed
movq %rax, %r12
jmp 0x107ed
jmp 0x107b1
movq %rax, %r12
movq (%r15), %rdi
cmpq 0x30(%rsp), %rdi
je 0x107ce
movq 0x30(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x5240
movq (%r14), %rdi
testq %rdi, %rdi
je 0x107e5
movq 0xb0(%rbx), %rsi
subq %rdi, %rsi
callq 0x5240
movq %rbx, %rdi
callq 0x12252
movq %r12, %rdi
callq 0x54c0
nop