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

	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);

	_asm_inst_xor_x_x(
		ctx,
		ctx->body,
		BE_TYPE_UINT32,
		_ASM_REG_NAME_EAX,
		_ASM_REG_NAME_EAX
	);

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

	ParserSymbol *symbol_target_l = _instantiate_varsym(ctx, symbol_target, 0);

	_asm_inst_mov_sym_x(
		ctx,
		ctx->body,
		symbol_target_l,
		_ASM_REG_NAME_EAX
	);

	_free_varsym(ctx, symbol_target_l);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x146c9
jmp 0x146e8
leaq 0x6ba91(%rip), %rdi     # 0x80161
leaq 0x61221(%rip), %rsi     # 0x758f8
movl $0x145d, %edx           # imm = 0x145D
leaq 0x635b4(%rip), %rcx     # 0x77c97
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x146f1
jmp 0x14710
leaq 0x61e64(%rip), %rdi     # 0x7655c
leaq 0x611f9(%rip), %rsi     # 0x758f8
movl $0x145e, %edx           # imm = 0x145E
leaq 0x6358c(%rip), %rcx     # 0x77c97
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0xbc3, (%rax)          # imm = 0xBC3
jne 0x1471e
jmp 0x1473d
leaq 0x635b7(%rip), %rdi     # 0x77cdc
leaq 0x611cc(%rip), %rsi     # 0x758f8
movl $0x145f, %edx           # imm = 0x145F
leaq 0x6355f(%rip), %rcx     # 0x77c97
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x14749
jmp 0x14768
leaq 0x6e5f4(%rip), %rdi     # 0x82d44
leaq 0x611a1(%rip), %rsi     # 0x758f8
movl $0x1460, %edx           # imm = 0x1460
leaq 0x63534(%rip), %rcx     # 0x77c97
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 0x14785
jmp 0x147a4
leaq 0x61c31(%rip), %rdi     # 0x763bd
leaq 0x61165(%rip), %rsi     # 0x758f8
movl $0x1463, %edx           # imm = 0x1463
leaq 0x634f8(%rip), %rcx     # 0x77c97
callq 0x30a0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1f720
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb 0x30(%rax), %al
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
cmpl $0x10, %eax
jne 0x147ca
jmp 0x147e9
leaq 0x62e3c(%rip), %rdi     # 0x7760d
leaq 0x61120(%rip), %rsi     # 0x758f8
movl $0x1466, %edx           # imm = 0x1466
leaq 0x634b3(%rip), %rcx     # 0x77c97
callq 0x30a0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movl $0x8, %edx
leaq 0x61be4(%rip), %r8      # 0x763e5
movq %r8, %rcx
callq 0x230c0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rcx
xorl %esi, %esi
movl $0x1, %edx
callq 0x22a20
movb %al, -0x31(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
xorl %edx, %edx
callq 0x1f8e0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x40(%rbp), %rdx
leaq 0x61b8b(%rip), %rcx     # 0x763e5
callq 0x20080
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1fd10
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)