// File: /workspace/github_c_makefile_star2_O1/Ihsoh[P]ilang/compiler/backend/semantics.c
// Function: stat_func_call
static ParserASTNode * _stat_func_call(
	ParserContext *ctx,
	ParserASTNode *node
) {
	assert(ctx);
	assert(node);
	assert(node->type == BE_NODE_STAT_FUNC_CALL);
	assert(node->nchilds == 2);

	ParserASTNode *node_func = node->childs[0];
	ParserASTNode *node_func_pointer_type = NULL;
	if (node_func->type == BE_NODE_IDENTIFIER) {
		ParserSymbol *symbol_func = _get_symbol_by_id_node(ctx, node_func);
		if (symbol_func->type == BE_SYM_FUNC) {
			node_func_pointer_type = BE_FUNC_SYMBOL_GET_FUNC_POINTER_TYPE_NODE(symbol_func);
		} else if (symbol_func->type == BE_SYM_VAR) {
			node_func_pointer_type = BE_VAR_SYMBOL_GET_TYPE_NODE(symbol_func);
		} else {
			_SYNERR_NODE(ctx, node_func, "must be a function or variable.");
		}
	} else if (node_func->type == BE_NODE_EXPR) {
		_expr_wrapper(ctx, node_func);
		node_func_pointer_type = BE_EXPR_AST_NODE_GET_TYPE_NODE(node_func);
	} else {
		assert(0);
	}
	if (node_func_pointer_type->type != BE_NODE_TYPE_POINTER
			|| node_func_pointer_type->childs[0]->type != BE_NODE_TYPE_FUNC) {
		_SYNERR_NODE(ctx, node_func, "must be function pointer type.");
	}
	ParserASTNode *node_func_type = node_func_pointer_type->childs[0];
	ParserASTNode *node_func_params = node_func_type->childs[0];

	ParserASTNode *node_func_call_params = node->childs[1];
	_check_fncall_params(ctx, node, node_func_params, node_func_call_params);

	if (node_func_type->nchilds == 1) {
		return _NODE_TYPE_VOID;
	} else if (node_func_type->nchilds == 2) {
		return node_func_type->childs[1];
	} else {
		assert(0);
		return NULL;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
testq %rsi, %rsi
je 0x34bde
movq %rsi, %r12
cmpl $0xbd2, (%rsi)          # imm = 0xBD2
jne 0x34bfd
cmpl $0x2, 0x44(%r12)
jne 0x34c1c
movq %rdi, %rbx
movq 0x48(%r12), %rax
movq (%rax), %r15
movl (%r15), %eax
cmpl $0xe00, %eax            # imm = 0xE00
je 0x3499c
cmpl $0x200, %eax            # imm = 0x200
jne 0x34c79
movq %rbx, %rdi
movq %r15, %rsi
callq 0x345e4
movl (%rax), %ecx
cmpl $0x1, %ecx
je 0x349ad
cmpl $0x3, %ecx
jne 0x349b3
movq 0x48(%rax), %r14
jmp 0x349db
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2e591
movq 0x68(%r15), %r14
jmp 0x349db
movq 0x38(%rax), %r14
jmp 0x349db
movups 0x1c152(%rip), %xmm0    # 0x50b0c
leaq -0x450(%rbp), %rdx
movaps %xmm0, 0x10(%rdx)
movups 0x1c130(%rip), %xmm0    # 0x50afc
movaps %xmm0, (%rdx)
movq %rbx, %rdi
movq %r15, %rsi
callq *0x58(%rbx)
xorl %r14d, %r14d
cmpl $0x440, (%r14)          # imm = 0x440
jne 0x349f3
movq 0x48(%r14), %rax
movq (%rax), %rax
cmpl $0x430, (%rax)          # imm = 0x430
je 0x34a18
movups 0x1c131(%rip), %xmm0    # 0x50b2b
leaq -0x450(%rbp), %rdx
movups %xmm0, 0xf(%rdx)
movups 0x1c110(%rip), %xmm0    # 0x50b1c
movaps %xmm0, (%rdx)
movq %rbx, %rdi
movq %r15, %rsi
callq *0x58(%rbx)
movq 0x48(%r14), %rax
movq (%rax), %rcx
movq 0x48(%rcx), %rax
movq (%rax), %r13
testq %r13, %r13
je 0x34c3b
movq %r12, -0x30(%rbp)
movq 0x48(%r12), %rax
movq 0x8(%rax), %r12
testq %r12, %r12
je 0x34c5a
movq %rcx, -0x38(%rbp)
movl 0x44(%r12), %ecx
movl 0x44(%r13), %eax
testl %eax, %eax
jle 0x34a75
movq 0x48(%r13), %rdx
leal -0x1(%rax), %esi
movq (%rdx,%rsi,8), %rdx
cmpl $0xa03, (%rdx)          # imm = 0xA03
sete %dl
cmpl %esi, %ecx
setge %sil
testb %sil, %dl
jne 0x34aaf
cmpl %eax, %ecx
je 0x34aaf
movups 0x1c1d2(%rip), %xmm0    # 0x50c52
leaq -0x450(%rbp), %rdx
movups %xmm0, 0x1b(%rdx)
movups 0x1c1b5(%rip), %xmm0    # 0x50c47
movaps %xmm0, 0x10(%rdx)
movups 0x1c19a(%rip), %xmm0    # 0x50c37
movaps %xmm0, (%rdx)
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq *0x58(%rbx)
jmp 0x34ba6
xorl %r15d, %r15d
testl %eax, %eax
jle 0x34b43
movq 0x48(%r13), %rax
movq (%rax,%r15,8), %r14
cmpl $0xa03, (%r14)          # imm = 0xA03
je 0x34b43
movq 0x48(%r12), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
leaq -0x48(%rbp), %rdx
callq 0x34420
movq -0x48(%rbp), %rdx
movq 0x48(%r14), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x2e61b
testb %al, %al
jne 0x34b33
movups 0x1c0db(%rip), %xmm0    # 0x50bda
movups %xmm0, -0x435(%rbp)
movups 0x1c0c2(%rip), %xmm0    # 0x50bcf
movaps %xmm0, -0x440(%rbp)
movups 0x1c0a4(%rip), %xmm0    # 0x50bbf
movaps %xmm0, -0x450(%rbp)
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
leaq -0x450(%rbp), %rdx
callq *0x58(%rbx)
incq %r15
movslq 0x44(%r13), %rax
cmpq %rax, %r15
jl 0x34aba
cmpl 0x44(%r12), %r15d
jge 0x34ba6
movl %r15d, %r14d
leaq -0x48(%rbp), %r15
leaq -0x450(%rbp), %r13
movq 0x48(%r12), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x34420
movq -0x48(%rbp), %rdi
callq 0x32b74
addb $-0xd, %al
cmpb $0x2, %al
ja 0x34b9c
movl $0x4d, %edx
movq %r13, %rdi
leaq 0x1c060(%rip), %rsi     # 0x50bea
callq 0x3100
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
movq %r13, %rdx
callq *0x58(%rbx)
incq %r14
cmpl %r14d, 0x44(%r12)
jg 0x34b58
movq -0x38(%rbp), %rcx
movl 0x44(%rcx), %eax
cmpl $0x1, %eax
je 0x34bc5
cmpl $0x2, %eax
jne 0x34c98
movq 0x48(%rcx), %rax
movq 0x8(%rax), %rax
jmp 0x34bcc
leaq 0x27cd4(%rip), %rax     # 0x5c8a0
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe366(%rip), %rdi      # 0x42f4b
leaq 0x19584(%rip), %rsi     # 0x4e170
leaq 0x1bec8(%rip), %rcx     # 0x50abb
movl $0x1349, %edx           # imm = 0x1349
callq 0x30a0
leaq 0x100f8(%rip), %rdi     # 0x44cfc
leaq 0x19565(%rip), %rsi     # 0x4e170
leaq 0x1bea9(%rip), %rcx     # 0x50abb
movl $0x134a, %edx           # imm = 0x134A
callq 0x30a0
leaq 0x199e2(%rip), %rdi     # 0x4e605
leaq 0x19546(%rip), %rsi     # 0x4e170
leaq 0x1be8a(%rip), %rcx     # 0x50abb
movl $0x134b, %edx           # imm = 0x134B
callq 0x30a0
leaq 0x1bf57(%rip), %rdi     # 0x50b99
leaq 0x19527(%rip), %rsi     # 0x4e170
leaq 0x1beeb(%rip), %rcx     # 0x50b3b
movl $0x130d, %edx           # imm = 0x130D
callq 0x30a0
leaq 0x1bf4d(%rip), %rdi     # 0x50bae
leaq 0x19508(%rip), %rsi     # 0x4e170
leaq 0x1becc(%rip), %rcx     # 0x50b3b
movl $0x130e, %edx           # imm = 0x130E
callq 0x30a0
leaq 0xb70d(%rip), %rdi      # 0x4038d
leaq 0x194e9(%rip), %rsi     # 0x4e170
leaq 0x1be2d(%rip), %rcx     # 0x50abb
movl $0x135c, %edx           # imm = 0x135C
callq 0x30a0
leaq 0xb6ee(%rip), %rdi      # 0x4038d
leaq 0x194ca(%rip), %rsi     # 0x4e170
leaq 0x1be0e(%rip), %rcx     # 0x50abb
movl $0x136d, %edx           # imm = 0x136D
callq 0x30a0