// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/backend/asmgen_gas32.c
// Function: asm_stat_fptrunc
static void _asm_stat_fptrunc(
	ASMGeneratorGas32Context *ctx,
	ParserASTNode *node
) {
	assert(ctx);
	assert(node);
	assert(node->type == BE_NODE_STAT_FPTRUNC);
	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);

	ParserASTNode *node_source = node->childs[1];
	uint8_t type_source = _move_id_or_constexpr_to_xmm_reg(
		ctx,
		_ASM_REG_NAME_XMM0,
		node_source
	);

	_asm_inst_cvtsd2ss_x_x(
		ctx,
		ctx->body,
		_ASM_REG_NAME_XMM0,
		_ASM_REG_NAME_XMM0
	);

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

	_asm_inst_movss_sym_x(
		ctx,
		ctx->body,
		symbol_target_l,
		_ASM_REG_NAME_XMM0
	);

	_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 0x15d49
jmp 0x15d68
leaq 0x6a411(%rip), %rdi     # 0x80161
leaq 0x5fba1(%rip), %rsi     # 0x758f8
movl $0x1715, %edx           # imm = 0x1715
leaq 0x628ac(%rip), %rcx     # 0x7860f
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x15d71
jmp 0x15d90
leaq 0x607e4(%rip), %rdi     # 0x7655c
leaq 0x5fb79(%rip), %rsi     # 0x758f8
movl $0x1716, %edx           # imm = 0x1716
leaq 0x62884(%rip), %rcx     # 0x7860f
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0xbc9, (%rax)          # imm = 0xBC9
jne 0x15d9e
jmp 0x15dbd
leaq 0x628ae(%rip), %rdi     # 0x78653
leaq 0x5fb4c(%rip), %rsi     # 0x758f8
movl $0x1717, %edx           # imm = 0x1717
leaq 0x62857(%rip), %rcx     # 0x7860f
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x15dc9
jmp 0x15de8
leaq 0x6cf74(%rip), %rdi     # 0x82d44
leaq 0x5fb21(%rip), %rsi     # 0x758f8
movl $0x1718, %edx           # imm = 0x1718
leaq 0x6282c(%rip), %rcx     # 0x7860f
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 0x15e05
jmp 0x15e24
leaq 0x605b1(%rip), %rdi     # 0x763bd
leaq 0x5fae5(%rip), %rsi     # 0x758f8
movl $0x171b, %edx           # imm = 0x171B
leaq 0x627f0(%rip), %rcx     # 0x7860f
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)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x61aa8(%rip), %rsi     # 0x77906
callq 0x24300
movb %al, -0x31(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
leaq 0x61a8d(%rip), %rcx     # 0x77906
movq %rcx, %rdx
callq 0x24f20
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 0x61a5b(%rip), %rcx     # 0x77906
callq 0x23420
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1fd10
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)