// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: dd_ul_vec_t(ul_idx_t const*, mg_lchain_t*, long, ul_vec_t*, long)
void dd_ul_vec_t(const ul_idx_t *uref, mg_lchain_t *a, int64_t a_n, ul_vec_t *rch, int64_t ulid)
{
	int64_t k, l, ovlp, novlp, tt, rs, re; uint64_t i; uc_block_t *z; mg_lchain_t *p, *c;
	for (l = 0, k = 1; k <= a_n; k++) {
		if(k == a_n || a[k].score != a[l].score) { ///x[k] and x[l] come from the same unitig
			renew_mg_lchains(uref->ug, a + l, k - l, ulid);
			l = k;
		}
	}

	
	for (i = 0; i < rch->bb.n; i++) {
		rch->bb.a[i].pidx = 0xfffffffe;
		rch->bb.a[i].aidx = rch->bb.a[i].pdis = (uint32_t)-1;
	}

	for (k = 0; k < a_n; k++) {
		if(a[k].dist_pre >= 0) {///not a new alignment
			z = &(rch->bb.a[a[k].dist_pre]); 
			assert(z->hid == (a[k].v>>1) && z->rev == (a[k].v&1));
			if((int64_t)z->qs == a[k].qs && (int64_t)z->qe == a[k].qe && (int64_t)z->ts == a[k].rs && (int64_t)z->te == a[k].re) {
				z->pidx = k; z->pchain = 1;
			} else {
				ovlp = novlp = tt = 0;
				ovlp = ((MIN((int64_t)z->qe, a[k].qe) > MAX((int64_t)z->qs, a[k].qs))? (MIN((int64_t)z->qe, a[k].qe)-MAX((int64_t)z->qs, a[k].qs)):0);
				tt += ovlp;
				novlp += (a[k].qe - a[k].qs - ovlp) + (z->qe - z->qs - ovlp);

				ovlp = ((MIN((int64_t)z->te, a[k].re) > MAX((int64_t)z->ts, a[k].rs))? (MIN((int64_t)z->te, a[k].re)-MAX((int64_t)z->ts, a[k].rs)):0);
				tt += ovlp;
				novlp += (a[k].re - a[k].rs - ovlp) + (z->te - z->ts - ovlp);
				if(novlp > 8 || novlp > (tt*0.01)) {
					kv_pushp(uc_block_t, rch->bb, &z); 
					z->hid = (a[k].v>>1); z->rev = (a[k].v&1); 
					z->pchain = 2; z->base = 0; z->el = 1;
					z->qs = a[k].qs; z->qe = a[k].qe;
					z->te = a[k].re; z->ts = a[k].rs;
					z->pidx = k;
					z->aidx = z->pdis = (uint32_t)-1;
				} else {
					z->qs = a[k].qs; z->qe = a[k].qe;
					z->te = a[k].re; z->ts = a[k].rs;
					z->pidx = k; z->pchain = 1;
				}
			}
		} else {
			kv_pushp(uc_block_t, rch->bb, &z); 
			z->hid = (a[k].v>>1); z->rev = (a[k].v&1); 
			z->pchain = 2; z->base = 0; z->el = 1;
			z->qs = a[k].qs; z->qe = a[k].qe;
			z->te = a[k].re; z->ts = a[k].rs;
			z->pidx = k;
			z->aidx = z->pdis = (uint32_t)-1;
		}
	}

	for (i = k = 0; i < rch->bb.n; i++) {
		if(rch->bb.a[i].pidx == 0xfffffffe && (rch->bb.a[i].pchain != 1 || rch->bb.a[i].pchain != 0)) continue;
		rch->bb.a[k++] = rch->bb.a[i];
	}
	rch->bb.n = k;

	radix_sort_uc_block_t_qe_srt(rch->bb.a, rch->bb.a + rch->bb.n);
	for (l = 0, k = 1; k <= (int64_t)rch->bb.n; k++) {
		if(k == (int64_t)rch->bb.n || rch->bb.a[k].qe != rch->bb.a[l].qe) {
			if(k - l > 1) radix_sort_uc_block_t_qs_srt(rch->bb.a+l, rch->bb.a+k);
			for (; l < k; l++) {
				if(rch->bb.a[l].pidx == 0xfffffffe) {
					rch->bb.a[l].pidx = (uint32_t)-1;
				} else {
					a[rch->bb.a[l].pidx].dist_pre = l;
				}
			}
		}
	}

	// for (i = 0; i < rch->bb.n; i++) {
	// 	if(rch->bb.a[i].pidx == 0xfffffffe) {
	// 		rch->bb.a[i].pidx = (uint32_t)-1;
	// 	} else {
	// 		a[rch->bb.a[i].pidx].dist_pre = i;
	// 	}
	// }
	// fprintf(stderr, "\n[M::%s::]\n", __func__);
	for (i = 0, k = -1; i < rch->bb.n; i++) {
		if(rch->bb.a[i].pidx == (uint32_t)-1) continue;
		if(k < 0) k = i;///in case there is only one UL-to-HiFi alignment
		if(a[rch->bb.a[i].pidx].hash_pre == (uint32_t)-1) {
			rch->bb.a[i].pidx = (uint32_t)-1;
			continue;
		}
		c = &(a[rch->bb.a[i].pidx]); p = &(a[a[rch->bb.a[i].pidx].hash_pre]);
		rch->bb.a[i].pidx = a[a[rch->bb.a[i].pidx].hash_pre].dist_pre; 
		rch->bb.a[rch->bb.a[i].pidx].aidx = i;
		tt = g_adjacent_dis_mul(uref->r_ug->rg, NULL, -1, -1, 
			((rch->bb.a[i].hid<<1)|((uint32_t)rch->bb.a[i].rev))^1, 
			((rch->bb.a[rch->bb.a[i].pidx].hid<<1)|((uint32_t)rch->bb.a[rch->bb.a[i].pidx].rev))^1);
		if(tt >= 0) {
			rch->bb.a[i].pdis = tt;
			// get_r_offset(uref->ug, p, NULL, &rs, NULL, NULL);
			// get_r_offset(uref->ug, c, NULL, &re, NULL, NULL);
			// fprintf(stderr, "+i->%lu: dis->%u, record_dis->%ld\n", i, rch->bb.a[i].pdis, re-rs);
		} else {
			rs = p->off + uref->ug->g->seq[p->score>>1].len;
			re = c->off + uref->ug->g->seq[c->score>>1].len;
			if(re >= rs) rch->bb.a[i].pdis = re - rs;
			else rch->bb.a[i].pdis = (uint32_t)-1;
			// fprintf(stderr, "-i->%lu: dis->%u\n", i, rch->bb.a[i].pdis);
		}

		k = i;
		// if(rch->bb.a[i].base || rch->bb.a[i].pchain == 0 || rch->bb.a[i].el == 0) {
		// 	fprintf(stderr, "+++(%lu) base:%u, pchain:%u, el:%u\n", 
		// 	i, rch->bb.a[i].base, rch->bb.a[i].pchain, rch->bb.a[i].el);
		// }
	}

	///make sure if this UL read has been done
	uint32_t sp = (uint32_t)-1, ep = (uint32_t)-1;
	for (l = 0 ; k >= 0; ) {
		// fprintf(stderr, "k->%ld\n", k);
		if(sp == (uint32_t)-1 || rch->bb.a[k].qe <= sp) {
            if(sp != (uint32_t)-1) l += ep - sp;
            sp = rch->bb.a[k].qs; ep = rch->bb.a[k].qe;
        } else {
            sp = MIN(sp, rch->bb.a[k].qs);
        }
		if(rch->bb.a[k].pidx == (uint32_t)-1) k = -1;
		else k = rch->bb.a[k].pidx;
	}

	if(sp != (uint32_t)-1) l += ep - sp;
	if(l == (int64_t)rch->rlen) rch->dd = 1;


	///debug_ssb
	// for (k = 0; (uint32_t)k < rch->bb.n; k++) {
	// 	if(rch->bb.a[k].pidx != (uint32_t)-1) {
	// 		if((rch->bb.a[k].pidx >= 0) && (rch->bb.a[k].pidx < rch->bb.n) && 
	// 					(rch->bb.a[rch->bb.a[k].pidx].aidx == k)) {
	// 			;
	// 		} else {
	// 			fprintf(stderr, "[M::%s::k->%ld] +rch->bb.n::%u\n", __func__, k, (uint32_t)rch->bb.n);
	// 			for (l = 0; (uint32_t)l < rch->bb.n; l++) {
	// 				fprintf(stderr, "[M::%.*s::k->%lu] q::[%u, %u), t::[%u, %u), pidx::%u, aidx::%u\n", 
	// 				(int)Get_NAME_LENGTH(R_INF, rch->bb.a[l].hid), Get_NAME(R_INF, rch->bb.a[l].hid), l, 
	// 				rch->bb.a[l].qs, rch->bb.a[l].qe, rch->bb.a[l].ts, rch->bb.a[l].te, 
	// 				rch->bb.a[l].pidx, rch->bb.a[l].aidx);
	// 			}
	// 			exit(1);
	// 		}
	// 	}

	// 	if(rch->bb.a[k].aidx != (uint32_t)-1) {
	// 		if((rch->bb.a[k].aidx >= 0) && (rch->bb.a[k].aidx < rch->bb.n) && 
	// 					(rch->bb.a[rch->bb.a[k].aidx].pidx == k)) {
	// 			;
	// 		} else {
	// 			fprintf(stderr, "[M::%s::k->%ld] -rch->bb.n::%u\n", __func__, k, (uint32_t)rch->bb.n);
	// 			for (l = 0; (uint32_t)l < rch->bb.n; l++) {
	// 				fprintf(stderr, "[M::%.*s::k->%lu] q::[%u, %u), t::[%u, %u), pidx::%u, aidx::%u\n", 
	// 				(int)Get_NAME_LENGTH(R_INF, rch->bb.a[l].hid), Get_NAME(R_INF, rch->bb.a[l].hid), l, 
	// 				rch->bb.a[l].qs, rch->bb.a[l].qe, rch->bb.a[l].ts, rch->bb.a[l].te, 
	// 				rch->bb.a[l].pidx, rch->bb.a[l].aidx);
	// 			}
	// 			exit(1);
	// 		}
	// 	}
	// }

	// if(ulid == 292) {
	// 	for (i = 0; i < rch->bb.n; i++) {
	// 		fprintf(stderr, "(%lu) qs:%u, qe:%u, ts:%u, te:%u, pidx:%u\n", i, 
	// 		rch->bb.a[i].qs, rch->bb.a[i].qe, rch->bb.a[i].ts, rch->bb.a[i].te, rch->bb.a[i].pidx);
	// 	}
	// }

	// for (i = 0; i < rch->bb.n; i++) {
	// 	if(rch->bb.a[i].pidx == (uint32_t)-1) continue;
	// 	if(rch->bb.a[i].base || rch->bb.a[i].pchain == 0 || rch->bb.a[i].el == 0) {
	// 		fprintf(stderr, "(%lu) base:%u, pchain:%u, el:%u\n", 
	// 		i, rch->bb.a[i].base, rch->bb.a[i].pchain, rch->bb.a[i].el);
	// 	}
	// 	assert((!(rch->bb.a[i].base)) && (rch->bb.a[i].pchain) && (rch->bb.a[i].el));
	// 	assert((!(rch->bb.a[rch->bb.a[i].pidx].base)) && (rch->bb.a[rch->bb.a[i].pidx].pchain) 
	// 														&& (rch->bb.a[rch->bb.a[i].pidx].el));
	// }
	// int64_t exact = 0, inexact = 0; uc_block_t *z;
	// for (k = 0; k < a_n; k++) {
	// 	// fprintf(stderr, "(%ld) a->qs:%d, a->qe:%d, a->rs:%d, a->re:%d\n", k, a[k].qs, a[k].qe, a[k].rs, a[k].re);
	// 	if(a[k].dist_pre < 0) continue;
	// 	z = &(rch->bb.a[a[k].dist_pre]);
	// 	assert(z->hid == (a[k].v>>1) && z->rev == (a[k].v&1));
	// 	if((int64_t)z->qs == a[k].qs && (int64_t)z->qe == a[k].qe && (int64_t)z->ts == a[k].rs && (int64_t)z->te == a[k].re) {
	// 		exact++;
	// 	} else {
	// 		inexact++;
	// 		// fprintf(stderr, "+z->qs:%u, z->qe:%u, z->ts:%u, z->te:%u\n", z->qs, z->qe, z->ts, z->te);
	// 		// fprintf(stderr, "-a->qs:%d, a->qe:%d, a->rs:%d, a->re:%d\n\n", a[k].qs, a[k].qe, a[k].rs, a[k].re);
	// 	}
	// }
	// fprintf(stderr, "[M::%s::exact->%ld, inexact->%ld]\n", __func__, exact, inexact);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq %rdx, (%rsp)
testq %rdx, %rdx
jle 0x1caf56
movq (%rsp), %r15
negq %r15
leaq 0x44(%r14), %r13
movl $0x1, %ebp
xorl %eax, %eax
movq %r15, %rcx
addq %rbp, %rcx
je 0x1caf28
movl (%r13), %ecx
leaq (%rax,%rax,4), %rdx
cmpl 0x1c(%r14,%rdx,8), %ecx
je 0x1caf42
movq (%r12), %rdi
leaq (%rax,%rax,4), %rcx
leaq (%r14,%rcx,8), %rsi
movq %rbp, %rdx
subq %rax, %rdx
callq 0x1caa39
movq %rbp, %rax
leaq (%r15,%rbp), %rcx
incq %rcx
incq %rbp
addq $0x28, %r13
cmpq $0x1, %rcx
jne 0x1caf11
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x1caf7e
movq 0x30(%rbx), %rcx
addq $0x1c, %rcx
movq $-0x2, -0x8(%rcx)
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
addq $0x24, %rcx
decq %rax
jne 0x1caf67
cmpq $0x0, (%rsp)
movq %r12, 0x20(%rsp)
jle 0x1cb1ad
leaq 0x8(%r14), %r13
xorl %ebp, %ebp
movq %rbx, 0x18(%rsp)
movq %r14, 0x10(%rsp)
movslq 0x18(%r13), %rax
testq %rax, %rax
js 0x1cb0e9
movq 0x30(%rbx), %rdi
leaq (%rax,%rax,8), %rax
movl (%r13), %edx
movl %edx, %ecx
shrl %ecx
cmpl %ecx, (%rdi,%rax,4)
jne 0x1cb4c2
leaq (%rdi,%rax,4), %rax
movl 0x20(%rax), %ecx
andl $0x1, %edx
btl $0x5, %ecx
sbbl $0x0, %edx
jne 0x1cb4c2
movl 0x4(%rax), %r8d
movl 0xc(%r13), %r9d
movslq %r9d, %r10
cmpq %r10, %r8
jne 0x1cb01f
movl 0x8(%rax), %edx
movslq 0x10(%r13), %rsi
cmpq %rsi, %rdx
jne 0x1cb01f
movl 0xc(%rax), %edx
movslq 0x4(%r13), %rsi
cmpq %rsi, %rdx
jne 0x1cb01f
movl 0x10(%rax), %edx
movslq 0x8(%r13), %rsi
cmpq %rsi, %rdx
jne 0x1cb01f
movl %ebp, 0x14(%rax)
andb $-0x20, %cl
incb %cl
movb %cl, 0x20(%rax)
jmp 0x1cb175
movl %r9d, 0x8(%rsp)
movl 0x8(%rax), %r9d
movslq 0x10(%r13), %rdx
cmpq %rdx, %r9
movq %rdx, %rsi
cmovlq %r9, %rsi
cmpq %r10, %r8
cmovgq %r8, %r10
subq %r10, %rsi
jg 0x1cb044
xorl %esi, %esi
movl 0xc(%rax), %r14d
movl 0x10(%rax), %r15d
movslq 0x8(%r13), %r12
cmpq %r12, %r15
movq %r12, %r10
cmovlq %r15, %r10
movslq 0x4(%r13), %rbx
cmpq %rbx, %r14
movq %rbx, %r11
cmovgq %r14, %r11
subq %r11, %r10
jg 0x1cb070
xorl %r10d, %r10d
addq %rsi, %r10
movl %edx, %esi
movl 0x8(%rsp), %r11d
subl %r11d, %esi
movslq %esi, %rsi
subl %r8d, %r9d
addq %rsi, %r9
movl %r12d, %esi
subl %ebx, %esi
movslq %esi, %rsi
subl %r14d, %r15d
addq %rsi, %r15
addq %r9, %r15
subq %r10, %r15
subq %r10, %r15
cmpq $0x8, %r15
jg 0x1cb0bf
cvtsi2sd %r15, %xmm0
cvtsi2sd %r10, %xmm1
mulsd 0x63f2b(%rip), %xmm1    # 0x22efe0
ucomisd %xmm1, %xmm0
jbe 0x1cb188
movq 0x18(%rsp), %rbx
movq 0x28(%rbx), %rax
cmpq %rax, 0x20(%rbx)
movq 0x10(%rsp), %r14
jne 0x1cb11c
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq %rcx, 0x28(%rbx)
jmp 0x1cb10b
movq 0x28(%rbx), %rax
cmpq %rax, 0x20(%rbx)
jne 0x1cb11c
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq %rcx, 0x28(%rbx)
movq 0x30(%rbx), %rdi
shlq $0x2, %rcx
leaq (%rcx,%rcx,8), %rsi
callq 0x2370
movq %rax, 0x30(%rbx)
movq 0x20(%rbx), %rax
movq 0x30(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x20(%rbx)
leaq (%rax,%rax,8), %rax
movl (%r13), %edx
movl %edx, %esi
shrl %esi
movl %esi, (%rcx,%rax,4)
shlb $0x5, %dl
andb $0x20, %dl
orb $-0x7e, %dl
movb %dl, 0x20(%rcx,%rax,4)
movl 0xc(%r13), %edx
movl %edx, 0x4(%rcx,%rax,4)
movl 0x10(%r13), %edx
movl %edx, 0x8(%rcx,%rax,4)
movl 0x8(%r13), %edx
movl %edx, 0x10(%rcx,%rax,4)
movl 0x4(%r13), %edx
movl %edx, 0xc(%rcx,%rax,4)
movl %ebp, 0x14(%rcx,%rax,4)
movq $-0x1, 0x18(%rcx,%rax,4)
incq %rbp
addq $0x28, %r13
cmpq %rbp, (%rsp)
jne 0x1caf9e
jmp 0x1cb1ad
movl %r11d, 0x4(%rax)
movl %edx, 0x8(%rax)
movl %r12d, 0x10(%rax)
movl %ebx, 0xc(%rax)
movl %ebp, 0x14(%rax)
andb $-0x20, %cl
incb %cl
movb %cl, 0x20(%rax)
movq 0x18(%rsp), %rbx
movq 0x10(%rsp), %r14
jmp 0x1cb175
cmpq $0x0, 0x20(%rbx)
je 0x1cb1fe
xorl %ecx, %ecx
xorl %eax, %eax
xorl %edx, %edx
movq 0x30(%rbx), %rsi
cmpl $-0x2, 0x14(%rsi,%rcx)
je 0x1cb1ef
leaq (%rsi,%rcx), %rdi
leaq (%rax,%rax,8), %r8
incq %rax
movl 0x20(%rdi), %r9d
movl %r9d, 0x20(%rsi,%r8,4)
movupd (%rdi), %xmm0
movupd 0x10(%rdi), %xmm1
movupd %xmm1, 0x10(%rsi,%r8,4)
movupd %xmm0, (%rsi,%r8,4)
incq %rdx
addq $0x24, %rcx
cmpq 0x20(%rbx), %rdx
jb 0x1cb1ba
jmp 0x1cb200
xorl %eax, %eax
movq %rax, 0x20(%rbx)
movq 0x30(%rbx), %rdi
leaq (%rax,%rax,8), %rax
leaq (%rdi,%rax,4), %rsi
callq 0x1966c5
movq 0x20(%rbx), %rax
testq %rax, %rax
jle 0x1cb2cb
movl $0x1, %r13d
xorl %r12d, %r12d
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
cmpq %rax, %r13
je 0x1cb252
movq 0x30(%rbx), %rax
leaq (,%r13,8), %rcx
addq %r13, %rcx
movl 0x8(%rax,%rcx,4), %ecx
leaq (%r12,%r12,8), %rdx
cmpl 0x8(%rax,%rdx,4), %ecx
je 0x1cb2b7
movq %r13, %rax
subq %r12, %rax
cmpq $0x2, %rax
jl 0x1cb27e
movq 0x30(%rbx), %rax
leaq (%r12,%r12,8), %rcx
leaq (%rax,%rcx,4), %rdi
leaq (,%r13,8), %rcx
addq %r13, %rcx
leaq (%rax,%rcx,4), %rsi
callq 0x196983
cmpq %r12, %r13
jle 0x1cb2b7
movq 0x30(%rbx), %rax
leaq (%r12,%r12,8), %rcx
leaq (%rax,%rcx,4), %rax
addq $0x14, %rax
movl (%rax), %ecx
cmpq %rbp, %rcx
jne 0x1cb2a2
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
jmp 0x1cb2ab
leaq (%rcx,%rcx,4), %rcx
movl %r12d, 0x20(%r14,%rcx,8)
incq %r12
addq $0x24, %rax
cmpq %r12, %r13
jne 0x1cb293
leaq 0x1(%r13), %rcx
movq 0x20(%rbx), %rax
cmpq %rax, %r13
movq %rcx, %r13
jl 0x1cb230
cmpq $0x0, 0x20(%rbx)
je 0x1cb410
movq $-0x1, %rax
movl $0x18, %r12d
xorl %r13d, %r13d
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq 0x20(%rsp), %rbp
movq 0x30(%rbx), %rcx
movl -0x4(%rcx,%r12), %edx
cmpq %rsi, %rdx
je 0x1cb3fd
leaq (%rdx,%rdx,4), %r15
movl 0x24(%r14,%r15,8), %edx
cmpq %rsi, %rdx
je 0x1cb38e
leaq (%rdx,%rdx,4), %rax
movq %rax, 0x8(%rsp)
movl 0x20(%r14,%rax,8), %eax
movl %eax, -0x4(%rcx,%r12)
leaq (%rax,%rax,8), %rax
movl %r13d, 0x1c(%rcx,%rax,4)
movq 0x28(%rbp), %rax
movq 0x20(%rax), %rdi
movl 0x8(%rcx,%r12), %eax
shrl $0x5, %eax
andl $0x1, %eax
movl -0x18(%rcx,%r12), %edx
movl -0x4(%rcx,%r12), %esi
leal (%rax,%rdx,2), %r8d
xorl $0x1, %r8d
leaq (%rsi,%rsi,8), %rax
movl (%rcx,%rax,4), %edx
movl 0x20(%rcx,%rax,4), %eax
shrl $0x5, %eax
andl $0x1, %eax
leal (%rax,%rdx,2), %r9d
xorl $0x1, %r9d
xorl %esi, %esi
movq $-0x1, %rdx
movq $-0x1, %rcx
callq 0x1cad23
testq %rax, %rax
js 0x1cb3a0
movq 0x30(%rbx), %rcx
movl %eax, (%rcx,%r12)
jmp 0x1cb3f5
testq %rax, %rax
cmovsq %r13, %rax
movl $0xffffffff, -0x4(%rcx,%r12) # imm = 0xFFFFFFFF
jmp 0x1cb3fd
leaq (%r14,%r15,8), %rcx
movq 0x8(%rsp), %rax
leaq (%r14,%rax,8), %rax
movq (%rbp), %rdx
movq 0x18(%rdx), %rdx
movq 0x20(%rdx), %rdx
movl 0x1c(%rax), %esi
sarl %esi
movslq %esi, %rsi
movl (%rdx,%rsi,8), %esi
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %esi
addl (%rax), %esi
movl 0x1c(%rcx), %eax
sarl %eax
cltq
movl (%rdx,%rax,8), %eax
andl %edi, %eax
addl (%rcx), %eax
subl %esi, %eax
jge 0x1cb3ed
movq 0x30(%rbx), %rax
movl $0xffffffff, (%rax,%r12) # imm = 0xFFFFFFFF
jmp 0x1cb3f5
movq 0x30(%rbx), %rcx
movl %eax, (%rcx,%r12)
movq %r13, %rax
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
incq %r13
addq $0x24, %r12
cmpq 0x20(%rbx), %r13
jb 0x1cb2f0
jmp 0x1cb417
movq $-0x1, %rax
xorl %ecx, %ecx
testq %rax, %rax
js 0x1cb48d
movq 0x30(%rbx), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movq $-0x1, %r9
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
cmpl $-0x1, %r10d
je 0x1cb468
movq 0x30(%rbx), %r11
leaq (%rax,%rax,8), %r14
cmpl %r10d, 0x8(%r11,%r14,4)
jbe 0x1cb462
leaq (%r11,%r14,4), %r11
movl 0x4(%r11), %r11d
cmpl %r11d, %r10d
cmovael %r11d, %r10d
jmp 0x1cb47a
subl %r10d, %esi
addq %rsi, %rdx
movq 0x30(%rbx), %rsi
leaq (%rax,%rax,8), %r11
movl 0x4(%rsi,%r11,4), %r10d
movl 0x8(%rsi,%r11,4), %esi
leaq (%rax,%rax,8), %rax
movl 0x14(%rdi,%rax,4), %eax
cmpq %r8, %rax
cmoveq %r9, %rax
jne 0x1cb43c
jmp 0x1cb49a
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
xorl %edx, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
subl %r10d, %esi
cmpl $-0x1, %r10d
cmovel %ecx, %esi
addq %rdx, %rsi
movl 0x18(%rbx), %eax
cmpq %rax, %rsi
jne 0x1cb4b3
movb $0x1, 0x50(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6b926(%rip), %rdi     # 0x236def
leaq 0x684bb(%rip), %rsi     # 0x23398b
leaq 0x6b946(%rip), %rcx     # 0x236e1d
movl $0x3dd7, %edx           # imm = 0x3DD7
callq 0x2110