// File: /workspace/github_c_makefile_star2_O1/lh3[P]minigraph/format.c
// Function: mg_write_gaf
void mg_write_gaf(kstring_t *s, const gfa_t *g, const mg_gchains_t *gs, int32_t n_seg, const int32_t *qlens, const char *qname, uint64_t flag, void *km)
{
	int32_t i, j, qlen, rev_sign = 0;
	s->l = 0;
	for (i = 0, qlen = 0; i < n_seg; ++i) qlen += qlens[i];
	if ((gs == 0 || gs->n_gc == 0) && (flag&MG_M_SHOW_UNMAP)) {
		mg_sprintf_lite(s, "%s", qname);
		if ((flag&MG_M_FRAG_MERGE) && n_seg == 2 && s->l > 2 && s->s[s->l-1] == '1' && s->s[s->l-2] == '/') s->l -= 2;
		mg_sprintf_lite(s, "\t%d\t0\t0\t*\t*\t0\t0\t0\t0\t0\t0\n", qlen);
		return;
	}
	if (gs == 0) return;
	for (i = 0; i < gs->n_gc; ++i) {
		const mg_gchain_t *p = &gs->gc[i];
		int32_t sign_pos, compact;
		if (p->id != p->parent && !(flag&MG_M_PRINT_2ND)) continue;
		if (p->cnt == 0) continue;
		mg_sprintf_lite(s, "%s", qname);
		if ((flag&MG_M_FRAG_MERGE) && n_seg == 2 && s->l > 2 && s->s[s->l-1] == '1' && s->s[s->l-2] == '/') s->l -= 2;
		mg_sprintf_lite(s, "\t%d\t%d\t%d\t+\t", qlen, p->qs, p->qe);
		assert(p->cnt > 0);
		sign_pos = s->l - 2;
		if (flag & MG_M_VERTEX_COOR) {
			compact = 0;
			for (j = 0; j < p->cnt; ++j) {
				const mg_llchain_t *q = &gs->lc[p->off + j];
				mg_sprintf_lite(s, "%c%s", "><"[q->v&1], g->seg[q->v>>1].name);
			}
		} else {
			int32_t last_pnid = -1, st = -1, en = -1, rev = -1;
			compact = flag&MG_M_NO_COMP_PATH? 0 : 1;
			for (j = 0; j < p->cnt; ++j) {
				const mg_llchain_t *q;
				const gfa_seg_t *t;
				assert(p->off + j < gs->n_lc);
				q = &gs->lc[p->off + j];
				t = &g->seg[q->v>>1];
				if (t->snid < 0) { // no stable ID; write the vertex coordinate
					compact = 0;
					if (last_pnid >= 0) mg_sprintf_lite(s, "%c%s:%d-%d", "><"[rev], g->sseq[last_pnid].name, st, en);
					last_pnid = -1, st = -1, en = -1, rev = -1;
					mg_sprintf_lite(s, "%c%s", "><"[q->v&1], g->seg[q->v>>1].name);
				} else {
					int cont = 0;
					if (last_pnid >= 0 && t->snid == last_pnid && (q->v&1) == rev) { // same stable sequence and same strand
						if (!(q->v&1)) { // forward strand
							if (t->soff == en)
								en = t->soff + t->len, cont = 1;
						} else { // reverse strand
							if (t->soff + t->len == st)
								st = t->soff, cont = 1;
						}
					}
					if (cont == 0) {
						if (last_pnid >= 0) compact = 0;
						if (last_pnid >= 0) mg_sprintf_lite(s, "%c%s:%d-%d", "><"[rev], g->sseq[last_pnid].name, st, en);
						last_pnid = t->snid, rev = q->v&1, st = t->soff, en = st + t->len;
					}
				}
			}
			if (last_pnid >= 0) {
				if (g->sseq[last_pnid].rank != 0 || g->sseq[last_pnid].min != 0)
					compact = 0;
				if (!compact) mg_sprintf_lite(s, "%c%s:%d-%d", "><"[rev], g->sseq[last_pnid].name, st, en);
			} else compact = 0;
		}
		if (compact) {
			int32_t rev = gs->lc[p->off].v&1;
			const gfa_seg_t *t = &g->seg[gs->lc[rev? p->off + p->cnt - 1 : p->off].v>>1];
			const gfa_sseq_t *ps = &g->sseq[t->snid];
			mg_sprintf_lite(s, "%s\t%d\t", ps->name, ps->max);
			if (rev) {
				rev_sign = 1;
				s->s[sign_pos] = '-';
				mg_sprintf_lite(s, "%d\t%d", t->soff + (p->plen - p->pe), t->soff + (p->plen - p->ps));
			} else {
				mg_sprintf_lite(s, "%d\t%d", t->soff + p->ps, t->soff + p->pe);
			}
		} else mg_sprintf_lite(s, "\t%d\t%d\t%d", p->plen, p->ps, p->pe);
		if (p->p) mg_sprintf_lite(s, "\t%d\t%d\t%d", p->p->mlen, p->p->blen, p->mapq);
		else mg_sprintf_lite(s, "\t%d\t%d\t%d", p->mlen, p->blen, p->mapq);
		mg_sprintf_lite(s, "\ttp:A:%c", p->id == p->parent? 'P' : 'S');
		if (p->p) mg_sprintf_lite(s, "\tNM:i:%d", p->p->blen - p->p->mlen);
		mg_sprintf_lite(s, "\tcm:i:%d\ts1:i:%d\ts2:i:%d", p->n_anchor, p->score, p->subsc);
		if (p->div >= 0.0f && p->div <= 1.0f) {
			char buf[16];
			if (p->div == 0.0f) buf[0] = '0', buf[1] = 0;
			else snprintf(buf, 16, "%.4f", p->div);
			mg_sprintf_lite(s, "\tdv:f:%s", buf);
		}
		if (n_seg > 1) {
			mg_sprintf_lite(s, "\tql:B:i");
			for (j = 0; j < n_seg; ++j) mg_sprintf_lite(s, ",%d", qlens[j]);
		}
		if (p->p) {
			mg_sprintf_lite(s, "\tcg:Z:");
			if (rev_sign)
				for (j = p->p->n_cigar - 1; j >= 0; --j)
					mg_sprintf_lite(s, "%d%c", (int32_t)(p->p->cigar[j]>>4), "MIDNSHP=XB"[p->p->cigar[j]&0xf]);
			else
				for (j = 0; j < p->p->n_cigar; ++j)
					mg_sprintf_lite(s, "%d%c", (int32_t)(p->p->cigar[j]>>4), "MIDNSHP=XB"[p->p->cigar[j]&0xf]);
		}
		if (p->ds.ds) {
			mg_sprintf_lite(s, "\tds:Z:");
			if (rev_sign) {
				const char *ds = p->ds.ds;
				int32_t i, j;
				for (i = p->ds.n_off - 1; i >= 0; --i) {
					int32_t off = p->ds.off[i], en;
					mg_sprintf_lite(s, "%c", ds[off]); // print the operator
					en = i < p->ds.n_off - 1? p->ds.off[i+1] : p->ds.len;
					if (ds[off] == ':') {
						for (j = off + 1; j < en; ++j)
							mg_sprintf_lite(s, "%c", ds[j]);
					} else if (ds[off] == '*') {
						for (j = off + 1; j < en; ++j)
							mg_sprintf_lite(s, "%c", gfa_comp_table[(uint8_t)ds[j]]);
					} else {
						for (j = en - 1; j >= off + 1; --j) {
							if (ds[j] == '[') mg_sprintf_lite(s, "]");
							else if (ds[j] == ']') mg_sprintf_lite(s, "[");
							else mg_sprintf_lite(s, "%c", gfa_comp_table[(uint8_t)ds[j]]);
						}
					}
				}
			} else {
				mg_sprintf_lite(s, "%s", p->ds.ds);
			}
		}
		mg_sprintf_lite(s, "\n");
		if ((mg_dbg_flag & MG_DBG_LCHAIN) || (flag & MG_M_WRITE_LCHAIN)) {
			char buf[16];
			for (j = 0; j < p->cnt; ++j) {
				const mg_llchain_t *lc = &gs->lc[p->off + j];
				mg_sprintf_lite(s, "*\t%c%s\t%d\t%d", "><"[lc->v&1], g->seg[lc->v>>1].name, g->seg[lc->v>>1].len, lc->cnt);
				if (lc->cnt > 0) {
					double div;
					int32_t q_span = (int32_t)(gs->a[lc->off].y>>32&0xff);
					int32_t n = (int32_t)(gs->a[lc->off + lc->cnt - 1].x>>32) - (int32_t)(gs->a[lc->off].x>>32) + 1;
					div = n == lc->cnt? 0.0 : (n > lc->cnt? log((double)n / lc->cnt) : log((double)lc->cnt / n)) / q_span;
					if (div == 0.0) buf[0] = '0', buf[1] = 0;
					else snprintf(buf, 16, "%.4f", div);
					mg_sprintf_lite(s, "\t%s", buf);
					mg_sprintf_lite(s, "\t%d\t%d", (int32_t)gs->a[lc->off].x + 1 - q_span, (int32_t)gs->a[lc->off + lc->cnt - 1].x + 1);
					mg_sprintf_lite(s, "\t%d\t%d", (int32_t)gs->a[lc->off].y + 1 - q_span, (int32_t)gs->a[lc->off + lc->cnt - 1].y + 1);
					if (flag & MG_M_WRITE_MZ) {
						int32_t i, last;
						last = (int32_t)gs->a[lc->off].x + 1 - q_span;
						mg_sprintf_lite(s, "\t%d\t", q_span);
						for (i = 1; i < lc->cnt; ++i) {
							int32_t x = (int32_t)gs->a[lc->off + i].x + 1 - q_span;
							if (i > 1) mg_sprintf_lite(s, ",");
							mg_sprintf_lite(s, "%d", x - last);
							last = x;
						}
						last = (int32_t)gs->a[lc->off].y + 1 - q_span;
						mg_sprintf_lite(s, "\t");
						for (i = 1; i < lc->cnt; ++i) {
							int32_t x = (int32_t)gs->a[lc->off + i].y + 1 - q_span;
							if (i > 1) mg_sprintf_lite(s, ",");
							mg_sprintf_lite(s, "%d", x - last);
							last = x;
						}
					}
				}
				mg_sprintf_lite(s, "\n");
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r9, 0x50(%rsp)
movq %r8, %r13
movq %rdx, %r8
movq %rsi, 0x30(%rsp)
movq %rdi, %rbx
movq 0xc0(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x0, (%rdi)
testl %ecx, %ecx
jle 0x20107
movl %ecx, %eax
xorl %edx, %edx
xorl %ebp, %ebp
addl (%r13,%rdx,4), %ebp
incq %rdx
cmpq %rdx, %rax
jne 0x200f8
jmp 0x20109
xorl %ebp, %ebp
testq %r8, %r8
je 0x2018c
btl $0x14, 0x20(%rsp)
jae 0x20194
cmpl $0x0, 0x8(%r8)
jne 0x20194
leaq 0x9e70(%rip), %rsi      # 0x29f94
movq %rbx, %rdi
movq 0x50(%rsp), %rdx
xorl %eax, %eax
movl %ecx, %r14d
callq 0x1fcfb
cmpb $0x0, 0x20(%rsp)
setns %al
cmpl $0x2, %r14d
setne %cl
orb %al, %cl
jne 0x20168
movl (%rbx), %eax
cmpl $0x3, %eax
jb 0x20168
movq 0x8(%rbx), %rcx
leal -0x1(%rax), %edx
cmpb $0x31, (%rcx,%rdx)
jne 0x20168
addl $-0x2, %eax
cmpb $0x2f, (%rcx,%rax)
jne 0x20168
movl %eax, (%rbx)
leaq 0x9cc5(%rip), %rsi      # 0x29e34
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1fcfb
btl $0x14, 0x20(%rsp)
jb 0x2011d
testq %r8, %r8
je 0x20d26
cmpl $0x0, 0x8(%r8)
jle 0x20d26
movq 0x20(%rsp), %rsi
testb %sil, %sil
sets %al
cmpl $0x2, %ecx
sete %dl
andb %al, %dl
movb %dl, 0xf(%rsp)
xorl %eax, %eax
btl $0x15, %esi
setae %al
movl %eax, 0x44(%rsp)
movl %ecx, %eax
movq %rax, 0x78(%rsp)
leaq 0x9d12(%rip), %r12      # 0x29eec
xorl %r14d, %r14d
movl $0x0, 0x2c(%rsp)
movl %ebp, 0x48(%rsp)
movl %ecx, 0x4c(%rsp)
movq %r13, 0x80(%rsp)
movq %r8, 0x18(%rsp)
movq 0x18(%r8), %rdx
imulq $0x68, %r14, %rax
btl $0xd, 0x20(%rsp)
jb 0x20217
movl 0x4(%rdx,%rax), %esi
cmpl %esi, (%rdx,%rax)
jne 0x20cd2
addq %rax, %rdx
movq %rdx, 0x10(%rsp)
cmpl $0x0, 0xc(%rdx)
je 0x20cd2
movq %rbx, %rdi
leaq 0x9d61(%rip), %rsi      # 0x29f94
movq 0x50(%rsp), %rdx
xorl %eax, %eax
callq 0x1fcfb
cmpb $0x0, 0xf(%rsp)
je 0x20265
movl (%rbx), %eax
cmpl $0x3, %eax
jb 0x20265
movq 0x8(%rbx), %rcx
leal -0x1(%rax), %edx
cmpb $0x31, (%rcx,%rdx)
jne 0x20265
addl $-0x2, %eax
cmpb $0x2f, (%rcx,%rax)
jne 0x20265
movl %eax, (%rbx)
movq 0x10(%rsp), %r15
movl 0x18(%r15), %ecx
movl 0x1c(%r15), %r8d
movq %rbx, %rdi
leaq 0x9bd1(%rip), %rsi      # 0x29e4d
movl %ebp, %edx
xorl %eax, %eax
callq 0x1fcfb
cmpl $0x0, 0xc(%r15)
jle 0x20d57
btl $0xb, 0x20(%rsp)
movl 0xc(%r15), %edx
movq 0x30(%rsp), %rbp
movq 0x18(%rsp), %r11
movq %r14, 0x58(%rsp)
jb 0x2046a
movl (%rbx), %eax
testl %edx, %edx
movl %eax, 0x38(%rsp)
jle 0x204cd
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movl 0x44(%rsp), %r12d
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq 0x10(%rsp), %r10
movslq 0x8(%r10), %rdx
leal (%r15,%rdx), %esi
cmpl 0xc(%r11), %esi
jge 0x20d38
movq 0x20(%r11), %rsi
addq %r15, %rdx
movq 0x10(%rbp), %rbp
leaq (%rdx,%rdx,4), %rdx
leaq (%rsi,%rdx,4), %r14
addq $0x8, %r14
movl (%r14), %esi
movl %esi, %edx
shrl %edx
shlq $0x6, %rdx
movl 0x8(%rbp,%rdx), %edi
testl %edi, %edi
js 0x20355
addq %rdx, %rbp
movb $0x1, %dl
cmpl %eax, %edi
jne 0x203e3
andl $0x1, %esi
cmpl %ecx, %esi
jne 0x203e3
movl 0xc(%rbp), %edi
testl %esi, %esi
jne 0x203d4
cmpl %r9d, %edi
jne 0x203e3
addl (%rbp), %edi
xorl %edx, %edx
movl %edi, %r9d
jmp 0x203e3
testl %eax, %eax
movq 0x30(%rsp), %rbp
leaq 0x8347(%rip), %r12      # 0x286aa
js 0x2038c
movslq %ecx, %rcx
movsbl (%rcx,%r12), %edx
movq 0x28(%rbp), %rcx
movl %eax, %eax
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rcx
movq %rbx, %rdi
leaq 0x9b82(%rip), %rsi      # 0x29f07
xorl %eax, %eax
callq 0x1fcfb
movl (%r14), %eax
movl %eax, %ecx
andl $0x1, %ecx
movsbl (%rcx,%r12), %edx
movq 0x10(%rbp), %rcx
shrl %eax
shlq $0x6, %rax
movq 0x18(%rcx,%rax), %rcx
xorl %r12d, %r12d
movq %rbx, %rdi
leaq 0x9b37(%rip), %rsi      # 0x29eec
xorl %eax, %eax
callq 0x1fcfb
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x20441
movl (%rbp), %edx
addl %edi, %edx
cmpl %r8d, %edx
setne %dl
cmovel %edi, %r8d
testb %dl, %dl
je 0x2044d
movl %r12d, %edx
xorl %r12d, %r12d
testl %eax, %eax
jns 0x203f4
movl %edx, %r12d
js 0x20428
movslq %ecx, %rcx
leaq 0x82aa(%rip), %rdx      # 0x286aa
movsbl (%rcx,%rdx), %edx
movq 0x30(%rsp), %rcx
movq 0x28(%rcx), %rcx
movl %eax, %eax
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rcx
movq %rbx, %rdi
leaq 0x9ae6(%rip), %rsi      # 0x29f07
xorl %eax, %eax
callq 0x1fcfb
movl 0x8(%rbp), %eax
movl 0xc(%rbp), %r8d
movl (%r14), %ecx
andl $0x1, %ecx
movl (%rbp), %r9d
addl %r8d, %r9d
movq 0x30(%rsp), %rbp
movq 0x10(%rsp), %r10
movq 0x18(%rsp), %r11
jmp 0x20452
movq 0x30(%rsp), %rbp
movl 0xc(%r10), %edx
incq %r15
cmpl %edx, %r15d
jl 0x202e0
movslq %ecx, %rsi
jmp 0x204ea
testl %edx, %edx
leaq 0x8237(%rip), %r15      # 0x286aa
movq 0x10(%rsp), %r13
jle 0x205c5
xorl %r14d, %r14d
movq 0x20(%r11), %rax
movslq 0x8(%r13), %rcx
addq %r14, %rcx
leaq (%rcx,%rcx,4), %rcx
movl 0x8(%rax,%rcx,4), %eax
movl %eax, %ecx
andl $0x1, %ecx
movsbl (%rcx,%r15), %edx
movq 0x10(%rbp), %rcx
shrl %eax
shlq $0x6, %rax
movq 0x18(%rcx,%rax), %rcx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1fcfb
movq 0x18(%rsp), %r11
incq %r14
cmpl 0xc(%r13), %r14d
jl 0x20481
jmp 0x205c5
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movq $-0x1, %rsi
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl 0x44(%rsp), %r12d
testl %eax, %eax
movq 0x10(%rsp), %r13
js 0x205c5
movq 0x28(%rbp), %rcx
movl %eax, %eax
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rax
cmpl $0x0, 0x10(%rax)
jne 0x20511
cmpl $0x0, 0x8(%rax)
je 0x20514
xorl %r12d, %r12d
testl %r12d, %r12d
movq 0x10(%rsp), %r13
je 0x205a6
movq 0x20(%r11), %rax
movslq 0x8(%r13), %rsi
leaq (%rsi,%rsi,4), %rdi
movq %rbp, %r8
movl 0x8(%rax,%rdi,4), %ebp
andl $0x1, %ebp
movl %ebp, %edi
negl %edi
movq 0x10(%r8), %r8
decl %edx
andl %edi, %edx
addl %esi, %edx
movslq %edx, %rdx
leaq (%rdx,%rdx,4), %rdx
movl 0x8(%rax,%rdx,4), %eax
shrl %eax
shlq $0x6, %rax
leaq (%r8,%rax), %r14
movslq 0x8(%r8,%rax), %rax
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rdx
movl 0xc(%rcx,%rax,8), %ecx
movq %rbx, %rdi
leaq 0x999c(%rip), %rsi      # 0x29f12
xorl %eax, %eax
callq 0x1fcfb
testl %ebp, %ebp
jne 0x20ce4
movl 0xc(%r14), %ecx
movl 0x24(%r13), %edx
addl %ecx, %edx
addl 0x28(%r13), %ecx
movq %rbx, %rdi
leaq 0x9980(%rip), %rsi      # 0x29f1d
xorl %eax, %eax
callq 0x1fcfb
jmp 0x205e2
leaq 0x80fd(%rip), %rcx      # 0x286aa
movsbl (%rsi,%rcx), %edx
movq (%rax), %rcx
movq %rbx, %rdi
leaq 0x9949(%rip), %rsi      # 0x29f07
xorl %eax, %eax
callq 0x1fcfb
movl 0x20(%r13), %edx
movl 0x24(%r13), %ecx
movl 0x28(%r13), %r8d
movq %rbx, %rdi
leaq 0x993e(%rip), %rsi      # 0x29f19
xorl %eax, %eax
callq 0x1fcfb
leaq 0x997b(%rip), %r12      # 0x29f64
movq 0x48(%r13), %rax
movzbl 0x44(%r13), %r8d
testq %rax, %rax
je 0x205ff
movl 0x4(%rax), %edx
movl 0x8(%rax), %ecx
jmp 0x20607
movl 0x2c(%r13), %ecx
movl 0x30(%r13), %edx
movq %rbx, %rdi
leaq 0x9908(%rip), %rsi      # 0x29f19
xorl %eax, %eax
callq 0x1fcfb
movl (%r13), %eax
xorl %ecx, %ecx
cmpl 0x4(%r13), %eax
setne %cl
leal (%rcx,%rcx,2), %edx
addl $0x50, %edx
movq %rbx, %rdi
leaq 0x98ee(%rip), %rsi      # 0x29f23
xorl %eax, %eax
callq 0x1fcfb
movq 0x48(%r13), %rax
testq %rax, %rax
je 0x2065c
movl 0x8(%rax), %edx
subl 0x4(%rax), %edx
movq %rbx, %rdi
leaq 0x98d7(%rip), %rsi      # 0x29f2c
xorl %eax, %eax
callq 0x1fcfb
movq 0x10(%rsp), %r14
movl 0x10(%r14), %edx
movl 0x14(%r14), %ecx
movl 0x3c(%r14), %r8d
movq %rbx, %rdi
leaq 0x98be(%rip), %rsi      # 0x29f35
xorl %eax, %eax
callq 0x1fcfb
movss 0x34(%r14), %xmm0
ucomiss 0x9771(%rip), %xmm0     # 0x29dfc
movq 0x80(%rsp), %r13
jb 0x206f8
movss 0x9407(%rip), %xmm1     # 0x29aa4
ucomiss %xmm0, %xmm1
jb 0x206f8
movq 0x10(%rsp), %rax
movss 0x34(%rax), %xmm0
ucomiss 0x9749(%rip), %xmm0     # 0x29dfc
jne 0x206c5
jp 0x206c5
movw $0x30, 0x60(%rsp)
leaq 0x60(%rsp), %r14
jmp 0x206e4
cvtss2sd %xmm0, %xmm0
movl $0x10, %esi
leaq 0x60(%rsp), %r14
movq %r14, %rdi
leaq 0x9871(%rip), %rdx      # 0x29f4e
movb $0x1, %al
callq 0x2140
movq %rbx, %rdi
leaq 0x9865(%rip), %rsi      # 0x29f53
movq %r14, %rdx
xorl %eax, %eax
callq 0x1fcfb
cmpl $0x2, 0x4c(%rsp)
movq 0x78(%rsp), %r15
jl 0x20732
movq %rbx, %rdi
leaq 0x984e(%rip), %rsi      # 0x29f5c
xorl %eax, %eax
callq 0x1fcfb
xorl %r14d, %r14d
movl (%r13,%r14,4), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1fcfb
incq %r14
cmpq %r14, %r15
jne 0x20718
movq 0x10(%rsp), %r13
cmpq $0x0, 0x48(%r13)
leaq 0x9831(%rip), %r15      # 0x29f74
leaq 0x9825(%rip), %r12      # 0x29f6f
je 0x207e9
movq %rbx, %rdi
leaq 0x980e(%rip), %rsi      # 0x29f68
xorl %eax, %eax
callq 0x1fcfb
movq 0x48(%r13), %rax
movl (%rax), %r14d
cmpl $0x0, 0x2c(%rsp)
je 0x207ac
testl %r14d, %r14d
movq 0x10(%rsp), %r13
jle 0x207e9
incq %r14
movq 0x48(%r13), %rax
movq 0x8(%rax,%r14,8), %rax
movq %rax, %rdx
shrq $0x4, %rdx
andl $0xf, %eax
movsbl (%rax,%r15), %ecx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1fcfb
decq %r14
cmpq $0x1, %r14
jg 0x2077c
jmp 0x207e9
testl %r14d, %r14d
movq 0x10(%rsp), %r13
jle 0x207e9
xorl %r14d, %r14d
movq 0x18(%rax,%r14,8), %rax
movq %rax, %rdx
shrq $0x4, %rdx
andl $0xf, %eax
movsbl (%rax,%r15), %ecx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1fcfb
incq %r14
movq 0x48(%r13), %rax
movslq (%rax), %rcx
cmpq %rcx, %r14
jl 0x207b9
cmpq $0x0, 0x60(%r13)
movq 0x18(%rsp), %rax
je 0x20991
movq %rbx, %rdi
leaq 0x977c(%rip), %rsi      # 0x29f7f
xorl %eax, %eax
callq 0x1fcfb
movq 0x60(%r13), %r15
cmpl $0x0, 0x2c(%rsp)
je 0x20978
movslq 0x54(%r13), %r14
testq %r14, %r14
movq 0x18(%rsp), %rax
jle 0x20991
leaq 0x50(%r13), %rax
movq %rax, 0x38(%rsp)
movq 0x58(%r13), %rax
movslq -0x4(%rax,%r14,4), %rbp
movsbl (%r15,%rbp), %edx
movq %rbx, %rdi
leaq 0x7cda(%rip), %rsi      # 0x28526
xorl %eax, %eax
callq 0x1fcfb
movslq 0x54(%r13), %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %r14
jge 0x2086d
leaq (,%r14,4), %rax
addq 0x58(%r13), %rax
movslq (%rax), %r12
movzbl (%r15,%rbp), %ecx
leal 0x1(%rbp), %eax
cmpl $0x3a, %ecx
je 0x208c8
cmpl $0x2a, %ecx
jne 0x20900
cmpl %r12d, %eax
jge 0x2095b
movslq %eax, %r13
addq %r15, %r13
notl %ebp
addl %r12d, %ebp
xorl %r12d, %r12d
movzbl (%r13,%r12), %eax
leaq 0x1195a(%rip), %rcx     # 0x32200
movzbl (%rcx,%rax), %edx
movq %rbx, %rdi
leaq 0x7c72(%rip), %rsi      # 0x28526
xorl %eax, %eax
callq 0x1fcfb
incq %r12
cmpl %r12d, %ebp
jne 0x20899
jmp 0x2095b
cmpl %r12d, %eax
jge 0x2095b
movslq %eax, %r13
addq %r15, %r13
notl %ebp
addl %r12d, %ebp
xorl %r12d, %r12d
movsbl (%r13,%r12), %edx
movq %rbx, %rdi
leaq 0x7c37(%rip), %rsi      # 0x28526
xorl %eax, %eax
callq 0x1fcfb
incq %r12
cmpl %r12d, %ebp
jne 0x208df
jmp 0x2095b
cmpl %eax, %r12d
jle 0x2095b
movslq %eax, %rbp
movzbl -0x1(%r15,%r12), %eax
cmpl $0x5d, %eax
je 0x20924
cmpl $0x5b, %eax
jne 0x20937
movq %rbx, %rdi
leaq 0x94d8(%rip), %rsi      # 0x29dfa
jmp 0x2092e
movq %rbx, %rdi
leaq 0x9171(%rip), %rsi      # 0x29a9f
xorl %eax, %eax
callq 0x1fcfb
jmp 0x20953
leaq 0x118c2(%rip), %rcx     # 0x32200
movzbl (%rcx,%rax), %edx
movq %rbx, %rdi
leaq 0x7bda(%rip), %rsi      # 0x28526
xorl %eax, %eax
callq 0x1fcfb
decq %r12
cmpq %rbp, %r12
jg 0x20908
leaq -0x1(%r14), %rax
cmpq $0x1, %r14
movq %rax, %r14
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %r13
jg 0x20834
jmp 0x20991
movq %rbx, %rdi
leaq 0x9612(%rip), %rsi      # 0x29f94
movq %r15, %rdx
xorl %eax, %eax
callq 0x1fcfb
movq 0x18(%rsp), %rax
movq %rax, %r15
movq %rbx, %rdi
leaq 0x9398(%rip), %rsi      # 0x29d36
xorl %eax, %eax
callq 0x1fcfb
btl $0x17, 0x20(%rsp)
jb 0x209d3
leaq 0x11cc4(%rip), %rax     # 0x32678
movl (%rax), %eax
andl $0x8, %eax
jne 0x209d3
movl 0x48(%rsp), %ebp
leaq 0x9526(%rip), %r12      # 0x29eec
movq 0x58(%rsp), %r14
movq %r15, %r8
jmp 0x20cd2
cmpl $0x0, 0xc(%r13)
leaq 0x7ccb(%rip), %rdx      # 0x286aa
movq %r15, %r8
jle 0x20cc2
xorl %ecx, %ecx
movq 0x20(%r8), %r15
movslq 0x8(%r13), %rax
movl %ecx, 0x38(%rsp)
movslq %ecx, %rcx
addq %rax, %rcx
leaq (%rcx,%rcx,4), %r14
movl 0x4(%r15,%r14,4), %r9d
movl 0x8(%r15,%r14,4), %eax
movl %eax, %ecx
andl $0x1, %ecx
movsbl (%rcx,%rdx), %edx
movq 0x30(%rsp), %rcx
movq 0x10(%rcx), %rsi
shrl %eax
shlq $0x6, %rax
movq 0x18(%rsi,%rax), %rcx
movl (%rsi,%rax), %r8d
movq %rbx, %rdi
leaq 0x9551(%rip), %rsi      # 0x29f86
xorl %eax, %eax
callq 0x1fcfb
movslq 0x4(%r15,%r14,4), %rax
testq %rax, %rax
jle 0x20c90
leaq (%r15,%r14,4), %rbp
movq 0x18(%rsp), %r14
movq 0x28(%r14), %rdx
movslq (%rbp), %rcx
movq %rcx, %rsi
shlq $0x4, %rsi
addq %rax, %rcx
shlq $0x4, %rcx
movl -0xc(%rdx,%rcx), %ecx
subl 0x4(%rdx,%rsi), %ecx
movzbl 0xc(%rdx,%rsi), %r15d
leal 0x1(%rcx), %edx
xorps %xmm0, %xmm0
cmpl %eax, %edx
je 0x20aaf
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
cvtsi2sd %eax, %xmm1
cmpl %eax, %ecx
jge 0x20a9a
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x20a9e
divsd %xmm1, %xmm0
callq 0x21a0
xorps %xmm1, %xmm1
cvtsi2sd %r15d, %xmm1
divsd %xmm1, %xmm0
ucomisd 0x9349(%rip), %xmm0     # 0x29e00
leaq 0x60(%rsp), %r12
jne 0x20ac9
jp 0x20ac9
movw $0x30, 0x60(%rsp)
jmp 0x20adf
movl $0x10, %esi
movq %r12, %rdi
leaq 0x9476(%rip), %rdx      # 0x29f4e
movb $0x1, %al
callq 0x2140
movq %rbx, %rdi
leaq 0x94aa(%rip), %rsi      # 0x29f93
movq %r12, %rdx
xorl %eax, %eax
callq 0x1fcfb
movq 0x28(%r14), %rax
movslq (%rbp), %rcx
movslq 0x4(%rbp), %rsi
addq %rcx, %rsi
shlq $0x4, %rcx
movl (%rax,%rcx), %edx
subl %r15d, %edx
incl %edx
shlq $0x4, %rsi
movl -0x10(%rax,%rsi), %ecx
incl %ecx
movq %rbx, %rdi
leaq 0x93fa(%rip), %r12      # 0x29f1c
movq %r12, %rsi
xorl %eax, %eax
callq 0x1fcfb
movq 0x28(%r14), %rax
movslq (%rbp), %rcx
movslq 0x4(%rbp), %rsi
addq %rcx, %rsi
shlq $0x4, %rcx
movl 0x8(%rax,%rcx), %edx
subl %r15d, %edx
incl %edx
shlq $0x4, %rsi
movl -0x8(%rax,%rsi), %ecx
incl %ecx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1fcfb
btl $0x18, 0x20(%rsp)
jae 0x20c90
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rax
movslq (%rbp), %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %r12
movq %rbx, %rdi
leaq 0x92a1(%rip), %rsi      # 0x29e2b
movl %r15d, %edx
xorl %eax, %eax
callq 0x1fcfb
cmpl $0x2, 0x4(%rbp)
jl 0x20bfe
subl %r15d, %r12d
incl %r12d
movl $0x1, %r13d
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rax
movslq (%rbp), %rcx
addq %r13, %rcx
shlq $0x4, %rcx
movl (%rax,%rcx), %r14d
cmpl $0x2, %r13d
jb 0x20bd5
movq %rbx, %rdi
leaq 0x9264(%rip), %rsi      # 0x29e32
xorl %eax, %eax
callq 0x1fcfb
subl %r15d, %r14d
incl %r14d
movl %r14d, %edx
subl %r12d, %edx
movq %rbx, %rdi
leaq 0x9335(%rip), %rsi      # 0x29f20
xorl %eax, %eax
callq 0x1fcfb
incq %r13
movl %r14d, %r12d
cmpl 0x4(%rbp), %r13d
jl 0x20ba6
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rax
movslq (%rbp), %rcx
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %r12
movq %rbx, %rdi
leaq 0x923a(%rip), %rsi      # 0x29e58
xorl %eax, %eax
callq 0x1fcfb
cmpl $0x2, 0x4(%rbp)
jl 0x20c90
subl %r15d, %r12d
incl %r12d
movl $0x1, %r13d
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rax
movslq (%rbp), %rcx
addq %r13, %rcx
shlq $0x4, %rcx
movl 0x8(%rax,%rcx), %r14d
cmpl $0x2, %r13d
jb 0x20c67
movq %rbx, %rdi
leaq 0x91d2(%rip), %rsi      # 0x29e32
xorl %eax, %eax
callq 0x1fcfb
subl %r15d, %r14d
incl %r14d
movl %r14d, %edx
subl %r12d, %edx
movq %rbx, %rdi
leaq 0x92a3(%rip), %rsi      # 0x29f20
xorl %eax, %eax
callq 0x1fcfb
incq %r13
movl %r14d, %r12d
cmpl 0x4(%rbp), %r13d
jl 0x20c37
movq %rbx, %rdi
leaq 0x909c(%rip), %rsi      # 0x29d36
xorl %eax, %eax
callq 0x1fcfb
movl 0x38(%rsp), %ecx
incl %ecx
movq 0x10(%rsp), %r13
cmpl 0xc(%r13), %ecx
movq 0x18(%rsp), %r8
leaq 0x79ee(%rip), %rdx      # 0x286aa
jl 0x209ea
movl 0x48(%rsp), %ebp
leaq 0x921f(%rip), %r12      # 0x29eec
movq 0x58(%rsp), %r14
incq %r14
movslq 0x8(%r8), %rax
cmpq %rax, %r14
jl 0x201fa
jmp 0x20d26
movl 0x38(%rsp), %ecx
addl $-0x2, %ecx
movq 0x8(%rbx), %rax
movslq %ecx, %rcx
movb $0x2d, (%rax,%rcx)
movl 0x20(%r13), %ecx
addl 0xc(%r14), %ecx
movl %ecx, %edx
subl 0x28(%r13), %edx
subl 0x24(%r13), %ecx
movq %rbx, %rdi
leaq 0x920b(%rip), %rsi      # 0x29f1d
xorl %eax, %eax
callq 0x1fcfb
movl $0x1, 0x2c(%rsp)
jmp 0x205e2
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x91b2(%rip), %rdi      # 0x29ef1
leaq 0x911f(%rip), %rsi      # 0x29e65
leaq 0x9121(%rip), %rcx      # 0x29e6e
movl $0x9b, %edx
callq 0x2160
leaq 0x90fc(%rip), %rdi      # 0x29e5a
leaq 0x9100(%rip), %rsi      # 0x29e65
leaq 0x9102(%rip), %rcx      # 0x29e6e
movl $0x8d, %edx
callq 0x2160
nop