// File: chhylp123[P]hifiasm/inter.cpp
// Function: worker_for_trans_ovlp(void*, long, int)
static void worker_for_trans_ovlp(void *data, long i, int tid) // callback for kt_for()
{
    ug_trans_t *s = (ug_trans_t*)data;
    ha_ovec_buf_t *b = s->hab[tid];
	kv_ul_ov_t *bl = &(s->ll[tid].tk);
    int64_t winLen = MIN((((double)THRESHOLD_MAX_SIZE)/s->diff_ec_ul), WINDOW);
	uint32_t high_occ = asm_opt.polyploidy + 1, k; uint64_t cnt, bn;
	overlap_region *aux_o = NULL; ul_ov_t *p;
	char *seq = s->ug->u.a[i].s; 
	int64_t len = s->ug->u.a[i].len;
	if((!s->is_ovlp) && (s->is_cnt)) s->idx_n.a[i] = 0;
	if(IF_HOM(i, (*(s->bub))) || s->ug->g->seq[i].del) return;

	// asprintf(&as, "\n[M::%s] rid::%ld, len::%lu, name::%.*s\n", __func__, s->id+i, s->len[i], (int32_t)UL_INF.nid.a[s->id+i].n, UL_INF.nid.a[s->id+i].a);
    // push_vlog(&(overall_zdbg->a[s->id+i]), as); free(as); as = NULL;

	if(!s->is_ovlp) {
		if(s->is_cnt) {
			s->idx_n.a[i] = ug_map_lchain(b->abl, i, seq, len, s->w, s->k, &(s->udb), NULL, NULL, s->bw_thres, s->bw_thres_double,
            	s->max_n_chain, 1, NULL, &(b->tmp_region), NULL, &(b->sp), &high_occ, NULL, 0, 1, 0.2, 3, s->is_HPC, NULL, 0, NULL, 0, s->mini_cut, s->chain_cut, NULL);
			// fprintf(stderr, "-1-[M::%s] rid::%ld, is_ovlp::%d, is_cnt::%d, len::%d, str::%u, s->idx_n.a[i]::%lu\n", 
			// 	__func__, i, s->is_ovlp, s->is_cnt, len, !!seq, s->idx_n.a[i]);
		} else {
			cnt = ug_map_lchain(b->abl, i, seq, len, s->w, s->k, &(s->udb), NULL, NULL, s->bw_thres, s->bw_thres_double,
				s->max_n_chain, 1, NULL, &(b->tmp_region), NULL, &(b->sp), &high_occ, NULL, 0, 1, 0.2, 3, s->is_HPC, s->idx_a.a + s->idx_n.a[i], 0, NULL, 0, s->mini_cut, s->chain_cut, NULL);
			assert(cnt == ((s->idx_n.a[i+1]-s->idx_n.a[i])));
			// if(i == 1576 || i == 2879) {
			// 	fprintf(stderr, "-2-[M::%s] rid::%ld, is_ovlp::%d, is_cnt::%d, len::%ld, str::%u, cnt::%lu\n", 
			// 	__func__, i, s->is_ovlp, s->is_cnt, len, !!seq, cnt);
			// }
		}
		return;
	} else {
		cnt = ((s->idx_n.a[i+1]-s->idx_n.a[i]));
		// fprintf(stderr, "\n-0-[M::%s] utg%.6u%c, rid::%ld, is_ovlp::%d, is_cnt::%d, len::%ld, str::%u, cnt::%lu, diff::%f\n", 
		// 		__func__, (uint32_t)i+1, "lc"[s->ug->u.a[i].circ], i, s->is_ovlp, s->is_cnt, len, (uint32_t)(!!seq), cnt, s->diff_ec_ul);
		///note: high_occ is different
		ug_map_lchain(b->abl, i, seq, len, s->w, s->k, &(s->udb), &b->olist, &b->clist, s->bw_thres, s->bw_thres_double,
				s->max_n_chain, 1, NULL, &(b->tmp_region), NULL, &(b->sp), &high_occ, NULL, 0, 1, 0.2, 3, s->is_HPC, s->idx_a.a + s->idx_n.a[i], cnt, s->srt_a.a, s->srt_a.n, s->mini_cut, s->chain_cut, NULL);
	}
	
	filter_by_reliable_ovlp(i, s->filter, &(b->sp), &b->olist, &(s->udb), s->sec_cutoff, 0);
	// fprintf(stderr, "-0-[M::%s] rid::%ld, is_ovlp::%d, is_cnt::%d, len::%ld, str::%u\n", 
	// __func__, i, s->is_ovlp, s->is_cnt, len, !!seq);
	clear_Cigar_record(&b->cigar1); clear_Round2_alignment(&b->round2);
	
	ug_lalign(&b->olist, &b->clist, &(s->udb), s->uopt, seq, len, &b->self_read, &b->ovlp_read,
                        &b->correct, &b->exz, aux_o, s->diff_ec_ul, winLen, i, s->k, s->chain_cut, NULL);
	
	aux_o = gen_aux_ovlp(&b->olist);///must be here

	ug_lalign(&b->olist, &b->clist, &(s->udb), s->uopt, seq, len, &b->self_read, &b->ovlp_read,
						&b->correct, &b->exz, aux_o, s->diff_ec_ul, winLen, i, s->k, s->chain_cut, NULL);
	if(b->olist.length > 0) {
		cnt = bl->n + b->olist.length; kv_resize(ul_ov_t, (*bl), cnt);
		for (k = 0, bn = bl->n; k < b->olist.length; k++) {
			// if(b->olist.list[k].non_homopolymer_errors == 0) continue;///exact match is not trans
			kv_pushp(ul_ov_t, (*bl), &p);
			p->qn = i; p->tn = b->olist.list[k].y_id; p->el = 1; 
			p->sec = b->olist.list[k].non_homopolymer_errors; 
			p->rev = b->olist.list[k].y_pos_strand;
			p->qs = b->olist.list[k].x_pos_s; p->qe = b->olist.list[k].x_pos_e+1;
			// p->ts = b->olist.list[k].y_pos_s; p->te = b->olist.list[k].y_pos_e+1;
			if(p->rev) {
				p->ts = s->udb.ug->u.a[p->tn].len - (b->olist.list[k].y_pos_e+1); 
				p->te = s->udb.ug->u.a[p->tn].len - b->olist.list[k].y_pos_s;
			} else {
				p->ts = b->olist.list[k].y_pos_s; 
				p->te = b->olist.list[k].y_pos_e+1;
			}
			// if(i == 5) 
			// {
			// 	fprintf(stderr, "***utg%.6u%c\t%u\t%u\t%u\t%c\tutg%.6u%c\t%u\t%u\t%u\ti::%ld\n", 
			// 		p->qn+1, "lc"[s->ug->u.a[p->qn].circ], s->ug->u.a[p->qn].len, p->qs, p->qe, "+-"[p->rev],
			// 		p->tn+1, "lc"[s->ug->u.a[p->tn].circ], s->ug->u.a[p->tn].len, p->ts, p->te, i);
			// }
			if(!trans_ovlp_connect(p, s->ug)) {
				bl->n--;
			} 
			// else {
			// 	if(i == 5) 
			// 	{
			// 		fprintf(stderr, ">>>utg%.6u%c\t%u\t%u\t%u\t%c\tutg%.6u%c\t%u\t%u\t%u\ti::%ld\n", 
			// 			p->qn+1, "lc"[s->ug->u.a[p->qn].circ], s->ug->u.a[p->qn].len, p->qs, p->qe, "+-"[p->rev],
			// 			p->tn+1, "lc"[s->ug->u.a[p->tn].circ], s->ug->u.a[p->tn].len, p->ts, p->te, i);
			// 	}
			// }
		}
		cnt = filter_sec_trans_ovlp(bl->a+bn, bl->n-bn, i, s->sec_cutoff) + bn;
		bl->n = cnt;
	}


	// fprintf(stderr, "[M::%s] rid:%ld, dd:%u\n", __func__, s->id+i, UL_INF.a[s->id+i].dd);
    // int64_t mem[6], mem_hab[6];
    // if(get_utepdat_t_mem_tid(s, tid, mem, mem_hab)>((int64_t)5*(int64_t)1073741824)) {
    //     fprintf(stderr, "[M::%s::tid->%d::rid->%ld] buffer[0]: %.3fGB(%.3fGB::%.3fGB::%.3fGB::%.3fGB::%.3fGB), buffer[1]: %.3fGB, buffer[2]: %.3fGB, buffer[3]: %.3fGB, buffer[4]: %.3fGB, buffer[5]: %.3fGB\n", 
    //             __func__, tid, i, mem[0]/1073741824.0, 
	// 			mem_hab[0]/1073741824.0, mem_hab[1]/1073741824.0, mem_hab[2]/1073741824.0, 
	// 			mem_hab[3]/1073741824.0, mem_hab[4]/1073741824.0,
	// 			mem[1]/1073741824.0, mem[2]/1073741824.0,
    //             mem[3]/1073741824.0, mem[4]/1073741824.0, mem[5]/1073741824.0);
    // }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
addq $0x18, %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rax
movsd 0x800a6(%rip), %xmm1    # 0x3822a8
divsd 0x40(%rax), %xmm1
movsd 0x80091(%rip), %xmm0    # 0x3822a0
ucomisd %xmm1, %xmm0
jb 0x302230
movq -0x48(%rbp), %rax
movsd 0x80087(%rip), %xmm0    # 0x3822a8
divsd 0x40(%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
jmp 0x302242
movsd 0x80068(%rip), %xmm0    # 0x3822a0
movsd %xmm0, -0xa0(%rbp)
jmp 0x302242
movsd -0xa0(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x60(%rbp)
leaq 0xc259e(%rip), %rax     # 0x3c47f8
movl 0x1bc(%rax), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0x98(%rbp)
movq -0x48(%rbp), %rax
cmpl $0x0, 0xb8(%rax)
jne 0x3022e2
movq -0x48(%rbp), %rax
cmpl $0x0, 0xb4(%rax)
je 0x3022e2
movq -0x48(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x48(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
ja 0x30232b
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq -0x38(%rbp), %rcx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x302330
jmp 0x302f2f
movq -0x48(%rbp), %rax
cmpl $0x0, 0xb8(%rax)
jne 0x3026b1
movq -0x48(%rbp), %rax
cmpl $0x0, 0xb4(%rax)
je 0x3024ce
movq -0x50(%rbp), %rax
movq 0xe8(%rax), %rdi
movq -0x38(%rbp), %rax
movl %eax, %esi
movq -0x90(%rbp), %rdx
movq -0x98(%rbp), %rcx
movq -0x48(%rbp), %rax
movslq 0x30(%rax), %r8
movq -0x48(%rbp), %rax
movslq 0x34(%rax), %r9
movq -0x48(%rbp), %r13
addq $0xc8, %r13
movq -0x48(%rbp), %rax
movsd 0x38(%rax), %xmm0
movq -0x48(%rbp), %rax
movsd 0x50(%rax), %xmm1
movq -0x48(%rbp), %rax
movl 0x60(%rax), %r12d
movq -0x50(%rbp), %r15
addq $0x121a0, %r15          # imm = 0x121A0
movq -0x50(%rbp), %r14
addq $0x12250, %r14          # imm = 0x12250
movq -0x48(%rbp), %rax
movl 0xa0(%rax), %r11d
movq -0x48(%rbp), %rax
movslq 0xbc(%rax), %r10
movq -0x48(%rbp), %rax
movslq 0xc0(%rax), %rax
movq %rax, -0xa8(%rbp)
xorl %eax, %eax
leaq -0x64(%rbp), %rbx
xorl %eax, %eax
movq -0xa8(%rbp), %rax
movsd 0x7cc15(%rip), %xmm2    # 0x37f010
movq %r13, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movl %r12d, 0x18(%rsp)
movl $0x1, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq %r15, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq %r14, 0x40(%rsp)
movq %rbx, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movl $0x0, 0x58(%rsp)
movl $0x1, 0x60(%rsp)
movl $0x3, 0x68(%rsp)
movl %r11d, 0x70(%rsp)
movq $0x0, 0x78(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0x88(%rsp)
movq $0x0, 0x90(%rsp)
movq %r10, 0x98(%rsp)
movq %rax, 0xa0(%rsp)
movq $0x0, 0xa8(%rsp)
callq 0x1b3e60
movq %rax, %rdx
movq -0x48(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x3026ac
movq -0x50(%rbp), %rax
movq 0xe8(%rax), %rdi
movq -0x38(%rbp), %rax
movl %eax, %esi
movq -0x90(%rbp), %rdx
movq -0x98(%rbp), %rcx
movq -0x48(%rbp), %rax
movslq 0x30(%rax), %r8
movq -0x48(%rbp), %rax
movslq 0x34(%rax), %r9
movq -0x48(%rbp), %rax
addq $0xc8, %rax
movq %rax, -0xb8(%rbp)
movq -0x48(%rbp), %rax
movsd 0x38(%rax), %xmm0
movq -0x48(%rbp), %rax
movsd 0x50(%rax), %xmm1
movq -0x48(%rbp), %rax
movl 0x60(%rax), %r13d
movq -0x50(%rbp), %r12
addq $0x121a0, %r12          # imm = 0x121A0
movq -0x50(%rbp), %r15
addq $0x12250, %r15          # imm = 0x12250
movq -0x48(%rbp), %rax
movl 0xa0(%rax), %ebx
movq -0x48(%rbp), %rax
movq 0x70(%rax), %r11
movq -0x48(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x38(%rbp), %r10
imulq $0x18, (%rax,%r10,8), %rax
addq %rax, %r11
movq -0x48(%rbp), %rax
movslq 0xbc(%rax), %r10
movq -0x48(%rbp), %rax
movslq 0xc0(%rax), %rax
movq %rax, -0xb0(%rbp)
xorl %eax, %eax
leaq -0x64(%rbp), %r14
xorl %eax, %eax
movq -0xb8(%rbp), %rax
movsd 0x7ca75(%rip), %xmm2    # 0x37f010
movq %rax, (%rsp)
movq -0xb0(%rbp), %rax
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movl %r13d, 0x18(%rsp)
movl $0x1, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq %r12, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq %r15, 0x40(%rsp)
movq %r14, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movl $0x0, 0x58(%rsp)
movl $0x1, 0x60(%rsp)
movl $0x3, 0x68(%rsp)
movl %ebx, 0x70(%rsp)
movq %r11, 0x78(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0x88(%rsp)
movq $0x0, 0x90(%rsp)
movq %r10, 0x98(%rsp)
movq %rax, 0xa0(%rsp)
movq $0x0, 0xa8(%rsp)
callq 0x1b3e60
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x88(%rcx), %rcx
movq -0x38(%rbp), %rdx
movq 0x8(%rcx,%rdx,8), %rcx
movq -0x48(%rbp), %rdx
movq 0x88(%rdx), %rdx
movq -0x38(%rbp), %rsi
subq (%rdx,%rsi,8), %rcx
cmpq %rcx, %rax
jne 0x30268b
jmp 0x3026aa
leaq 0x937d0(%rip), %rdi     # 0x395e62
leaq 0x8e196(%rip), %rsi     # 0x39082f
movl $0x25f6, %edx           # imm = 0x25F6
leaq 0x937e6(%rip), %rcx     # 0x395e8b
callq 0x2130
jmp 0x3026ac
jmp 0x302f2f
movq -0x48(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq -0x48(%rbp), %rcx
movq 0x88(%rcx), %rcx
movq -0x38(%rbp), %rdx
subq (%rcx,%rdx,8), %rax
movq %rax, -0x70(%rbp)
movq -0x50(%rbp), %rax
movq 0xe8(%rax), %rdi
movq -0x38(%rbp), %rax
movl %eax, %esi
movq -0x90(%rbp), %rdx
movq -0x98(%rbp), %rcx
movq -0x48(%rbp), %rax
movslq 0x30(%rax), %r8
movq -0x48(%rbp), %rax
movslq 0x34(%rax), %r9
movq -0x48(%rbp), %rax
addq $0xc8, %rax
movq %rax, -0xf0(%rbp)
movq -0x50(%rbp), %rax
addq $0xa0, %rax
movq %rax, -0xe8(%rbp)
movq -0x50(%rbp), %rax
addq $0x48, %rax
movq %rax, -0xe0(%rbp)
movq -0x48(%rbp), %rax
movsd 0x38(%rax), %xmm0
movq -0x48(%rbp), %rax
movsd 0x50(%rax), %xmm1
movq -0x48(%rbp), %rax
movl 0x60(%rax), %eax
movl %eax, -0xd4(%rbp)
movq -0x50(%rbp), %rax
addq $0x121a0, %rax          # imm = 0x121A0
movq %rax, -0xd0(%rbp)
movq -0x50(%rbp), %rax
addq $0x12250, %rax          # imm = 0x12250
movq %rax, -0xc8(%rbp)
movq -0x48(%rbp), %rax
movl 0xa0(%rax), %r12d
movq -0x48(%rbp), %rax
movq 0x70(%rax), %r15
movq -0x48(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x38(%rbp), %r10
imulq $0x18, (%rax,%r10,8), %rax
addq %rax, %r15
movq -0x70(%rbp), %r14
movq -0x48(%rbp), %rax
movq 0x98(%rax), %rbx
movq -0x48(%rbp), %rax
movl 0x90(%rax), %eax
movl %eax, %r11d
movq -0x48(%rbp), %rax
movslq 0xbc(%rax), %r10
movq -0x48(%rbp), %rax
movslq 0xc0(%rax), %rax
movq %rax, -0xc0(%rbp)
xorl %eax, %eax
leaq -0x64(%rbp), %r13
xorl %eax, %eax
movq -0xf0(%rbp), %rax
movsd 0x7c819(%rip), %xmm2    # 0x37f010
movq %rax, (%rsp)
movq -0xe8(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0xe0(%rbp), %rax
movq %rax, 0x10(%rsp)
movl -0xd4(%rbp), %eax
movl %eax, 0x18(%rsp)
movq -0xd0(%rbp), %rax
movl $0x1, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq -0xc8(%rbp), %rax
movq $0x0, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movq -0xc0(%rbp), %rax
movq %r13, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movl $0x0, 0x58(%rsp)
movl $0x1, 0x60(%rsp)
movl $0x3, 0x68(%rsp)
movl %r12d, 0x70(%rsp)
movq %r15, 0x78(%rsp)
movq %r14, 0x80(%rsp)
movq %rbx, 0x88(%rsp)
movq %r11, 0x90(%rsp)
movq %r10, 0x98(%rsp)
movq %rax, 0xa0(%rsp)
movq $0x0, 0xa8(%rsp)
callq 0x1b3e60
movq -0x38(%rbp), %rax
movl %eax, %edi
movq -0x48(%rbp), %rax
movq 0xf8(%rax), %rsi
movq -0x50(%rbp), %rdx
addq $0x12250, %rdx          # imm = 0x12250
movq -0x50(%rbp), %rcx
addq $0xa0, %rcx
movq -0x48(%rbp), %r8
addq $0xc8, %r8
movq -0x48(%rbp), %rax
movsd 0x48(%rax), %xmm0
xorl %r9d, %r9d
callq 0x2bc3e0
movq -0x50(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
callq 0x31d60
movq -0x50(%rbp), %rdi
addq $0x9330, %rdi           # imm = 0x9330
callq 0x31cb0
movq -0x50(%rbp), %rdi
addq $0xa0, %rdi
movq -0x50(%rbp), %rsi
addq $0x48, %rsi
movq -0x48(%rbp), %rdx
addq $0xc8, %rdx
movq -0x48(%rbp), %rax
movq (%rax), %rcx
movq -0x90(%rbp), %r8
movq -0x98(%rbp), %r9
movq -0x50(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x110(%rbp)
movq -0x50(%rbp), %r13
addq $0x28, %r13
movq -0x50(%rbp), %r12
addq $0x2c0, %r12            # imm = 0x2C0
movq -0x50(%rbp), %r15
addq $0x12268, %r15          # imm = 0x12268
movq -0x80(%rbp), %r14
movq -0x48(%rbp), %rax
movsd 0x40(%rax), %xmm0
movq -0x60(%rbp), %rbx
movq -0x38(%rbp), %r11
movq -0x48(%rbp), %rax
movslq 0x34(%rax), %r10
movq -0x48(%rbp), %rax
movslq 0xc0(%rax), %rax
movq %rax, -0x108(%rbp)
xorl %eax, %eax
movq -0x110(%rbp), %rax
movq %rax, (%rsp)
movq -0x108(%rbp), %rax
movq %r13, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq %r15, 0x18(%rsp)
movq %r14, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movq %r11, 0x30(%rsp)
movq %r10, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
callq 0x9bba0
movq -0x50(%rbp), %rdi
addq $0xa0, %rdi
callq 0x2b0b20
movq %rax, -0x80(%rbp)
movq -0x50(%rbp), %rdi
addq $0xa0, %rdi
movq -0x50(%rbp), %rsi
addq $0x48, %rsi
movq -0x48(%rbp), %rdx
addq $0xc8, %rdx
movq -0x48(%rbp), %rax
movq (%rax), %rcx
movq -0x90(%rbp), %r8
movq -0x98(%rbp), %r9
movq -0x50(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x100(%rbp)
movq -0x50(%rbp), %r13
addq $0x28, %r13
movq -0x50(%rbp), %r12
addq $0x2c0, %r12            # imm = 0x2C0
movq -0x50(%rbp), %r15
addq $0x12268, %r15          # imm = 0x12268
movq -0x80(%rbp), %r14
movq -0x48(%rbp), %rax
movsd 0x40(%rax), %xmm0
movq -0x60(%rbp), %rbx
movq -0x38(%rbp), %r11
movq -0x48(%rbp), %rax
movslq 0x34(%rax), %r10
movq -0x48(%rbp), %rax
movslq 0xc0(%rax), %rax
movq %rax, -0xf8(%rbp)
xorl %eax, %eax
movq -0x100(%rbp), %rax
movq %rax, (%rsp)
movq -0xf8(%rbp), %rax
movq %r13, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq %r15, 0x18(%rsp)
movq %r14, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movq %r11, 0x30(%rsp)
movq %r10, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
callq 0x9bba0
movq -0x50(%rbp), %rax
cmpq $0x0, 0xb0(%rax)
jbe 0x302f2f
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x50(%rbp), %rcx
addq 0xb0(%rcx), %rax
movq %rax, -0x70(%rbp)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x70(%rbp), %rax
jae 0x302be5
movq -0x70(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rcx
shrq %rcx
movq -0x58(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rcx
shrq $0x2, %rcx
movq -0x58(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rcx
shrq $0x4, %rcx
movq -0x58(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rcx
shrq $0x8, %rcx
movq -0x58(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rcx
shrq $0x10, %rcx
movq -0x58(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rax
movq (%rax), %rdi
movq -0x58(%rbp), %rax
imulq $0x1c, 0x10(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, (%rax)
jmp 0x302be7
movl $0x0, -0x68(%rbp)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x78(%rbp)
movl -0x68(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpq 0xb0(%rcx), %rax
jae 0x302ee8
jmp 0x302c10
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x58(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x302c7d
movq -0x58(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x302c41
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x118(%rbp)
jmp 0x302c4f
movl $0x2, %eax
movq %rax, -0x118(%rbp)
jmp 0x302c4f
movq -0x118(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rax
movq (%rax), %rdi
movq -0x58(%rbp), %rax
imulq $0x1c, 0x10(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq -0x58(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x8(%rdx)
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x88(%rbp), %rax
movl %ecx, (%rax)
movq -0x50(%rbp), %rax
movq 0xa0(%rax), %rax
movl -0x68(%rbp), %ecx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x88(%rbp), %rax
movl 0x18(%rax), %ecx
andl $0xbfffffff, %ecx       # imm = 0xBFFFFFFF
orl $0x40000000, %ecx       # imm = 0x40000000
movl %ecx, 0x18(%rax)
movq -0x50(%rbp), %rax
movq 0xa0(%rax), %rax
movl -0x68(%rbp), %ecx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x30(%rax), %edx
movq -0x88(%rbp), %rax
movl 0x18(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x18(%rax)
movq -0x50(%rbp), %rax
movq 0xa0(%rax), %rax
movl -0x68(%rbp), %ecx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %edx
movq -0x88(%rbp), %rax
movl 0x18(%rax), %ecx
andl $0x1, %edx
shll $0x1f, %edx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl %edx, %ecx
movl %ecx, 0x18(%rax)
movq -0x50(%rbp), %rax
movq 0xa0(%rax), %rax
movl -0x68(%rbp), %ecx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x50(%rbp), %rax
movq 0xa0(%rax), %rax
movl -0x68(%rbp), %ecx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x88(%rbp), %rax
movl 0x18(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x302e62
movq -0x48(%rbp), %rax
movq 0xc8(%rax), %rax
movq 0x10(%rax), %rax
movq -0x88(%rbp), %rcx
movl 0xc(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x50(%rbp), %rax
movq 0xa0(%rax), %rax
movl -0x68(%rbp), %edx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rax
movl 0x18(%rax), %eax
addl $0x1, %eax
subl %eax, %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x48(%rbp), %rax
movq 0xc8(%rax), %rax
movq 0x10(%rax), %rax
movq -0x88(%rbp), %rcx
movl 0xc(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x50(%rbp), %rax
movq 0xa0(%rax), %rax
movl -0x68(%rbp), %edx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rax
subl 0x14(%rax), %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x14(%rax)
jmp 0x302eaf
movq -0x50(%rbp), %rax
movq 0xa0(%rax), %rax
movl -0x68(%rbp), %ecx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x50(%rbp), %rax
movq 0xa0(%rax), %rax
movl -0x68(%rbp), %ecx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x88(%rbp), %rdi
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x2bbdc0
cmpl $0x0, %eax
jne 0x302ed8
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
jmp 0x302eda
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x302bfa
movq -0x58(%rbp), %rax
movq (%rax), %rdi
imulq $0x1c, -0x78(%rbp), %rax
addq %rax, %rdi
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
subq -0x78(%rbp), %rax
movl %eax, %esi
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x48(%rbp), %rax
movsd 0x48(%rax), %xmm0
callq 0x2bb7e0
movl %eax, %eax
addq -0x78(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)