// File: chhylp123[P]hifiasm/inter.cpp
// Function: dedup_second_chain_adv(ul_idx_t const*, ul_ov_t*, long, mg_lchain_t*, kv_ul_ov_t*, kv_ul_ov_t*, unsigned long*, long, long)
void dedup_second_chain_adv(const ul_idx_t *uref, ul_ov_t *gb, int64_t gb_n, mg_lchain_t *chain_a,
kv_ul_ov_t *raw_idx, kv_ul_ov_t *raw_chn, uint64_t *b, int64_t qlen, int64_t ulid)
{
	int64_t k, i, z, ss, ee, b_n, n_s; uint64_t qs, qe, ts, te; uint32_t mk = 0x80000000/**, pi**/; mg_lchain_t nn;
	int64_t iqs, iqe, its, ite, tsc;

	for (z = gb_n - 1; z >= 0; z--) {///start from the best chain
		ss = gb[z].ts; ee = gb[z].te; tsc = 0; gb[z].qs = qlen; gb[z].qe = 0;
		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;
			for (n_s = 0;i>=0;) {
				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;

				if(!(raw_chn->a[i].qs&mk)) b[b_n++] = i;
				else n_s++;

				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(b_n > 0);
			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);
			// if(!(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)) {
			// 	fprintf(stderr, "\n[M::%s::ulid->%ld******] raw_idx_offset:%d, qs:%lu, qe:%lu, ts:%lu, te:%lu, raw_idx->qs:%u, raw_idx->qe:%u, raw_idx->ts:%u, raw_idx->te:%u\n", 
			// 	__func__, ulid, chain_a[k].off, qs, qe, ts, te, 
			// 	raw_idx->a[chain_a[k].off].qs, raw_idx->a[chain_a[k].off].qe, 
			// 	raw_idx->a[chain_a[k].off].ts, raw_idx->a[chain_a[k].off].te); 

			// 	for (i = raw_idx->a[chain_a[k].off].qn;i>=0;) {
			// 		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;
			// 		fprintf(stderr, "[M::%s->pieces (%ld)] qs->%u, qe->%u, ts->%u, te->%u\n", __func__, i, 
            // 				((raw_chn->a[i].qs<<1)>>1), raw_chn->a[i].qe, raw_chn->a[i].ts, raw_chn->a[i].te);
			// 		if(raw_chn->a[i].tn == (uint32_t)-1) i = -1;
			// 		else i = raw_chn->a[i].tn;
			// 	}
			// }
			
			update_exist_chain_adv(uref, raw_chn->a, b, b_n, raw_idx->a[chain_a[k].off].tn, &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);

			if(n_s) {
				// raw_idx->a[chain_a[k].off].qn = b[b_n-1];
				// for (i = 0, pi = (uint32_t)-1; i < b_n; i++) {
				// 	raw_chn->a[b[i]].tn = pi; pi = b[i];
				// }
				///don't update chain_a[k] as it will be used for taceback in the next step
				chain_a[k].score = nn.score; 
				chain_a[k].qs = nn.qs; chain_a[k].qe = nn.qe; 
				chain_a[k].rs = nn.rs; chain_a[k].re = nn.re; 
				// raw_idx->a[chain_a[k].off].sec = nn.score; 
				// raw_idx->a[chain_a[k].off].qs = nn.qs; 
				// raw_idx->a[chain_a[k].off].qe = nn.qe; 
				// raw_idx->a[chain_a[k].off].ts = nn.rs; 
				// raw_idx->a[chain_a[k].off].te = nn.re;
			} else {
				// if(!(chain_a[k].score == nn.score && chain_a[k].qs == nn.qs && chain_a[k].qe == nn.qe && chain_a[k].rs == nn.rs && chain_a[k].re == nn.re)) {
				// 	fprintf(stderr, "++++[M::%s::k->%ld] chain_a[k].score->%d, nn.score->%d, chain_a[k].qs->%d, nn.qs->%d, chain_a[k].qe->%d, nn.qe->%d, chain_a[k].rs->%d, nn.rs->%d, chain_a[k].re->%d, nn.re->%d\n", __func__, 
				// 	k, chain_a[k].score, nn.score, chain_a[k].qs, nn.qs, chain_a[k].qe, nn.qe, chain_a[k].rs, nn.rs, chain_a[k].re, nn.re);
				// }
				assert(chain_a[k].score == nn.score && chain_a[k].qs == nn.qs && chain_a[k].qe == nn.qe && chain_a[k].rs == nn.rs && chain_a[k].re == nn.re);
			}

			if((int32_t)gb[z].qs > nn.qs) gb[z].qs = nn.qs;///update qs and qe
			if((int32_t)gb[z].qe < nn.qe) gb[z].qe = nn.qe;
		}
		tsc = (int64_t)(gb[z].qn) - tsc; if(tsc < 0) tsc = 0; gb[z].qn = tsc;///update score
		// if(gb[z].qe <= gb[z].qs) {
		// 	fprintf(stderr, "++++[M::%s::] gb[%ld].qe->%u, gb[%ld].qs->%u\n", __func__, z, gb[z].qe, z, gb[z].qs);
		// }
		assert(gb[z].qe > gb[z].qs);
		// fprintf(stderr, "[M::%s::z->%ld] score->%u, qs->%u, qe->%u, occ->%u\n", 
		// __func__, z, gb[z].qn, gb[z].qs, gb[z].qe, gb[z].te-gb[z].ts); 
	}

	for (i = 0; i < (int64_t)raw_chn->n; i++){
		if(raw_chn->a[i].qs&mk) raw_chn->a[i].qs -= mk;
	}
	radix_sort_ul_ov_srt_qn(gb, gb + gb_n);//sort by scores
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
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)
movl $0x80000000, -0x8c(%rbp) # imm = 0x80000000
movq -0x18(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jl 0x2d8125
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq %rax, -0x58(%rbp)
movq $0x0, -0xe0(%rbp)
movq 0x18(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x58(%rbp), %rax
jge 0x2d8089
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq %rax, -0x40(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
shll %eax
shrl %eax
movl %eax, %eax
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq %rax, -0x88(%rbp)
movq $0x0, -0x68(%rbp)
cmpq $0x0, -0x40(%rbp)
jl 0x2d7c33
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
shll %eax
shrl %eax
movl %eax, %eax
cmpq -0x70(%rbp), %rax
jae 0x2d7b08
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
shll %eax
shrl %eax
movl %eax, %eax
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
cmpq -0x80(%rbp), %rax
jae 0x2d7b36
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpq -0x78(%rbp), %rax
jbe 0x2d7b64
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
cmpq -0x88(%rbp), %rax
jbe 0x2d7b98
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
andl -0x8c(%rbp), %eax
cmpl $0x0, %eax
jne 0x2d7bd2
movq -0x40(%rbp), %rdx
movq 0x10(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x60(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x2d7bde
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
movl -0x8c(%rbp), %ecx
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rdx
addq %rdx, %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
cmpl $-0x1, 0xc(%rax)
jne 0x2d7c18
movq $-0x1, -0x40(%rbp)
jmp 0x2d7c2e
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x40(%rbp)
jmp 0x2d7ac3
cmpq $0x0, -0x60(%rbp)
jle 0x2d7c3c
jmp 0x2d7c5b
leaq 0xbbb9c(%rip), %rdi     # 0x3937df
leaq 0xb8be5(%rip), %rsi     # 0x39082f
movl $0x3af4, %edx           # imm = 0x3AF4
leaq 0xbbb91(%rip), %rcx     # 0x3937e7
callq 0x2130
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
imulq $0x28, -0x38(%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 -0x70(%rbp), %rcx
movb %al, -0xe1(%rbp)
jne 0x2d7d1f
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
imulq $0x28, -0x38(%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 -0x78(%rbp), %rcx
movb %al, -0xe1(%rbp)
jne 0x2d7d1f
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
imulq $0x28, -0x38(%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 -0x80(%rbp), %rcx
movb %al, -0xe1(%rbp)
jne 0x2d7d1f
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
cmpq -0x88(%rbp), %rax
sete %al
movb %al, -0xe1(%rbp)
movb -0xe1(%rbp), %al
testb $0x1, %al
jne 0x2d7d2b
jmp 0x2d7d2d
jmp 0x2d7d4c
leaq 0xbb664(%rip), %rdi     # 0x393398
leaq 0xb8af4(%rip), %rsi     # 0x39082f
movl $0x3af6, %edx           # imm = 0x3AF6
leaq 0xbbaa0(%rip), %rcx     # 0x3937e7
callq 0x2130
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
movq 0x10(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %r8
imulq $0x28, -0x38(%rbp), %r9
addq %r9, %r8
movslq (%r8), %r8
imulq $0x1c, %r8, %r8
addq %r8, %rax
movl 0xc(%rax), %eax
movl %eax, %r8d
leaq -0xb4(%rbp), %r9
callq 0x2d7700
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shll %eax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
movq -0x20(%rbp), %rdx
imulq $0x28, -0x38(%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, -0xac(%rbp)
movq 0x18(%rbp), %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
movq -0x20(%rbp), %rsi
imulq $0x28, -0x38(%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 -0xb4(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0xc0(%rbp), %r8
leaq -0xc8(%rbp), %r9
leaq -0xd0(%rbp), %r10
leaq -0xd8(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2d2ba0
movq -0xc0(%rbp), %rax
movl %eax, -0xa0(%rbp)
movq -0xc8(%rbp), %rax
movl %eax, -0x9c(%rbp)
movq -0xd0(%rbp), %rax
movl %eax, -0xa8(%rbp)
movq -0xd8(%rbp), %rax
movl %eax, -0xa4(%rbp)
movq -0x20(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
cmpl -0x98(%rbp), %eax
jl 0x2d7e9c
jmp 0x2d7ebb
leaq 0xbb832(%rip), %rdi     # 0x3936d5
leaq 0xb8985(%rip), %rsi     # 0x39082f
movl $0x3b0e, %edx           # imm = 0x3B0E
leaq 0xbb931(%rip), %rcx     # 0x3937e7
callq 0x2130
movq -0x20(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
subl -0x98(%rbp), %eax
cltq
addq -0xe0(%rbp), %rax
movq %rax, -0xe0(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x2d7f55
movl -0x98(%rbp), %ecx
movq -0x20(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x1c(%rax)
movl -0xa0(%rbp), %ecx
movq -0x20(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x14(%rax)
movl -0x9c(%rbp), %ecx
movq -0x20(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movl -0xa8(%rbp), %ecx
movq -0x20(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movl -0xa4(%rbp), %ecx
movq -0x20(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
jmp 0x2d801e
movq -0x20(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x1c(%rax), %ecx
xorl %eax, %eax
cmpl -0x98(%rbp), %ecx
movb %al, -0xe2(%rbp)
jne 0x2d7fef
movq -0x20(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %ecx
xorl %eax, %eax
cmpl -0xa0(%rbp), %ecx
movb %al, -0xe2(%rbp)
jne 0x2d7fef
movq -0x20(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x18(%rax), %ecx
xorl %eax, %eax
cmpl -0x9c(%rbp), %ecx
movb %al, -0xe2(%rbp)
jne 0x2d7fef
movq -0x20(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
xorl %eax, %eax
cmpl -0xa8(%rbp), %ecx
movb %al, -0xe2(%rbp)
jne 0x2d7fef
movq -0x20(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
cmpl -0xa4(%rbp), %eax
sete %al
movb %al, -0xe2(%rbp)
movb -0xe2(%rbp), %al
testb $0x1, %al
jne 0x2d7ffb
jmp 0x2d7ffd
jmp 0x2d801c
leaq 0xbb58c(%rip), %rdi     # 0x393590
leaq 0xb8824(%rip), %rsi     # 0x39082f
movl $0x3b24, %edx           # imm = 0x3B24
leaq 0xbb7d0(%rip), %rcx     # 0x3937e7
callq 0x2130
jmp 0x2d801e
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
cmpl -0xa0(%rbp), %eax
jle 0x2d804a
movl -0xa0(%rbp), %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x9c(%rbp), %eax
jge 0x2d8076
movl -0x9c(%rbp), %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
jmp 0x2d8078
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2d7a21
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
subq -0xe0(%rbp), %rax
movq %rax, -0xe0(%rbp)
cmpq $0x0, -0xe0(%rbp)
jge 0x2d80ba
movq $0x0, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
imulq $0x1c, -0x48(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
jbe 0x2d80f3
jmp 0x2d8112
leaq 0xbb778(%rip), %rdi     # 0x393872
leaq 0xb872e(%rip), %rsi     # 0x39082f
movl $0x3b2e, %edx           # imm = 0x3B2E
leaq 0xbb6da(%rip), %rcx     # 0x3937e7
callq 0x2130
jmp 0x2d8114
movq -0x48(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2d79b5
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x2d8185
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
andl -0x8c(%rbp), %eax
cmpl $0x0, %eax
je 0x2d8175
movl -0x8c(%rbp), %edx
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x4(%rax)
jmp 0x2d8177
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2d812d
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
imulq $0x1c, -0x18(%rbp), %rax
addq %rax, %rsi
callq 0x27c310
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw %cs:(%rax,%rax)