// File: /workspace/github_c_makefile_star2_O0/rikuu[P]kermit/kermit-color.c
// Function: km_align_reference
km_multicolor_t *km_align_reference(km_idx_t *idx, size_t n_reads, int unicolor)
{
	km_multicolor_t *colors = (km_multicolor_t*) calloc(n_reads, sizeof(km_multicolor_t));
	for (size_t i = 0; i < idx->d->n_seq; i++) {
		km_target_t *target = &idx->targets[i];
		for (size_t j = 0; j < target->n_bins; j++) {
			const uint64_t color = unicolor ? (i << 16) : (i << 16 | (j + 1));
			for (size_t k = 0; k < target->bins[j].n; k++) {
				int32_t id = target->bins[j].a[k].qn;
				if (id == -1 || id >= (int32_t) n_reads || (colors[id].n > 0 && colors[id].a[colors[id].n - 1] == color)) continue;
				kv_push(uint64_t, colors[id], color);
			}
		}
	}
	color_stats(colors, n_reads);
	return colors;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl $0x18, %esi
callq 0x10c0
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl (%rcx), %ecx
cmpq %rcx, %rax
jae 0xe033
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x28(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movl (%rcx), %ecx
cmpq %rcx, %rax
jae 0xe020
cmpl $0x0, -0x14(%rbp)
je 0xde3a
movq -0x28(%rbp), %rax
shlq $0x10, %rax
movq %rax, -0x58(%rbp)
jmp 0xde51
movq -0x28(%rbp), %rax
shlq $0x10, %rax
movq -0x38(%rbp), %rcx
addq $0x1, %rcx
orq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
imulq $0x18, -0x38(%rbp), %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0xe00d
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
imulq $0xc, -0x48(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
cmpl $-0x1, -0x4c(%rbp)
je 0xdef8
movl -0x4c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl %ecx, %eax
jge 0xdef8
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
jbe 0xdefd
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movslq -0x4c(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x40(%rbp), %rax
jne 0xdefd
jmp 0xdffc
jmp 0xdeff
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movslq -0x4c(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jne 0xdfc3
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0xdf5c
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x60(%rbp)
jmp 0xdf67
movl $0x2, %eax
movq %rax, -0x60(%rbp)
jmp 0xdf67
movq -0x60(%rbp), %rcx
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x1150
movq %rax, %rcx
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rdx
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rsi
movslq -0x4c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0xdffc
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0xde61
jmp 0xe00f
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xde13
jmp 0xe022
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xdddd
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xdca0
movq -0x20(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)