// File: /workspace/github_c_makefile_star2_O2/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, 0x60(%rsp)
movq %r8, %r15
movq %rdi, %rbx
movq 0xc0(%rsp), %rax
movq %rax, 0x18(%rsp)
andl $0x0, (%rdi)
movq %rdx, %rbp
movq %rsi, 0x20(%rsp)
xorl %eax, %eax
testl %ecx, %ecx
movl $0x0, %esi
movl %ecx, 0x30(%rsp)
cmovgl %ecx, %esi
xorl %edx, %edx
cmpq %rax, %rsi
je 0x1c27d
addl (%r15,%rax,4), %edx
incq %rax
jmp 0x1c26f
movl %edx, 0x44(%rsp)
testq %rbp, %rbp
je 0x1cd33
movl 0x8(%rbp), %eax
testl %eax, %eax
sete %cl
movq 0x18(%rsp), %rdx
shrl $0x14, %edx
testb %cl, %dl
jne 0x1cd4d
movq 0x18(%rsp), %rsi
testb %sil, %sil
sets %cl
movl 0x30(%rsp), %edx
cmpl $0x2, %edx
sete %dil
andb %cl, %dil
movb %dil, 0xf(%rsp)
xorl %ecx, %ecx
btl $0x15, %esi
setae %cl
movl %ecx, 0x5c(%rsp)
movl %edx, %ecx
movq %rcx, 0x48(%rsp)
xorl %edx, %edx
movl $0x0, 0x2c(%rsp)
movq %r15, 0x50(%rsp)
movq %rbp, 0x38(%rsp)
cltq
cmpq %rax, %rdx
jge 0x1cd3b
movq 0x18(%rbp), %r12
imulq $0x68, %rdx, %rax
btl $0xd, 0x18(%rsp)
jb 0x1c312
movl 0x4(%r12,%rax), %ecx
cmpl %ecx, (%r12,%rax)
jne 0x1cc4e
addq %rax, %r12
cmpl $0x0, 0xc(%r12)
je 0x1cc4e
movq %rdx, 0x68(%rsp)
movq %rbx, %rdi
leaq 0x8ce4(%rip), %rsi      # 0x25014
movq 0x60(%rsp), %rdx
xorl %eax, %eax
callq 0x1be9c
cmpb $0x0, 0xf(%rsp)
je 0x1c362
movl (%rbx), %eax
cmpl $0x3, %eax
jb 0x1c362
movq 0x8(%rbx), %rcx
leal -0x1(%rax), %edx
cmpb $0x31, (%rcx,%rdx)
jne 0x1c362
addl $-0x2, %eax
cmpb $0x2f, (%rcx,%rax)
jne 0x1c362
movl %eax, (%rbx)
movl 0x18(%r12), %ecx
movl 0x1c(%r12), %r8d
movq %rbx, %rdi
leaq 0x8b57(%rip), %rsi      # 0x24ecd
movl 0x44(%rsp), %edx
xorl %eax, %eax
callq 0x1be9c
movl 0xc(%r12), %edi
testl %edi, %edi
jle 0x1cddb
btl $0xb, 0x18(%rsp)
movq %r12, 0x10(%rsp)
jb 0x1c546
movl (%rbx), %eax
addl $-0x2, %eax
movl %eax, 0x34(%rsp)
xorl %r15d, %r15d
pushq $-0x1
popq %rax
movl %eax, %edx
movl %eax, %r9d
movl %eax, %r8d
movl 0x5c(%rsp), %r13d
movslq %edx, %rcx
movl %eax, %esi
cmpl %edi, %r15d
jge 0x1c5a5
movslq 0x8(%r12), %rdi
leal (%r15,%rdi), %r10d
cmpl 0xc(%rbp), %r10d
jge 0x1cdbc
movq 0x20(%rbp), %r10
addq %r15, %rdi
movq 0x20(%rsp), %r11
movq 0x10(%r11), %rbp
imulq $0x14, %rdi, %rdi
leaq (%r10,%rdi), %r12
addq $0x8, %r12
movl (%r12), %edi
movl %edi, %r11d
shrl %r11d
movq %r11, %r14
shlq $0x6, %r14
movl 0x8(%rbp,%r14), %r10d
testl %r10d, %r10d
js 0x1c44e
addq %r14, %rbp
cmpl %eax, %r10d
jne 0x1c4c0
andl $0x1, %edi
cmpl %edx, %edi
jne 0x1c4d6
movl 0xc(%rbp), %edi
testl %edx, %edx
je 0x1c4c9
movl (%rbp), %edx
addl %edi, %edx
cmpl %r8d, %edx
jne 0x1c4d6
pushq $0x1
popq %rdx
movl %edi, %r8d
jmp 0x1c52f
testl %eax, %eax
leaq 0x725c(%rip), %r14      # 0x236b3
js 0x1c48e
movsbl (%rcx,%r14), %edx
movq 0x20(%rsp), %r13
movq 0x28(%r13), %rax
imulq $0x18, %rsi, %rcx
movq (%rax,%rcx), %rcx
movq %rbx, %rdi
leaq 0x8b0e(%rip), %rsi      # 0x24f87
xorl %eax, %eax
callq 0x1be9c
movl (%r12), %edi
movq 0x10(%r13), %rbp
movl %edi, %r11d
shrl %r11d
andl $0x1, %edi
movsbl (%rdi,%r14), %edx
shlq $0x6, %r11
movq 0x18(%rbp,%r11), %rcx
xorl %r13d, %r13d
movq %rbx, %rdi
leaq 0x8ac0(%rip), %rsi      # 0x24f6c
xorl %eax, %eax
callq 0x1be9c
pushq $-0x1
popq %rax
movl %eax, %edx
movl %eax, %r9d
movl %eax, %r8d
jmp 0x1c52f
xorl %r14d, %r14d
testl %eax, %eax
jns 0x1c4e4
jmp 0x1c51c
cmpl %r9d, %edi
jne 0x1c4d6
addl (%rbp), %r9d
xorl %edx, %edx
jmp 0x1c52f
testl %eax, %eax
movl $0x0, %eax
cmovnsl %eax, %r13d
movl %r13d, %r14d
leaq 0x71c8(%rip), %rax      # 0x236b3
movsbl (%rcx,%rax), %edx
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rax
imulq $0x18, %rsi, %rcx
movq (%rax,%rcx), %rcx
movq %rbx, %rdi
leaq 0x8a7d(%rip), %rsi      # 0x24f87
xorl %eax, %eax
callq 0x1be9c
movl 0x8(%rbp), %r10d
movl (%r12), %edi
movl %r14d, %r13d
andl $0x1, %edi
movl 0xc(%rbp), %r8d
movl (%rbp), %r9d
addl %r8d, %r9d
movl %edi, %edx
movl %r10d, %eax
movq 0x10(%rsp), %r12
movl 0xc(%r12), %edi
incq %r15
movq 0x38(%rsp), %rbp
jmp 0x1c3bb
xorl %r14d, %r14d
cmpl %edi, %r14d
jge 0x1c5e9
movq 0x20(%rbp), %rax
movslq 0x8(%r12), %rcx
addq %r14, %rcx
imulq $0x14, %rcx, %rcx
movl 0x8(%rax,%rcx), %eax
movl %eax, %ecx
andl $0x1, %ecx
leaq 0x7141(%rip), %rdx      # 0x236b3
movsbl (%rcx,%rdx), %edx
movq 0x20(%rsp), %rcx
movq 0x10(%rcx), %rcx
shrl %eax
shlq $0x6, %rax
movq 0x18(%rcx,%rax), %rcx
movq %rbx, %rdi
leaq 0x89d8(%rip), %rsi      # 0x24f6c
xorl %eax, %eax
callq 0x1be9c
movl 0xc(%r12), %edi
incq %r14
jmp 0x1c549
testl %eax, %eax
movq 0x50(%rsp), %r15
js 0x1c5e9
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rax
imulq $0x18, %rsi, %rdx
leaq (%rax,%rdx), %rsi
cmpl $0x0, 0x10(%rax,%rdx)
je 0x1cc59
leaq 0x70e2(%rip), %rax      # 0x236b3
movsbl (%rcx,%rax), %edx
movq (%rsi), %rcx
movq %rbx, %rdi
leaq 0x89a5(%rip), %rsi      # 0x24f87
xorl %eax, %eax
callq 0x1be9c
movl 0x20(%r12), %edx
movl 0x24(%r12), %ecx
movl 0x28(%r12), %r8d
movq %rbx, %rdi
leaq 0x8997(%rip), %rsi      # 0x24f99
xorl %eax, %eax
callq 0x1be9c
movq %r12, %r14
movq 0x48(%rsp), %r12
leaq 0x89cc(%rip), %rbp      # 0x24fe4
movq 0x48(%r14), %rax
movzbl 0x44(%r14), %r8d
testq %rax, %rax
je 0x1c62e
movl 0x4(%rax), %edx
movl 0x8(%rax), %ecx
jmp 0x1c636
movl 0x2c(%r14), %ecx
movl 0x30(%r14), %edx
movq %rbx, %rdi
leaq 0x8959(%rip), %rsi      # 0x24f99
xorl %eax, %eax
callq 0x1be9c
movl (%r14), %eax
xorl %ecx, %ecx
cmpl 0x4(%r14), %eax
setne %cl
leal (%rcx,%rcx,2), %edx
addl $0x50, %edx
movq %rbx, %rdi
leaq 0x8940(%rip), %rsi      # 0x24fa3
xorl %eax, %eax
callq 0x1be9c
movq 0x48(%r14), %rax
testq %rax, %rax
je 0x1c68a
movl 0x8(%rax), %edx
subl 0x4(%rax), %edx
movq %rbx, %rdi
leaq 0x8929(%rip), %rsi      # 0x24fac
xorl %eax, %eax
callq 0x1be9c
movq 0x10(%rsp), %r14
movl 0x10(%r14), %edx
movl 0x14(%r14), %ecx
movl 0x3c(%r14), %r8d
movq %rbx, %rdi
leaq 0x8910(%rip), %rsi      # 0x24fb5
xorl %eax, %eax
callq 0x1be9c
movss 0x34(%r14), %xmm0
ucomiss 0x87c3(%rip), %xmm0     # 0x24e7c
jb 0x1c712
movss 0x8469(%rip), %xmm1     # 0x24b2c
ucomiss %xmm0, %xmm1
jb 0x1c712
ucomiss 0x87ad(%rip), %xmm0     # 0x24e7c
jne 0x1c6e1
jp 0x1c6e1
movw $0x30, 0x70(%rsp)
leaq 0x70(%rsp), %r14
jmp 0x1c6fe
cvtss2sd %xmm0, %xmm0
leaq 0x70(%rsp), %r14
movq %r14, %rdi
pushq $0x10
popq %rsi
leaq 0x88d7(%rip), %rdx      # 0x24fce
movb $0x1, %al
callq 0x2140
movq %rbx, %rdi
leaq 0x88cb(%rip), %rsi      # 0x24fd3
movq %r14, %rdx
xorl %eax, %eax
callq 0x1be9c
cmpl $0x2, 0x30(%rsp)
jl 0x1c748
movq %rbx, %rdi
leaq 0x88b9(%rip), %rsi      # 0x24fdc
xorl %eax, %eax
callq 0x1be9c
xorl %r14d, %r14d
cmpq %r14, %r12
je 0x1c748
movl (%r15,%r14,4), %edx
movq %rbx, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1be9c
incq %r14
jmp 0x1c72d
movq 0x10(%rsp), %rax
cmpq $0x0, 0x48(%rax)
leaq 0x889b(%rip), %r15      # 0x24ff4
leaq 0x888f(%rip), %r12      # 0x24fef
je 0x1c7f8
movq %rbx, %rdi
leaq 0x8878(%rip), %rsi      # 0x24fe8
xorl %eax, %eax
callq 0x1be9c
cmpl $0x0, 0x2c(%rsp)
je 0x1c7be
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movl (%rax), %r14d
testl %r14d, %r14d
jle 0x1c7f8
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax,%r14,8), %rax
decq %r14
movq %rax, %rdx
shrq $0x4, %rdx
andl $0xf, %eax
movsbl (%rax,%r15), %ecx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1be9c
jmp 0x1c78a
xorl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movslq (%rax), %rcx
cmpq %rcx, %r14
jge 0x1c7f8
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 0x1be9c
incq %r14
jmp 0x1c7c1
movq 0x10(%rsp), %r12
cmpq $0x0, 0x60(%r12)
je 0x1c94a
movq %rbx, %rdi
leaq 0x87ec(%rip), %rsi      # 0x24fff
xorl %eax, %eax
callq 0x1be9c
movq 0x60(%r12), %r15
cmpl $0x0, 0x2c(%rsp)
je 0x1c936
leaq 0x50(%r12), %r13
movl 0x54(%r12), %ebp
testl %ebp, %ebp
jle 0x1c94a
movq 0x58(%r12), %rax
movslq -0x4(%rax,%rbp,4), %r14
movsbl (%r15,%r14), %edx
movq %rbx, %rdi
leaq 0x6cda(%rip), %rsi      # 0x2352f
xorl %eax, %eax
callq 0x1be9c
movq %r13, %rax
cmpl %ebp, 0x54(%r12)
jle 0x1c873
leaq (,%rbp,4), %rax
addq 0x58(%r12), %rax
decq %rbp
movslq (%rax), %r12
movzbl (%r15,%r14), %eax
cmpl $0x3a, %eax
je 0x1c8c9
cmpl $0x2a, %eax
jne 0x1c8db
incq %r14
cmpq %r12, %r14
jge 0x1c8d1
movzbl (%r15,%r14), %eax
leaq 0x11964(%rip), %rcx     # 0x2e200
movzbl (%rcx,%rax), %edx
movq %rbx, %rdi
leaq 0x6c85(%rip), %rsi      # 0x2352f
xorl %eax, %eax
callq 0x1be9c
jmp 0x1c888
movsbl (%r15,%r14), %edx
movq %rbx, %rdi
leaq 0x6c6d(%rip), %rsi      # 0x2352f
xorl %eax, %eax
callq 0x1be9c
incq %r14
cmpq %r12, %r14
jl 0x1c8b3
movq 0x10(%rsp), %r12
jmp 0x1c834
incl %r14d
movslq %r14d, %r14
cmpq %r14, %r12
jle 0x1c8d1
movzbl -0x1(%r15,%r12), %eax
cmpl $0x5d, %eax
je 0x1c902
cmpl $0x5b, %eax
jne 0x1c915
movq %rbx, %rdi
leaq 0x857a(%rip), %rsi      # 0x24e7a
jmp 0x1c90c
movq %rbx, %rdi
leaq 0x821b(%rip), %rsi      # 0x24b27
xorl %eax, %eax
callq 0x1be9c
jmp 0x1c931
leaq 0x118e4(%rip), %rcx     # 0x2e200
movzbl (%rcx,%rax), %edx
movq %rbx, %rdi
leaq 0x6c05(%rip), %rsi      # 0x2352f
xorl %eax, %eax
callq 0x1be9c
decq %r12
jmp 0x1c8e1
movq %rbx, %rdi
leaq 0x86d4(%rip), %rsi      # 0x25014
movq %r15, %rdx
xorl %eax, %eax
callq 0x1be9c
movq %rbx, %rdi
leaq 0x8462(%rip), %rsi      # 0x24db6
xorl %eax, %eax
callq 0x1be9c
btl $0x17, 0x18(%rsp)
jb 0x1c980
leaq 0x11d0e(%rip), %rax     # 0x2e678
movl (%rax), %eax
andl $0x8, %eax
jne 0x1c980
movq 0x50(%rsp), %r15
movq 0x38(%rsp), %rbp
jmp 0x1cc49
xorl %ecx, %ecx
movq 0x38(%rsp), %rbp
cmpl 0xc(%r12), %ecx
leaq 0x6d20(%rip), %rdx      # 0x236b3
jge 0x1cc44
movq %r12, %rax
movq 0x20(%rbp), %r12
movslq 0x8(%rax), %rax
movl %ecx, 0x34(%rsp)
movslq %ecx, %rcx
addq %rax, %rcx
imulq $0x14, %rcx, %r14
movl 0x4(%r12,%r14), %r9d
movl 0x8(%r12,%r14), %eax
movl %eax, %ecx
andl $0x1, %ecx
movsbl (%rcx,%rdx), %edx
movq 0x20(%rsp), %rcx
movq 0x10(%rcx), %rsi
shrl %eax
shlq $0x6, %rax
movq 0x18(%rsi,%rax), %rcx
movl (%rsi,%rax), %r8d
movq %rbx, %rdi
leaq 0x861f(%rip), %rsi      # 0x25006
xorl %eax, %eax
callq 0x1be9c
movslq 0x4(%r12,%r14), %rax
testq %rax, %rax
jle 0x1cafc
addq %r14, %r12
movq 0x28(%rbp), %rdx
movslq (%r12), %rcx
movq %rcx, %rsi
shlq $0x4, %rsi
movzbl 0xc(%rdx,%rsi), %r15d
addq %rax, %rcx
shlq $0x4, %rcx
movl -0xc(%rdx,%rcx), %ecx
subl 0x4(%rdx,%rsi), %ecx
leal 0x1(%rcx), %edx
cmpl %eax, %edx
leaq 0x70(%rsp), %r14
je 0x1ca6b
cvtsi2sd %edx, %xmm0
cvtsi2sd %eax, %xmm1
cmpl %eax, %ecx
jge 0x1ca45
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x1ca49
divsd %xmm1, %xmm0
callq 0x21a0
cvtsi2sd %r15d, %xmm1
divsd %xmm1, %xmm0
ucomisd 0x8421(%rip), %xmm0     # 0x24e80
jne 0x1cc2b
jp 0x1cc2b
movw $0x30, 0x70(%rsp)
movq %rbx, %rdi
leaq 0x8597(%rip), %rsi      # 0x25013
movq %r14, %rdx
xorl %eax, %eax
callq 0x1be9c
movq 0x28(%rbp), %rax
movslq (%r12), %rcx
movslq 0x4(%r12), %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 0x84e6(%rip), %r14      # 0x24f9c
movq %r14, %rsi
xorl %eax, %eax
callq 0x1be9c
movq 0x28(%rbp), %rax
movslq (%r12), %rcx
movslq 0x4(%r12), %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 %r14, %rsi
xorl %eax, %eax
callq 0x1be9c
btl $0x18, 0x18(%rsp)
jb 0x1cb1d
movq %rbx, %rdi
leaq 0x82b0(%rip), %rsi      # 0x24db6
xorl %eax, %eax
callq 0x1be9c
movl 0x34(%rsp), %ecx
incl %ecx
movq 0x10(%rsp), %r12
jmp 0x1c987
movq 0x28(%rbp), %rax
movslq (%r12), %rcx
shlq $0x4, %rcx
movl (%rax,%rcx), %r14d
subl %r15d, %r14d
incl %r14d
movq %rbx, %rdi
leaq 0x836e(%rip), %rsi      # 0x24eab
movl %r15d, %edx
xorl %eax, %eax
callq 0x1be9c
pushq $0x1
popq %rbp
movq 0x38(%rsp), %rax
movq 0x28(%rax), %rax
movslq (%r12), %rcx
cmpl 0x4(%r12), %ebp
jge 0x1cba5
addl %ebp, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
movl (%rax,%rcx), %r13d
cmpl $0x2, %ebp
jb 0x1cb81
movq %rbx, %rdi
leaq 0x8338(%rip), %rsi      # 0x24eb2
xorl %eax, %eax
callq 0x1be9c
subl %r15d, %r13d
incl %r13d
movl %r13d, %edx
subl %r14d, %edx
movq %rbx, %rdi
leaq 0x8409(%rip), %rsi      # 0x24fa0
xorl %eax, %eax
callq 0x1be9c
incl %ebp
movl %r13d, %r14d
jmp 0x1cb4a
shlq $0x4, %rcx
movl 0x8(%rax,%rcx), %eax
movl %r15d, %ecx
negl %ecx
leal (%rax,%rcx), %r13d
incl %r13d
movq %rbx, %rdi
leaq 0x8315(%rip), %rsi      # 0x24ed8
xorl %eax, %eax
callq 0x1be9c
pushq $0x1
popq %r14
cmpl 0x4(%r12), %r14d
movq 0x38(%rsp), %rbp
jge 0x1cafc
movq 0x28(%rbp), %rax
movslq (%r12), %rcx
addq %r14, %rcx
shlq $0x4, %rcx
movl 0x8(%rax,%rcx), %ebp
cmpl $0x2, %r14d
jb 0x1cc08
movq %rbx, %rdi
leaq 0x82b1(%rip), %rsi      # 0x24eb2
xorl %eax, %eax
callq 0x1be9c
subl %r15d, %ebp
incl %ebp
movl %ebp, %edx
subl %r13d, %edx
movq %rbx, %rdi
leaq 0x8384(%rip), %rsi      # 0x24fa0
xorl %eax, %eax
callq 0x1be9c
incq %r14
movl %ebp, %r13d
jmp 0x1cbce
movq %r14, %rdi
pushq $0x10
popq %rsi
leaq 0x8396(%rip), %rdx      # 0x24fce
movb $0x1, %al
callq 0x2140
jmp 0x1ca72
movq 0x50(%rsp), %r15
movq 0x68(%rsp), %rdx
incq %rdx
movl 0x8(%rbp), %eax
jmp 0x1c2e8
cmpl $0x0, 0x8(%rsi)
jne 0x1c5ca
testl %r13d, %r13d
je 0x1c5ca
movq 0x20(%rbp), %rcx
movslq 0x8(%r12), %rdx
imulq $0x14, %rdx, %rsi
movl 0x8(%rcx,%rsi), %ebp
andl $0x1, %ebp
movl %ebp, %esi
negl %esi
movq 0x20(%rsp), %r8
movq 0x10(%r8), %r8
decl %edi
andl %esi, %edi
addl %edx, %edi
movslq %edi, %rdx
imulq $0x14, %rdx, %rdx
movl 0x8(%rcx,%rdx), %ecx
shrl %ecx
shlq $0x6, %rcx
leaq (%r8,%rcx), %r14
movslq 0x8(%r8,%rcx), %rcx
imulq $0x18, %rcx, %rcx
movq (%rax,%rcx), %rdx
movl 0xc(%rax,%rcx), %ecx
movq %rbx, %rdi
leaq 0x82cf(%rip), %rsi      # 0x24f92
xorl %eax, %eax
callq 0x1be9c
testl %ebp, %ebp
jne 0x1ccf4
movl 0xc(%r14), %ecx
movl 0x24(%r12), %edx
addl %ecx, %edx
addl 0x28(%r12), %ecx
movq %rbx, %rdi
leaq 0x82b5(%rip), %rsi      # 0x24f9d
xorl %eax, %eax
callq 0x1be9c
jmp 0x1c609
movq 0x8(%rbx), %rax
movslq 0x34(%rsp), %rcx
movb $0x2d, (%rax,%rcx)
movl 0x20(%r12), %ecx
addl 0xc(%r14), %ecx
movl %ecx, %edx
subl 0x28(%r12), %edx
subl 0x24(%r12), %ecx
movq %rbx, %rdi
leaq 0x827d(%rip), %rsi      # 0x24f9d
xorl %eax, %eax
callq 0x1be9c
pushq $0x1
popq %rax
movl %eax, 0x2c(%rsp)
jmp 0x1c609
btl $0x14, 0x18(%rsp)
jb 0x1cd4d
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x82c0(%rip), %rsi      # 0x25014
movq %rbx, %rdi
movq 0x60(%rsp), %rdx
xorl %eax, %eax
callq 0x1be9c
cmpb $0x0, 0x18(%rsp)
setns %al
cmpl $0x2, 0x30(%rsp)
setne %cl
orb %al, %cl
jne 0x1cd96
movl (%rbx), %eax
cmpl $0x3, %eax
jb 0x1cd96
movq 0x8(%rbx), %rcx
leal -0x1(%rax), %edx
cmpb $0x31, (%rcx,%rdx)
jne 0x1cd96
addl $-0x2, %eax
cmpb $0x2f, (%rcx,%rax)
jne 0x1cd96
movl %eax, (%rbx)
leaq 0x8117(%rip), %rsi      # 0x24eb4
movq %rbx, %rdi
movl 0x44(%rsp), %edx
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1be9c
leaq 0x81ae(%rip), %rdi      # 0x24f71
leaq 0x811b(%rip), %rsi      # 0x24ee5
leaq 0x811d(%rip), %rcx      # 0x24eee
movl $0x9b, %edx
callq 0x2160
leaq 0x80f8(%rip), %rdi      # 0x24eda
leaq 0x80fc(%rip), %rsi      # 0x24ee5
leaq 0x80fe(%rip), %rcx      # 0x24eee
movl $0x8d, %edx
callq 0x2160
nop