// File: /workspace/github_cpp_makefile_star2_O3/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 %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
movq %rdx, 0x28(%rsp)
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x19717(%rip), %rdx     # 0x29931
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x6d8a
movq %rsp, %rdx
movq %rbx, %rdi
movl $0x3, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xe1ee
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x10253
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
leaq 0x24386(%rip), %rax     # 0x345e0
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 %r13, %rsi
callq 0x5140
leaq 0x18c44(%rip), %rsi     # 0x28ef5
movq %r15, %rdi
callq 0x50a0
testl %eax, %eax
je 0x102de
leaq 0x18c41(%rip), %rsi     # 0x28f05
movq %r15, %rdi
callq 0x50a0
testl %eax, %eax
je 0x102de
testq %r12, %r12
jne 0x10430
jmp 0x10470
leaq 0x188c5(%rip), %rsi     # 0x28baa
movq %rsp, %rdi
movq %r15, %rdx
movq %r15, 0x20(%rsp)
callq 0x11c02
movq %rsp, %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x5310
movq (%rbp), %rdi
leaq 0x10(%rsp), %rbp
cmpq %rbp, %rdi
je 0x1031e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
testq %r12, %r12
movq 0x20(%rsp), %r15
je 0x103d4
leaq 0x1887e(%rip), %rsi     # 0x28bb1
leaq 0x38(%rsp), %rdi
movq %r13, %rdx
callq 0x11c02
leaq 0x186ba(%rip), %rsi     # 0x28a01
leaq 0x38(%rsp), %rdi
callq 0x5510
movq %rbp, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x10372
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x10379
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x103ac
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5240
movq (%rsp), %rdi
leaq 0x24ef9(%rip), %rax     # 0x352b0
movl (%rax), %esi
callq 0x8030
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x103d4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
movl $0xa0, %edi
callq 0x5220
movq %rax, %r12
movq %rsp, %rdi
movq %rbp, (%rdi)
leaq 0x19543(%rip), %rdx     # 0x29931
movq %rdx, %rsi
callq 0x6d8a
leaq 0x24eb3(%rip), %rax     # 0x352b0
movl (%rax), %ecx
movq %rsp, %rdx
movq %r12, %rdi
movl $0x2, %esi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xe1ee
movq %r12, 0x28(%rsp)
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x10430
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
leaq 0x28(%rsp), %r13
movq 0xa8(%rbx), %rsi
cmpq 0xb0(%rbx), %rsi
je 0x10452
movq %r12, (%rsi)
addq $0x8, 0xa8(%rbx)
jmp 0x1045d
movq %r14, %rdi
movq %r13, %rdx
callq 0x12a2a
movq 0x28(%rsp), %rax
movq 0x40(%rax), %r12
movq %r12, 0x28(%rsp)
testq %r12, %r12
jne 0x10435
movq %rbx, %rdi
callq 0x1054c
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, %r13
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10506
movq 0x48(%rsp), %rsi
incq %rsi
jmp 0x104d3
jmp 0x10503
movq %rax, %r13
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x104cb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x104cb
movq %rax, %r13
movl $0xa0, %esi
movq %r12, %rdi
callq 0x5240
jmp 0x10506
jmp 0x10503
movq %rax, %r13
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x10544
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x10544
movq %rax, %r13
jmp 0x10544
jmp 0x104fe
movq %r15, 0x20(%rsp)
movq %rax, %r13
movq 0x20(%rsp), %rax
movq (%rax), %rdi
cmpq 0x30(%rsp), %rdi
je 0x10525
movq 0x30(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x5240
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1053c
movq 0xb0(%rbx), %rsi
subq %rdi, %rsi
callq 0x5240
movq %rbx, %rdi
callq 0x11fa0
movq %r13, %rdi
callq 0x54c0