// File: /workspace/github_c_makefile_star2_O1/Ihsoh[P]ilang/compiler/backend/asmgen_gas32.c
// Function: move_id_or_constexpr_to_xmm_reg
static uint8_t _move_id_or_constexpr_to_xmm_reg(
	ASMGeneratorGas32Context *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);
		symbol = _instantiate_varsym(ctx, symbol, 0);
		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);
		}

		_free_varsym(ctx, symbol);

		return symbol_type;
	} else if (source_id_or_constexpr->type == BE_NODE_EXPR) {
		uint8_t type = BE_EXPR_AST_NODE_GET_TYPE(source_id_or_constexpr);

		ParserSymbol *cur_func_symbol = ctx->func_symbol;
		assert(cur_func_symbol);
		ParserASTNode *cur_func_name_node = BE_FUNC_SYMBOL_GET_FUNC_NAME_NODE(cur_func_symbol);
		assert(cur_func_name_node);

		ResizableString rstr_cur_func_name;
		rstr_init_with_raw(
			&rstr_cur_func_name,
			cur_func_name_node->token->content,
			cur_func_name_node->token->len
		);

		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_disp;
			rstr_init(&rstr_disp);
			rstr_appendf(
				&rstr_disp,
				"%s-%s%s",
				RSTR_CSTR(&rstr_name),
				_ASM_IP_LABEL_PREFIX,
				RSTR_CSTR(&rstr_cur_func_name)
			);

			_asm_get_ip(ctx);

			ResizableString rstr_memref;
			rstr_init(&rstr_memref);
			_asm_inst_memref_base_disp(
				ctx,
				&rstr_memref,
				_ASM_IP_REG,
				RSTR_CSTR(&rstr_disp)
			);

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

			rstr_free(&rstr_name);
			rstr_free(&rstr_disp);
			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_disp;
			rstr_init(&rstr_disp);
			rstr_appendf(
				&rstr_disp,
				"%s-%s%s",
				RSTR_CSTR(&rstr_name),
				_ASM_IP_LABEL_PREFIX,
				RSTR_CSTR(&rstr_cur_func_name)
			);

			_asm_get_ip(ctx);

			ResizableString rstr_memref;
			rstr_init(&rstr_memref);
			_asm_inst_memref_base_disp(
				ctx,
				&rstr_memref,
				_ASM_IP_REG,
				RSTR_CSTR(&rstr_disp)
			);

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

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

		rstr_free(&rstr_cur_func_name);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
testq %rsi, %rsi
je 0x16e92
movq %rdx, %r13
testq %rdx, %rdx
je 0x16eb1
movq %rsi, %r14
movq %rdi, %r15
movl (%r13), %eax
cmpl $0xe00, %eax            # imm = 0xE00
je 0x16bb2
cmpl $0x200, %eax            # imm = 0x200
jne 0x16ed0
movq %r15, %rdi
movq %r13, %rsi
callq 0x14565
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x1466e
movq %rax, %r12
movzbl 0x30(%rax), %ebx
cmpl $0xb, %ebx
je 0x16d10
cmpl $0xa, %ebx
jne 0x16f2d
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x16f4c
testq %r12, %r12
je 0x16f8a
movq 0x58(%r12), %rax
testq %rax, %rax
leaq 0x2beba(%rip), %rdx     # 0x42a5b
cmovneq %rax, %rdx
movq %r14, %rsi
callq 0x1653d
jmp 0x16d41
movq 0x58(%r15), %rax
testq %rax, %rax
je 0x16eef
movq 0x58(%rax), %rax
testq %rax, %rax
je 0x16f0e
movb 0x60(%r13), %bl
movzbl %bl, %r12d
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movl 0x4(%rax), %edx
leaq -0x50(%rbp), %rdi
callq 0x76ad
cmpl $0xb, %r12d
je 0x16d4e
cmpl $0xa, %r12d
jne 0x16fa9
leaq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x7508
movl 0x88(%r13), %eax
movl %eax, -0x30(%rbp)
movq 0x50(%r15), %r13
leaq 0x1(%r13), %rax
movq %rax, 0x50(%r15)
leaq 0x2dc9a(%rip), %rsi     # 0x448bf
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x7af1
movq 0x18(%r15), %rdi
leaq 0x2dc8d(%rip), %rsi     # 0x448ca
callq 0x758f
movq 0x18(%r15), %rdi
leaq 0x2dc8f(%rip), %rsi     # 0x448dc
movq %r13, %rdx
xorl %eax, %eax
callq 0x7af1
movq 0x18(%r15), %rdi
leaq 0x2dc87(%rip), %rsi     # 0x448e9
movl -0x30(%rbp), %edx
xorl %eax, %eax
callq 0x7af1
leaq -0x70(%rbp), %r13
movq %r13, %rdi
callq 0x7508
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x2bdd4(%rip), %rax     # 0x42a5b
cmoveq %rax, %rdx
movq -0x48(%rbp), %r8
testq %r8, %r8
cmoveq %rax, %r8
leaq 0x2c559(%rip), %rsi     # 0x431f6
leaq 0x2bfb7(%rip), %rcx     # 0x42c5b
movq %r13, %rdi
xorl %eax, %eax
callq 0x7af1
movq %r15, %rdi
callq 0x151f1
leaq -0x60(%rbp), %r12
movq %r12, %rdi
callq 0x7508
movq 0x8(%r13), %rdx
testq %rdx, %rdx
leaq 0x2bd8b(%rip), %rax     # 0x42a5b
cmoveq %rax, %rdx
leaq 0x2bde0(%rip), %rsi     # 0x42abb
leaq 0x2bf83(%rip), %rcx     # 0x42c65
movq %r12, %rdi
xorl %eax, %eax
callq 0x7af1
movq 0x20(%r15), %rdi
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x2bd5c(%rip), %rax     # 0x42a5b
cmoveq %rax, %rdx
movq %r14, %rsi
callq 0x1653d
jmp 0x16e5f
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x16f6b
testq %r12, %r12
je 0x16fc8
movq 0x58(%r12), %rax
testq %rax, %rax
leaq 0x2bd26(%rip), %rdx     # 0x42a5b
cmovneq %rax, %rdx
movq %r14, %rsi
callq 0x165c9
movq %r12, %rdi
callq 0x14956
jmp 0x16e81
leaq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x7508
movq 0x88(%r13), %rax
movq %rax, -0x30(%rbp)
movq 0x50(%r15), %r13
leaq 0x1(%r13), %rax
movq %rax, 0x50(%r15)
leaq 0x2db7d(%rip), %rsi     # 0x448f5
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x7af1
movq 0x18(%r15), %rdi
leaq 0x2db71(%rip), %rsi     # 0x44901
callq 0x758f
movq 0x18(%r15), %rdi
leaq 0x2db73(%rip), %rsi     # 0x44913
movq %r13, %rdx
xorl %eax, %eax
callq 0x7af1
movq 0x18(%r15), %rdi
leaq 0x2db6c(%rip), %rsi     # 0x44921
movq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x7af1
leaq -0x70(%rbp), %r13
movq %r13, %rdi
callq 0x7508
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x2bc80(%rip), %rax     # 0x42a5b
cmoveq %rax, %rdx
movq -0x48(%rbp), %r8
testq %r8, %r8
cmoveq %rax, %r8
leaq 0x2c405(%rip), %rsi     # 0x431f6
leaq 0x2be63(%rip), %rcx     # 0x42c5b
movq %r13, %rdi
xorl %eax, %eax
callq 0x7af1
movq %r15, %rdi
callq 0x151f1
leaq -0x60(%rbp), %r12
movq %r12, %rdi
callq 0x7508
movq 0x8(%r13), %rdx
testq %rdx, %rdx
leaq 0x2bc37(%rip), %rax     # 0x42a5b
cmoveq %rax, %rdx
leaq 0x2bc8c(%rip), %rsi     # 0x42abb
leaq 0x2be2f(%rip), %rcx     # 0x42c65
movq %r12, %rdi
xorl %eax, %eax
callq 0x7af1
movq 0x20(%r15), %rdi
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x2bc08(%rip), %rax     # 0x42a5b
cmoveq %rax, %rdx
movq %r14, %rsi
callq 0x165c9
leaq -0x40(%rbp), %rdi
callq 0x79f8
movq %r13, %rdi
callq 0x79f8
movq %r12, %rdi
callq 0x79f8
leaq -0x50(%rbp), %rdi
callq 0x79f8
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2d94b(%rip), %rdi     # 0x447e4
leaq 0x2b5d8(%rip), %rsi     # 0x42478
leaq 0x2d8d9(%rip), %rcx     # 0x44780
movl $0xea0, %edx            # imm = 0xEA0
callq 0x30a0
leaq 0x2c48e(%rip), %rdi     # 0x43346
leaq 0x2b5b9(%rip), %rsi     # 0x42478
leaq 0x2d8ba(%rip), %rcx     # 0x44780
movl $0xea1, %edx            # imm = 0xEA1
callq 0x30a0
leaq 0x294b6(%rip), %rdi     # 0x4038d
leaq 0x2b59a(%rip), %rsi     # 0x42478
leaq 0x2d89b(%rip), %rcx     # 0x44780
movl $0xf24, %edx            # imm = 0xF24
callq 0x30a0
leaq 0x2c037(%rip), %rdi     # 0x42f2d
leaq 0x2b57b(%rip), %rsi     # 0x42478
leaq 0x2d87c(%rip), %rcx     # 0x44780
movl $0xec1, %edx            # imm = 0xEC1
callq 0x30a0
leaq 0x2c028(%rip), %rdi     # 0x42f3d
leaq 0x2b55c(%rip), %rsi     # 0x42478
leaq 0x2d85d(%rip), %rcx     # 0x44780
movl $0xec3, %edx            # imm = 0xEC3
callq 0x30a0
leaq 0x29459(%rip), %rdi     # 0x4038d
leaq 0x2b53d(%rip), %rsi     # 0x42478
leaq 0x2d83e(%rip), %rcx     # 0x44780
movl $0xeb7, %edx            # imm = 0xEB7
callq 0x30a0
leaq 0x29afd(%rip), %rdi     # 0x40a50
leaq 0x2b51e(%rip), %rsi     # 0x42478
leaq 0x2d88e(%rip), %rcx     # 0x447ef
movl $0x54a, %edx            # imm = 0x54A
callq 0x30a0
leaq 0x29ade(%rip), %rdi     # 0x40a50
leaq 0x2b4ff(%rip), %rsi     # 0x42478
leaq 0x2d8d7(%rip), %rcx     # 0x44857
movl $0x58a, %edx            # imm = 0x58A
callq 0x30a0
leaq 0x30bb9(%rip), %rdi     # 0x47b4a
leaq 0x2b4e0(%rip), %rsi     # 0x42478
leaq 0x2d850(%rip), %rcx     # 0x447ef
movl $0x54c, %edx            # imm = 0x54C
callq 0x30a0
leaq 0x293dd(%rip), %rdi     # 0x4038d
leaq 0x2b4c1(%rip), %rsi     # 0x42478
leaq 0x2d7c2(%rip), %rcx     # 0x44780
movl $0xf1d, %edx            # imm = 0xF1D
callq 0x30a0
leaq 0x30b7b(%rip), %rdi     # 0x47b4a
leaq 0x2b4a2(%rip), %rsi     # 0x42478
leaq 0x2d87a(%rip), %rcx     # 0x44857
movl $0x58c, %edx            # imm = 0x58C
callq 0x30a0