// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/backend/asmgen_gas64.c
// Function: asm_stat_mbr
static void _asm_stat_mbr(
	ASMGeneratorGas64Context *ctx,
	ParserASTNode *node
) {
	assert(ctx);
	assert(node);
	assert(node->type == BE_NODE_STAT_MBR);
	assert(node->nchilds == 3);

	ParserASTNode *node_target = node->childs[0];
	assert(node_target->type == BE_NODE_IDENTIFIER);
	ParserSymbol *symbol_target = _get_var_symbol_by_id_node(ctx, node_target);
	uint8_t type_target = BE_VAR_SYMBOL_GET_TYPE(symbol_target);
	assert(type_target == BE_TYPE_POINTER);

	ParserASTNode *node_source_left = node->childs[1];
	MoveIdOrConstexprToRegEx result;
	_move_id_or_constexpr_to_reg_ex(
		ctx,
		_ASM_REG_AX,
		node_source_left,
		&result
	);
	assert(result.node_type->type == BE_NODE_TYPE_POINTER);
	assert(result.node_type->childs[0]->type == BE_NODE_TYPE_STRUCT);
	ParserASTNode *node_struct_id = result.node_type->childs[0]->childs[0];

	ParserASTNode *node_source_right = node->childs[2];
	assert(node_source_right->type == BE_NODE_IDENTIFIER);
	ParserSymbol *symbol_struct_member = be_sem_get_struct_member_symbol(
		ctx->psrctx, node_struct_id, node_source_right
	);
	size_t offset = BE_STRUCT_MEMBER_VAR_SYMBOL_GET_OFFSET(symbol_struct_member);
	ResizableString rstr_offset;
	rstr_init(&rstr_offset);
	_asm_inst_uint_const(
		ctx,
		&rstr_offset,
		offset
	);
	_asm_inst_add_x_x(
		ctx,
		ctx->body,
		BE_TYPE_UINT64,
		_ASM_REG_NAME_RAX,
		RSTR_CSTR(&rstr_offset)
	);
	rstr_free(&rstr_offset);

	_asm_inst_mov_sym_x(
		ctx,
		ctx->body,
		symbol_target,
		_ASM_REG_NAME_RAX
	);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x2e8ac
jmp 0x2e8cb
leaq 0x518ae(%rip), %rdi     # 0x80161
leaq 0x4c24a(%rip), %rsi     # 0x7ab04
movl $0x150c, %edx           # imm = 0x150C
leaq 0x4e95d(%rip), %rcx     # 0x7d223
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x2e8d4
jmp 0x2e8f3
leaq 0x47c81(%rip), %rdi     # 0x7655c
leaq 0x4c222(%rip), %rsi     # 0x7ab04
movl $0x150d, %edx           # imm = 0x150D
leaq 0x4e935(%rip), %rcx     # 0x7d223
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0xbe5, (%rax)          # imm = 0xBE5
jne 0x2e901
jmp 0x2e920
leaq 0x4aa86(%rip), %rdi     # 0x7938e
leaq 0x4c1f5(%rip), %rsi     # 0x7ab04
movl $0x150e, %edx           # imm = 0x150E
leaq 0x4e908(%rip), %rcx     # 0x7d223
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0x3, 0x44(%rax)
jne 0x2e92c
jmp 0x2e94b
leaq 0x4880b(%rip), %rdi     # 0x7713e
leaq 0x4c1ca(%rip), %rsi     # 0x7ab04
movl $0x150f, %edx           # imm = 0x150F
leaq 0x4e8dd(%rip), %rcx     # 0x7d223
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 0x2e968
jmp 0x2e987
leaq 0x47a4e(%rip), %rdi     # 0x763bd
leaq 0x4c18e(%rip), %rsi     # 0x7ab04
movl $0x1512, %edx           # imm = 0x1512
leaq 0x4e8a1(%rip), %rcx     # 0x7d223
callq 0x30a0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x32820
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb 0x30(%rax), %al
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
cmpl $0x10, %eax
jne 0x2e9ad
jmp 0x2e9cc
leaq 0x48c59(%rip), %rdi     # 0x7760d
leaq 0x4c149(%rip), %rsi     # 0x7ab04
movl $0x1515, %edx           # imm = 0x1515
leaq 0x4e85c(%rip), %rcx     # 0x7d223
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
xorl %esi, %esi
leaq -0x48(%rbp), %rcx
callq 0x33c70
movq -0x38(%rbp), %rax
cmpl $0x440, (%rax)          # imm = 0x440
jne 0x2e9fd
jmp 0x2ea1c
leaq 0x4a9a9(%rip), %rdi     # 0x793ad
leaq 0x4c0f9(%rip), %rsi     # 0x7ab04
movl $0x151f, %edx           # imm = 0x151F
leaq 0x4e80c(%rip), %rcx     # 0x7d223
callq 0x30a0
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
cmpl $0x410, (%rax)          # imm = 0x410
jne 0x2ea31
jmp 0x2ea50
leaq 0x4a9a4(%rip), %rdi     # 0x793dc
leaq 0x4c0c5(%rip), %rsi     # 0x7ab04
movl $0x1520, %edx           # imm = 0x1520
leaq 0x4e7d8(%rip), %rcx     # 0x7d223
callq 0x30a0
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x2ea84
jmp 0x2eaa3
leaq 0x4a98a(%rip), %rdi     # 0x79415
leaq 0x4c072(%rip), %rsi     # 0x7ab04
movl $0x1524, %edx           # imm = 0x1524
leaq 0x4e785(%rip), %rcx     # 0x7d223
callq 0x30a0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0x4dd00
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x68(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x8c90
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rdx
leaq -0x78(%rbp), %rsi
callq 0x33b00
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x2eb0f
leaq 0x47439(%rip), %rax     # 0x75f3f
movq %rax, -0x90(%rbp)
jmp 0x2eb1a
movq -0x70(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %r8
movl $0x9, %edx
leaq 0x4c582(%rip), %rcx     # 0x7b0ba
callq 0x33b30
leaq -0x78(%rbp), %rdi
callq 0x9310
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x20(%rbp), %rdx
leaq 0x4c55d(%rip), %rcx     # 0x7b0ba
callq 0x32d40
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax,%rax)