// File: /workspace/github_c_makefile_star2_O2/Ihsoh[P]ilang/compiler/backend/asmgen_gas64.c
// Function: move_id_or_constexpr_to_xmm_reg
static uint8_t _move_id_or_constexpr_to_xmm_reg(
	ASMGeneratorGas64Context *ctx,
	const char *target_reg,
	ParserASTNode *source_id_or_constexpr
) {
	assert(ctx);
	assert(target_reg);
	assert(source_id_or_constexpr);

	if (source_id_or_constexpr->type == BE_NODE_IDENTIFIER) {
		ParserSymbol *symbol = _get_var_symbol_by_id_node(ctx, source_id_or_constexpr);
		uint8_t symbol_type = BE_VAR_SYMBOL_GET_TYPE(symbol);

		if (symbol_type == BE_TYPE_FLOAT) {
			_asm_inst_movss_x_sym(
				ctx,
				ctx->body,
				target_reg,
				symbol
			);
		} else if (symbol_type == BE_TYPE_DOUBLE) {
			_asm_inst_movsd_x_sym(
				ctx,
				ctx->body,
				target_reg,
				symbol
			);
		} else {
			assert(0);
		}

		return symbol_type;
	} else if (source_id_or_constexpr->type == BE_NODE_EXPR) {
		ResizableString rstr;
		rstr_init(&rstr);
		_asm_constexpr_param(ctx, &rstr, source_id_or_constexpr, _ASM_REG_AX);
		uint8_t type = BE_EXPR_AST_NODE_GET_TYPE(source_id_or_constexpr);

		if (type == BE_TYPE_FLOAT) {
			ResizableString rstr_name;
			rstr_init(&rstr_name);
			_new_float(
				ctx,
				&rstr_name,
				BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_FLOAT_VAL(source_id_or_constexpr)
			);

			ResizableString rstr_memref;
			rstr_init(&rstr_memref);
			_asm_inst_memref_base_disp(
				ctx,
				&rstr_memref,
				_ASM_REG_NAME_RIP,
				RSTR_CSTR(&rstr_name)
			);

			_asm_inst_movss_x_x(
				ctx,
				ctx->body,
				target_reg,
				RSTR_CSTR(&rstr_memref)
			);

			rstr_free(&rstr_name);
			rstr_free(&rstr_memref);
		} else if (type == BE_TYPE_DOUBLE) {
			ResizableString rstr_name;
			rstr_init(&rstr_name);
			_new_double(
				ctx,
				&rstr_name,
				BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_DOUBLE_VAL(source_id_or_constexpr)
			);

			ResizableString rstr_memref;
			rstr_init(&rstr_memref);
			_asm_inst_memref_base_disp(
				ctx,
				&rstr_memref,
				_ASM_REG_NAME_RIP,
				RSTR_CSTR(&rstr_name)
			);

			_asm_inst_movsd_x_x(
				ctx,
				ctx->body,
				target_reg,
				RSTR_CSTR(&rstr_memref)
			);

			rstr_free(&rstr_name);
			rstr_free(&rstr_memref);
		} else {
			assert(0);
		}

		return type;
	} else {
		assert(0);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
testq %rsi, %rsi
je 0x1d05c
movq %rdx, %r13
testq %rdx, %rdx
je 0x1d07b
movq %rsi, %rbx
movq %rdi, %r15
movl (%r13), %eax
cmpl $0xe00, %eax            # imm = 0xE00
je 0x1ce59
cmpl $0x200, %eax            # imm = 0x200
jne 0x1d09a
movq %r15, %rdi
movq %r13, %rsi
callq 0x1b683
movzbl 0x30(%rax), %ecx
cmpl $0xb, %ecx
je 0x1d020
cmpl $0xa, %ecx
jne 0x1d0b9
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x1d0f7
movq 0x58(%rax), %rax
testq %rax, %rax
leaq 0x20be6(%rip), %rdx     # 0x3da2b
cmovneq %rax, %rdx
movq %rbx, %rsi
callq 0x1ca50
movb $0xa, %r14b
jmp 0x1d04a
leaq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0x6e1c
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x1b909
movzbl 0x60(%r13), %r14d
cmpl $0xb, %r14d
je 0x1cf50
cmpl $0xa, %r14d
jne 0x1d0d8
leaq -0x38(%rbp), %rdi
callq 0x6e1c
movl 0x88(%r13), %r13d
movq 0x50(%r15), %r12
leaq 0x1(%r12), %rax
movq %rax, 0x50(%r15)
leaq 0x229ff(%rip), %rsi     # 0x3f8b1
leaq -0x38(%rbp), %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x739a
movq 0x18(%r15), %rdi
leaq 0x229f1(%rip), %rsi     # 0x3f8bc
callq 0x6e99
movq 0x18(%r15), %rdi
leaq 0x229f3(%rip), %rsi     # 0x3f8ce
movq %r12, %rdx
xorl %eax, %eax
callq 0x739a
movq 0x18(%r15), %rdi
leaq 0x26074(%rip), %rsi     # 0x42f64
movl %r13d, %edx
xorl %eax, %eax
callq 0x739a
leaq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x6e1c
leaq -0x38(%rbp), %rax
movq 0x8(%rax), %rdx
testq %rdx, %rdx
leaq 0x20b13(%rip), %r12     # 0x3da2b
cmoveq %r12, %rdx
leaq 0x20b68(%rip), %rsi     # 0x3da8b
leaq 0x248d8(%rip), %rcx     # 0x41802
movq %r13, %rdi
xorl %eax, %eax
callq 0x739a
movq 0x20(%r15), %rdi
movq 0x8(%r13), %rdx
testq %rdx, %rdx
cmoveq %r12, %rdx
movq %rbx, %rsi
callq 0x1ca50
jmp 0x1d00d
leaq -0x38(%rbp), %rdi
callq 0x6e1c
movq 0x88(%r13), %r13
movq 0x50(%r15), %r12
leaq 0x1(%r12), %rax
movq %rax, 0x50(%r15)
leaq 0x22973(%rip), %rsi     # 0x3f8e7
leaq -0x38(%rbp), %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x739a
movq 0x18(%r15), %rdi
leaq 0x22966(%rip), %rsi     # 0x3f8f3
callq 0x6e99
movq 0x18(%r15), %rdi
leaq 0x22968(%rip), %rsi     # 0x3f905
movq %r12, %rdx
xorl %eax, %eax
callq 0x739a
movq 0x18(%r15), %rdi
leaq 0x25fc0(%rip), %rsi     # 0x42f72
movq %r13, %rdx
xorl %eax, %eax
callq 0x739a
leaq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x6e1c
leaq -0x38(%rbp), %rax
movq 0x8(%rax), %rdx
testq %rdx, %rdx
leaq 0x20a51(%rip), %r12     # 0x3da2b
cmoveq %r12, %rdx
leaq 0x20aa6(%rip), %rsi     # 0x3da8b
leaq 0x24816(%rip), %rcx     # 0x41802
movq %r13, %rdi
xorl %eax, %eax
callq 0x739a
movq 0x20(%r15), %rdi
movq 0x8(%r13), %rdx
testq %rdx, %rdx
cmoveq %r12, %rdx
movq %rbx, %rsi
callq 0x1cadc
leaq -0x38(%rbp), %rdi
callq 0x72b9
movq %r13, %rdi
callq 0x72b9
jmp 0x1d04a
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x1d116
movq 0x58(%rax), %rax
testq %rax, %rax
leaq 0x209f0(%rip), %rdx     # 0x3da2b
cmovneq %rax, %rdx
movq %rbx, %rsi
callq 0x1cadc
movb $0xb, %r14b
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x22773(%rip), %rdi     # 0x3f7d6
leaq 0x2462e(%rip), %rsi     # 0x41698
leaq 0x25dbf(%rip), %rcx     # 0x42e30
movl $0xc7d, %edx            # imm = 0xC7D
callq 0x30a0
leaq 0x21283(%rip), %rdi     # 0x3e305
leaq 0x2460f(%rip), %rsi     # 0x41698
leaq 0x25da0(%rip), %rcx     # 0x42e30
movl $0xc7e, %edx            # imm = 0xC7E
callq 0x30a0
leaq 0x1e2c8(%rip), %rdi     # 0x3b369
leaq 0x245f0(%rip), %rsi     # 0x41698
leaq 0x25d81(%rip), %rcx     # 0x42e30
movl $0xcd9, %edx            # imm = 0xCD9
callq 0x30a0
leaq 0x1e2a9(%rip), %rdi     # 0x3b369
leaq 0x245d1(%rip), %rsi     # 0x41698
leaq 0x25d62(%rip), %rcx     # 0x42e30
movl $0xc93, %edx            # imm = 0xC93
callq 0x30a0
leaq 0x1e28a(%rip), %rdi     # 0x3b369
leaq 0x245b2(%rip), %rsi     # 0x41698
leaq 0x25d43(%rip), %rcx     # 0x42e30
movl $0xcd4, %edx            # imm = 0xCD4
callq 0x30a0
leaq 0x1e932(%rip), %rdi     # 0x3ba30
leaq 0x24593(%rip), %rsi     # 0x41698
leaq 0x25d88(%rip), %rcx     # 0x42e94
movl $0x4d9, %edx            # imm = 0x4D9
callq 0x30a0
leaq 0x1e913(%rip), %rdi     # 0x3ba30
leaq 0x24574(%rip), %rsi     # 0x41698
leaq 0x25dd1(%rip), %rcx     # 0x42efc
movl $0x519, %edx            # imm = 0x519
callq 0x30a0