// File: /workspace/github_c_makefile_star2_O3/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 0x1ef8c
movq %rdx, %r13
testq %rdx, %rdx
je 0x1efab
movq %rsi, %rbx
movq %rdi, %r15
movl (%r13), %eax
cmpl $0xe00, %eax            # imm = 0xE00
je 0x1ed89
cmpl $0x200, %eax            # imm = 0x200
jne 0x1efca
movq %r15, %rdi
movq %r13, %rsi
callq 0x1d5d1
movzbl 0x30(%rax), %ecx
cmpl $0xb, %ecx
je 0x1ef50
cmpl $0xa, %ecx
jne 0x1efe9
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x1f027
movq 0x58(%rax), %rax
testq %rax, %rax
leaq 0x21ca6(%rip), %rdx     # 0x40a1b
cmovneq %rax, %rdx
movq %rbx, %rsi
callq 0x1e97c
movb $0xa, %r14b
jmp 0x1ef7a
leaq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0x7314
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x1d869
movzbl 0x60(%r13), %r14d
cmpl $0xb, %r14d
je 0x1ee80
cmpl $0xa, %r14d
jne 0x1f008
leaq -0x38(%rbp), %rdi
callq 0x7314
movl 0x88(%r13), %r13d
movq 0x50(%r15), %r12
leaq 0x1(%r12), %rax
movq %rax, 0x50(%r15)
leaq 0x23a9d(%rip), %rsi     # 0x4287f
leaq -0x38(%rbp), %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x7905
movq 0x18(%r15), %rdi
leaq 0x23a8f(%rip), %rsi     # 0x4288a
callq 0x739b
movq 0x18(%r15), %rdi
leaq 0x23a91(%rip), %rsi     # 0x4289c
movq %r12, %rdx
xorl %eax, %eax
callq 0x7905
movq 0x18(%r15), %rdi
leaq 0x27114(%rip), %rsi     # 0x45f34
movl %r13d, %edx
xorl %eax, %eax
callq 0x7905
leaq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x7314
leaq -0x38(%rbp), %rax
movq 0x8(%rax), %rdx
testq %rdx, %rdx
leaq 0x21bd3(%rip), %r12     # 0x40a1b
cmoveq %r12, %rdx
leaq 0x21c28(%rip), %rsi     # 0x40a7b
leaq 0x25978(%rip), %rcx     # 0x447d2
movq %r13, %rdi
xorl %eax, %eax
callq 0x7905
movq 0x20(%r15), %rdi
movq 0x8(%r13), %rdx
testq %rdx, %rdx
cmoveq %r12, %rdx
movq %rbx, %rsi
callq 0x1e97c
jmp 0x1ef3d
leaq -0x38(%rbp), %rdi
callq 0x7314
movq 0x88(%r13), %r13
movq 0x50(%r15), %r12
leaq 0x1(%r12), %rax
movq %rax, 0x50(%r15)
leaq 0x23a11(%rip), %rsi     # 0x428b5
leaq -0x38(%rbp), %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x7905
movq 0x18(%r15), %rdi
leaq 0x23a04(%rip), %rsi     # 0x428c1
callq 0x739b
movq 0x18(%r15), %rdi
leaq 0x23a06(%rip), %rsi     # 0x428d3
movq %r12, %rdx
xorl %eax, %eax
callq 0x7905
movq 0x18(%r15), %rdi
leaq 0x27060(%rip), %rsi     # 0x45f42
movq %r13, %rdx
xorl %eax, %eax
callq 0x7905
leaq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x7314
leaq -0x38(%rbp), %rax
movq 0x8(%rax), %rdx
testq %rdx, %rdx
leaq 0x21b11(%rip), %r12     # 0x40a1b
cmoveq %r12, %rdx
leaq 0x21b66(%rip), %rsi     # 0x40a7b
leaq 0x258b6(%rip), %rcx     # 0x447d2
movq %r13, %rdi
xorl %eax, %eax
callq 0x7905
movq 0x20(%r15), %rdi
movq 0x8(%r13), %rdx
testq %rdx, %rdx
cmoveq %r12, %rdx
movq %rbx, %rsi
callq 0x1ea08
leaq -0x38(%rbp), %rdi
callq 0x7812
movq %r13, %rdi
callq 0x7812
jmp 0x1ef7a
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x1f046
movq 0x58(%rax), %rax
testq %rax, %rax
leaq 0x21ab0(%rip), %rdx     # 0x40a1b
cmovneq %rax, %rdx
movq %rbx, %rsi
callq 0x1ea08
movb $0xb, %r14b
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x23811(%rip), %rdi     # 0x427a4
leaq 0x256ce(%rip), %rsi     # 0x44668
leaq 0x26e5f(%rip), %rcx     # 0x45e00
movl $0xc7d, %edx            # imm = 0xC7D
callq 0x30a0
leaq 0x22354(%rip), %rdi     # 0x41306
leaq 0x256af(%rip), %rsi     # 0x44668
leaq 0x26e40(%rip), %rcx     # 0x45e00
movl $0xc7e, %edx            # imm = 0xC7E
callq 0x30a0
leaq 0x1f398(%rip), %rdi     # 0x3e369
leaq 0x25690(%rip), %rsi     # 0x44668
leaq 0x26e21(%rip), %rcx     # 0x45e00
movl $0xcd9, %edx            # imm = 0xCD9
callq 0x30a0
leaq 0x1f379(%rip), %rdi     # 0x3e369
leaq 0x25671(%rip), %rsi     # 0x44668
leaq 0x26e02(%rip), %rcx     # 0x45e00
movl $0xc93, %edx            # imm = 0xC93
callq 0x30a0
leaq 0x1f35a(%rip), %rdi     # 0x3e369
leaq 0x25652(%rip), %rsi     # 0x44668
leaq 0x26de3(%rip), %rcx     # 0x45e00
movl $0xcd4, %edx            # imm = 0xCD4
callq 0x30a0
leaq 0x1fa02(%rip), %rdi     # 0x3ea30
leaq 0x25633(%rip), %rsi     # 0x44668
leaq 0x26e28(%rip), %rcx     # 0x45e64
movl $0x4d9, %edx            # imm = 0x4D9
callq 0x30a0
leaq 0x1f9e3(%rip), %rdi     # 0x3ea30
leaq 0x25614(%rip), %rsi     # 0x44668
leaq 0x26e71(%rip), %rcx     # 0x45ecc
movl $0x519, %edx            # imm = 0x519
callq 0x30a0