// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/backend/asmgen_gas32.c
// Function: asm_stat_store
static void _asm_stat_store(
	ASMGeneratorGas32Context *ctx,
	ParserASTNode *node
) {
	assert(ctx);
	assert(node);
	assert(node->type == BE_NODE_STAT_STORE);
	assert(node->nchilds == 2);

	ParserASTNode *node_target = node->childs[0];
	uint8_t type_target = _move_id_or_constexpr_to_reg(
		ctx,
		_ASM_REG_AX,
		_ASM_REG_BX,	// 32位指针，EBX应该不会被改变！
		node_target
	);
	assert(type_target == BE_TYPE_POINTER);

	ParserASTNode *node_source = node->childs[1];
	uint8_t type_source = _move_id_or_constexpr_to_reg(
		ctx,
		_ASM_REG_BX,
		_ASM_REG_CX,
		node_source
	);

	ResizableString rstr_memref_l;
	rstr_init(&rstr_memref_l);
	_asm_inst_memref_base_disp(ctx, &rstr_memref_l, _ASM_REG_NAME_EAX, "0");

	ResizableString rstr_memref_h;
	rstr_init(&rstr_memref_h);
	_asm_inst_memref_base_disp(ctx, &rstr_memref_h, _ASM_REG_NAME_EAX, "4");

	if (type_source == BE_TYPE_UINT64
			|| type_source == BE_TYPE_INT64
			|| type_source == BE_TYPE_DOUBLE) {
		_asm_inst_mov_x_x(
			ctx,
			ctx->body,
			BE_TYPE_UINT32,
			RSTR_CSTR(&rstr_memref_l),
			_asm_inst_reg(ctx, BE_TYPE_UINT32, _ASM_REG_BX)
		);

		_asm_inst_mov_x_x(
			ctx,
			ctx->body,
			BE_TYPE_UINT32,
			RSTR_CSTR(&rstr_memref_h),
			_asm_inst_reg(ctx, BE_TYPE_UINT32, _ASM_REG_CX)
		);
	} else {
		_asm_inst_mov_x_x(
			ctx,
			ctx->body,
			type_source,
			RSTR_CSTR(&rstr_memref_l),
			_asm_inst_reg(ctx, type_source, _ASM_REG_BX)
		);
	}

	rstr_free(&rstr_memref_l);
	rstr_free(&rstr_memref_h);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x135cc
jmp 0x135eb
leaq 0x6cb8e(%rip), %rdi     # 0x80161
leaq 0x6231e(%rip), %rsi     # 0x758f8
movl $0x1295, %edx           # imm = 0x1295
leaq 0x63fc4(%rip), %rcx     # 0x775aa
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x135f4
jmp 0x13613
leaq 0x62f61(%rip), %rdi     # 0x7655c
leaq 0x622f6(%rip), %rsi     # 0x758f8
movl $0x1296, %edx           # imm = 0x1296
leaq 0x63f9c(%rip), %rcx     # 0x775aa
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0xb80, (%rax)          # imm = 0xB80
jne 0x13621
jmp 0x13640
leaq 0x63fc4(%rip), %rdi     # 0x775ec
leaq 0x622c9(%rip), %rsi     # 0x758f8
movl $0x1297, %edx           # imm = 0x1297
leaq 0x63f6f(%rip), %rcx     # 0x775aa
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x1364c
jmp 0x1366b
leaq 0x6f6f1(%rip), %rdi     # 0x82d44
leaq 0x6229e(%rip), %rsi     # 0x758f8
movl $0x1298, %edx           # imm = 0x1298
leaq 0x63f44(%rip), %rcx     # 0x775aa
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rcx
xorl %esi, %esi
movl $0x1, %edx
callq 0x22a20
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x10, %eax
jne 0x1369c
jmp 0x136bb
leaq 0x63f6a(%rip), %rdi     # 0x7760d
leaq 0x6224e(%rip), %rsi     # 0x758f8
movl $0x12a1, %edx           # imm = 0x12A1
leaq 0x63ef4(%rip), %rcx     # 0x775aa
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rcx
movl $0x1, %esi
movl $0x2, %edx
callq 0x22a20
movb %al, -0x29(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x8c90
movq -0x8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq 0x62ce8(%rip), %rdx     # 0x763e5
leaq 0x5fd56(%rip), %rcx     # 0x7345a
callq 0x10e00
leaq -0x50(%rbp), %rdi
callq 0x8c90
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq 0x62cc4(%rip), %rdx     # 0x763e5
leaq 0x62e3f(%rip), %rcx     # 0x76567
callq 0x10e00
movzbl -0x29(%rbp), %eax
cmpl $0x9, %eax
je 0x1374c
movzbl -0x29(%rbp), %eax
cmpl $0x5, %eax
je 0x1374c
movzbl -0x29(%rbp), %eax
cmpl $0xb, %eax
jne 0x13842
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x13774
leaq 0x627d1(%rip), %rax     # 0x75f3f
movq %rax, -0x68(%rbp)
jmp 0x1377c
movq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
leaq 0x6215f(%rip), %rcx     # 0x758f8
movl $0x12bb, %r8d           # imm = 0x12BB
callq 0x20d10
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x80(%rbp), %rcx
movq %rax, %r8
movl $0x8, %edx
callq 0x20f30
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x137e8
leaq 0x62760(%rip), %rax     # 0x75f3f
movq %rax, -0x88(%rbp)
jmp 0x137f3
movq -0x48(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rdi
movl $0x8, %esi
movl $0x2, %edx
leaq 0x620e2(%rip), %rcx     # 0x758f8
movl $0x12c3, %r8d           # imm = 0x12C3
callq 0x20d10
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x90(%rbp), %rcx
movq %rax, %r8
movl $0x8, %edx
callq 0x20f30
jmp 0x138da
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0xa0(%rbp)
movb -0x29(%rbp), %al
movb %al, -0x91(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1387c
leaq 0x626cc(%rip), %rax     # 0x75f3f
movq %rax, -0xb0(%rbp)
jmp 0x13887
movq -0x38(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %edx
leaq 0x62053(%rip), %rcx     # 0x758f8
movl $0x12cb, %r8d           # imm = 0x12CB
movzbl -0x29(%rbp), %esi
callq 0x20d10
movq -0xa8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0xb8(%rbp), %rcx
movq %rax, %r8
movb -0x91(%rbp), %al
movzbl %al, %edx
callq 0x20f30
leaq -0x40(%rbp), %rdi
callq 0x9310
leaq -0x50(%rbp), %rdi
callq 0x9310
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)