// File: /workspace/github_c_makefile_star2_O1/Ihsoh[P]ilang/compiler/frontend/semantics.c
// Function: process_struct_member
static void _process_struct_member(
	ParserContext *ctx,
	ParserASTNode *node,
	ParserASTNode *node_struct_body,
	ParserSymbol *symbol_struct
) {
	assert(ctx);
	assert(node);
	assert(node->type == FE_NODE_STRUCT);
	assert(node->nchilds == 2);
	assert(node_struct_body);
	assert(node_struct_body->type == FE_NODE_STRUCT_BODY);
	assert(symbol_struct);

	for (int i = 0; i < node_struct_body->nchilds; i++) {
		ParserASTNode *child = node_struct_body->childs[i];
		assert(child);
		if (child->type == FE_NODE_VAR) {
			FE_VAR_AST_NODE_SET_TYPE(child, FE_VAR_TYPE_STRUCT_MEMBER);
			for (int j = 0; j < child->nchilds; j++) {
				ParserASTNode *node_var_item = child->childs[j];
				assert(node_var_item->type == FE_NODE_VAR_ITEM);
				
				if (node_var_item->nchilds == 2) {
					ParserASTNode *node_var_id = node_var_item->childs[0];
					assert(node_var_id->type == FE_NODE_IDENTIFIER);

					ParserASTNode *node_var_type = node_var_item->childs[1];
					uint8_t var_type = 0;
					_type(ctx, node_var_type, &var_type);

					fe_parser_add_struct_member_var_symbol_to_symbol(
						ctx,
						symbol_struct,
						node_var_id->token,
						var_type,
						node_var_type
					);
				} else if (node_var_item->nchilds == 3) {
					_SYNERR_NODE(
						ctx,
						node,
						"struct variable cannot contain initial expression."
					);
				} else {
					assert(0);
				}
			}
		} else {
			assert(0);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq %rcx, -0x30(%rbp)
movq %rdi, -0x38(%rbp)
cmpl $0xd00, (%rsi)          # imm = 0xD00
jne 0x33b51
movq %rsi, %r14
cmpl $0x2, 0x44(%rsi)
jne 0x33b70
testq %rdx, %rdx
je 0x33b8f
cmpl $0xd01, (%rdx)          # imm = 0xD01
jne 0x33bae
cmpq $0x0, -0x30(%rbp)
je 0x33bcd
cmpl $0x0, 0x44(%rdx)
jle 0x33aa4
xorl %ecx, %ecx
movq %rdx, -0x40(%rbp)
movq %r14, -0x50(%rbp)
movq -0x38(%rbp), %rbx
movq 0x48(%rdx), %rax
movq (%rax,%rcx,8), %r12
testq %r12, %r12
je 0x33b13
movq %rcx, -0x48(%rbp)
cmpl $0xc00, (%r12)          # imm = 0xC00
jne 0x33b32
movb $0x3, 0x60(%r12)
cmpl $0x0, 0x44(%r12)
jle 0x33a8c
xorl %r15d, %r15d
movq 0x48(%r12), %rax
movq (%rax,%r15,8), %rax
cmpl $0xc01, (%rax)          # imm = 0xC01
jne 0x33ab6
movl 0x44(%rax), %ecx
cmpl $0x3, %ecx
je 0x33a36
cmpl $0x2, %ecx
jne 0x33af4
movq 0x48(%rax), %rax
movq (%rax), %r13
cmpl $0x200, (%r13)          # imm = 0x200
jne 0x33ad5
movq 0x8(%rax), %r14
movb $0x0, -0x450(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
leaq -0x450(%rbp), %rdx
callq 0x2bbca
movq 0x10(%r13), %rdx
movzbl -0x450(%rbp), %ecx
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
movq %r14, %r8
movq -0x50(%rbp), %r14
callq 0x25254
jmp 0x33a7b
movups 0x19ed2(%rip), %xmm0    # 0x4d90f
movaps %xmm0, -0x430(%rbp)
movups 0x19eb4(%rip), %xmm0    # 0x4d8ff
movaps %xmm0, -0x440(%rbp)
movups 0x19e96(%rip), %xmm0    # 0x4d8ef
movaps %xmm0, -0x450(%rbp)
movl $0x2e6e6f, -0x421(%rbp) # imm = 0x2E6E6F
movq -0x38(%rbp), %rdi
movq %r14, %rsi
leaq -0x450(%rbp), %rdx
callq *0x58(%rdi)
incq %r15
movslq 0x44(%r12), %rax
cmpq %rax, %r15
jl 0x339be
movq -0x48(%rbp), %rcx
incq %rcx
movq -0x40(%rbp), %rdx
movslq 0x44(%rdx), %rax
cmpq %rax, %rcx
jl 0x33986
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xea8e(%rip), %rdi      # 0x4254b
leaq 0x17d96(%rip), %rsi     # 0x4b85a
leaq 0x19d7e(%rip), %rcx     # 0x4d849
movl $0x145e, %edx           # imm = 0x145E
callq 0x30a0
leaq 0x19deb(%rip), %rdi     # 0x4d8c7
leaq 0x17d77(%rip), %rsi     # 0x4b85a
leaq 0x19d5f(%rip), %rcx     # 0x4d849
movl $0x1462, %edx           # imm = 0x1462
callq 0x30a0
leaq 0xc889(%rip), %rdi      # 0x40384
leaq 0x17d58(%rip), %rsi     # 0x4b85a
leaq 0x19d40(%rip), %rcx     # 0x4d849
movl $0x1476, %edx           # imm = 0x1476
callq 0x30a0
leaq 0xc808(%rip), %rdi      # 0x40322
leaq 0x17d39(%rip), %rsi     # 0x4b85a
leaq 0x19d21(%rip), %rcx     # 0x4d849
movl $0x1459, %edx           # imm = 0x1459
callq 0x30a0
leaq 0xc84b(%rip), %rdi      # 0x40384
leaq 0x17d1a(%rip), %rsi     # 0x4b85a
leaq 0x19d02(%rip), %rcx     # 0x4d849
movl $0x147a, %edx           # imm = 0x147A
callq 0x30a0
leaq 0x181d8(%rip), %rdi     # 0x4bd30
leaq 0x17cfb(%rip), %rsi     # 0x4b85a
leaq 0x19ce3(%rip), %rcx     # 0x4d849
movl $0x1451, %edx           # imm = 0x1451
callq 0x30a0
leaq 0x180de(%rip), %rdi     # 0x4bc55
leaq 0x17cdc(%rip), %rsi     # 0x4b85a
leaq 0x19cc4(%rip), %rcx     # 0x4d849
movl $0x1452, %edx           # imm = 0x1452
callq 0x30a0
leaq 0x19d12(%rip), %rdi     # 0x4d8a8
leaq 0x17cbd(%rip), %rsi     # 0x4b85a
leaq 0x19ca5(%rip), %rcx     # 0x4d849
movl $0x1453, %edx           # imm = 0x1453
callq 0x30a0
leaq 0x134f3(%rip), %rdi     # 0x470a8
leaq 0x17c9e(%rip), %rsi     # 0x4b85a
leaq 0x19c86(%rip), %rcx     # 0x4d849
movl $0x1454, %edx           # imm = 0x1454
callq 0x30a0
leaq 0x19ce5(%rip), %rdi     # 0x4d8b9
leaq 0x17c7f(%rip), %rsi     # 0x4b85a
leaq 0x19c67(%rip), %rcx     # 0x4d849
movl $0x1455, %edx           # imm = 0x1455
callq 0x30a0