// File: /workspace/github_c_makefile_star2_O0/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
subq $0x460, %rsp            # imm = 0x460
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x5d004
jmp 0x5d023
leaq 0x1f54b(%rip), %rdi     # 0x7c556
leaq 0x21238(%rip), %rsi     # 0x7e24a
movl $0x144f, %edx           # imm = 0x144F
leaq 0x2335e(%rip), %rcx     # 0x8037c
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x5d02c
jmp 0x5d04b
leaq 0x18fa0(%rip), %rdi     # 0x75fd3
leaq 0x21210(%rip), %rsi     # 0x7e24a
movl $0x1450, %edx           # imm = 0x1450
leaq 0x23336(%rip), %rcx     # 0x8037c
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0xd00, (%rax)          # imm = 0xD00
jne 0x5d059
jmp 0x5d078
leaq 0x216ef(%rip), %rdi     # 0x7e74f
leaq 0x211e3(%rip), %rsi     # 0x7e24a
movl $0x1451, %edx           # imm = 0x1451
leaq 0x23309(%rip), %rcx     # 0x8037c
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x5d084
jmp 0x5d0a3
leaq 0x215e9(%rip), %rdi     # 0x7e674
leaq 0x211b8(%rip), %rsi     # 0x7e24a
movl $0x1452, %edx           # imm = 0x1452
leaq 0x232de(%rip), %rcx     # 0x8037c
callq 0x30a0
cmpq $0x0, -0x18(%rbp)
je 0x5d0ac
jmp 0x5d0cb
leaq 0x23328(%rip), %rdi     # 0x803db
leaq 0x21190(%rip), %rsi     # 0x7e24a
movl $0x1453, %edx           # imm = 0x1453
leaq 0x232b6(%rip), %rcx     # 0x8037c
callq 0x30a0
movq -0x18(%rbp), %rax
cmpl $0xd01, (%rax)          # imm = 0xD01
jne 0x5d0d9
jmp 0x5d0f8
leaq 0x1c955(%rip), %rdi     # 0x79a35
leaq 0x21163(%rip), %rsi     # 0x7e24a
movl $0x1454, %edx           # imm = 0x1454
leaq 0x23289(%rip), %rcx     # 0x8037c
callq 0x30a0
cmpq $0x0, -0x20(%rbp)
je 0x5d101
jmp 0x5d120
leaq 0x232e4(%rip), %rdi     # 0x803ec
leaq 0x2113b(%rip), %rsi     # 0x7e24a
movl $0x1455, %edx           # imm = 0x1455
leaq 0x23261(%rip), %rcx     # 0x8037c
callq 0x30a0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jge 0x5d30f
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x5d154
jmp 0x5d173
leaq 0x1529e(%rip), %rdi     # 0x723f9
leaq 0x210e8(%rip), %rsi     # 0x7e24a
movl $0x1459, %edx           # imm = 0x1459
leaq 0x2320e(%rip), %rcx     # 0x8037c
callq 0x30a0
movq -0x30(%rbp), %rax
cmpl $0xc00, (%rax)          # imm = 0xC00
jne 0x5d2e0
movq -0x30(%rbp), %rax
movb $0x3, 0x60(%rax)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jge 0x5d2de
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpl $0xc01, (%rax)          # imm = 0xC01
jne 0x5d1c4
jmp 0x5d1e3
leaq 0x173fc(%rip), %rdi     # 0x745c7
leaq 0x21078(%rip), %rsi     # 0x7e24a
movl $0x145e, %edx           # imm = 0x145E
leaq 0x2319e(%rip), %rcx     # 0x8037c
callq 0x30a0
movq -0x40(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x5d273
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x5d20e
jmp 0x5d22d
leaq 0x231e5(%rip), %rdi     # 0x803fa
leaq 0x2102e(%rip), %rsi     # 0x7e24a
movl $0x1462, %edx           # imm = 0x1462
leaq 0x23154(%rip), %rcx     # 0x8037c
callq 0x30a0
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movb $0x0, -0x51(%rbp)
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rsi
leaq -0x51(%rbp), %rdx
callq 0x4f0d0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdx
movb -0x51(%rbp), %al
movq -0x50(%rbp), %r8
movzbl %al, %ecx
callq 0x42ea0
jmp 0x5d2ce
movq -0x40(%rbp), %rax
cmpl $0x3, 0x44(%rax)
jne 0x5d2ad
leaq -0x460(%rbp), %rdi
leaq 0x23197(%rip), %rsi     # 0x80422
movb $0x0, %al
callq 0x3160
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x460(%rbp), %rdx
callq *%rax
jmp 0x5d2cc
leaq 0x151a7(%rip), %rdi     # 0x7245b
leaq 0x20f8f(%rip), %rsi     # 0x7e24a
movl $0x1476, %edx           # imm = 0x1476
leaq 0x230b5(%rip), %rcx     # 0x8037c
callq 0x30a0
jmp 0x5d2ce
jmp 0x5d2d0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x5d192
jmp 0x5d2ff
leaq 0x15174(%rip), %rdi     # 0x7245b
leaq 0x20f5c(%rip), %rsi     # 0x7e24a
movl $0x147a, %edx           # imm = 0x147A
leaq 0x23082(%rip), %rcx     # 0x8037c
callq 0x30a0
jmp 0x5d301
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x5d127
addq $0x460, %rsp            # imm = 0x460
popq %rbp
retq
nopl (%rax,%rax)