// File: chhylp123[P]hifiasm/inter.cpp
// Function: linear_rchain_dp_adv(ul_ov_t*, long, ul_ov_t*, ug_opt_t const*, long, double, long, long, long, long, Chain_Data*, asg_t const*, long)
uint64_t linear_rchain_dp_adv(ul_ov_t *ch, int64_t ch_n, ul_ov_t *sv, const ug_opt_t *uopt, int64_t bw, 
double diff_ec_ul, int64_t qlen, int64_t max_skip, int64_t max_iter, int64_t max_dis, Chain_Data* dp, const asg_t *rg, int64_t ulid)
{	///all in[].el must be 1
	if(ch_n == 0) return 0;
    int64_t i, j, k, sc, csc, mm_sc, mm_idx, its, ite, max; int32_t *f, *bq, *bt;
    ul_ov_t *li = NULL, *lj = NULL; int64_t *p, *t, st, plus, max_ii, n_skip, end_j; 
	resize_Chain_Data(dp, ch_n, NULL);
	t = dp->tmp; f = dp->score; p = dp->pre; bq = dp->indels; bt = dp->self_length;

    radix_sort_ul_ov_srt_qe(ch, ch + ch_n);
	for (i = 1, j = 0; i <= ch_n; i++) {
        if (i == ch_n || ch[i].qe != ch[j].qe) {
            if(i - j > 1) radix_sort_ul_ov_srt_qs(ch+j, ch+i);
            j = i;
        }
    }

	memset(t, 0, (ch_n*sizeof((*t))));
	for (i = st = plus = 0, max_ii = -1; i < ch_n; ++i) {
		li = &(ch[i]); csc = MIN((li->qe-li->qs), (li->te-li->ts));
		mm_sc = /**csc**/-1; mm_idx = -1; n_skip = 0; end_j = -1; 
		st = (i<max_iter)?(0):(i-max_iter);
		for (j = i-1; j >= st; --j) {
			lj = &(ch[j]); 
			if(lj->qe <= li->qs) break;
			sc = comput_rlinear_sc(li, lj, j, bq, bt, diff_ec_ul, bw); ///should allow contain
			if(sc == INT32_MIN) continue;
			if(sc > mm_sc) {
				mm_sc = sc, mm_idx = j;
				if (n_skip > 0) --n_skip;
			} else if (t[j] == i) {
				if (++n_skip > max_skip)
					break;
			}
			if (p[j] >= 0) t[p[j]] = i;
		}
		end_j = j;
		if (max_ii < 0 || (ch[i].qe>(ch[max_ii].qe+max_dis))) {//too long
			max = INT32_MIN; max_ii = -1;
            for (j = i - 1; (j >= st) && (ch[i].qe<=(max_dis+ch[j].qe)); --j) {
                if (max < f[j]) {
                    max = f[j], max_ii = j;
                }
            }
		}
		
        if (max_ii >= 0 && max_ii < end_j) {///just have a try with a[i]<->a[max_ii]
			lj = &(ch[max_ii]); 
			if(lj->qe > li->qs) {
				sc = comput_rlinear_sc(li, lj, max_ii, bq, bt, diff_ec_ul, bw); ///should allow contain
				if(sc != INT32_MIN) {
					if(sc > mm_sc) {
						mm_sc = sc; mm_idx = max_ii;
					}
				}
			}
		}

		if(mm_idx < 0) mm_sc = csc;
		f[i] = mm_sc; p[i] = mm_idx; 
		bq[i] = li->qs; bt[i] = li->ts;
		if(mm_idx >= 0) {
			if(bq[i] > bq[mm_idx]) bq[i] = bq[mm_idx];
			if(bt[i] > bt[mm_idx]) bt[i] = bt[mm_idx];
		} 

        if ((max_ii < 0) || ((ch[i].qe<=max_dis+ch[max_ii].qe) && (f[max_ii]<f[i]))) {
            max_ii = i;
        }
		li->sec = (mm_idx<0?0x3FFFFFFF:i-mm_idx); sv[i] = *li;
		// if(ulid == 442462) {    
		// 	fprintf(stderr, "[M::%s::id->%u::%.*s]\tq::[%u, %u),\tt::[%u, %u),\tis_rev::%u\n", 
		// 	__func__, li->tn, (int)Get_NAME_LENGTH(R_INF, li->tn), Get_NAME(R_INF, li->tn), 
		// 	li->qs, li->qe, li->ts, li->te, li->rev);
		// }

	}
	// radix_sort_gfa64i
	for (i = 0; i < ch_n; ++i) {
		t[i] = ((uint64_t)f[i])<<32; t[i] += i; bt[i] = 0;
	}
	radix_sort_gfa64i(t, t+ch_n);
	int64_t n_u, z;
	for (z = ch_n-1, n_u = 0; z >= 0; --z) {
		k = (uint32_t)t[z];
		if(bt[k]) continue;
		i = k; ch[n_u]=sv[i]; sc = f[i];
		for (;i>=0;) {
			if(sv[i].qs < ch[n_u].qs) ch[n_u].qs = sv[i].qs;
			if(sv[i].ts < ch[n_u].ts) ch[n_u].ts = sv[i].ts;
			if(sv[i].qe > ch[n_u].qe) ch[n_u].qe = sv[i].qe;
			if(sv[i].te > ch[n_u].te) ch[n_u].te = sv[i].te;
			// ch[n_u].qn = i;//start idx of read alignment in chain
			bt[i] = 1; i = p[i];
		}
		adjust_rev_tse(&(ch[n_u]), rg->seq[ch[n_u].tn].len, &its, &ite);
		ch[n_u].ts = its; ch[n_u].te = ite; ch[n_u].sec = (sc>0x3FFFFFFF?0x3FFFFFFF:sc);
		ch[n_u].qn = 0; 
		n_u++;
	}
	return n_u;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movsd %xmm0, -0x38(%rbp)
movq %r9, -0x40(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2e6094
movq $0x0, -0x8(%rbp)
jmp 0x2e6b0d
movq $0x0, -0xb0(%rbp)
movq $0x0, -0xb8(%rbp)
movq 0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x226f0
movq 0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0xc8(%rbp)
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xc0(%rbp)
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xa0(%rbp)
movq 0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
imulq $0x1c, -0x18(%rbp), %rax
addq %rax, %rsi
callq 0x27b350
movq $0x1, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
jg 0x2e61a1
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
je 0x2e615e
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
imulq $0x1c, -0x50(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
je 0x2e6191
movq -0x48(%rbp), %rax
subq -0x50(%rbp), %rax
cmpq $0x1, %rax
jle 0x2e6189
movq -0x10(%rbp), %rdi
imulq $0x1c, -0x50(%rbp), %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
imulq $0x1c, -0x48(%rbp), %rax
addq %rax, %rsi
callq 0x27b890
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x2e6193
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2e612a
movq -0xc8(%rbp), %rdi
movq -0x18(%rbp), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2100
movq $0x0, -0xd8(%rbp)
movq $0x0, -0xd0(%rbp)
movq $0x0, -0x48(%rbp)
movq $-0x1, -0xe0(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x2e6787
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xb0(%rbp), %rcx
subl 0x4(%rcx), %eax
movq -0xb0(%rbp), %rcx
movl 0x14(%rcx), %ecx
movq -0xb0(%rbp), %rdx
subl 0x10(%rdx), %ecx
cmpl %ecx, %eax
ja 0x2e6249
movq -0xb0(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xb0(%rbp), %rcx
subl 0x4(%rcx), %eax
movl %eax, -0x104(%rbp)
jmp 0x2e6263
movq -0xb0(%rbp), %rax
movl 0x14(%rax), %eax
movq -0xb0(%rbp), %rcx
subl 0x10(%rcx), %eax
movl %eax, -0x104(%rbp)
movl -0x104(%rbp), %eax
movl %eax, %eax
movq %rax, -0x68(%rbp)
movq $-0x1, -0x70(%rbp)
movq $-0x1, -0x78(%rbp)
movq $0x0, -0xe8(%rbp)
movq $-0x1, -0xf0(%rbp)
movq -0x48(%rbp), %rax
cmpq 0x18(%rbp), %rax
jge 0x2e62aa
xorl %eax, %eax
movq %rax, -0x110(%rbp)
jmp 0x2e62b9
movq -0x48(%rbp), %rax
subq 0x18(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x48(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0xd0(%rbp), %rax
jl 0x2e6401
movq -0x10(%rbp), %rax
imulq $0x1c, -0x50(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xb0(%rbp), %rcx
cmpl 0x4(%rcx), %eax
ja 0x2e6312
jmp 0x2e6401
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0xa0(%rbp), %rcx
movq -0xa8(%rbp), %r8
movsd -0x38(%rbp), %xmm0
movq -0x30(%rbp), %r9
callq 0x30dd60
movq %rax, -0x60(%rbp)
cmpq $-0x80000000, -0x60(%rbp) # imm = 0x80000000
jne 0x2e6353
jmp 0x2e63f0
movq -0x60(%rbp), %rax
cmpq -0x70(%rbp), %rax
jle 0x2e638b
movq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0xe8(%rbp)
jle 0x2e6389
movq -0xe8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xe8(%rbp)
jmp 0x2e63be
movq -0xc8(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x48(%rbp), %rax
jne 0x2e63bc
movq -0xe8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xe8(%rbp)
cmpq 0x10(%rbp), %rax
jle 0x2e63ba
jmp 0x2e6401
jmp 0x2e63bc
jmp 0x2e63be
movq -0xc0(%rbp), %rax
movq -0x50(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jl 0x2e63ee
movq -0x48(%rbp), %rdx
movq -0xc8(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq -0x50(%rbp), %rsi
movq (%rcx,%rsi,8), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x2e63f0
movq -0x50(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2e62d3
movq -0x50(%rbp), %rax
movq %rax, -0xf0(%rbp)
cmpq $0x0, -0xe0(%rbp)
jl 0x2e6444
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
imulq $0x1c, -0xe0(%rbp), %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
addq 0x20(%rbp), %rcx
cmpq %rcx, %rax
jle 0x2e6509
movq $-0x80000000, -0x90(%rbp) # imm = 0x80000000
movq $-0x1, -0xe0(%rbp)
movq -0x48(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rcx
xorl %eax, %eax
cmpq -0xd0(%rbp), %rcx
movb %al, -0x111(%rbp)
jl 0x2e64ac
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0x20(%rbp), %rcx
movq -0x10(%rbp), %rdx
imulq $0x1c, -0x50(%rbp), %rsi
addq %rsi, %rdx
movl 0x8(%rdx), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
setle %al
movb %al, -0x111(%rbp)
movb -0x111(%rbp), %al
testb $0x1, %al
jne 0x2e64b8
jmp 0x2e6507
movq -0x90(%rbp), %rax
movq -0x98(%rbp), %rcx
movq -0x50(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpq %rcx, %rax
jge 0x2e64f4
movq -0x98(%rbp), %rax
movq -0x50(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq %rax, -0x90(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xe0(%rbp)
jmp 0x2e64f6
movq -0x50(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2e6466
jmp 0x2e6509
cmpq $0x0, -0xe0(%rbp)
jl 0x2e65b9
movq -0xe0(%rbp), %rax
cmpq -0xf0(%rbp), %rax
jge 0x2e65b9
movq -0x10(%rbp), %rax
imulq $0x1c, -0xe0(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xb0(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jbe 0x2e65b7
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
movq -0xa0(%rbp), %rcx
movq -0xa8(%rbp), %r8
movsd -0x38(%rbp), %xmm0
movq -0x30(%rbp), %r9
callq 0x30dd60
movq %rax, -0x60(%rbp)
cmpq $-0x80000000, -0x60(%rbp) # imm = 0x80000000
je 0x2e65b5
movq -0x60(%rbp), %rax
cmpq -0x70(%rbp), %rax
jle 0x2e65b3
movq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x2e65b5
jmp 0x2e65b7
jmp 0x2e65b9
cmpq $0x0, -0x78(%rbp)
jge 0x2e65c8
movq -0x68(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl %eax, %edx
movq -0x98(%rbp), %rax
movq -0x48(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x78(%rbp), %rdx
movq -0xc0(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0xb0(%rbp), %rax
movl 0x4(%rax), %edx
movq -0xa0(%rbp), %rax
movq -0x48(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0xb0(%rbp), %rax
movl 0x10(%rax), %edx
movq -0xa8(%rbp), %rax
movq -0x48(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
cmpq $0x0, -0x78(%rbp)
jl 0x2e669c
movq -0xa0(%rbp), %rax
movq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0xa0(%rbp), %rcx
movq -0x78(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x2e6660
movq -0xa0(%rbp), %rax
movq -0x78(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0xa0(%rbp), %rax
movq -0x48(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0xa8(%rbp), %rax
movq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0xa8(%rbp), %rcx
movq -0x78(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x2e669a
movq -0xa8(%rbp), %rax
movq -0x78(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0xa8(%rbp), %rax
movq -0x48(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x2e669c
cmpq $0x0, -0xe0(%rbp)
jl 0x2e66f4
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0x20(%rbp), %rcx
movq -0x10(%rbp), %rdx
imulq $0x1c, -0xe0(%rbp), %rsi
addq %rsi, %rdx
movl 0x8(%rdx), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jg 0x2e66ff
movq -0x98(%rbp), %rax
movq -0xe0(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x98(%rbp), %rcx
movq -0x48(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2e66ff
movq -0x48(%rbp), %rax
movq %rax, -0xe0(%rbp)
cmpq $0x0, -0x78(%rbp)
jge 0x2e6714
movl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movq %rax, -0x120(%rbp)
jmp 0x2e6723
movq -0x48(%rbp), %rax
subq -0x78(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rax
movl %eax, %edx
movq -0xb0(%rbp), %rax
movl 0x18(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x18(%rax)
movq -0xb0(%rbp), %rcx
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2e61e0
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x2e67f2
movq -0x98(%rbp), %rax
movq -0x48(%rbp), %rcx
movslq (%rax,%rcx,4), %rdx
shlq $0x20, %rdx
movq -0xc8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x48(%rbp), %rdx
movq -0xc8(%rbp), %rax
movq -0x48(%rbp), %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0xa8(%rbp), %rax
movq -0x48(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2e678f
movq -0xc8(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movq -0x18(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x27ae10
movq -0x18(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x100(%rbp)
movq $0x0, -0xf8(%rbp)
cmpq $0x0, -0x100(%rbp)
jl 0x2e6b02
movq -0xc8(%rbp), %rax
movq -0x100(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x58(%rbp)
movq -0xa8(%rbp), %rax
movq -0x58(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x2e6866
jmp 0x2e6aeb
movq -0x58(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rcx
imulq $0x1c, -0x48(%rbp), %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xf8(%rbp), %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
movq -0x98(%rbp), %rax
movq -0x48(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x48(%rbp)
jl 0x2e69fd
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
imulq $0x1c, -0xf8(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
jae 0x2e6907
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xf8(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq -0x10(%rbp), %rcx
imulq $0x1c, -0xf8(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jae 0x2e694b
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xf8(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
imulq $0x1c, -0xf8(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jbe 0x2e698f
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xf8(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq -0x10(%rbp), %rcx
imulq $0x1c, -0xf8(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x14(%rcx), %eax
jbe 0x2e69d3
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xf8(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x14(%rax)
movq -0xa8(%rbp), %rax
movq -0x48(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0xc0(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
jmp 0x2e68b8
movq -0x10(%rbp), %rdi
imulq $0x1c, -0xf8(%rbp), %rax
addq %rax, %rdi
movq 0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
imulq $0x1c, -0xf8(%rbp), %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdx
leaq -0x88(%rbp), %rcx
callq 0x2cffe0
movq -0x80(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xf8(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movq -0x88(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xf8(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x14(%rax)
cmpq $0x3fffffff, -0x60(%rbp) # imm = 0x3FFFFFFF
jle 0x2e6a8d
movl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movq %rax, -0x128(%rbp)
jmp 0x2e6a98
movq -0x60(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xf8(%rbp), %rcx
addq %rcx, %rax
movl 0x18(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rax
imulq $0x1c, -0xf8(%rbp), %rcx
addq %rcx, %rax
movl $0x0, (%rax)
movq -0xf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf8(%rbp)
movq -0x100(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x100(%rbp)
jmp 0x2e682a
movq -0xf8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw (%rax,%rax)