// File: /workspace/github_c_makefile_star2_O1/Ihsoh[P]ilang/compiler/backend/asmgen_gas32.c
// Function: asm_inst_mov_x_fsym
static void _asm_inst_mov_x_fsym(
	ASMGeneratorGas32Context *ctx,
	ResizableString *rstr,
	const char *target,
	ParserSymbol *source
) {
	assert(ctx);
	assert(rstr);
	assert(target);
	assert(source);
	assert(source->type == BE_SYM_FUNC);

	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
	);

	ResizableString rstr_func_name;
	rstr_init_with_raw(
		&rstr_func_name,
		source->token->content,
		source->token->len
	);

	ResizableString rstr_disp;
	rstr_init(&rstr_disp);
	rstr_appendf(
		&rstr_disp,
		"%s-%s%s",
		RSTR_CSTR(&rstr_func_name),
		_ASM_IP_LABEL_PREFIX,
		RSTR_CSTR(&rstr_cur_func_name)
	);

	_asm_get_ip(ctx);

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

	_asm_inst_lea_x_x(
		ctx,
		rstr,
		target,
		RSTR_CSTR(&rstr_source)
	);

	rstr_free(&rstr_cur_func_name);
	rstr_free(&rstr_func_name);
	rstr_free(&rstr_disp);
	rstr_free(&rstr_source);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
testq %rsi, %rsi
je 0x14aff
testq %rdx, %rdx
je 0x14b1e
movq %rcx, %r12
cmpl $0x3, (%rcx)
jne 0x14b3d
movq %rdi, %r15
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x14b5c
movq %rdx, -0x30(%rbp)
movq 0x58(%rax), %rax
testq %rax, %rax
je 0x14b7b
movq %rsi, %r14
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movl 0x4(%rax), %edx
leaq -0x70(%rbp), %rbx
movq %rbx, %rdi
callq 0x76ad
movq 0x8(%r12), %rax
movq 0x8(%rax), %rsi
movl 0x4(%rax), %edx
leaq -0x40(%rbp), %rdi
movq %rdi, %r12
callq 0x76ad
leaq -0x60(%rbp), %r13
movq %r13, %rdi
callq 0x7508
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x2e011(%rip), %r12     # 0x42a5b
cmoveq %r12, %rdx
movq 0x8(%rbx), %r8
testq %r8, %r8
cmoveq %r12, %r8
leaq 0x2e796(%rip), %rsi     # 0x431f6
leaq 0x2e1f4(%rip), %rcx     # 0x42c5b
movq %r13, %rdi
xorl %eax, %eax
callq 0x7af1
movq %r15, %rdi
callq 0x151f1
leaq -0x50(%rbp), %r15
movq %r15, %rdi
callq 0x7508
movq 0x8(%r13), %rdx
testq %rdx, %rdx
cmoveq %r12, %rdx
leaq 0x2e024(%rip), %rsi     # 0x42abb
leaq 0x2e1c7(%rip), %rcx     # 0x42c65
movq %r15, %rdi
xorl %eax, %eax
callq 0x7af1
movq 0x8(%r15), %rcx
testq %rcx, %rcx
cmoveq %r12, %rcx
leaq 0x2e54d(%rip), %rsi     # 0x43007
leaq 0x2e79f(%rip), %rdx     # 0x43260
movq %r14, %rdi
movq -0x30(%rbp), %r8
xorl %eax, %eax
callq 0x7af1
movq %rbx, %rdi
callq 0x79f8
leaq -0x40(%rbp), %rdi
callq 0x79f8
movq %r13, %rdi
callq 0x79f8
movq %r15, %rdi
callq 0x79f8
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2bf4a(%rip), %rdi     # 0x40a50
leaq 0x2d96b(%rip), %rsi     # 0x42478
leaq 0x2e65f(%rip), %rcx     # 0x43173
movl $0x375, %edx            # imm = 0x375
callq 0x30a0
leaq 0x35f9c(%rip), %rdi     # 0x4aac1
leaq 0x2d94c(%rip), %rsi     # 0x42478
leaq 0x2e640(%rip), %rcx     # 0x43173
movl $0x376, %edx            # imm = 0x376
callq 0x30a0
leaq 0x2e696(%rip), %rdi     # 0x431da
leaq 0x2d92d(%rip), %rsi     # 0x42478
leaq 0x2e621(%rip), %rcx     # 0x43173
movl $0x378, %edx            # imm = 0x378
callq 0x30a0
leaq 0x2e3ca(%rip), %rdi     # 0x42f2d
leaq 0x2d90e(%rip), %rsi     # 0x42478
leaq 0x2e602(%rip), %rcx     # 0x43173
movl $0x37b, %edx            # imm = 0x37B
callq 0x30a0
leaq 0x2e3bb(%rip), %rdi     # 0x42f3d
leaq 0x2d8ef(%rip), %rsi     # 0x42478
leaq 0x2e5e3(%rip), %rcx     # 0x43173
movl $0x37d, %edx            # imm = 0x37D
callq 0x30a0