// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/backend/semantics.c
// Function: struct
static void _struct(
	ParserContext *ctx,
	ParserASTNode *node
) {
	assert(ctx);
	assert(node);
	assert(node->type == BE_NODE_STRUCT);
	assert(node->nchilds == 2);

	ParserASTNode *node_identifier = node->childs[0];
	assert(node_identifier->type == BE_NODE_IDENTIFIER);

	ParserASTNode *node_struct_body = node->childs[1];
	assert(node_struct_body->type == BE_NODE_STRUCT_BODY
			|| node_struct_body->type == BE_NODE_DUMMY);

	ParserASTNode *node_parent = node->parent;
	assert(node_parent);

	if (node_struct_body->type == BE_NODE_DUMMY) {
		be_parser_add_struct_symbol_to_node(
			ctx, node_parent, node_identifier->token, node_struct_body, true
		);
	} else {
		ParserSymbol *symbol = parser_get_symbol_from_node(
			ctx, node_parent, BE_SYM_STRUCT, node_identifier->token
		);

		if (symbol != NULL
				&& BE_STRUCT_SYMBOL_GET_DUMMY(symbol)) {
			_process_struct_member(ctx, node, node_struct_body, symbol);

			BE_STRUCT_SYMBOL_SET_DUMMY(symbol, false);
			BE_STRUCT_SYMBOL_SET_STRUCT_NODE(symbol, node);
			BE_STRUCT_SYMBOL_SET_BODY_NODE(symbol, node_struct_body);
		} else {
			ParserSymbol *symbol_struct = be_parser_new_struct_symbol(
				ctx, node_identifier->token, node, node_struct_body, false
			);

			_process_struct_member(ctx, node, node_struct_body, symbol_struct);

			parser_add_symptr_to_node(ctx, node_parent, symbol_struct);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x4e089
jmp 0x4e0a8
leaq 0x320d1(%rip), %rdi     # 0x80161
leaq 0x347e9(%rip), %rsi     # 0x82880
movl $0xf80, %edx            # imm = 0xF80
leaq 0x3655f(%rip), %rcx     # 0x84602
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x4e0b1
jmp 0x4e0d0
leaq 0x284a4(%rip), %rdi     # 0x7655c
leaq 0x347c1(%rip), %rsi     # 0x82880
movl $0xf81, %edx            # imm = 0xF81
leaq 0x36537(%rip), %rcx     # 0x84602
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0xd00, (%rax)          # imm = 0xD00
jne 0x4e0de
jmp 0x4e0fd
leaq 0x34da2(%rip), %rdi     # 0x82e87
leaq 0x34794(%rip), %rsi     # 0x82880
movl $0xf82, %edx            # imm = 0xF82
leaq 0x3650a(%rip), %rcx     # 0x84602
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x4e109
jmp 0x4e128
leaq 0x34c34(%rip), %rdi     # 0x82d44
leaq 0x34769(%rip), %rsi     # 0x82880
movl $0xf83, %edx            # imm = 0xF83
leaq 0x364df(%rip), %rcx     # 0x84602
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x4e145
jmp 0x4e164
leaq 0x27b05(%rip), %rdi     # 0x75c51
leaq 0x3472d(%rip), %rsi     # 0x82880
movl $0xf86, %edx            # imm = 0xF86
leaq 0x364a3(%rip), %rcx     # 0x84602
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0xd01, (%rax)          # imm = 0xD01
je 0x4e18c
movq -0x20(%rbp), %rax
cmpl $0x900, (%rax)          # imm = 0x900
jne 0x4e18e
jmp 0x4e1ad
leaq 0x3649c(%rip), %rdi     # 0x84631
leaq 0x346e4(%rip), %rsi     # 0x82880
movl $0xf8a, %edx            # imm = 0xF8A
leaq 0x3645a(%rip), %rcx     # 0x84602
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x4e1c2
jmp 0x4e1e1
leaq 0x3480e(%rip), %rdi     # 0x829d7
leaq 0x346b0(%rip), %rsi     # 0x82880
movl $0xf8d, %edx            # imm = 0xF8D
leaq 0x36426(%rip), %rcx     # 0x84602
callq 0x30a0
movq -0x20(%rbp), %rax
cmpl $0x900, (%rax)          # imm = 0x900
jne 0x4e211
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x20(%rbp), %rcx
movl $0x1, %r8d
callq 0x3e980
jmp 0x4e2bf
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
movl $0x2, %edx
callq 0x82f0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x4e277
movq -0x30(%rbp), %rax
testb $0x1, 0x40(%rax)
je 0x4e277
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x5b020
movq -0x30(%rbp), %rax
movb $0x0, 0x40(%rax)
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x38(%rax)
jmp 0x4e2bd
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rdx
movq -0x20(%rbp), %rcx
xorl %r8d, %r8d
callq 0x3e8a0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x5b020
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x8200
jmp 0x4e2bf
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)