// File: /workspace/github_c_makefile_star2_O0/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
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x36080
jmp 0x3609f
leaq 0x4a0da(%rip), %rdi     # 0x80161
leaq 0x44a76(%rip), %rsi     # 0x7ab04
movl $0xc7c, %edx            # imm = 0xC7C
leaq 0x46490(%rip), %rcx     # 0x7c52a
callq 0x30a0
cmpq $0x0, -0x18(%rbp)
je 0x360a8
jmp 0x360c7
leaq 0x4216b(%rip), %rdi     # 0x7821a
leaq 0x44a4e(%rip), %rsi     # 0x7ab04
movl $0xc7d, %edx            # imm = 0xC7D
leaq 0x46468(%rip), %rcx     # 0x7c52a
callq 0x30a0
cmpq $0x0, -0x20(%rbp)
je 0x360d0
jmp 0x360ef
leaq 0x408fc(%rip), %rdi     # 0x769d3
leaq 0x44a26(%rip), %rsi     # 0x7ab04
movl $0xc7e, %edx            # imm = 0xC7E
leaq 0x46440(%rip), %rcx     # 0x7c52a
callq 0x30a0
movq -0x20(%rbp), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x3618e
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x32820
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movb 0x30(%rax), %al
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
cmpl $0xa, %eax
jne 0x3613e
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x36610
jmp 0x36183
movzbl -0x29(%rbp), %eax
cmpl $0xb, %eax
jne 0x36162
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x36720
jmp 0x36181
leaq 0x3d2f1(%rip), %rdi     # 0x7345a
leaq 0x44994(%rip), %rsi     # 0x7ab04
movl $0xc93, %edx            # imm = 0xC93
leaq 0x463ae(%rip), %rcx     # 0x7c52a
callq 0x30a0
jmp 0x36183
movb -0x29(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x36416
movq -0x20(%rbp), %rax
cmpl $0xe00, (%rax)          # imm = 0xE00
jne 0x363f7
leaq -0x40(%rbp), %rdi
callq 0x8c90
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x40(%rbp), %rsi
xorl %ecx, %ecx
callq 0x32e60
movq -0x20(%rbp), %rax
movb 0x60(%rax), %al
movb %al, -0x41(%rbp)
movzbl -0x41(%rbp), %eax
cmpl $0xa, %eax
jne 0x362c6
leaq -0x58(%rbp), %rdi
callq 0x8c90
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movss 0x88(%rax), %xmm0
leaq -0x58(%rbp), %rsi
callq 0x36830
leaq -0x68(%rbp), %rdi
callq 0x8c90
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x3621e
leaq 0x3fd2a(%rip), %rax     # 0x75f3f
movq %rax, -0x98(%rbp)
jmp 0x36229
movq -0x50(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rcx
leaq -0x68(%rbp), %rsi
leaq 0x44a6a(%rip), %rdx     # 0x7acac
callq 0x29520
movq -0x10(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x36283
leaq 0x3fcc5(%rip), %rax     # 0x75f3f
movq %rax, -0xb8(%rbp)
jmp 0x3628e
movq -0x60(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xa0(%rbp), %rdx
movq -0xa8(%rbp), %rsi
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rcx
callq 0x357f0
leaq -0x58(%rbp), %rdi
callq 0x9310
leaq -0x68(%rbp), %rdi
callq 0x9310
jmp 0x363ef
movzbl -0x41(%rbp), %eax
cmpl $0xb, %eax
jne 0x363ce
leaq -0x78(%rbp), %rdi
callq 0x8c90
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movsd 0x88(%rax), %xmm0
leaq -0x78(%rbp), %rsi
callq 0x368f0
leaq -0x88(%rbp), %rdi
callq 0x8c90
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x36323
leaq 0x3fc25(%rip), %rax     # 0x75f3f
movq %rax, -0xc8(%rbp)
jmp 0x3632e
movq -0x70(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rdi
movq -0xc8(%rbp), %rcx
leaq -0x88(%rbp), %rsi
leaq 0x44962(%rip), %rdx     # 0x7acac
callq 0x29520
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xd0(%rbp)
cmpq $0x0, -0x80(%rbp)
jne 0x3638b
leaq 0x3fbbd(%rip), %rax     # 0x75f3f
movq %rax, -0xe8(%rbp)
jmp 0x36396
movq -0x80(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xd0(%rbp), %rdx
movq -0xd8(%rbp), %rsi
movq -0xe0(%rbp), %rdi
movq -0xe8(%rbp), %rcx
callq 0x358e0
leaq -0x78(%rbp), %rdi
callq 0x9310
leaq -0x88(%rbp), %rdi
callq 0x9310
jmp 0x363ed
leaq 0x3d085(%rip), %rdi     # 0x7345a
leaq 0x44728(%rip), %rsi     # 0x7ab04
movl $0xcd4, %edx            # imm = 0xCD4
leaq 0x46142(%rip), %rcx     # 0x7c52a
callq 0x30a0
jmp 0x363ef
movb -0x41(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x36416
leaq 0x3d05c(%rip), %rdi     # 0x7345a
leaq 0x446ff(%rip), %rsi     # 0x7ab04
movl $0xcd9, %edx            # imm = 0xCD9
leaq 0x46119(%rip), %rcx     # 0x7c52a
callq 0x30a0
movb -0x1(%rbp), %al
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)