// File: chhylp123[P]hifiasm/inter.cpp
// Function: gen_hpc_re_t(ma_ug_t*)
hpc_re_t *gen_hpc_re_t(ma_ug_t *ug)
{
	uint64_t k; asg64_v buf; kv_init(buf); 
	hpc_re_t *p = NULL; CALLOC(p, 1);
	kvec_t(char) cc; kv_init(cc);
	p->idx_n = ug->u.n; CALLOC(p->idx, p->idx_n);

	for (k = 0; k < ug->u.n; k++) {
		kv_resize(char, cc, ug->u.a[k].len);
		retrieve_u_seq(NULL, cc.a, &(ug->u.a[k]), 0, 0, ug->u.a[k].len, NULL);
		// fprintf(stderr, "\nutg%.6lu%c\tlen::%u\n", k + 1, "lc"[ug->u.a[k].circ], ug->u.a[k].len);
		extract_microsatellite(cc.a, ug->u.a[k].len, p, &buf, 8, 8, 5, 1, &(p->idx[k]));
		// fprintf(stderr, "utg%.6lu%c\t#::%u\tlen::%u\n", k + 1, "lc"[ug->u.a[k].circ], p->idx[k].e-p->idx[k].s, ug->u.a[k].len);
	}

	kv_destroy(cc); kv_destroy(buf); 
	return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x30(%rbp)
movl $0x1, %edi
movl $0x28, %esi
callq 0x2140
movq %rax, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rdi
movl $0x8, %esi
callq 0x2140
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x308b91
jmp 0x308a1e
movq -0x40(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, -0x10(%rbp), %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x308ade
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq $0x2, %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq $0x4, %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq $0x8, %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq $0x10, %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, -0x38(%rbp)
jmp 0x308ae0
movq -0x38(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
imulq $0x28, -0x10(%rbp), %rax
addq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %r9d
xorl %eax, %eax
movl %eax, %r8d
xorl %ecx, %ecx
movq %r8, %rdi
movq $0x0, (%rsp)
callq 0x10980
movq -0x38(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq -0x30(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
leaq -0x28(%rbp), %rcx
movl $0x8, %r9d
movl %r9d, %r8d
movl $0x5, (%rsp)
movl $0x1, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x307c30
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x308a0b
movq -0x38(%rbp), %rdi
callq 0x2210
movq -0x18(%rbp), %rdi
callq 0x2210
movq -0x30(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)