// File: /workspace/github_c_makefile_star2_O3/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 0x147e9
testq %rdx, %rdx
je 0x14808
movq %rcx, %r12
cmpl $0x3, (%rcx)
jne 0x14827
movq %rdi, %r15
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x14846
movq %rdx, -0x30(%rbp)
movq 0x58(%rax), %rax
testq %rax, %rax
je 0x14865
movq %rsi, %r14
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movl 0x4(%rax), %edx
leaq -0x70(%rbp), %rbx
movq %rbx, %rdi
callq 0x74bc
movq 0x8(%r12), %rax
movq 0x8(%rax), %rsi
movl 0x4(%rax), %edx
leaq -0x40(%rbp), %rdi
movq %rdi, %r12
callq 0x74bc
leaq -0x60(%rbp), %r13
movq %r13, %rdi
callq 0x7314
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x2c2e7(%rip), %r12     # 0x40a1b
cmoveq %r12, %rdx
movq 0x8(%rbx), %r8
testq %r8, %r8
cmoveq %r12, %r8
leaq 0x2ca6c(%rip), %rsi     # 0x411b6
leaq 0x2c4ca(%rip), %rcx     # 0x40c1b
movq %r13, %rdi
xorl %eax, %eax
callq 0x7905
movq %r15, %rdi
callq 0x14f0a
leaq -0x50(%rbp), %r15
movq %r15, %rdi
callq 0x7314
movq 0x8(%r13), %rdx
testq %rdx, %rdx
cmoveq %r12, %rdx
leaq 0x2c2fa(%rip), %rsi     # 0x40a7b
leaq 0x2c49d(%rip), %rcx     # 0x40c25
movq %r15, %rdi
xorl %eax, %eax
callq 0x7905
movq 0x8(%r15), %rcx
testq %rcx, %rcx
cmoveq %r12, %rcx
leaq 0x2c823(%rip), %rsi     # 0x40fc7
leaq 0x2ca75(%rip), %rdx     # 0x41220
movq %r14, %rdi
movq -0x30(%rbp), %r8
xorl %eax, %eax
callq 0x7905
movq %rbx, %rdi
callq 0x7812
leaq -0x40(%rbp), %rdi
callq 0x7812
movq %r13, %rdi
callq 0x7812
movq %r15, %rdi
callq 0x7812
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2a240(%rip), %rdi     # 0x3ea30
leaq 0x2bc41(%rip), %rsi     # 0x40438
leaq 0x2c935(%rip), %rcx     # 0x41133
movl $0x375, %edx            # imm = 0x375
callq 0x30a0
leaq 0x34272(%rip), %rdi     # 0x48a81
leaq 0x2bc22(%rip), %rsi     # 0x40438
leaq 0x2c916(%rip), %rcx     # 0x41133
movl $0x376, %edx            # imm = 0x376
callq 0x30a0
leaq 0x2c96c(%rip), %rdi     # 0x4119a
leaq 0x2bc03(%rip), %rsi     # 0x40438
leaq 0x2c8f7(%rip), %rcx     # 0x41133
movl $0x378, %edx            # imm = 0x378
callq 0x30a0
leaq 0x2c6a0(%rip), %rdi     # 0x40eed
leaq 0x2bbe4(%rip), %rsi     # 0x40438
leaq 0x2c8d8(%rip), %rcx     # 0x41133
movl $0x37b, %edx            # imm = 0x37B
callq 0x30a0
leaq 0x2c691(%rip), %rdi     # 0x40efd
leaq 0x2bbc5(%rip), %rsi     # 0x40438
leaq 0x2c8b9(%rip), %rcx     # 0x41133
movl $0x37d, %edx            # imm = 0x37D
callq 0x30a0