// File: /workspace/github_c_makefile_star2_O3/Ihsoh[P]ilang/compiler/frontend/semantics.c
// Function: expr_member_arridx_fncall
static void _expr_member_arridx_fncall(
	ParserContext *ctx,
	ParserASTNode *node
) {
	assert(ctx);
	assert(node);

	switch (node->type) {
		case FE_NODE_EXPR_MEMBER: {
			assert(node->nchilds == 2);

			ParserASTNode *node_expr = node->childs[0];
			ParserASTNode *node_id = node->childs[1];
			_expr_parenthesis(ctx, node_expr);

			if (FE_EXPR_AST_NODE_GET_TYPE(node_expr) != FE_TYPE_STRUCT) {
				_SYNERR_NODE(ctx, node_expr, "need struct type expression.");
			}
			ParserASTNode *struct_type_node = FE_EXPR_AST_NODE_GET_TYPE_NODE(node_expr);
			ParserASTNode *type_node = _get_struct_member_type_node(
				ctx, node, struct_type_node->childs[0]->token, node_id->token
			);
			FE_EXPR_AST_NODE_SET_TYPE(node, _get_type_by_type_node(ctx, type_node));
			FE_EXPR_AST_NODE_SET_TYPE_NODE(node, type_node);

			FE_EXPR_AST_NODE_SET_CONSTANT(node, false);
			break;
		}
		case FE_NODE_EXPR_PMEMBER: {
			assert(node->nchilds == 2);

			ParserASTNode *node_expr = node->childs[0];
			ParserASTNode *node_id = node->childs[1];
			_expr_parenthesis(ctx, node_expr);
			
			if (FE_EXPR_AST_NODE_GET_TYPE(node_expr) != FE_TYPE_POINTER) {
				_SYNERR_NODE(ctx, node_expr, "need struct pointer type expression.");
			}
			ParserASTNode *struct_pointer_type_node = FE_EXPR_AST_NODE_GET_TYPE_NODE(node_expr);
			assert(struct_pointer_type_node);
			ParserASTNode *struct_type_node = struct_pointer_type_node->childs[0];
			if (_get_type_by_type_node(ctx, struct_type_node) != FE_TYPE_STRUCT) {
				_SYNERR_NODE(ctx, node_expr, "need struct pointer type expression.");
			}
			assert(struct_type_node);
			assert(struct_type_node->nchilds == 1);
			assert(struct_type_node->childs[0]);
			assert(struct_type_node->childs[0]->token);
			assert(node_id->token);

			ParserASTNode *type_node = _get_struct_member_type_node(
				ctx, node, struct_type_node->childs[0]->token, node_id->token
			);
			FE_EXPR_AST_NODE_SET_TYPE(node, _get_type_by_type_node(ctx, type_node));
			FE_EXPR_AST_NODE_SET_TYPE_NODE(node, type_node);

			FE_EXPR_AST_NODE_SET_CONSTANT(node, false);
			break;
		}
		case FE_NODE_EXPR_ARRAY_INDEX: {
			assert(node->nchilds == 2);

			ParserASTNode *node_expr = node->childs[0];
			ParserASTNode *node_index = node->childs[1];
			_expr_parenthesis(ctx, node_expr);
			_expr(ctx, node_index);

			uint8_t node_expr_type = FE_EXPR_AST_NODE_GET_TYPE(node_expr);
			if (node_expr_type == FE_TYPE_POINTER) {
				ParserASTNode *node_type = FE_EXPR_AST_NODE_GET_TYPE_NODE(node_expr);
				assert(node_type);
				assert(node_type->nchilds == 1);
				
				FE_EXPR_AST_NODE_SET_TYPE(node, _get_type_by_type_node(ctx, node_type->childs[0]));
				FE_EXPR_AST_NODE_SET_TYPE_NODE(node, node_type->childs[0]);
			} else if (node_expr_type == FE_TYPE_ARRAY) {
				ParserASTNode *node_type = FE_EXPR_AST_NODE_GET_TYPE_NODE(node_expr);
				assert(node_type);
				assert(node_type->nchilds == 2);

				ParserASTNode *node_array_dims = node_type->childs[0];
				ParserASTNode *node_array_type = node_type->childs[1];

				if (node_array_dims->nchilds == 1) {
					FE_EXPR_AST_NODE_SET_TYPE(node, _get_type_by_type_node(ctx, node_array_type));
					FE_EXPR_AST_NODE_SET_TYPE_NODE(node, node_array_type);
				} else if (node_array_dims->nchilds > 1) {
					ParserASTNode *new_node_array_type = _NEW_NODE(ctx, FE_NODE_TYPE_ARRAY, NULL);
					ParserASTNode *new_node_array_dims = _NEW_NODE(ctx, FE_NODE_TYPE_ARRAY_DIMS, NULL);

					for (int32_t i = 1; i < node_array_dims->nchilds; i++) {
						parser_add_child(ctx, new_node_array_dims, node_array_dims->childs[i]);
					}

					parser_add_child(ctx, new_node_array_type, new_node_array_dims);
					parser_add_child(ctx, new_node_array_type, node_array_type);
					FE_EXPR_AST_NODE_SET_TYPE(node, _get_type_by_type_node(ctx, new_node_array_type));
					FE_EXPR_AST_NODE_SET_TYPE_NODE(node, new_node_array_type);
				} else {
					assert(0);
				}
			} else {
				_SYNERR_NODE(ctx, node_expr, "need pointer type or array type expression.");
			}

			FE_EXPR_AST_NODE_SET_CONSTANT(node, false);
			break;
		}
		case FE_NODE_EXPR_FUNC_CALL: {
			assert(node->nchilds == 2);
			
			ParserASTNode *node_expr = node->childs[0];
			ParserASTNode *node_func_params = node->childs[1];

			_expr_parenthesis(ctx, node_expr);

			ParserASTNode *node_expr_type = FE_EXPR_AST_NODE_GET_TYPE_NODE(node_expr);

			if (node_expr_type->type == FE_NODE_TYPE_POINTER
					&& node_expr_type->childs[0]->type == FE_NODE_TYPE_FUNC) {
				ParserASTNode *node_expr_params = node_expr_type->childs[0]->childs[0];

				_check_fncall_params(ctx, node_expr, node_expr_params, node_func_params);

				if (node_expr_type->childs[0]->nchilds == 1) {
					FE_EXPR_AST_NODE_SET_TYPE(node, FE_TYPE_VOID);
					FE_EXPR_AST_NODE_SET_TYPE_NODE(node, _NODE_TYPE_VOID);
				} else {
					ParserASTNode *node_expr_ret_type = node_expr_type->childs[0]->childs[1];
					FE_EXPR_AST_NODE_SET_TYPE(node, _get_type_by_type_node(ctx, node_expr_ret_type));
					FE_EXPR_AST_NODE_SET_TYPE_NODE(node, node_expr_ret_type);
				}
			} else {
				_SYNERR_NODE(ctx, node_expr, "function call need function pointer type.");
			}

			FE_EXPR_AST_NODE_SET_CONSTANT(node, false);
			break;
		}
		default: {
			_expr_parenthesis(ctx, node);
			break;
		}
	}
}

