// File: chhylp123[P]hifiasm/inter.cpp
// Function: linear_chain_dp_adv(ul_ov_t*, long, ul_ov_t*, ul_idx_t const*, ug_opt_t const*, long, double, long, long, long, long, Chain_Data*, ma_ug_t*, long)
uint64_t linear_chain_dp_adv(ul_ov_t *ch, int64_t ch_n, ul_ov_t *sv, const ul_idx_t *uref, 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, ma_ug_t *ug, 
int64_t chain_offset)
{	///all in[].el must be 1
	if(ch_n == 0) return 0;
    int64_t /**mm_ovlp, x,**/ i, j, k, sc, csc, mm_sc, mm_idx, its, ite, max;
    ul_ov_t *li = NULL, *lj = NULL; int64_t *p, *t, st, plus, max_ii, n_skip, end_j; int32_t *f;
	resize_Chain_Data(dp, ch_n, NULL);
	t = dp->tmp; f = dp->score; p = dp->pre;

    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;
        }
    }

	// fprintf(stderr, "[M::%s::] ch_n:%ld\n", __func__, ch_n);
	memset(t, 0, (ch_n*sizeof((*t))));
	for (i = st = plus = 0, max_ii = -1; i < ch_n; ++i) {
		li = &(ch[i]); csc = li->qe - li->qs;
		mm_sc = csc; 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]); 
			sc = comput_linear_sc(li, lj, diff_ec_ul, bw); ///should allow contain
			if(sc == INT32_MIN) continue;
			sc += f[j];
			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]); 
			sc = comput_linear_sc(li, lj, diff_ec_ul, bw); ///should allow contain
			if(sc != INT32_MIN) {
				sc += f[max_ii];
				if(sc > mm_sc) {
					mm_sc = sc; mm_idx = max_ii;
				}
			}
		}

		f[i] = mm_sc; p[i] = 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;
		// fprintf(stderr, "##(%ld) %u\t%u\t%c\tutg%.6d%c(%u)\t%u\t%u\tmm_idx:%ld\tmm_sc:%ld\n", i, li->qs, li->qe, "+-"[li->rev], 
        // (int32_t)(li->tn)+1, "lc"[uref->ug->u.a[li->tn].circ], uref->ug->u.a[li->tn].len, li->ts, li->te, mm_idx, mm_sc);
		// track[i] = push_sc_pre(mm_sc, mm_idx); 
		// li->sec = (mm_idx<0?0x3FFFFFFF:i-mm_idx); sv[i] = *li;
	}

	for (i = 0; i < ch_n; ++i) t[i] = 0;
	int64_t n_u;
	for (k = ch_n-1, n_u = 0; k >= 0; --k) {
		if(t[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
			t[i] = 1; i = p[i];
		}
		adjust_rev_tse(&(ch[n_u]), ug->g->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 += chain_offset; //start idx of read alignment in chain
		// ch[n_u].tn = k + chain_offset; //end idx of read alignment in chain
		ch[n_u].qn = k + chain_offset; //end idx of read alignment in chain
		n_u++;
	}
	for (i = 0; i < ch_n; ++i) {
		adjust_rev_tse(&(sv[i]), ug->g->seq[sv[i].tn].len, &its, &ite);
		sv[i].ts = its; sv[i].te = ite; 
		k = p[i]; sv[i].tn = k>=0?k+chain_offset:(uint32_t)-1;
	}
	return n_u;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq 0x40(%rbp), %rax
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)
movq %r9, -0x38(%rbp)
movsd %xmm0, -0x40(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2d0b88
movq $0x0, -0x8(%rbp)
jmp 0x2d1520
movq $0x0, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
movq 0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x226f0
movq 0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0xb0(%rbp)
movq 0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xe0(%rbp)
movq 0x30(%rbp), %rax
movq 0x8(%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 0x2d0c77
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
je 0x2d0c34
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 0x2d0c67
movq -0x48(%rbp), %rax
subq -0x50(%rbp), %rax
cmpq $0x1, %rax
jle 0x2d0c5f
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 0x2d0c69
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2d0c00
movq -0xb0(%rbp), %rdi
movq -0x18(%rbp), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2100
movq $0x0, -0xc0(%rbp)
movq $0x0, -0xb8(%rbp)
movq $0x0, -0x48(%rbp)
movq $-0x1, -0xc8(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x2d1120
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x98(%rbp), %rcx
subl 0x4(%rcx), %eax
movl %eax, %eax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x70(%rbp)
movq $-0x1, -0x78(%rbp)
movq $0x0, -0xd0(%rbp)
movq $-0x1, -0xd8(%rbp)
movq -0x48(%rbp), %rax
cmpq 0x20(%rbp), %rax
jge 0x2d0d2c
xorl %eax, %eax
movq %rax, -0xf0(%rbp)
jmp 0x2d0d3b
movq -0x48(%rbp), %rax
subq 0x20(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x48(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0xb8(%rbp), %rax
jl 0x2d0e6d
movq -0x10(%rbp), %rax
imulq $0x1c, -0x50(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movsd -0x40(%rbp), %xmm0
movq -0x38(%rbp), %rdx
callq 0x30d420
movq %rax, -0x60(%rbp)
cmpq $-0x80000000, -0x60(%rbp) # imm = 0x80000000
jne 0x2d0da8
jmp 0x2d0e5c
movq -0xe0(%rbp), %rax
movq -0x50(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x70(%rbp), %rax
jle 0x2d0df7
movq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0xd0(%rbp)
jle 0x2d0df5
movq -0xd0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xd0(%rbp)
jmp 0x2d0e2a
movq -0xb0(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x48(%rbp), %rax
jne 0x2d0e28
movq -0xd0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xd0(%rbp)
cmpq 0x18(%rbp), %rax
jle 0x2d0e26
jmp 0x2d0e6d
jmp 0x2d0e28
jmp 0x2d0e2a
movq -0xa8(%rbp), %rax
movq -0x50(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jl 0x2d0e5a
movq -0x48(%rbp), %rdx
movq -0xb0(%rbp), %rax
movq -0xa8(%rbp), %rcx
movq -0x50(%rbp), %rsi
movq (%rcx,%rsi,8), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x2d0e5c
movq -0x50(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2d0d55
movq -0x50(%rbp), %rax
movq %rax, -0xd8(%rbp)
cmpq $0x0, -0xc8(%rbp)
jl 0x2d0eb0
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
imulq $0x1c, -0xc8(%rbp), %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
addq 0x28(%rbp), %rcx
cmpq %rcx, %rax
jle 0x2d0f75
movq $-0x80000000, -0x90(%rbp) # imm = 0x80000000
movq $-0x1, -0xc8(%rbp)
movq -0x48(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rcx
xorl %eax, %eax
cmpq -0xb8(%rbp), %rcx
movb %al, -0xf1(%rbp)
jl 0x2d0f18
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0x28(%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, -0xf1(%rbp)
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0x2d0f24
jmp 0x2d0f73
movq -0x90(%rbp), %rax
movq -0xe0(%rbp), %rcx
movq -0x50(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpq %rcx, %rax
jge 0x2d0f60
movq -0xe0(%rbp), %rax
movq -0x50(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq %rax, -0x90(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xc8(%rbp)
jmp 0x2d0f62
movq -0x50(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2d0ed2
jmp 0x2d0f75
cmpq $0x0, -0xc8(%rbp)
jl 0x2d100e
movq -0xc8(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jge 0x2d100e
movq -0x10(%rbp), %rax
imulq $0x1c, -0xc8(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movsd -0x40(%rbp), %xmm0
movq -0x38(%rbp), %rdx
callq 0x30d420
movq %rax, -0x60(%rbp)
cmpq $-0x80000000, -0x60(%rbp) # imm = 0x80000000
je 0x2d100c
movq -0xe0(%rbp), %rax
movq -0xc8(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x70(%rbp), %rax
jle 0x2d100a
movq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x2d100c
jmp 0x2d100e
movq -0x70(%rbp), %rax
movl %eax, %edx
movq -0xe0(%rbp), %rax
movq -0x48(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x78(%rbp), %rdx
movq -0xa8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
cmpq $0x0, -0xc8(%rbp)
jl 0x2d108d
movq -0x10(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0x28(%rbp), %rcx
movq -0x10(%rbp), %rdx
imulq $0x1c, -0xc8(%rbp), %rsi
addq %rsi, %rdx
movl 0x8(%rdx), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jg 0x2d1098
movq -0xe0(%rbp), %rax
movq -0xc8(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0xe0(%rbp), %rcx
movq -0x48(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2d1098
movq -0x48(%rbp), %rax
movq %rax, -0xc8(%rbp)
cmpq $0x0, -0x78(%rbp)
jge 0x2d10ad
movl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movq %rax, -0x100(%rbp)
jmp 0x2d10bc
movq -0x48(%rbp), %rax
subq -0x78(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movl %eax, %edx
movq -0x98(%rbp), %rax
movl 0x18(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x18(%rax)
movq -0x98(%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 0x2d0cb6
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x2d1153
movq -0xb0(%rbp), %rax
movq -0x48(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2d1128
movq -0x18(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0xe8(%rbp)
cmpq $0x0, -0x58(%rbp)
jl 0x2d142d
movq -0xb0(%rbp), %rax
movq -0x58(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x2d118c
jmp 0x2d141c
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, -0xe8(%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 -0xe0(%rbp), %rax
movq -0x48(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x48(%rbp)
jl 0x2d1324
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
imulq $0x1c, -0xe8(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
jae 0x2d122d
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xe8(%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, -0xe8(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jae 0x2d1271
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xe8(%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, -0xe8(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jbe 0x2d12b5
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xe8(%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, -0xe8(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x14(%rcx), %eax
jbe 0x2d12f9
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xe8(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x14(%rax)
movq -0xb0(%rbp), %rax
movq -0x48(%rbp), %rcx
movq $0x1, (%rax,%rcx,8)
movq -0xa8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
jmp 0x2d11de
movq -0x10(%rbp), %rdi
imulq $0x1c, -0xe8(%rbp), %rax
addq %rax, %rdi
movq 0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
imulq $0x1c, -0xe8(%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, -0xe8(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movq -0x88(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xe8(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x14(%rax)
cmpq $0x3fffffff, -0x60(%rbp) # imm = 0x3FFFFFFF
jle 0x2d13b8
movl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movq %rax, -0x108(%rbp)
jmp 0x2d13c3
movq -0x60(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xe8(%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 -0x58(%rbp), %rax
addq 0x40(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
imulq $0x1c, -0xe8(%rbp), %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0xe8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xe8(%rbp)
movq -0x58(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x2d116a
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x2d1515
movq -0x20(%rbp), %rdi
imulq $0x1c, -0x48(%rbp), %rax
addq %rax, %rdi
movq 0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq -0x20(%rbp), %rcx
imulq $0x1c, -0x48(%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 -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movq -0x88(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x14(%rax)
movq -0xa8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jl 0x2d14de
movq -0x58(%rbp), %rax
addq 0x40(%rbp), %rax
movq %rax, -0x110(%rbp)
jmp 0x2d14ec
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x110(%rbp)
jmp 0x2d14ec
movq -0x110(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
imulq $0x1c, -0x48(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2d1435
movq -0xe8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopl (%rax)