// File: /workspace/github_c_makefile_star2_O1/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 0x1f368
movq %rdx, %r13
testq %rdx, %rdx
je 0x1f387
movq %rsi, %r14
movq %rdi, %r15
movl (%r13), %eax
cmpl $0xe00, %eax            # imm = 0xE00
je 0x1f16b
cmpl $0x200, %eax            # imm = 0x200
jne 0x1f3a6
movq %r15, %rdi
movq %r13, %rsi
callq 0x1d9c6
movzbl 0x30(%rax), %ebx
cmpl $0xb, %ebx
je 0x1f330
cmpl $0xa, %ebx
jne 0x1f3c5
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x1f403
movq 0x58(%rax), %rax
testq %rax, %rax
leaq 0x23901(%rip), %rdx     # 0x42a5b
cmovneq %rax, %rdx
movq %r14, %rsi
callq 0x1ed61
jmp 0x1f357
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
callq 0x7508
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x1dc5e
movzbl 0x60(%r13), %ebx
cmpl $0xb, %ebx
je 0x1f260
cmpl $0xa, %ebx
jne 0x1f3e4
leaq -0x38(%rbp), %rdi
callq 0x7508
movl 0x88(%r13), %r13d
movq 0x50(%r15), %r12
leaq 0x1(%r12), %rax
movq %rax, 0x50(%r15)
leaq 0x256fd(%rip), %rsi     # 0x448bf
leaq -0x38(%rbp), %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x7af1
movq 0x18(%r15), %rdi
leaq 0x256ef(%rip), %rsi     # 0x448ca
callq 0x758f
movq 0x18(%r15), %rdi
leaq 0x256f1(%rip), %rsi     # 0x448dc
movq %r12, %rdx
xorl %eax, %eax
callq 0x7af1
movq 0x18(%r15), %rdi
leaq 0x28d74(%rip), %rsi     # 0x47f74
movl %r13d, %edx
xorl %eax, %eax
callq 0x7af1
leaq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x7508
leaq -0x38(%rbp), %rax
movq 0x8(%rax), %rdx
testq %rdx, %rdx
leaq 0x23833(%rip), %r12     # 0x42a5b
cmoveq %r12, %rdx
leaq 0x23888(%rip), %rsi     # 0x42abb
leaq 0x275d8(%rip), %rcx     # 0x46812
movq %r13, %rdi
xorl %eax, %eax
callq 0x7af1
movq 0x20(%r15), %rdi
movq 0x8(%r13), %rdx
testq %rdx, %rdx
cmoveq %r12, %rdx
movq %r14, %rsi
callq 0x1ed61
jmp 0x1f31d
leaq -0x38(%rbp), %rdi
callq 0x7508
movq 0x88(%r13), %r13
movq 0x50(%r15), %r12
leaq 0x1(%r12), %rax
movq %rax, 0x50(%r15)
leaq 0x25671(%rip), %rsi     # 0x448f5
leaq -0x38(%rbp), %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x7af1
movq 0x18(%r15), %rdi
leaq 0x25664(%rip), %rsi     # 0x44901
callq 0x758f
movq 0x18(%r15), %rdi
leaq 0x25666(%rip), %rsi     # 0x44913
movq %r12, %rdx
xorl %eax, %eax
callq 0x7af1
movq 0x18(%r15), %rdi
leaq 0x28cc0(%rip), %rsi     # 0x47f82
movq %r13, %rdx
xorl %eax, %eax
callq 0x7af1
leaq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x7508
leaq -0x38(%rbp), %rax
movq 0x8(%rax), %rdx
testq %rdx, %rdx
leaq 0x23771(%rip), %r12     # 0x42a5b
cmoveq %r12, %rdx
leaq 0x237c6(%rip), %rsi     # 0x42abb
leaq 0x27516(%rip), %rcx     # 0x46812
movq %r13, %rdi
xorl %eax, %eax
callq 0x7af1
movq 0x20(%r15), %rdi
movq 0x8(%r13), %rdx
testq %rdx, %rdx
cmoveq %r12, %rdx
movq %r14, %rsi
callq 0x1eded
leaq -0x38(%rbp), %rdi
callq 0x79f8
movq %r13, %rdi
callq 0x79f8
jmp 0x1f357
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x1f422
movq 0x58(%rax), %rax
testq %rax, %rax
leaq 0x23710(%rip), %rdx     # 0x42a5b
cmovneq %rax, %rdx
movq %r14, %rsi
callq 0x1eded
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x25475(%rip), %rdi     # 0x447e4
leaq 0x27332(%rip), %rsi     # 0x466a8
leaq 0x28ac3(%rip), %rcx     # 0x47e40
movl $0xc7d, %edx            # imm = 0xC7D
callq 0x30a0
leaq 0x23fb8(%rip), %rdi     # 0x43346
leaq 0x27313(%rip), %rsi     # 0x466a8
leaq 0x28aa4(%rip), %rcx     # 0x47e40
movl $0xc7e, %edx            # imm = 0xC7E
callq 0x30a0
leaq 0x20fe0(%rip), %rdi     # 0x4038d
leaq 0x272f4(%rip), %rsi     # 0x466a8
leaq 0x28a85(%rip), %rcx     # 0x47e40
movl $0xcd9, %edx            # imm = 0xCD9
callq 0x30a0
leaq 0x20fc1(%rip), %rdi     # 0x4038d
leaq 0x272d5(%rip), %rsi     # 0x466a8
leaq 0x28a66(%rip), %rcx     # 0x47e40
movl $0xc93, %edx            # imm = 0xC93
callq 0x30a0
leaq 0x20fa2(%rip), %rdi     # 0x4038d
leaq 0x272b6(%rip), %rsi     # 0x466a8
leaq 0x28a47(%rip), %rcx     # 0x47e40
movl $0xcd4, %edx            # imm = 0xCD4
callq 0x30a0
leaq 0x21646(%rip), %rdi     # 0x40a50
leaq 0x27297(%rip), %rsi     # 0x466a8
leaq 0x28a8c(%rip), %rcx     # 0x47ea4
movl $0x4d9, %edx            # imm = 0x4D9
callq 0x30a0
leaq 0x21627(%rip), %rdi     # 0x40a50
leaq 0x27278(%rip), %rsi     # 0x466a8
leaq 0x28ad5(%rip), %rcx     # 0x47f0c
movl $0x519, %edx            # imm = 0x519
callq 0x30a0