// File: /workspace/github_c_makefile_star2_O2/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 0x12e1f
testq %rdx, %rdx
je 0x12e3e
movq %rcx, %r15
cmpl $0x3, (%rcx)
jne 0x12e5d
movq %rdi, %r12
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x12e7c
movq %rdx, -0x30(%rbp)
movq 0x58(%rax), %rax
testq %rax, %rax
je 0x12e9b
movq %rsi, %r14
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movl 0x4(%rax), %edx
leaq -0x70(%rbp), %rbx
movq %rbx, %rdi
callq 0x6fa2
movq 0x8(%r15), %rax
movq 0x8(%rax), %rsi
movl 0x4(%rax), %edx
leaq -0x40(%rbp), %rdi
movq %rdi, %r13
callq 0x6fa2
leaq -0x60(%rbp), %r15
movq %r15, %rdi
callq 0x6e1c
movq 0x8(%r13), %rdx
testq %rdx, %rdx
leaq 0x2acb2(%rip), %r13     # 0x3da2b
cmoveq %r13, %rdx
movq 0x8(%rbx), %r8
testq %r8, %r8
cmoveq %r13, %r8
leaq 0x2b426(%rip), %rsi     # 0x3e1b5
leaq 0x2ae95(%rip), %rcx     # 0x3dc2b
movq %r15, %rdi
xorl %eax, %eax
callq 0x739a
movq %r12, %rdi
callq 0x13558
leaq -0x50(%rbp), %r12
movq %r12, %rdi
callq 0x6e1c
movq 0x8(%r15), %rdx
testq %rdx, %rdx
cmoveq %r13, %rdx
leaq 0x2acc5(%rip), %rsi     # 0x3da8b
leaq 0x2ae68(%rip), %rcx     # 0x3dc35
movq %r12, %rdi
xorl %eax, %eax
callq 0x739a
movq 0x8(%r12), %rdx
testq %rdx, %rdx
cmoveq %r13, %rdx
movq %r14, %rdi
movq -0x30(%rbp), %rsi
callq 0x1379b
movq %rbx, %rdi
callq 0x72b9
leaq -0x40(%rbp), %rdi
callq 0x72b9
movq %r15, %rdi
callq 0x72b9
movq %r12, %rdi
callq 0x72b9
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28c0a(%rip), %rdi     # 0x3ba30
leaq 0x2a61b(%rip), %rsi     # 0x3d448
leaq 0x2b2fe(%rip), %rcx     # 0x3e132
movl $0x375, %edx            # imm = 0x375
callq 0x30a0
leaq 0x32c6c(%rip), %rdi     # 0x45ab1
leaq 0x2a5fc(%rip), %rsi     # 0x3d448
leaq 0x2b2df(%rip), %rcx     # 0x3e132
movl $0x376, %edx            # imm = 0x376
callq 0x30a0
leaq 0x2b335(%rip), %rdi     # 0x3e199
leaq 0x2a5dd(%rip), %rsi     # 0x3d448
leaq 0x2b2c0(%rip), %rcx     # 0x3e132
movl $0x378, %edx            # imm = 0x378
callq 0x30a0
leaq 0x2b069(%rip), %rdi     # 0x3deec
leaq 0x2a5be(%rip), %rsi     # 0x3d448
leaq 0x2b2a1(%rip), %rcx     # 0x3e132
movl $0x37b, %edx            # imm = 0x37B
callq 0x30a0
leaq 0x2b05a(%rip), %rdi     # 0x3defc
leaq 0x2a59f(%rip), %rsi     # 0x3d448
leaq 0x2b282(%rip), %rcx     # 0x3e132
movl $0x37d, %edx            # imm = 0x37D
callq 0x30a0