// File: /workspace/github_c_makefile_star2_O3/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 0x16b1f
movq %rdx, %r13
testq %rdx, %rdx
je 0x16b3e
movq %rsi, %r14
movq %rdi, %r15
movl (%r13), %eax
cmpl $0xe00, %eax            # imm = 0xE00
je 0x16848
cmpl $0x200, %eax            # imm = 0x200
jne 0x16b5d
movq %r15, %rdi
movq %r13, %rsi
callq 0x1424f
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x14358
movq %rax, %r12
movzbl 0x30(%rax), %ebx
cmpl $0xb, %ebx
je 0x169a6
cmpl $0xa, %ebx
jne 0x16bba
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x16bd9
movq 0x58(%r12), %rax
testq %rax, %rax
leaq 0x2a1e4(%rip), %rdx     # 0x40a1b
cmovneq %rax, %rdx
movq %r14, %rsi
callq 0x161dc
jmp 0x169ce
movq 0x58(%r15), %rax
testq %rax, %rax
je 0x16b7c
movq 0x58(%rax), %rax
testq %rax, %rax
je 0x16b9b
movb 0x60(%r13), %bl
movzbl %bl, %r12d
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movl 0x4(%rax), %edx
leaq -0x50(%rbp), %rdi
callq 0x74bc
cmpl $0xb, %r12d
je 0x169db
cmpl $0xa, %r12d
jne 0x16c17
leaq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x7314
movl 0x88(%r13), %eax
movl %eax, -0x30(%rbp)
movq 0x50(%r15), %r13
leaq 0x1(%r13), %rax
movq %rax, 0x50(%r15)
leaq 0x2bfc4(%rip), %rsi     # 0x4287f
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x7905
movq 0x18(%r15), %rdi
leaq 0x2bfb7(%rip), %rsi     # 0x4288a
callq 0x739b
movq 0x18(%r15), %rdi
leaq 0x2bfb9(%rip), %rsi     # 0x4289c
movq %r13, %rdx
xorl %eax, %eax
callq 0x7905
movq 0x18(%r15), %rdi
leaq 0x2bfb1(%rip), %rsi     # 0x428a9
movl -0x30(%rbp), %edx
xorl %eax, %eax
callq 0x7905
leaq -0x70(%rbp), %r13
movq %r13, %rdi
callq 0x7314
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x2a0fe(%rip), %rax     # 0x40a1b
cmoveq %rax, %rdx
movq -0x48(%rbp), %r8
testq %r8, %r8
cmoveq %rax, %r8
leaq 0x2a883(%rip), %rsi     # 0x411b6
leaq 0x2a2e1(%rip), %rcx     # 0x40c1b
movq %r13, %rdi
xorl %eax, %eax
callq 0x7905
movq %r15, %rdi
callq 0x14f0a
leaq -0x60(%rbp), %r12
movq %r12, %rdi
callq 0x7314
movq 0x8(%r13), %rdx
testq %rdx, %rdx
leaq 0x2a0b5(%rip), %rax     # 0x40a1b
cmoveq %rax, %rdx
leaq 0x2a10a(%rip), %rsi     # 0x40a7b
leaq 0x2a2ad(%rip), %rcx     # 0x40c25
movq %r12, %rdi
xorl %eax, %eax
callq 0x7905
movq 0x20(%r15), %rdi
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x2a086(%rip), %rax     # 0x40a1b
cmoveq %rax, %rdx
movq %r14, %rsi
callq 0x161dc
jmp 0x16aec
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x16bf8
movq 0x58(%r12), %rax
testq %rax, %rax
leaq 0x2a059(%rip), %rdx     # 0x40a1b
cmovneq %rax, %rdx
movq %r14, %rsi
callq 0x16268
movq %r12, %rdi
callq 0x14640
jmp 0x16b0e
leaq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x7314
movq 0x88(%r13), %rax
movq %rax, -0x30(%rbp)
movq 0x50(%r15), %r13
leaq 0x1(%r13), %rax
movq %rax, 0x50(%r15)
leaq 0x2beb0(%rip), %rsi     # 0x428b5
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x7905
movq 0x18(%r15), %rdi
leaq 0x2bea4(%rip), %rsi     # 0x428c1
callq 0x739b
movq 0x18(%r15), %rdi
leaq 0x2bea6(%rip), %rsi     # 0x428d3
movq %r13, %rdx
xorl %eax, %eax
callq 0x7905
movq 0x18(%r15), %rdi
leaq 0x2be9f(%rip), %rsi     # 0x428e1
movq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x7905
leaq -0x70(%rbp), %r13
movq %r13, %rdi
callq 0x7314
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x29fb3(%rip), %rax     # 0x40a1b
cmoveq %rax, %rdx
movq -0x48(%rbp), %r8
testq %r8, %r8
cmoveq %rax, %r8
leaq 0x2a738(%rip), %rsi     # 0x411b6
leaq 0x2a196(%rip), %rcx     # 0x40c1b
movq %r13, %rdi
xorl %eax, %eax
callq 0x7905
movq %r15, %rdi
callq 0x14f0a
leaq -0x60(%rbp), %r12
movq %r12, %rdi
callq 0x7314
movq 0x8(%r13), %rdx
testq %rdx, %rdx
leaq 0x29f6a(%rip), %rax     # 0x40a1b
cmoveq %rax, %rdx
leaq 0x29fbf(%rip), %rsi     # 0x40a7b
leaq 0x2a162(%rip), %rcx     # 0x40c25
movq %r12, %rdi
xorl %eax, %eax
callq 0x7905
movq 0x20(%r15), %rdi
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x29f3b(%rip), %rax     # 0x40a1b
cmoveq %rax, %rdx
movq %r14, %rsi
callq 0x16268
leaq -0x40(%rbp), %rdi
callq 0x7812
movq %r13, %rdi
callq 0x7812
movq %r12, %rdi
callq 0x7812
leaq -0x50(%rbp), %rdi
callq 0x7812
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2bc7e(%rip), %rdi     # 0x427a4
leaq 0x2990b(%rip), %rsi     # 0x40438
leaq 0x2bc0c(%rip), %rcx     # 0x42740
movl $0xea0, %edx            # imm = 0xEA0
callq 0x30a0
leaq 0x2a7c1(%rip), %rdi     # 0x41306
leaq 0x298ec(%rip), %rsi     # 0x40438
leaq 0x2bbed(%rip), %rcx     # 0x42740
movl $0xea1, %edx            # imm = 0xEA1
callq 0x30a0
leaq 0x27805(%rip), %rdi     # 0x3e369
leaq 0x298cd(%rip), %rsi     # 0x40438
leaq 0x2bbce(%rip), %rcx     # 0x42740
movl $0xf24, %edx            # imm = 0xF24
callq 0x30a0
leaq 0x2a36a(%rip), %rdi     # 0x40eed
leaq 0x298ae(%rip), %rsi     # 0x40438
leaq 0x2bbaf(%rip), %rcx     # 0x42740
movl $0xec1, %edx            # imm = 0xEC1
callq 0x30a0
leaq 0x2a35b(%rip), %rdi     # 0x40efd
leaq 0x2988f(%rip), %rsi     # 0x40438
leaq 0x2bb90(%rip), %rcx     # 0x42740
movl $0xec3, %edx            # imm = 0xEC3
callq 0x30a0
leaq 0x277a8(%rip), %rdi     # 0x3e369
leaq 0x29870(%rip), %rsi     # 0x40438
leaq 0x2bb71(%rip), %rcx     # 0x42740
movl $0xeb7, %edx            # imm = 0xEB7
callq 0x30a0
leaq 0x27e50(%rip), %rdi     # 0x3ea30
leaq 0x29851(%rip), %rsi     # 0x40438
leaq 0x2bbc1(%rip), %rcx     # 0x427af
movl $0x54a, %edx            # imm = 0x54A
callq 0x30a0
leaq 0x27e31(%rip), %rdi     # 0x3ea30
leaq 0x29832(%rip), %rsi     # 0x40438
leaq 0x2bc0a(%rip), %rcx     # 0x42817
movl $0x58a, %edx            # imm = 0x58A
callq 0x30a0
leaq 0x2774b(%rip), %rdi     # 0x3e369
leaq 0x29813(%rip), %rsi     # 0x40438
leaq 0x2bb14(%rip), %rcx     # 0x42740
movl $0xf1d, %edx            # imm = 0xF1D
callq 0x30a0