// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/index.c
// Function: sort_jjump
static void sort_jjump(mm_idx_jjump_t *jj2)
{
	int32_t j0, j, k;
	if (jj2 == 0 || jj2->n == 0) return;
	radix_sort_jj(jj2->a, jj2->a + jj2->n);
	for (j0 = 0, j = 1; j <= jj2->n; ++j) {
		if (j == jj2->n || jj2->a[j0].off != jj2->a[j].off) {
			radix_sort_jj2(jj2->a + j0, jj2->a + j);
			j0 = j;
		}
	}
	// the actual merge
	for (j0 = 0, j = 1, k = 0; j <= jj2->n; ++j) {
		if (j == jj2->n || jj2->a[j0].off != jj2->a[j].off || jj2->a[j0].off2 != jj2->a[j].off2) {
			int32_t t, cnt = 0;
			uint16_t flag = 0;
			for (t = j0; t < j; ++t) cnt += jj2->a[t].cnt, flag |= jj2->a[t].flag;
			jj2->a[k] = jj2->a[j0];
			jj2->a[k].cnt = cnt;
			jj2->a[k++].flag = flag;
			j0 = j;
		}
	}
	jj2->n = k;
	jj2->a = REALLOC(mm_idx_jjump1_t, jj2->a, k);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xed9c
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xeda1
jmp 0xeff3
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
movslq (%rax), %rax
shlq $0x4, %rax
addq %rax, %rsi
callq 0xc760
movl $0x0, -0xc(%rbp)
movl $0x1, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jg 0xee52
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
je 0xee14
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
je 0xee45
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0xc(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movslq -0x10(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
callq 0xcc60
movl -0x10(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0xee47
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xedd2
movl $0x0, -0xc(%rbp)
movl $0x1, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jg 0xefca
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
je 0xeedf
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0xeedf
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
je 0xefba
movl $0x0, -0x1c(%rbp)
movw $0x0, -0x1e(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0xef42
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x18(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x18(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0xe(%rax), %ecx
movzwl -0x1e(%rbp), %eax
orl %ecx, %eax
movw %ax, -0x1e(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xeef2
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0xc(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movw -0x1e(%rbp), %cx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x14(%rbp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movw %cx, 0xe(%rax)
movl -0x10(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0xefbc
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xee67
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0x14(%rbp), %rsi
shlq $0x4, %rsi
callq 0x2310
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)