// File: /workspace/github_cpp_makefile_star2_O2/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 $0x38, %rsp
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
xorl %eax, %eax
testq %rdx, %rdx
movl $0x0, %r15d
cmovgq %rdx, %r15
movq %r15, 0x30(%rsp)
negq %r15
leaq 0x44(%rsi), %r13
pushq $0x1
popq %rbp
movq %rdi, 0x10(%rsp)
leaq (%r15,%rbp), %rcx
cmpq $0x1, %rcx
je 0x1885eb
cmpq %rbp, %r12
je 0x1885c5
movl (%r13), %ecx
imulq $0x28, %rax, %rdx
cmpl 0x1c(%r14,%rdx), %ecx
movq 0x10(%rsp), %rdi
je 0x1885e2
movq (%rdi), %rdi
imulq $0x28, %rax, %rsi
addq %r14, %rsi
movq %rbp, %rdx
subq %rax, %rdx
callq 0x1881d2
movq 0x10(%rsp), %rdi
movq %rbp, %rax
incq %rbp
addq $0x28, %r13
jmp 0x1885a2
movq 0x20(%rbx), %rax
pushq $0x1c
popq %rcx
subq $0x1, %rax
jb 0x18860f
movq 0x30(%rbx), %rdx
movq $-0x2, -0x8(%rdx,%rcx)
orl $-0x1, (%rdx,%rcx)
addq $0x24, %rcx
jmp 0x1885f2
leaq 0x8(%r14), %r12
xorl %r13d, %r13d
movq %r14, 0x18(%rsp)
cmpq %r13, 0x30(%rsp)
je 0x1888a1
movslq 0x18(%r12), %rcx
testq %rcx, %rcx
js 0x1886cd
movq 0x30(%rbx), %rax
imulq $0x24, %rcx, %rsi
movl (%r12), %ecx
movl %ecx, %edx
shrl %edx
cmpl %edx, (%rax,%rsi)
jne 0x188b3b
addq %rax, %rsi
movl 0x20(%rsi), %ebp
movl %ecx, %edi
andl $0x1, %edi
btl $0x5, %ebp
sbbl $0x0, %edi
jne 0x188b3b
movl 0x4(%rsi), %r11d
movl 0x8(%rsi), %r10d
movl 0xc(%r12), %edi
movl %edi, 0xc(%rsp)
movslq %edi, %r8
cmpq %r8, %r11
jne 0x188747
movl 0x10(%r12), %edi
movl %edi, 0x8(%rsp)
movslq %edi, %r15
cmpq %r15, %r10
jne 0x188753
movl 0xc(%rsi), %edi
movslq 0x4(%r12), %r9
cmpq %r9, %rdi
jne 0x188753
movl 0x10(%rsi), %edi
movslq 0x8(%r12), %r9
cmpq %r9, %rdi
jne 0x188753
movl %r13d, 0x14(%rsi)
andb $-0x20, %bpl
incb %bpl
movb %bpl, 0x20(%rsi)
jmp 0x188895
movq 0x20(%rbx), %rcx
movq 0x30(%rbx), %rax
cmpq 0x28(%rbx), %rcx
jne 0x188701
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rdx
movq %rdx, 0x28(%rbx)
imulq $0x24, %rdx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x30(%rbx)
movq 0x20(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%rbx)
imulq $0x24, %rcx, %rcx
movl (%r12), %edx
movl %edx, %esi
shrl %esi
movl %esi, (%rax,%rcx)
shlb $0x5, %dl
andb $0x20, %dl
orb $-0x7e, %dl
movb %dl, 0x20(%rax,%rcx)
movdqu 0x4(%r12), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x4(%rax,%rcx)
movl %r13d, 0x14(%rax,%rcx)
orq $-0x1, 0x18(%rax,%rcx)
jmp 0x188895
movl 0x10(%r12), %edi
movl %edi, 0x8(%rsp)
movslq %edi, %r15
movl %ebp, 0x2c(%rsp)
movq %r13, 0x20(%rsp)
cmpq %r15, %r10
cmovlq %r10, %r15
cmpq %r8, %r11
cmovgq %r11, %r8
subq %r8, %r15
jg 0x188772
xorl %r15d, %r15d
movl 0xc(%rsi), %edi
movl 0x10(%rsi), %r8d
movslq 0x8(%r12), %r9
cmpq %r9, %r8
movq %r9, %r13
cmovlq %r8, %r13
movslq 0x4(%r12), %r14
cmpq %r14, %rdi
movq %r14, %rbp
cmovgq %rdi, %rbp
subq %rbp, %r13
jg 0x18879f
xorl %r13d, %r13d
addq %r15, %r13
movl 0x8(%rsp), %ebp
subl 0xc(%rsp), %ebp
movslq %ebp, %r15
subl %r11d, %r10d
addq %r15, %r10
movl %r9d, %r11d
subl %r14d, %r11d
movslq %r11d, %r11
subl %edi, %r8d
addq %r11, %r8
addq %r10, %r8
subq %r13, %r8
subq %r13, %r8
cmpq $0x8, %r8
jg 0x1887e9
cvtsi2sd %r8, %xmm0
cvtsi2sd %r13, %xmm1
mulsd 0x6493d(%rip), %xmm1    # 0x1ed120
ucomisd %xmm1, %xmm0
jbe 0x188866
movq 0x20(%rbx), %rsi
cmpq 0x28(%rbx), %rsi
jne 0x188821
leaq (%rsi,%rsi), %rcx
testq %rsi, %rsi
pushq $0x2
popq %rdx
cmoveq %rdx, %rcx
movq %rcx, 0x28(%rbx)
imulq $0x24, %rcx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x30(%rbx)
movq 0x20(%rbx), %rsi
movl (%r12), %ecx
movl %ecx, %edx
shrl %edx
movq 0x18(%rsp), %r14
movq 0x20(%rsp), %r13
leaq 0x1(%rsi), %rdi
movq %rdi, 0x20(%rbx)
imulq $0x24, %rsi, %rsi
movl %edx, (%rax,%rsi)
shlb $0x5, %cl
andb $0x20, %cl
orb $-0x7e, %cl
movb %cl, 0x20(%rax,%rsi)
movdqu 0x4(%r12), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x4(%rax,%rsi)
movl %r13d, 0x14(%rax,%rsi)
orq $-0x1, 0x18(%rax,%rsi)
jmp 0x188895
movl 0xc(%rsp), %eax
movl %eax, 0x4(%rsi)
movl 0x8(%rsp), %eax
movl %eax, 0x8(%rsi)
movl %r9d, 0x10(%rsi)
movl %r14d, 0xc(%rsi)
movq 0x20(%rsp), %r13
movl %r13d, 0x14(%rsi)
movl 0x2c(%rsp), %eax
andb $-0x20, %al
incb %al
movb %al, 0x20(%rsi)
movq 0x18(%rsp), %r14
incq %r13
addq $0x28, %r12
jmp 0x18861b
xorl %eax, %eax
xorl %edx, %edx
xorl %ecx, %ecx
cmpq 0x20(%rbx), %rdx
jae 0x1888eb
movq 0x30(%rbx), %rsi
cmpl $-0x2, 0x14(%rsi,%rax)
je 0x1888e2
leaq (%rsi,%rax), %rdi
imulq $0x24, %rcx, %r8
incq %rcx
movl 0x20(%rdi), %r9d
movl %r9d, 0x20(%rsi,%r8)
movdqu (%rdi), %xmm0
movupd 0x10(%rdi), %xmm1
movupd %xmm1, 0x10(%rsi,%r8)
movdqu %xmm0, (%rsi,%r8)
incq %rdx
addq $0x24, %rax
jmp 0x1888a7
movq %rcx, 0x20(%rbx)
movq 0x30(%rbx), %rdi
imulq $0x24, %rcx, %rsi
addq %rdi, %rsi
callq 0x1580d5
pushq $0x1
popq %r15
xorl %r12d, %r12d
movl $0xfffffffe, %r13d      # imm = 0xFFFFFFFE
movq 0x20(%rbx), %rcx
cmpq %rcx, %r15
jg 0x188986
je 0x188932
movq 0x30(%rbx), %rax
imulq $0x24, %r15, %rcx
movl 0x8(%rax,%rcx), %ecx
imulq $0x24, %r12, %rdx
cmpl 0x8(%rax,%rdx), %ecx
jne 0x188932
incq %r15
jmp 0x18890c
movq %r15, %rax
subq %r12, %rax
cmpq $0x2, %rax
jl 0x188955
movq 0x30(%rbx), %rax
imulq $0x24, %r12, %rdi
addq %rax, %rdi
imulq $0x24, %r15, %rsi
addq %rax, %rsi
callq 0x158386
imulq $0x24, %r12, %rax
addq $0x14, %rax
cmpq %r15, %r12
jge 0x18892d
movq 0x30(%rbx), %rcx
movl (%rcx,%rax), %edx
cmpq %r13, %rdx
jne 0x188974
orl $-0x1, (%rcx,%rax)
jmp 0x18897d
imulq $0x28, %rdx, %rcx
movl %r12d, 0x20(%r14,%rcx)
incq %r12
addq $0x24, %rax
jmp 0x18895d
pushq $-0x1
popq %rax
pushq $0x18
popq %r13
xorl %ebp, %ebp
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
cmpq %rcx, %rbp
jae 0x188aa6
movq 0x30(%rbx), %rcx
movl -0x4(%rcx,%r13), %edx
cmpq %rsi, %rdx
je 0x188a96
imulq $0x28, %rdx, %r12
movl 0x24(%r14,%r12), %edx
cmpq %rsi, %rdx
je 0x188a29
imulq $0x28, %rdx, %r15
movl 0x20(%r14,%r15), %eax
movl %eax, -0x4(%rcx,%r13)
imulq $0x24, %rax, %rax
movl %ebp, 0x1c(%rcx,%rax)
movq 0x10(%rsp), %rdx
movq 0x28(%rdx), %rdx
movq 0x20(%rdx), %rdi
movl -0x18(%rcx,%r13), %edx
movl 0x8(%rcx,%r13), %esi
shrl $0x5, %esi
andl $0x1, %esi
leal (%rsi,%rdx,2), %r8d
xorl $0x1, %r8d
movl (%rcx,%rax), %edx
movl 0x20(%rcx,%rax), %eax
shrl $0x5, %eax
andl $0x1, %eax
leal (%rax,%rdx,2), %r9d
xorl $0x1, %r9d
xorl %esi, %esi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0x18842c
testq %rax, %rax
js 0x188a38
movq 0x30(%rbx), %rcx
movl %eax, (%rcx,%r13)
jmp 0x188a8e
testq %rax, %rax
cmovsq %rbp, %rax
orl $-0x1, -0x4(%rcx,%r13)
jmp 0x188a96
addq %r14, %r12
addq %r14, %r15
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl 0x1c(%r15), %ecx
sarl %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,8), %ecx
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl %esi, %ecx
addl (%r15), %ecx
movl 0x1c(%r12), %edx
sarl %edx
movslq %edx, %rdx
movl (%rax,%rdx,8), %eax
andl %esi, %eax
addl (%r12), %eax
subl %ecx, %eax
jge 0x188a86
movq 0x30(%rbx), %rax
orl $-0x1, (%rax,%r13)
jmp 0x188a8e
movq 0x30(%rbx), %rcx
movl %eax, (%rcx,%r13)
movq %rbp, %rax
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
incq %rbp
movq 0x20(%rbx), %rcx
addq $0x24, %r13
jmp 0x188994
pushq $-0x1
popq %rdi
xorl %ecx, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
pushq $-0x1
popq %rsi
movl %edi, %r8d
testq %rax, %rax
js 0x188b11
movq 0x30(%rbx), %r9
cmpl $-0x1, %edi
je 0x188ae2
imulq $0x24, %rax, %r11
movl 0x8(%r9,%r11), %r10d
cmpl %edi, %r10d
jbe 0x188aed
addq %r9, %r11
movl 0x4(%r11), %r10d
cmpl %r10d, %edi
cmovael %r10d, %edi
jmp 0x188aff
imulq $0x24, %rax, %rdi
movl 0x8(%r9,%rdi), %r10d
jmp 0x188af3
subl %edi, %r8d
addq %r8, %rcx
imulq $0x24, %rax, %rdi
movl 0x4(%r9,%rdi), %edi
movl %r10d, %r8d
imulq $0x24, %rax, %rax
movl 0x14(%r9,%rax), %eax
cmpq %rdx, %rax
cmoveq %rsi, %rax
jmp 0x188ab6
subl %edi, %r8d
xorl %eax, %eax
cmpl $-0x1, %edi
cmovnel %r8d, %eax
addq %rax, %rcx
movl 0x18(%rbx), %eax
cmpq %rax, %rcx
jne 0x188b2c
movb $0x1, 0x50(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6c445(%rip), %rdi     # 0x1f4f87
leaq 0x68fda(%rip), %rsi     # 0x1f1b23
leaq 0x6c465(%rip), %rcx     # 0x1f4fb5
movl $0x3dd7, %edx           # imm = 0x3DD7
callq 0x2110