// 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 0x31a15
movq %rsi, %rbx
movq %rdi, %r14
movl $0xfffff130, %eax       # imm = 0xFFFFF130
addl (%rsi), %eax
cmpl $0x3, %eax
ja 0x317d5
leaq 0x1919d(%rip), %rcx     # 0x4a5f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x2, 0x44(%rbx)
jne 0x31a72
movq 0x48(%rbx), %rax
movq (%rax), %r15
movq 0x8(%rax), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x31c43
cmpb $0xd, 0x60(%r15)
je 0x314b1
movups 0x1a293(%rip), %xmm0    # 0x4b725
leaq -0x450(%rbp), %rdx
movups %xmm0, 0xd(%rdx)
movups 0x1a274(%rip), %xmm0    # 0x4b718
movaps %xmm0, (%rdx)
movq %r14, %rdi
movq %r15, %rsi
callq *0x58(%r14)
movq 0x68(%r15), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdx
movq 0x10(%r12), %rcx
jmp 0x317b0
cmpl $0x2, 0x44(%rbx)
jne 0x31a34
movq 0x48(%rbx), %rax
movq (%rax), %r15
movq 0x8(%rax), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x31c43
movq %r14, %rdi
movq %r12, %rsi
callq 0x2b6a7
movzbl 0x60(%r15), %eax
cmpl $0xe, %eax
je 0x31820
cmpl $0x10, %eax
jne 0x31862
movq 0x68(%r15), %r15
testq %r15, %r15
je 0x31b6a
cmpl $0x1, 0x44(%r15)
jne 0x31ba8
movq 0x48(%r15), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x2a712
movb %al, 0x60(%rbx)
movq 0x48(%r15), %rax
movq (%rax), %rax
jmp 0x319e8
cmpl $0x2, 0x44(%rbx)
jne 0x31a53
movq 0x48(%rbx), %rax
movq (%rax), %r12
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x31c43
movq 0x68(%r12), %r9
cmpl $0x440, (%r9)           # imm = 0x440
jne 0x317f1
movq 0x48(%r9), %rax
movq (%rax), %rax
cmpl $0x430, (%rax)          # imm = 0x430
jne 0x317f1
movq 0x48(%rax), %rax
movq (%rax), %r8
testq %r8, %r8
je 0x31be6
movq %r12, -0x40(%rbp)
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x31c05
movl 0x44(%rdi), %eax
movl 0x44(%r8), %ecx
testl %ecx, %ecx
movq %r9, -0x48(%rbp)
jle 0x31933
movq 0x48(%r8), %rdx
leal -0x1(%rcx), %esi
movq (%rdx,%rsi,8), %rdx
cmpl $0xa03, (%rdx)          # imm = 0xA03
sete %dl
cmpl %esi, %eax
setge %sil
testb %sil, %dl
jne 0x315e6
cmpl %ecx, %eax
jne 0x3199a
xorl %r13d, %r13d
movq %r8, -0x38(%rbp)
movq 0x48(%r8), %rax
movq (%rax,%r13,8), %r15
cmpl $0xa03, (%r15)          # imm = 0xA03
je 0x316b6
movq 0x48(%rdi), %rax
movq (%rax,%r13,8), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x31c43
movb 0x60(%r12), %al
addb $-0xd, %al
cmpb $0x2, %al
ja 0x31649
movl $0x4d, %edx
leaq -0x450(%rbp), %rdi
leaq 0x1a306(%rip), %rsi     # 0x4b939
callq 0x3110
movq %r14, %rdi
movq %r12, %rsi
leaq -0x450(%rbp), %rdx
callq *0x58(%r14)
movq 0x48(%r15), %rax
movq 0x8(%rax), %rsi
movq 0x68(%r12), %rdx
movq %r14, %rdi
callq 0x2be1b
testb %al, %al
jne 0x3169e
movups 0x1a338(%rip), %xmm0    # 0x4b9a1
movups %xmm0, -0x435(%rbp)
movups 0x1a31f(%rip), %xmm0    # 0x4b996
movaps %xmm0, -0x440(%rbp)
movups 0x1a301(%rip), %xmm0    # 0x4b986
movaps %xmm0, -0x450(%rbp)
movq %r14, %rdi
movq -0x40(%rbp), %rsi
leaq -0x450(%rbp), %rdx
callq *0x58(%r14)
incq %r13
movq -0x38(%rbp), %r8
movslq 0x44(%r8), %rax
cmpq %rax, %r13
movq -0x30(%rbp), %rdi
jl 0x315ed
movl 0x44(%rdi), %eax
jmp 0x3193a
cmpl $0x2, 0x44(%rbx)
jne 0x31a91
movq 0x48(%rbx), %rax
movq (%rax), %r15
movq 0x8(%rax), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x31c43
cmpb $0x10, 0x60(%r15)
je 0x31719
movups 0x1a059(%rip), %xmm0    # 0x4b745
leaq -0x450(%rbp), %rdx
movaps %xmm0, 0x10(%rdx)
movups 0x1a037(%rip), %xmm0    # 0x4b735
movaps %xmm0, (%rdx)
movabsq $0x2e6e6f69737365, %rax # imm = 0x2E6E6F69737365
movq %rax, 0x1d(%rdx)
movq %r14, %rdi
movq %r15, %rsi
callq *0x58(%r14)
movq 0x68(%r15), %rax
testq %rax, %rax
je 0x31ab0
movq 0x48(%rax), %rax
movq (%rax), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x2a712
cmpb $0xd, %al
je 0x31770
movups 0x1a002(%rip), %xmm0    # 0x4b745
leaq -0x450(%rbp), %rdx
movaps %xmm0, 0x10(%rdx)
movups 0x19fe0(%rip), %xmm0    # 0x4b735
movaps %xmm0, (%rdx)
movabsq $0x2e6e6f69737365, %rax # imm = 0x2E6E6F69737365
movq %rax, 0x1d(%rdx)
movq %r14, %rdi
movq %r15, %rsi
callq *0x58(%r14)
testq %r12, %r12
je 0x31acf
cmpl $0x1, 0x44(%r12)
jne 0x31aee
movq 0x48(%r12), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x31b0d
movq 0x10(%rax), %rdx
testq %rdx, %rdx
je 0x31b2c
movq 0x10(%r13), %rcx
testq %rcx, %rcx
je 0x31b4b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2a2b3
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x2a712
movb %al, 0x60(%rbx)
movq %r15, 0x68(%rbx)
jmp 0x319ec
movq %r14, %rdi
movq %rbx, %rsi
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31c43
movups 0x1a03f(%rip), %xmm0    # 0x4b837
leaq -0x450(%rbp), %rdx
movups %xmm0, 0x1a(%rdx)
movups 0x1a023(%rip), %xmm0    # 0x4b82d
movaps %xmm0, 0x10(%rdx)
movups 0x1a008(%rip), %xmm0    # 0x4b81d
movaps %xmm0, (%rdx)
movq %r14, %rdi
movq %r12, %rsi
jmp 0x3188f
movq 0x68(%r15), %rax
testq %rax, %rax
je 0x31b89
cmpl $0x2, 0x44(%rax)
jne 0x31bc7
movq 0x48(%rax), %rax
movq (%rax), %r15
movq 0x8(%rax), %r12
movl 0x44(%r15), %eax
cmpl $0x1, %eax
jne 0x31898
movq %r14, %rdi
movq %r12, %rsi
callq 0x2a712
movb %al, 0x60(%rbx)
movq %r12, 0x68(%rbx)
jmp 0x319ec
movups 0x19fa4(%rip), %xmm0    # 0x4b80d
leaq -0x450(%rbp), %rdx
movups %xmm0, 0x1c(%rdx)
movups 0x19f86(%rip), %xmm0    # 0x4b801
movaps %xmm0, 0x10(%rdx)
movups 0x19f6b(%rip), %xmm0    # 0x4b7f1
movaps %xmm0, (%rdx)
movq %r14, %rdi
movq %r15, %rsi
callq *0x58(%r14)
jmp 0x319ec
movq %r12, -0x30(%rbp)
jle 0x31c24
leaq 0x17ceb(%rip), %rdx     # 0x49594
movq %r14, %rdi
movl $0x420, %esi            # imm = 0x420
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x65f1
movq %rax, -0x38(%rbp)
leaq 0xfed0(%rip), %rdx      # 0x41799
movq %r14, %rdi
movl $0x421, %esi            # imm = 0x421
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x65f1
movq %rax, %r13
cmpl $0x2, 0x44(%r15)
jl 0x3190d
movl $0x1, %r12d
movq 0x48(%r15), %rax
movq (%rax,%r12,8), %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0x68cf
incq %r12
movslq 0x44(%r15), %rax
cmpq %rax, %r12
jl 0x318ee
movq %r14, %rdi
movq -0x38(%rbp), %r15
movq %r15, %rsi
movq %r13, %rdx
callq 0x68cf
movq %r14, %rdi
movq %r15, %rsi
movq -0x30(%rbp), %rdx
callq 0x68cf
jmp 0x31a0a
xorl %r13d, %r13d
cmpl %ecx, %eax
jne 0x3199a
cmpl %eax, %r13d
jge 0x319cc
movl %r13d, %r12d
movq 0x48(%rdi), %rax
movq (%rax,%r12,8), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x31c43
movb 0x60(%r13), %al
addb $-0xd, %al
cmpb $0x2, %al
ja 0x3198b
movl $0x4d, %edx
leaq -0x450(%rbp), %r15
movq %r15, %rdi
leaq 0x19fc0(%rip), %rsi     # 0x4b939
callq 0x3110
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq *0x58(%r14)
incq %r12
movq -0x30(%rbp), %rdi
cmpl %r12d, 0x44(%rdi)
jg 0x31946
jmp 0x319cc
movups 0x1a02b(%rip), %xmm0    # 0x4b9cc
leaq -0x450(%rbp), %rdx
movups %xmm0, 0x1b(%rdx)
movups 0x1a00e(%rip), %xmm0    # 0x4b9c1
movaps %xmm0, 0x10(%rdx)
movups 0x19ff3(%rip), %xmm0    # 0x4b9b1
movaps %xmm0, (%rdx)
movq %r14, %rdi
movq -0x40(%rbp), %rsi
callq *0x58(%r14)
movq -0x48(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
cmpl $0x1, 0x44(%rax)
jne 0x31a02
movb $-0x1, 0x60(%rbx)
leaq 0x270a0(%rip), %rax     # 0x58a88
movq %rax, 0x68(%rbx)
movb $0x0, 0x70(%rbx)
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x48(%rax), %rax
movq 0x8(%rax), %r15
movq %r14, %rdi
movq %r15, %rsi
jmp 0x317c4
leaq 0x113c6(%rip), %rdi     # 0x42de2
leaq 0x18ed7(%rip), %rsi     # 0x4a8fa
leaq 0x19cac(%rip), %rcx     # 0x4b6d6
movl $0xd1d, %edx            # imm = 0xD1D
callq 0x30a0
leaq 0x192ba(%rip), %rdi     # 0x4acf5
leaq 0x18eb8(%rip), %rsi     # 0x4a8fa
leaq 0x19c8d(%rip), %rcx     # 0x4b6d6
movl $0xd54, %edx            # imm = 0xD54
callq 0x30a0
leaq 0x1929b(%rip), %rdi     # 0x4acf5
leaq 0x18e99(%rip), %rsi     # 0x4a8fa
leaq 0x19c6e(%rip), %rcx     # 0x4b6d6
movl $0xd85, %edx            # imm = 0xD85
callq 0x30a0
leaq 0x1927c(%rip), %rdi     # 0x4acf5
leaq 0x18e7a(%rip), %rsi     # 0x4a8fa
leaq 0x19c4f(%rip), %rcx     # 0x4b6d6
movl $0xd21, %edx            # imm = 0xD21
callq 0x30a0
leaq 0x1925d(%rip), %rdi     # 0x4acf5
leaq 0x18e5b(%rip), %rsi     # 0x4a8fa
leaq 0x19c30(%rip), %rcx     # 0x4b6d6
movl $0xd35, %edx            # imm = 0xD35
callq 0x30a0
leaq 0x19ca3(%rip), %rdi     # 0x4b75a
leaq 0x18e3c(%rip), %rsi     # 0x4a8fa
leaq 0x19c11(%rip), %rcx     # 0x4b6d6
movl $0xd3f, %edx            # imm = 0xD3F
callq 0x30a0
leaq 0x19c9d(%rip), %rdi     # 0x4b773
leaq 0x18e1d(%rip), %rsi     # 0x4a8fa
leaq 0x19bf2(%rip), %rcx     # 0x4b6d6
movl $0xd44, %edx            # imm = 0xD44
callq 0x30a0
leaq 0x19c8f(%rip), %rdi     # 0x4b784
leaq 0x18dfe(%rip), %rsi     # 0x4a8fa
leaq 0x19bd3(%rip), %rcx     # 0x4b6d6
movl $0xd45, %edx            # imm = 0xD45
callq 0x30a0
leaq 0x19c8f(%rip), %rdi     # 0x4b7a3
leaq 0x18ddf(%rip), %rsi     # 0x4a8fa
leaq 0x19bb4(%rip), %rcx     # 0x4b6d6
movl $0xd46, %edx            # imm = 0xD46
callq 0x30a0
leaq 0x19c8c(%rip), %rdi     # 0x4b7bf
leaq 0x18dc0(%rip), %rsi     # 0x4a8fa
leaq 0x19b95(%rip), %rcx     # 0x4b6d6
movl $0xd47, %edx            # imm = 0xD47
callq 0x30a0
leaq 0x19c90(%rip), %rdi     # 0x4b7e2
leaq 0x18da1(%rip), %rsi     # 0x4a8fa
leaq 0x19b76(%rip), %rcx     # 0x4b6d6
movl $0xd48, %edx            # imm = 0xD48
callq 0x30a0
leaq 0xfb92(%rip), %rdi      # 0x41703
leaq 0x18d82(%rip), %rsi     # 0x4a8fa
leaq 0x19b57(%rip), %rcx     # 0x4b6d6
movl $0xd5e, %edx            # imm = 0xD5E
callq 0x30a0
leaq 0xfb73(%rip), %rdi      # 0x41703
leaq 0x18d63(%rip), %rsi     # 0x4a8fa
leaq 0x19b38(%rip), %rcx     # 0x4b6d6
movl $0xd65, %edx            # imm = 0xD65
callq 0x30a0
leaq 0xfb95(%rip), %rdi      # 0x41744
leaq 0x18d44(%rip), %rsi     # 0x4a8fa
leaq 0x19b19(%rip), %rcx     # 0x4b6d6
movl $0xd5f, %edx            # imm = 0xD5F
callq 0x30a0
leaq 0xfc4a(%rip), %rdi      # 0x41818
leaq 0x18d25(%rip), %rsi     # 0x4a8fa
leaq 0x19afa(%rip), %rcx     # 0x4b6d6
movl $0xd66, %edx            # imm = 0xD66
callq 0x30a0
leaq 0x19d37(%rip), %rdi     # 0x4b924
leaq 0x18d06(%rip), %rsi     # 0x4a8fa
leaq 0x19ccb(%rip), %rcx     # 0x4b8c6
movl $0xcda, %edx            # imm = 0xCDA
callq 0x30a0
leaq 0x11ef0(%rip), %rdi     # 0x43afc
leaq 0x18ce7(%rip), %rsi     # 0x4a8fa
leaq 0x19cac(%rip), %rcx     # 0x4b8c6
movl $0xcdb, %edx            # imm = 0xCDB
callq 0x30a0
leaq 0xd735(%rip), %rdi      # 0x3f360
leaq 0x18cc8(%rip), %rsi     # 0x4a8fa
leaq 0x19a9d(%rip), %rcx     # 0x4b6d6
movl $0xd7b, %edx            # imm = 0xD7B
callq 0x30a0