// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/galign.c
// Function: mg_gchain_cigar
void mg_gchain_cigar(void *km, const gfa_t *g, const gfa_edseq_t *es, const char *qseq, mg_gchains_t *gt, const char *qname) // qname for debugging only
{
	int32_t i, l_seq = 0, m_seq = 0;
	char *seq = 0;
	void *km2;
	mg64_v cigar = {0,0,0};
	km2 = km_init2(km, 0);
	for (i = 0; i < gt->n_gc; ++i) {
		mg_gchain_t *gc = &gt->gc[i];
		int32_t l0 = gc->off;
		int32_t off_a0 = gt->lc[l0].off;
		int32_t j, j0 = 0, k, l;
		cigar.n = 0;
		append_cigar1(km, &cigar, 7, gt->a[off_a0].y>>32&0xff);
		for (j = 1; j < gc->n_anchor; ++j) {
			const mg128_t *q, *p = &gt->a[off_a0 + j];
			if ((p->y & MG_SEED_IGNORE) && j != gc->n_anchor - 1) continue;
			q = &gt->a[off_a0 + j0];
			// find the lchain that contains the anchor
			for (l = l0; l < gc->off + gc->cnt; ++l) {
				mg_llchain_t *r = &gt->lc[l];
				if (off_a0 + j >= r->off && off_a0 + j < r->off + r->cnt)
					break;
			}
			assert(l < gc->off + gc->cnt);
			assert((int32_t)q->x < g->seg[gt->lc[l0].v>>1].len);
			// calculate the target sequence length
			if (l == l0) {
				l_seq = (int32_t)p->x - (int32_t)q->x;
			} else {
				l_seq = g->seg[gt->lc[l0].v>>1].len - (int32_t)q->x - 1;
				for (k = l0 + 1; k < l; ++k)
					l_seq += es[gt->lc[k].v].len;
				l_seq += (int32_t)p->x + 1;
			}
			if (l_seq + 1 > m_seq) {
				m_seq = l_seq + 1;
				kroundup32(m_seq);
				KREALLOC(km, seq, m_seq);
			}
			// get the target sequence
			if (l == l0) { // on the same vertex
				memcpy(seq, &es[gt->lc[l0].v].seq[(int32_t)q->x + 1], l_seq);
			} else {
				uint32_t v = gt->lc[l0].v;
				l_seq = g->seg[v>>1].len - (int32_t)q->x - 1;
				memcpy(seq, &es[v].seq[(int32_t)q->x + 1], l_seq);
				for (k = l0 + 1; k < l; ++k) {
					v = gt->lc[k].v;
					memcpy(&seq[l_seq], es[v].seq, es[v].len);
					l_seq += es[v].len;
				}
				memcpy(&seq[l_seq], es[gt->lc[l].v].seq, (int32_t)p->x + 1);
				l_seq += (int32_t)p->x + 1;
			}
			{
				int32_t qlen = (int32_t)p->y - (int32_t)q->y;
				const char *qs = &qseq[(int32_t)q->y + 1];
				assert(l_seq > 0 || qlen > 0);
				if (l_seq == 0) append_cigar1(km, &cigar, 1, qlen);
				else if (qlen == 0) append_cigar1(km, &cigar, 2, l_seq);
				else if (l_seq == qlen && qlen <= (q->y>>32&0xff)) append_cigar1(km, &cigar, 7, qlen);
				else {
					mwf_opt_t opt;
					mwf_rst_t rst;
					mwf_opt_init(&opt);
					opt.flag |= MWF_F_CIGAR;
					mwf_wfa_auto(km2, &opt, l_seq, seq, qlen, qs, &rst);
					append_cigar(km, &cigar, rst.n_cigar, rst.cigar);
					kfree(km2, rst.cigar);
					if ((mg_dbg_flag&MG_DBG_MINIWFA) && l_seq > 5000 && qlen > 5000 && rst.s >= 10000)
						fprintf(stderr, "WL\t%s\t%d\t%d\t%d\t%d\t%d\n", qname, i, (int32_t)q->y + 1, (int32_t)p->y - (int32_t)q->y, l_seq, rst.s);
					if (rst.s >= 10000 && l_seq > 5000 && qlen > 5000) {
						km_destroy(km2);
						km2 = km_init2(km, 0);
					}
					if ((mg_dbg_flag&MG_DBG_MWF_SEQ) && l_seq > 5000 && qlen > 5000 && rst.s >= 10000) {
						char *str;
						str = Kmalloc(km, char, qlen + l_seq + strlen(qname) + 100);
						k = sprintf(str, "WL\t%s\t%d\t%d\t%d\nWT\t%.*s\nWQ\t%.*s\n", qname, i, (int32_t)q->y + 1, rst.s, l_seq, seq, qlen, qs);
						fwrite(str, 1, k, stderr);
						kfree(km, str);
					}
				}
			}
			j0 = j, l0 = l;
		}
		// save the CIGAR to gt->gc[i]
		gc->p = (mg_cigar_t*)kcalloc(gt->km, 1, cigar.n * 8 + sizeof(mg_cigar_t));
		gc->p->ss = (int32_t)gt->a[off_a0].x + 1 - (int32_t)(gt->a[off_a0].y>>32&0xff);
		gc->p->ee = (int32_t)gt->a[off_a0 + gc->n_anchor - 1].x + 1;
		gc->p->n_cigar = cigar.n;
		memcpy(gc->p->cigar, cigar.a, cigar.n * 8);
		for (j = 0, l = 0; j < gc->p->n_cigar; ++j) {
			int32_t op = gc->p->cigar[j]&0xf, len = gc->p->cigar[j]>>4;
			if (op == 7) gc->p->mlen += len, gc->p->blen += len;
			else gc->p->blen += len;
			if (op != 1) gc->p->aplen += len;
			if (op != 2) l += len;
		}
		memset(&gc->ds, 0, sizeof(gc->ds));
		assert(l == gc->qe - gc->qs && gc->p->aplen == gc->pe - gc->ps);
	}
	km_destroy(km2);
	kfree(km, seq);
	kfree(km, cigar.a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq $0x0, -0x50(%rbp)
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2190
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x24a0
movq %rax, -0x58(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x2a07a
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x74(%rbp)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x74(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x78(%rbp)
movl $0x0, -0x80(%rbp)
movl $0x0, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x78(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
movl %eax, %ecx
leaq -0x68(%rbp), %rsi
movl $0x7, %edx
callq 0x2a0b0
movl $0x1, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movq -0x70(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x29e48
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x78(%rbp), %ecx
addl -0x7c(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rcx
movabsq $0x20000000000, %rax    # imm = 0x20000000000
andq 0x8(%rcx), %rax
cmpq $0x0, %rax
je 0x29675
movl -0x7c(%rbp), %eax
movq -0x70(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x29675
jmp 0x29e3a
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x78(%rbp), %ecx
addl -0x80(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movl -0x74(%rbp), %eax
movl %eax, -0x88(%rbp)
movl -0x88(%rbp), %eax
movq -0x70(%rbp), %rcx
movl 0x8(%rcx), %ecx
movq -0x70(%rbp), %rdx
addl 0xc(%rdx), %ecx
cmpl %ecx, %eax
jge 0x29715
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x88(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movl -0x78(%rbp), %eax
addl -0x7c(%rbp), %eax
movq -0xa0(%rbp), %rcx
cmpl (%rcx), %eax
jl 0x29702
movl -0x78(%rbp), %eax
addl -0x7c(%rbp), %eax
movq -0xa0(%rbp), %rcx
movl (%rcx), %ecx
movq -0xa0(%rbp), %rdx
addl 0x4(%rdx), %ecx
cmpl %ecx, %eax
jge 0x29702
jmp 0x29715
jmp 0x29704
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0x2969d
movl -0x88(%rbp), %eax
movq -0x70(%rbp), %rcx
movl 0x8(%rcx), %ecx
movq -0x70(%rbp), %rdx
addl 0xc(%rdx), %ecx
cmpl %ecx, %eax
jge 0x2972f
jmp 0x2974e
leaq 0x149f5(%rip), %rdi     # 0x3e12b
leaq 0x140f4(%rip), %rsi     # 0x3d831
movl $0x3f, %edx
leaq 0x140f1(%rip), %rcx     # 0x3d83a
callq 0x2170
movq -0x90(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x30(%rbp), %rdx
movq 0x20(%rdx), %rdx
movslq -0x74(%rbp), %rsi
imulq $0x14, %rsi, %rsi
addq %rsi, %rdx
movl 0x8(%rdx), %edx
shrl %edx
movl %edx, %edx
shlq $0x6, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jge 0x29787
jmp 0x297a6
leaq 0x14119(%rip), %rdi     # 0x3d8a7
leaq 0x1409c(%rip), %rsi     # 0x3d831
movl $0x40, %edx
leaq 0x14099(%rip), %rcx     # 0x3d83a
callq 0x2170
movl -0x88(%rbp), %eax
cmpl -0x74(%rbp), %eax
jne 0x297cf
movq -0x98(%rbp), %rax
movq (%rax), %rax
movq -0x90(%rbp), %rcx
movq (%rcx), %rcx
subl %ecx, %eax
movl %eax, -0x40(%rbp)
jmp 0x29877
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x20(%rcx), %rcx
movslq -0x74(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x90(%rbp), %rcx
movq (%rcx), %rcx
subl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x88(%rbp), %eax
jge 0x29864
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x20(%rcx), %rcx
movslq -0x84(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
addl -0x40(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x29818
movq -0x98(%rbp), %rax
movq (%rax), %rax
addl $0x1, %eax
addl -0x40(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
cmpl -0x44(%rbp), %eax
jle 0x298f1
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
sarl %eax
orl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
sarl $0x2, %eax
orl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
sarl $0x4, %eax
orl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
sarl $0x8, %eax
orl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
sarl $0x10, %eax
orl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
movslq -0x44(%rbp), %rdx
shlq $0x0, %rdx
callq 0x2ae0
movq %rax, -0x50(%rbp)
movl -0x88(%rbp), %eax
cmpl -0x74(%rbp), %eax
jne 0x29944
movq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x20(%rcx), %rcx
movslq -0x74(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movq -0x90(%rbp), %rax
movq (%rax), %rax
addl $0x1, %eax
cltq
addq %rax, %rsi
movslq -0x40(%rbp), %rdx
callq 0x2230
jmp 0x29abe
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x74(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0xa4(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xa4(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x90(%rbp), %rcx
movq (%rcx), %rcx
subl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x40(%rbp)
movq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rax
movl -0xa4(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movq -0x90(%rbp), %rax
movq (%rax), %rax
addl $0x1, %eax
cltq
addq %rax, %rsi
movslq -0x40(%rbp), %rdx
callq 0x2230
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x88(%rbp), %eax
jge 0x29a64
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x84(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0xa4(%rbp)
movq -0x50(%rbp), %rdi
movslq -0x40(%rbp), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rax
movl -0xa4(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rax
movl -0xa4(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movslq 0x8(%rax), %rdx
callq 0x2230
movq -0x20(%rbp), %rax
movl -0xa4(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
addl -0x40(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x299cc
movq -0x50(%rbp), %rdi
movslq -0x40(%rbp), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x20(%rcx), %rcx
movslq -0x88(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movq -0x98(%rbp), %rax
movq (%rax), %rax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x2230
movq -0x98(%rbp), %rax
movq (%rax), %rax
addl $0x1, %eax
addl -0x40(%rbp), %eax
movl %eax, -0x40(%rbp)
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x90(%rbp), %rcx
movq 0x8(%rcx), %rcx
subl %ecx, %eax
movl %eax, -0xa8(%rbp)
movq -0x28(%rbp), %rax
movq -0x90(%rbp), %rcx
movq 0x8(%rcx), %rcx
addl $0x1, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
cmpl $0x0, -0x40(%rbp)
jg 0x29b0a
cmpl $0x0, -0xa8(%rbp)
jle 0x29b0c
jmp 0x29b2b
leaq 0x13dc0(%rip), %rdi     # 0x3d8d3
leaq 0x13d17(%rip), %rsi     # 0x3d831
movl $0x61, %edx
leaq 0x13d14(%rip), %rcx     # 0x3d83a
callq 0x2170
cmpl $0x0, -0x40(%rbp)
jne 0x29b4e
movq -0x10(%rbp), %rdi
movl -0xa8(%rbp), %ecx
leaq -0x68(%rbp), %rsi
movl $0x1, %edx
callq 0x2a0b0
jmp 0x29e2b
cmpl $0x0, -0xa8(%rbp)
jne 0x29b71
movq -0x10(%rbp), %rdi
movl -0x40(%rbp), %ecx
leaq -0x68(%rbp), %rsi
movl $0x2, %edx
callq 0x2a0b0
jmp 0x29e29
movl -0x40(%rbp), %eax
cmpl -0xa8(%rbp), %eax
jne 0x29bbb
movslq -0xa8(%rbp), %rax
movq -0x90(%rbp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x20, %rcx
andq $0xff, %rcx
cmpq %rcx, %rax
ja 0x29bbb
movq -0x10(%rbp), %rdi
movl -0xa8(%rbp), %ecx
leaq -0x68(%rbp), %rsi
movl $0x7, %edx
callq 0x2a0b0
jmp 0x29e27
leaq -0xe8(%rbp), %rdi
callq 0x1bbe0
movl -0xe8(%rbp), %eax
orl $0x1, %eax
movl %eax, -0xe8(%rbp)
movq -0x58(%rbp), %rdi
movl -0x40(%rbp), %edx
movq -0x50(%rbp), %rcx
movl -0xa8(%rbp), %r8d
movq -0xb0(%rbp), %r9
leaq -0xe8(%rbp), %rsi
leaq -0x100(%rbp), %rax
movq %rax, (%rsp)
callq 0x1eb80
movq -0x10(%rbp), %rdi
movl -0xfc(%rbp), %edx
movq -0xf0(%rbp), %rcx
leaq -0x68(%rbp), %rsi
callq 0x2a1a0
movq -0x58(%rbp), %rdi
movq -0xf0(%rbp), %rsi
callq 0x2670
leaq 0x1ba51(%rip), %rax     # 0x45688
movl (%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x29cc7
cmpl $0x1388, -0x40(%rbp)    # imm = 0x1388
jle 0x29cc7
cmpl $0x1388, -0xa8(%rbp)    # imm = 0x1388
jle 0x29cc7
cmpl $0x2710, -0x100(%rbp)   # imm = 0x2710
jl 0x29cc7
movq 0x1b389(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movl -0x3c(%rbp), %ecx
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %r8d
addl $0x1, %r8d
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %r9d
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
subl %eax, %r9d
movl -0x40(%rbp), %r10d
movl -0x100(%rbp), %eax
leaq 0x13c31(%rip), %rsi     # 0x3d8e9
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x2210
cmpl $0x2710, -0x100(%rbp)   # imm = 0x2710
jl 0x29d02
cmpl $0x1388, -0x40(%rbp)    # imm = 0x1388
jle 0x29d02
cmpl $0x1388, -0xa8(%rbp)    # imm = 0x1388
jle 0x29d02
movq -0x58(%rbp), %rdi
callq 0x25f0
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x24a0
movq %rax, -0x58(%rbp)
leaq 0x1b97f(%rip), %rax     # 0x45688
movl (%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x29e25
cmpl $0x1388, -0x40(%rbp)    # imm = 0x1388
jle 0x29e25
cmpl $0x1388, -0xa8(%rbp)    # imm = 0x1388
jle 0x29e25
cmpl $0x2710, -0x100(%rbp)   # imm = 0x2710
jl 0x29e25
movq -0x10(%rbp), %rax
movq %rax, -0x118(%rbp)
movl -0xa8(%rbp), %eax
addl -0x40(%rbp), %eax
cltq
movq %rax, -0x120(%rbp)
movq -0x38(%rbp), %rdi
callq 0x2110
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdi
addq %rax, %rsi
addq $0x64, %rsi
shlq $0x0, %rsi
callq 0x2890
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl -0x3c(%rbp), %ecx
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %r8d
addl $0x1, %r8d
movl -0x100(%rbp), %r9d
movl -0x40(%rbp), %ebx
movq -0x50(%rbp), %r11
movl -0xa8(%rbp), %r10d
movq -0xb0(%rbp), %rax
leaq 0x13b2b(%rip), %rsi     # 0x3d8ff
movl %ebx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x2320
movl %eax, -0x84(%rbp)
movq -0x108(%rbp), %rdi
movslq -0x84(%rbp), %rdx
movq 0x1b1f0(%rip), %rax     # 0x44ff8
movq (%rax), %rcx
movl $0x1, %esi
callq 0x2340
movq -0x10(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x2670
jmp 0x29e27
jmp 0x29e29
jmp 0x29e2b
movl -0x7c(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x88(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x29615
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0x68(%rbp), %eax
shll $0x3, %eax
movslq %eax, %rdx
addq $0x18, %rdx
movl $0x1, %esi
callq 0x2540
movq %rax, %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x78(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x78(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
subl %eax, %ecx
movq -0x70(%rbp), %rax
movq 0x48(%rax), %rax
movl %ecx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x78(%rbp), %ecx
movq -0x70(%rbp), %rdx
addl 0x10(%rdx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, %ecx
addl $0x1, %ecx
movq -0x70(%rbp), %rax
movq 0x48(%rax), %rax
movl %ecx, 0x14(%rax)
movl -0x68(%rbp), %ecx
movq -0x70(%rbp), %rax
movq 0x48(%rax), %rax
movl %ecx, (%rax)
movq -0x70(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x18, %rdi
movq -0x60(%rbp), %rsi
movl -0x68(%rbp), %eax
shll $0x3, %eax
movslq %eax, %rdx
callq 0x2230
movl $0x0, -0x7c(%rbp)
movl $0x0, -0x88(%rbp)
movl -0x7c(%rbp), %eax
movq -0x70(%rbp), %rcx
movq 0x48(%rcx), %rcx
cmpl (%rcx), %eax
jge 0x2a000
movq -0x70(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x7c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
andq $0xf, %rax
movl %eax, -0x10c(%rbp)
movq -0x70(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x7c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
shrq $0x4, %rax
movl %eax, -0x110(%rbp)
cmpl $0x7, -0x10c(%rbp)
jne 0x29fa4
movl -0x110(%rbp), %ecx
movq -0x70(%rbp), %rax
movq 0x48(%rax), %rax
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movl -0x110(%rbp), %ecx
movq -0x70(%rbp), %rax
movq 0x48(%rax), %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
jmp 0x29fb8
movl -0x110(%rbp), %ecx
movq -0x70(%rbp), %rax
movq 0x48(%rax), %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
cmpl $0x1, -0x10c(%rbp)
je 0x29fd5
movl -0x110(%rbp), %ecx
movq -0x70(%rbp), %rax
movq 0x48(%rax), %rax
addl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
cmpl $0x2, -0x10c(%rbp)
je 0x29ff0
movl -0x110(%rbp), %eax
addl -0x88(%rbp), %eax
movl %eax, -0x88(%rbp)
jmp 0x29ff2
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x29f28
movq -0x70(%rbp), %rdi
addq $0x50, %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2190
movl -0x88(%rbp), %eax
movq -0x70(%rbp), %rcx
movl 0x1c(%rcx), %ecx
movq -0x70(%rbp), %rdx
subl 0x18(%rdx), %ecx
cmpl %ecx, %eax
jne 0x2a04b
movq -0x70(%rbp), %rax
movq 0x48(%rax), %rax
movl 0xc(%rax), %eax
movq -0x70(%rbp), %rcx
movl 0x28(%rcx), %ecx
movq -0x70(%rbp), %rdx
subl 0x24(%rdx), %ecx
cmpl %ecx, %eax
jne 0x2a04b
jmp 0x2a06a
leaq 0x138cd(%rip), %rdi     # 0x3d91f
leaq 0x137d8(%rip), %rsi     # 0x3d831
movl $0x8c, %edx
leaq 0x137d5(%rip), %rcx     # 0x3d83a
callq 0x2170
jmp 0x2a06c
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x29582
movq -0x58(%rbp), %rdi
callq 0x25f0
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x2670
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x2670
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %rbp
retq
nopw (%rax,%rax)