// File: /workspace/github_c_makefile_star2_O0/lh3[P]partig/pdist.c
// Function: pt_collect_anchors
static pt128_t *pt_collect_anchors(const gfa_t *g, uint32_t n_mz, const pt_mz1_t *mz, int32_t max_occ, int64_t *n_a_, pt_uinfo_t *info)
{
	uint32_t st, j;
	int64_t m_a = 0, n_a = 0;
	pt128_t *a = 0;
	for (j = 1, st = 0; j <= n_mz; ++j) {
		if (j == n_mz || mz[j].x != mz[st].x) {
			uint32_t k, l;
			if (j - st == 1) ++info[mz[st].rid].cnt1;
			if (j - st == 1 || j - st > max_occ) goto end_anchor;
			for (k = st; k < j; ++k) {
				++info[mz[k].rid].cnt2;
				for (l = k + 1; l < j; ++l) {
					uint32_t span, rev = (mz[k].rev != mz[l].rev);
					int32_t lk = g->seg[mz[k].rid].len, ll = g->seg[mz[l].rid].len;
					if (n_a == m_a) PT_EXPAND(a, m_a);
					span = mz[l].span;
					a[n_a].x = (uint64_t)mz[k].rid << 33 | mz[l].rid << 1 | rev;
					a[n_a++].y = (uint64_t)mz[k].pos << 32 | (rev? ll - (mz[l].pos + 1 - span) - 1 : mz[l].pos);
					if (n_a == m_a) PT_EXPAND(a, m_a);
					span = mz[k].span;
					a[n_a].x = (uint64_t)mz[l].rid << 33 | mz[k].rid << 1 | rev;
					a[n_a++].y = (uint64_t)mz[l].pos << 32 | (rev? lk - (mz[k].pos + 1 - span) - 1 : mz[k].pos);
				}
			}
end_anchor:	st = j;
		}
	}
	if (pt_verbose >= 3)
		fprintf(stderr, "[%s::%.3f] collected %ld anchors\n", __func__, pt_realtime(), (long)n_a);
	radix_sort_pt128x(a, a + n_a);
	if (pt_verbose >= 3)
		fprintf(stderr, "[%s::%.3f] sorted %ld anchors\n", __func__, pt_realtime(), (long)n_a);
	*n_a_ = n_a;
	return a;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movl $0x1, -0x38(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x38(%rbp), %eax
cmpl -0xc(%rbp), %eax
ja 0xadf9
movl -0x38(%rbp), %eax
cmpl -0xc(%rbp), %eax
je 0xa9b3
movq -0x18(%rbp), %rax
movl -0x38(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movl -0x34(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
je 0xade9
movl -0x38(%rbp), %eax
subl -0x34(%rbp), %eax
cmpl $0x1, %eax
jne 0xa9e6
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movl -0x34(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
andq $0xfffffff, %rcx        # imm = 0xFFFFFFF
movl 0x4(%rax,%rcx,8), %edx
addl $0x1, %edx
movl %edx, 0x4(%rax,%rcx,8)
movl -0x38(%rbp), %eax
subl -0x34(%rbp), %eax
cmpl $0x1, %eax
je 0xa9fc
movl -0x38(%rbp), %eax
subl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jbe 0xaa01
jmp 0xade3
movl -0x34(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x38(%rbp), %eax
jae 0xade1
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movl -0x54(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
andq $0xfffffff, %rcx        # imm = 0xFFFFFFF
movl (%rax,%rcx,8), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,8)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x38(%rbp), %eax
jae 0xadd1
movq -0x18(%rbp), %rax
movl -0x54(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x37, %rax
andq $0x1, %rax
movq -0x18(%rbp), %rcx
movl -0x58(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
shrq $0x37, %rcx
andq $0x1, %rcx
cmpl %ecx, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movl -0x54(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
andq $0xfffffff, %rcx        # imm = 0xFFFFFFF
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movl -0x58(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
andq $0xfffffff, %rcx        # imm = 0xFFFFFFF
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0xab3a
jmp 0xaaf5
cmpq $0x0, -0x40(%rbp)
je 0xab10
movq -0x40(%rbp), %rax
movq -0x40(%rbp), %rcx
sarq %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
jmp 0xab1b
movl $0x10, %eax
movq %rax, -0x70(%rbp)
jmp 0xab1b
movq -0x70(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rsi
shlq $0x4, %rsi
callq 0x11b0
movq %rax, -0x50(%rbp)
jmp 0xab3a
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x38, %rax
movl %eax, -0x5c(%rbp)
movq -0x18(%rbp), %rax
movl -0x54(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
andq $0xfffffff, %rcx        # imm = 0xFFFFFFF
shlq $0x21, %rcx
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movq 0x8(%rax), %rax
andq $0xfffffff, %rax        # imm = 0xFFFFFFF
shll %eax
cltq
orq %rax, %rcx
movl -0x60(%rbp), %eax
orq %rax, %rcx
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movl -0x54(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x1c, %rax
andq $0x7ffffff, %rax        # imm = 0x7FFFFFF
shlq $0x20, %rax
movq %rax, -0x78(%rbp)
cmpl $0x0, -0x60(%rbp)
je 0xac01
movl -0x68(%rbp), %eax
movq -0x18(%rbp), %rcx
movl -0x58(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
shrq $0x1c, %rcx
andq $0x7ffffff, %rcx        # imm = 0x7FFFFFF
addl $0x1, %ecx
subl -0x5c(%rbp), %ecx
subl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0xac20
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x1c, %rax
andq $0x7ffffff, %rax        # imm = 0x7FFFFFF
movl %eax, -0x7c(%rbp)
movq -0x78(%rbp), %rcx
movl -0x7c(%rbp), %eax
movl %eax, %eax
orq %rax, %rcx
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rdx
movq %rdx, %rsi
addq $0x1, %rsi
movq %rsi, -0x48(%rbp)
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0xaca4
jmp 0xac56
cmpq $0x0, -0x40(%rbp)
je 0xac74
movq -0x40(%rbp), %rax
movq -0x40(%rbp), %rcx
sarq %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
jmp 0xac82
movl $0x10, %eax
movq %rax, -0x88(%rbp)
jmp 0xac82
movq -0x88(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rsi
shlq $0x4, %rsi
callq 0x11b0
movq %rax, -0x50(%rbp)
jmp 0xaca4
movq -0x18(%rbp), %rax
movl -0x54(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x38, %rax
movl %eax, -0x5c(%rbp)
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
andq $0xfffffff, %rcx        # imm = 0xFFFFFFF
shlq $0x21, %rcx
movq -0x18(%rbp), %rax
movl -0x54(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movq 0x8(%rax), %rax
andq $0xfffffff, %rax        # imm = 0xFFFFFFF
shll %eax
cltq
orq %rax, %rcx
movl -0x60(%rbp), %eax
orq %rax, %rcx
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x1c, %rax
andq $0x7ffffff, %rax        # imm = 0x7FFFFFF
shlq $0x20, %rax
movq %rax, -0x90(%rbp)
cmpl $0x0, -0x60(%rbp)
je 0xad71
movl -0x64(%rbp), %eax
movq -0x18(%rbp), %rcx
movl -0x54(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
shrq $0x1c, %rcx
andq $0x7ffffff, %rcx        # imm = 0x7FFFFFF
addl $0x1, %ecx
subl -0x5c(%rbp), %ecx
subl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0xad93
movq -0x18(%rbp), %rax
movl -0x54(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x1c, %rax
andq $0x7ffffff, %rax        # imm = 0x7FFFFFF
movl %eax, -0x94(%rbp)
movq -0x90(%rbp), %rcx
movl -0x94(%rbp), %eax
movl %eax, %eax
orq %rax, %rcx
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rdx
movq %rdx, %rsi
addq $0x1, %rsi
movq %rsi, -0x48(%rbp)
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xaa42
jmp 0xadd3
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xaa07
jmp 0xade3
movl -0x38(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0xadeb
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xa977
leaq 0x5438(%rip), %rax      # 0x10238
cmpl $0x3, (%rax)
jb 0xae3b
movq 0x51ec(%rip), %rax      # 0xfff8
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
callq 0x8c60
movq -0xa0(%rbp), %rdi
movq -0x48(%rbp), %rcx
leaq 0x294f(%rip), %rsi      # 0xd77c
leaq 0x296a(%rip), %rdx      # 0xd79e
movb $0x1, %al
callq 0x1170
movq -0x50(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
callq 0x8b70
leaq 0x53de(%rip), %rax      # 0x10238
cmpl $0x3, (%rax)
jb 0xae95
movq 0x5192(%rip), %rax      # 0xfff8
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
callq 0x8c60
movq -0xa8(%rbp), %rdi
movq -0x48(%rbp), %rcx
leaq 0x292a(%rip), %rsi      # 0xd7b1
leaq 0x2910(%rip), %rdx      # 0xd79e
movb $0x1, %al
callq 0x1170
movq -0x48(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x50(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)