// File: /workspace/github_c_makefile_star2_O2/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 0x150c5
movq %rdx, %r13
testq %rdx, %rdx
je 0x150e4
movq %rsi, %r14
movq %rdi, %r15
movl (%r13), %eax
cmpl $0xe00, %eax            # imm = 0xE00
je 0x14dee
cmpl $0x200, %eax            # imm = 0x200
jne 0x15103
movq %r15, %rdi
movq %r13, %rsi
callq 0x128ba
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x129c1
movq %rax, %r12
movzbl 0x30(%rax), %ebx
cmpl $0xb, %ebx
je 0x14f4c
cmpl $0xa, %ebx
jne 0x15160
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x1517f
movq 0x58(%r12), %rax
testq %rax, %rax
leaq 0x28c4e(%rip), %rdx     # 0x3da2b
cmovneq %rax, %rdx
movq %r14, %rsi
callq 0x147b8
jmp 0x14f74
movq 0x58(%r15), %rax
testq %rax, %rax
je 0x15122
movq 0x58(%rax), %rax
testq %rax, %rax
je 0x15141
movb 0x60(%r13), %bl
movzbl %bl, %r12d
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movl 0x4(%rax), %edx
leaq -0x50(%rbp), %rdi
callq 0x6fa2
cmpl $0xb, %r12d
je 0x14f81
cmpl $0xa, %r12d
jne 0x151bd
leaq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x6e1c
movl 0x88(%r13), %eax
movl %eax, -0x30(%rbp)
movq 0x50(%r15), %r13
leaq 0x1(%r13), %rax
movq %rax, 0x50(%r15)
leaq 0x2aa50(%rip), %rsi     # 0x3f8b1
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x739a
movq 0x18(%r15), %rdi
leaq 0x2aa43(%rip), %rsi     # 0x3f8bc
callq 0x6e99
movq 0x18(%r15), %rdi
leaq 0x2aa45(%rip), %rsi     # 0x3f8ce
movq %r13, %rdx
xorl %eax, %eax
callq 0x739a
movq 0x18(%r15), %rdi
leaq 0x2aa3d(%rip), %rsi     # 0x3f8db
movl -0x30(%rbp), %edx
xorl %eax, %eax
callq 0x739a
leaq -0x70(%rbp), %r13
movq %r13, %rdi
callq 0x6e1c
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x28b68(%rip), %rax     # 0x3da2b
cmoveq %rax, %rdx
movq -0x48(%rbp), %r8
testq %r8, %r8
cmoveq %rax, %r8
leaq 0x292dc(%rip), %rsi     # 0x3e1b5
leaq 0x28d4b(%rip), %rcx     # 0x3dc2b
movq %r13, %rdi
xorl %eax, %eax
callq 0x739a
movq %r15, %rdi
callq 0x13558
leaq -0x60(%rbp), %r12
movq %r12, %rdi
callq 0x6e1c
movq 0x8(%r13), %rdx
testq %rdx, %rdx
leaq 0x28b1f(%rip), %rax     # 0x3da2b
cmoveq %rax, %rdx
leaq 0x28b74(%rip), %rsi     # 0x3da8b
leaq 0x28d17(%rip), %rcx     # 0x3dc35
movq %r12, %rdi
xorl %eax, %eax
callq 0x739a
movq 0x20(%r15), %rdi
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x28af0(%rip), %rax     # 0x3da2b
cmoveq %rax, %rdx
movq %r14, %rsi
callq 0x147b8
jmp 0x15092
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x1519e
movq 0x58(%r12), %rax
testq %rax, %rax
leaq 0x28ac3(%rip), %rdx     # 0x3da2b
cmovneq %rax, %rdx
movq %r14, %rsi
callq 0x14844
movq %r12, %rdi
callq 0x12c87
jmp 0x150b4
leaq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x6e1c
movq 0x88(%r13), %rax
movq %rax, -0x30(%rbp)
movq 0x50(%r15), %r13
leaq 0x1(%r13), %rax
movq %rax, 0x50(%r15)
leaq 0x2a93c(%rip), %rsi     # 0x3f8e7
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x739a
movq 0x18(%r15), %rdi
leaq 0x2a930(%rip), %rsi     # 0x3f8f3
callq 0x6e99
movq 0x18(%r15), %rdi
leaq 0x2a932(%rip), %rsi     # 0x3f905
movq %r13, %rdx
xorl %eax, %eax
callq 0x739a
movq 0x18(%r15), %rdi
leaq 0x2a92b(%rip), %rsi     # 0x3f913
movq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x739a
leaq -0x70(%rbp), %r13
movq %r13, %rdi
callq 0x6e1c
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x28a1d(%rip), %rax     # 0x3da2b
cmoveq %rax, %rdx
movq -0x48(%rbp), %r8
testq %r8, %r8
cmoveq %rax, %r8
leaq 0x29191(%rip), %rsi     # 0x3e1b5
leaq 0x28c00(%rip), %rcx     # 0x3dc2b
movq %r13, %rdi
xorl %eax, %eax
callq 0x739a
movq %r15, %rdi
callq 0x13558
leaq -0x60(%rbp), %r12
movq %r12, %rdi
callq 0x6e1c
movq 0x8(%r13), %rdx
testq %rdx, %rdx
leaq 0x289d4(%rip), %rax     # 0x3da2b
cmoveq %rax, %rdx
leaq 0x28a29(%rip), %rsi     # 0x3da8b
leaq 0x28bcc(%rip), %rcx     # 0x3dc35
movq %r12, %rdi
xorl %eax, %eax
callq 0x739a
movq 0x20(%r15), %rdi
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x289a5(%rip), %rax     # 0x3da2b
cmoveq %rax, %rdx
movq %r14, %rsi
callq 0x14844
leaq -0x40(%rbp), %rdi
callq 0x72b9
movq %r13, %rdi
callq 0x72b9
movq %r12, %rdi
callq 0x72b9
leaq -0x50(%rbp), %rdi
callq 0x72b9
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2a70a(%rip), %rdi     # 0x3f7d6
leaq 0x28375(%rip), %rsi     # 0x3d448
leaq 0x2a698(%rip), %rcx     # 0x3f772
movl $0xea0, %edx            # imm = 0xEA0
callq 0x30a0
leaq 0x2921a(%rip), %rdi     # 0x3e305
leaq 0x28356(%rip), %rsi     # 0x3d448
leaq 0x2a679(%rip), %rcx     # 0x3f772
movl $0xea1, %edx            # imm = 0xEA1
callq 0x30a0
leaq 0x2625f(%rip), %rdi     # 0x3b369
leaq 0x28337(%rip), %rsi     # 0x3d448
leaq 0x2a65a(%rip), %rcx     # 0x3f772
movl $0xf24, %edx            # imm = 0xF24
callq 0x30a0
leaq 0x28dc3(%rip), %rdi     # 0x3deec
leaq 0x28318(%rip), %rsi     # 0x3d448
leaq 0x2a63b(%rip), %rcx     # 0x3f772
movl $0xec1, %edx            # imm = 0xEC1
callq 0x30a0
leaq 0x28db4(%rip), %rdi     # 0x3defc
leaq 0x282f9(%rip), %rsi     # 0x3d448
leaq 0x2a61c(%rip), %rcx     # 0x3f772
movl $0xec3, %edx            # imm = 0xEC3
callq 0x30a0
leaq 0x26202(%rip), %rdi     # 0x3b369
leaq 0x282da(%rip), %rsi     # 0x3d448
leaq 0x2a5fd(%rip), %rcx     # 0x3f772
movl $0xeb7, %edx            # imm = 0xEB7
callq 0x30a0
leaq 0x268aa(%rip), %rdi     # 0x3ba30
leaq 0x282bb(%rip), %rsi     # 0x3d448
leaq 0x2a64d(%rip), %rcx     # 0x3f7e1
movl $0x54a, %edx            # imm = 0x54A
callq 0x30a0
leaq 0x2688b(%rip), %rdi     # 0x3ba30
leaq 0x2829c(%rip), %rsi     # 0x3d448
leaq 0x2a696(%rip), %rcx     # 0x3f849
movl $0x58a, %edx            # imm = 0x58A
callq 0x30a0
leaq 0x261a5(%rip), %rdi     # 0x3b369
leaq 0x2827d(%rip), %rsi     # 0x3d448
leaq 0x2a5a0(%rip), %rcx     # 0x3f772
movl $0xf1d, %edx            # imm = 0xF1D
callq 0x30a0