// File: chhylp123[P]hifiasm/inter.cpp
// Function: dedup_second_chain(ul_idx_t const*, unsigned long*, long, long, long, mg_lchain_t*, kv_ul_ov_t*, kv_ul_ov_t*, unsigned long*, long, double, long)
void dedup_second_chain(const ul_idx_t *uref, uint64_t *ix, int64_t ix_n, int64_t p_sidx, int64_t p_eidx, mg_lchain_t *chain_a,
kv_ul_ov_t *raw_idx, kv_ul_ov_t *raw_chn, uint64_t *b, int64_t bw, double diff_ec_ul, int64_t qlen)
{
	int64_t k, i, z, a_n, ss, ee, b_n; uint64_t qs, qe, ts, te; uint32_t mk = 0x80000000; mg_lchain_t nn;
	int64_t iqs, iqe, its, ite, tsc;
	
	for (k = p_sidx; k < p_eidx; k++) {
		i = raw_idx->a[chain_a[k].off].qn; 
		qs = raw_chn->a[i].qs; qe = raw_chn->a[i].qe;
		ts = raw_chn->a[i].ts; te = raw_chn->a[i].te;
		// fprintf(stderr, "++++++++++++[M::%s::idx:%ld]\n", __func__, i);
		for (;i>=0;) {
			// fprintf(stderr, "--[M::%s::i->%ld]\n", __func__, i);
			if(raw_chn->a[i].qs < qs) qs = raw_chn->a[i].qs;
        	if(raw_chn->a[i].ts < ts) ts = raw_chn->a[i].ts;
        	if(raw_chn->a[i].qe > qe) qe = raw_chn->a[i].qe;
        	if(raw_chn->a[i].te > te) te = raw_chn->a[i].te;
			raw_chn->a[i].qs |= mk;

			if(raw_chn->a[i].tn == (uint32_t)-1) i = -1;
			else i = raw_chn->a[i].tn;
		}
		assert(raw_idx->a[chain_a[k].off].qs == qs && raw_idx->a[chain_a[k].off].qe == qe && 
				raw_idx->a[chain_a[k].off].ts == ts && raw_idx->a[chain_a[k].off].te == te);
	}


	///dedup
	for (z = a_n = 0; z < ix_n; ++z) {
		ss = a_n; ee = a_n + ((uint32_t)ix[z]); tsc = 0;
		if(ss != p_sidx || ee != p_eidx) {
			for (k = ss; k < ee; k++) {
				i = raw_idx->a[chain_a[k].off].qn; b_n = 0;
				qs = ((raw_chn->a[i].qs<<1)>>1); qe = raw_chn->a[i].qe;
				ts = raw_chn->a[i].ts; te = raw_chn->a[i].te;
				// fprintf(stderr, "++++++++++++[M::%s::idx:%ld]\n", __func__, i);
				for (;i>=0;) {
					// fprintf(stderr, "--[M::%s::i->%ld]\n", __func__, i);
					if(((raw_chn->a[i].qs<<1)>>1) < qs) qs = ((raw_chn->a[i].qs<<1)>>1);
					if(raw_chn->a[i].ts < ts) ts = raw_chn->a[i].ts;
					if(raw_chn->a[i].qe > qe) qe = raw_chn->a[i].qe;
					if(raw_chn->a[i].te > te) te = raw_chn->a[i].te;
					// raw_chn->a[i].qs |= mk;
					//update here!!!!!!!
					if(!(raw_chn->a[i].qs&mk)) b[b_n++] = i;
					if(raw_chn->a[i].tn == (uint32_t)-1) i = -1;
					else i = raw_chn->a[i].tn;
				}
				assert(raw_idx->a[chain_a[k].off].qs == qs && raw_idx->a[chain_a[k].off].qe == qe && 
						raw_idx->a[chain_a[k].off].ts == ts && raw_idx->a[chain_a[k].off].te == te);
				
				update_exist_chain(uref, raw_chn->a, b, b_n, raw_idx->a[chain_a[k].off].tn, bw, diff_ec_ul, &nn);
				nn.v = (raw_idx->a[chain_a[k].off].tn<<1)|raw_idx->a[chain_a[k].off].rev;
				extend_end_coord(&nn, NULL, qlen, uref->ug->g->seq[raw_idx->a[chain_a[k].off].tn].len, &iqs, &iqe, &its, &ite);
				nn.qs = iqs; nn.qe = iqe; nn.rs = its; nn.re = ite;
				assert(chain_a[k].score >= nn.score);
				tsc += (chain_a[k].score - nn.score);
			}
		}
		///TODO: also update qs, qe
		tsc = ((int64_t)(ix[z]>>32)) - tsc; if(tsc < 0) tsc = 0;
		ix[z] <<= 32; ix[z] >>= 32; ix[z] |= ((uint64_t)tsc)<<32;

		a_n += ((uint32_t)ix[z]);
	}



	for (k = p_sidx; k < p_eidx; k++) {
		i = raw_idx->a[chain_a[k].off].qn; 
		qs = ((raw_chn->a[i].qs<<1)>>1); qe = raw_chn->a[i].qe;
		ts = raw_chn->a[i].ts; te = raw_chn->a[i].te;
		for (;i>=0;) {
			// fprintf(stderr, "--[M::%s::i->%ld]\n", __func__, i);
			if(raw_chn->a[i].qs&mk) raw_chn->a[i].qs -= mk;
			if(raw_chn->a[i].qs < qs) qs = raw_chn->a[i].qs;
        	if(raw_chn->a[i].ts < ts) ts = raw_chn->a[i].ts;
        	if(raw_chn->a[i].qe > qe) qe = raw_chn->a[i].qe;
        	if(raw_chn->a[i].te > te) te = raw_chn->a[i].te;
			

			if(raw_chn->a[i].tn == (uint32_t)-1) i = -1;
			else i = raw_chn->a[i].tn;
		}
		assert(raw_idx->a[chain_a[k].off].qs == qs && raw_idx->a[chain_a[k].off].qe == qe && 
				raw_idx->a[chain_a[k].off].ts == ts && raw_idx->a[chain_a[k].off].te == te);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movsd %xmm0, -0x38(%rbp)
movl $0x80000000, -0x94(%rbp) # imm = 0x80000000
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x2d6378
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq %rax, -0x48(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq %rax, -0x78(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x80(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x88(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x48(%rbp)
jl 0x2d6271
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
cmpq -0x78(%rbp), %rax
jae 0x2d6186
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq %rax, -0x78(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
cmpq -0x88(%rbp), %rax
jae 0x2d61ba
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x88(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpq -0x80(%rbp), %rax
jbe 0x2d61e8
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x80(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
cmpq -0x90(%rbp), %rax
jbe 0x2d621c
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq %rax, -0x90(%rbp)
movl -0x94(%rbp), %ecx
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rdx
addq %rdx, %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
cmpl $-0x1, 0xc(%rax)
jne 0x2d6256
movq $-0x1, -0x48(%rbp)
jmp 0x2d626c
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x48(%rbp)
jmp 0x2d614d
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x78(%rbp), %rcx
movb %al, -0xe9(%rbp)
jne 0x2d6338
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x80(%rbp), %rcx
movb %al, -0xe9(%rbp)
jne 0x2d6338
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x88(%rbp), %rcx
movb %al, -0xe9(%rbp)
jne 0x2d6338
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
cmpq -0x90(%rbp), %rax
sete %al
movb %al, -0xe9(%rbp)
movb -0xe9(%rbp), %al
testb $0x1, %al
jne 0x2d6344
jmp 0x2d6346
jmp 0x2d6365
leaq 0xbd04b(%rip), %rdi     # 0x393398
leaq 0xba4db(%rip), %rsi     # 0x39082f
movl $0x3a25, %edx           # imm = 0x3A25
leaq 0xbd2d3(%rip), %rcx     # 0x393633
callq 0x2130
jmp 0x2d6367
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2d60be
movq $0x0, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x2d6911
movq -0x58(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x50(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0xe8(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x2d63da
movq -0x68(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x2d6874
movq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x68(%rbp), %rax
jge 0x2d6872
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq %rax, -0x48(%rbp)
movq $0x0, -0x70(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
shll %eax
shrl %eax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x80(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x88(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x48(%rbp)
jl 0x2d65cc
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
shll %eax
shrl %eax
movl %eax, %eax
cmpq -0x78(%rbp), %rax
jae 0x2d64c4
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
shll %eax
shrl %eax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
cmpq -0x88(%rbp), %rax
jae 0x2d64f8
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x88(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpq -0x80(%rbp), %rax
jbe 0x2d6526
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x80(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
cmpq -0x90(%rbp), %rax
jbe 0x2d655a
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq %rax, -0x90(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
andl -0x94(%rbp), %eax
cmpl $0x0, %eax
jne 0x2d6592
movq -0x48(%rbp), %rdx
movq 0x20(%rbp), %rax
movq -0x70(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x70(%rbp)
movq %rdx, (%rax,%rcx,8)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
cmpl $-0x1, 0xc(%rax)
jne 0x2d65b1
movq $-0x1, -0x48(%rbp)
jmp 0x2d65c7
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x48(%rbp)
jmp 0x2d647f
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x78(%rbp), %rcx
movb %al, -0xea(%rbp)
jne 0x2d6693
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x80(%rbp), %rcx
movb %al, -0xea(%rbp)
jne 0x2d6693
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x88(%rbp), %rcx
movb %al, -0xea(%rbp)
jne 0x2d6693
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
cmpq -0x90(%rbp), %rax
sete %al
movb %al, -0xea(%rbp)
movb -0xea(%rbp), %al
testb $0x1, %al
jne 0x2d669f
jmp 0x2d66a1
jmp 0x2d66c0
leaq 0xbccf0(%rip), %rdi     # 0x393398
leaq 0xba180(%rip), %rsi     # 0x39082f
movl $0x3a3f, %edx           # imm = 0x3A3F
leaq 0xbcf78(%rip), %rcx     # 0x393633
callq 0x2130
movq -0x8(%rbp), %rdi
movq 0x18(%rbp), %rax
movq (%rax), %rsi
movq 0x20(%rbp), %rdx
movq -0x70(%rbp), %rcx
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %r8
imulq $0x28, -0x40(%rbp), %r9
addq %r9, %r8
movslq (%r8), %r8
imulq $0x1c, %r8, %r8
addq %r8, %rax
movl 0xc(%rax), %eax
movl %eax, %r8d
movq 0x28(%rbp), %r9
movsd -0x38(%rbp), %xmm0
leaq -0xbc(%rbp), %rax
movq %rax, (%rsp)
callq 0x2d4d30
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shll %eax
movq 0x10(%rbp), %rcx
movq (%rcx), %rcx
movq -0x30(%rbp), %rdx
imulq $0x28, -0x40(%rbp), %rsi
addq %rsi, %rdx
movslq (%rdx), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
shrl $0x1f, %ecx
orl %ecx, %eax
movl %eax, -0xb4(%rbp)
movq 0x30(%rbp), %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq 0x10(%rbp), %rcx
movq (%rcx), %rcx
movq -0x30(%rbp), %rsi
imulq $0x28, -0x40(%rbp), %rdi
addq %rdi, %rsi
movslq (%rsi), %rsi
imulq $0x1c, %rsi, %rsi
addq %rsi, %rcx
movl 0xc(%rcx), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %ecx
leaq -0xbc(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0xc8(%rbp), %r8
leaq -0xd0(%rbp), %r9
leaq -0xd8(%rbp), %r10
leaq -0xe0(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2d2ba0
movq -0xc8(%rbp), %rax
movl %eax, -0xa8(%rbp)
movq -0xd0(%rbp), %rax
movl %eax, -0xa4(%rbp)
movq -0xd8(%rbp), %rax
movl %eax, -0xb0(%rbp)
movq -0xe0(%rbp), %rax
movl %eax, -0xac(%rbp)
movq -0x30(%rbp), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
cmpl -0xa0(%rbp), %eax
jl 0x2d681d
jmp 0x2d683c
leaq 0xbceb1(%rip), %rdi     # 0x3936d5
leaq 0xba004(%rip), %rsi     # 0x39082f
movl $0x3a45, %edx           # imm = 0x3A45
leaq 0xbcdfc(%rip), %rcx     # 0x393633
callq 0x2130
movq -0x30(%rbp), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
subl -0xa0(%rbp), %eax
cltq
addq -0xe8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2d63e2
jmp 0x2d6874
movq -0x10(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
subq -0xe8(%rbp), %rax
movq %rax, -0xe8(%rbp)
cmpq $0x0, -0xe8(%rbp)
jge 0x2d68a7
movq $0x0, -0xe8(%rbp)
movq -0x10(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
shlq $0x20, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
shrq $0x20, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0xe8(%rbp), %rdx
shlq $0x20, %rdx
movq -0x10(%rbp), %rax
movq -0x50(%rbp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2d6388
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x2d6bf8
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq %rax, -0x48(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
shll %eax
shrl %eax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x80(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x88(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x48(%rbp)
jl 0x2d6af1
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
andl -0x94(%rbp), %eax
cmpl $0x0, %eax
je 0x2d69f3
movl -0x94(%rbp), %edx
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x4(%rax)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
cmpq -0x78(%rbp), %rax
jae 0x2d6a21
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq %rax, -0x78(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
cmpq -0x88(%rbp), %rax
jae 0x2d6a55
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x88(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpq -0x80(%rbp), %rax
jbe 0x2d6a83
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x80(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
cmpq -0x90(%rbp), %rax
jbe 0x2d6ab7
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq %rax, -0x90(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
cmpl $-0x1, 0xc(%rax)
jne 0x2d6ad6
movq $-0x1, -0x48(%rbp)
jmp 0x2d6aec
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x48(%rbp)
jmp 0x2d69ae
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x78(%rbp), %rcx
movb %al, -0xeb(%rbp)
jne 0x2d6bb8
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x80(%rbp), %rcx
movb %al, -0xeb(%rbp)
jne 0x2d6bb8
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x88(%rbp), %rcx
movb %al, -0xeb(%rbp)
jne 0x2d6bb8
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
cmpq -0x90(%rbp), %rax
sete %al
movb %al, -0xeb(%rbp)
movb -0xeb(%rbp), %al
testb $0x1, %al
jne 0x2d6bc4
jmp 0x2d6bc6
jmp 0x2d6be5
leaq 0xbc7cb(%rip), %rdi     # 0x393398
leaq 0xb9c5b(%rip), %rsi     # 0x39082f
movl $0x3a63, %edx           # imm = 0x3A63
leaq 0xbca53(%rip), %rcx     # 0x393633
callq 0x2130
jmp 0x2d6be7
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2d6919
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw %cs:(%rax,%rax)