// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/gfa-aug.c
// Function: gfa_augment
void gfa_augment(gfa_t *g, int32_t n_ins, const gfa_ins_t *ins, int32_t n_ctg, const char *const* name, const char *const* seq)
{
	int32_t i, j, k, *scnt, *soff, n_ctg_seg, n_old_seg, n_seg;
	gfa_split_t *sp;
	gfa_seg_t *seg;
	char buf[16];
	uint64_t t, n_old_arc = g->n_arc, *ins_side, *oldcnt;

	if (n_ins <= 0 || n_ctg <= 0) return;

	// set soff[]
	GFA_CALLOC(scnt, g->n_seg);
	for (i = 0; i < n_ins; ++i)
		++scnt[ins[i].v[0]>>1], ++scnt[ins[i].v[1]>>1];
	GFA_MALLOC(soff, g->n_seg + 1);
	for (j = 1, soff[0] = 0; j <= g->n_seg; ++j)
		soff[j] = soff[j-1] + scnt[j-1];

	// populate sp[]
	GFA_MALLOC(sp, soff[g->n_seg]);
	GFA_BZERO(scnt, g->n_seg);
	for (i = 0, n_ctg_seg = 0; i < n_ins; ++i) {
		const gfa_ins_t *p = &ins[i];
		for (k = 0; k < 2; ++k) {
			uint32_t vlen = g->seg[p->v[k]>>1].len;
			gfa_split_t *q = &sp[soff[p->v[k]>>1] + scnt[p->v[k]>>1]];
			q->ins = i, q->end = k;
			q->side = (p->v[k]&1? vlen - p->voff[k] : p->voff[k]) << 1 | ((p->v[k]&1) ^ k);
			assert(q->side != (0<<1|0) && q->side != (vlen<<1|1)); // not possible to link such sides
			++scnt[p->v[k]>>1];
		}
		if (p->coff[1] > p->coff[0])
			++n_ctg_seg;
	}
	free(scnt);

	// sort sp[]
	for (j = 0, n_old_seg = 0; j < g->n_seg; ++j)
		if (soff[j+1] - soff[j] > 1)
			radix_sort_split(&sp[soff[j]], &sp[soff[j+1]]);

	// precompute the number of segments after split
	for (j = 0, n_old_seg = 0; j < g->n_seg; ++j) {
		int32_t i0;
		for (i0 = soff[j], i = i0 + 1, k = 0; i <= soff[j+1]; ++i)
			if (i == soff[j+1] || sp[i0].side>>1 != sp[i].side>>1) {
				if (sp[i0].side>>1 != 0 && sp[i0].side>>1 != g->seg[j].len) // otherwise no new segment will be created
					++k;
				i0 = i;
			}
		n_old_seg += k + 1;
	}

	// compute ins_side[] and split old segments
	n_seg = n_old_seg + n_ctg_seg;
	GFA_CALLOC(seg, n_seg);
	GFA_CALLOC(ins_side, n_ins);
	GFA_MALLOC(oldcnt, g->n_seg);
	for (j = 0, k = 0; j < g->n_seg; ++j) {
		int32_t i0, l, off = 0, k0 = k;
		gfa_seg_t *s = &g->seg[j];
		gfa_seg_t *t = &seg[k]; // this is so far a placeholder
		// create the first half of a new segment
		snprintf(buf, 15, "s%d", k + 1);
		t->name = gfa_strdup(buf);
		t->snid = s->snid, t->soff = s->soff, t->rank = s->rank;
		// iterate over splits
		for (i0 = soff[j], i = i0 + 1; i <= soff[j+1]; ++i) {
			if (i == soff[j+1] || sp[i].side>>1 != sp[i0].side>>1) {
				gfa_split_t *q0 = &sp[i0];
				for (l = i0; l < i; ++l) {
					gfa_split_t *q = &sp[l];
					int32_t shift = q->end == 0? 32 : 0; // first end on the higher 32 bits
					int32_t side = q->side & 1;
					int32_t which = q->side>>1 == 0? 0 : side; // special-casing when q->side==1, because no new segment created in this case
					ins_side[q->ins] |= (uint64_t)((uint32_t)(k + which) << 1 | (side^q->end)) << shift;
				}
				if (q0->side>>1 != 0 && q0->side>>1 != g->seg[j].len) { // create a new segment
					t->len = (q0->side>>1) - off;
					GFA_MALLOC(t->seq, t->len + 1);
					memcpy(t->seq, &s->seq[off], t->len);
					t->seq[t->len] = 0;
					off += t->len;
					t = &seg[++k]; // create a new segment
					snprintf(buf, 15, "s%d", k + 1);
					t->name = gfa_strdup(buf);
					t->snid = s->snid, t->soff = s->soff + off, t->rank = s->rank;
				}
				i0 = i;
			}
		}
		// finish the last segment
		t->len = s->len - off;
		GFA_MALLOC(t->seq, t->len + 1);
		memcpy(t->seq, &s->seq[off], t->len);
		t->seq[t->len] = 0;
		++k;
		oldcnt[j] = (uint64_t)k0 << 32 | (k - k0);
		// add new arcs between newly created segments
		for (i = 0; i < k - k0 - 1; ++i)
			create_first_arc(g, seg, (uint32_t)(k0+i)<<1, (uint32_t)(k0+i+1)<<1, s->rank);
	}
	assert(k == n_old_seg);
	free(soff);
	free(sp);

	// update existing g->arc[]
	for (t = 0; t < n_old_arc; ++t) {
		gfa_arc_t *a = &g->arc[t];
		uint32_t v = a->v_lv >> 32;
		uint32_t off = oldcnt[v>>1]>>32, cnt = (uint32_t)oldcnt[v>>1];
		v = (v&1) == 0? (off+cnt-1)<<1 : off<<1 | 1;
		a->v_lv = (uint64_t)v << 32 | seg[v>>1].len;
		off = oldcnt[a->w>>1]>>32, cnt = (uint32_t)oldcnt[a->w>>1];
		a->w = (a->w&1) == 0? off<<1 : (off+cnt-1)<<1 | 1;
	}
	free(oldcnt);

	// create newly inserted segments
	for (i = 0, k = n_old_seg; i < n_ins; ++i) {
		const gfa_ins_t *p = &ins[i];
		if (p->coff[0] < p->coff[1]) { // not a pure deletion
			gfa_seg_t *t = &seg[k];
			snprintf(buf, 15, "s%d", k + 1);
			t->name = gfa_strdup(buf);
			GFA_MALLOC(t->seq, p->coff[1] - p->coff[0] + 1);
			for (j = 0; j < p->coff[1] - p->coff[0]; ++j)
				t->seq[j] = seq[p->ctg][p->coff[0] + j];
			t->seq[j] = 0;
			t->len = j;
			t->snid = gfa_sseq_add(g, name[p->ctg]);
			t->soff = p->coff[0];
			t->rank = g->max_rank + 1; // TODO: to deal with SN/SO/SR tags somewhere
			gfa_sseq_update(g, t);
			create_first_arc(g, seg, ins_side[i]>>32, (uint32_t)k<<1, t->rank);
			create_first_arc(g, seg, (uint32_t)k<<1, (uint32_t)ins_side[i], t->rank);
			++k;
		} else { // a pure deletion
			create_first_arc(g, seg, ins_side[i]>>32, (uint32_t)ins_side[i], g->max_rank + 1);
		}
	}
	free(ins_side);

	// update *g
	for (j = 0; j < g->n_seg; ++j) {
		free(g->seg[j].name);
		free(g->seg[j].seq);
		free(g->seg[j].aux.aux);
	}
	free(g->seg);
	g->seg = seg, g->n_seg = g->m_seg = n_seg;
	++g->max_rank;
	GFA_REALLOC(g->link_aux, g->m_arc);
	GFA_BZERO(&g->link_aux[n_old_arc], g->m_arc - n_old_arc);
	gfa_arc_sort(g);
	gfa_arc_index(g);
	gfa_fix_multi(g);
	// k = gfa_fix_symm(g); assert(k == 0); // for debugging; the graph should be symmetric
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %r8, 0xa0(%rsp)
testl %esi, %esi
setle %al
testl %ecx, %ecx
setle %cl
orb %al, %cl
jne 0x9cf5
movq %rdx, %r15
movl %esi, %ebx
movq %r9, 0x98(%rsp)
movq 0x40(%rdi), %rax
movq %rax, 0x40(%rsp)
movq %rdi, 0x18(%rsp)
movl 0x4(%rdi), %r12d
movl $0x4, %esi
movq %r12, %rdi
callq 0x21e0
movq %rax, %r14
movl %ebx, %ecx
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rax
movq %rcx, 0x50(%rsp)
addq %rcx, %rax
xorl %ecx, %ecx
movl (%r15,%rcx), %edx
shrl %edx
incl (%r14,%rdx,4)
movl 0x4(%r15,%rcx), %edx
shrl %edx
incl (%r14,%rdx,4)
addq $0x1c, %rcx
cmpq %rcx, %rax
jne 0x9375
leal 0x1(%r12), %ebx
leaq (,%rbx,4), %rdi
callq 0x2280
movl $0x0, (%rax)
testl %r12d, %r12d
je 0x93c7
decq %rbx
xorl %edx, %edx
xorl %ecx, %ecx
addl (%r14,%rdx,4), %ecx
movl %ecx, 0x4(%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rbx
jne 0x93b7
movq %rax, 0x28(%rsp)
movslq (%rax,%r12,4), %rdi
shlq $0x3, %rdi
callq 0x2280
movq %rax, 0x8(%rsp)
movq %r12, (%rsp)
leaq (,%r12,4), %rdx
xorl %ebx, %ebx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2180
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
xorl %r13d, %r13d
movq %r15, 0x48(%rsp)
movq 0x8(%rsp), %r12
leaq (%rbx,%rbx,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %r15, %rcx
addq %rbx, %rcx
movb $0x1, %dl
xorl %edi, %edi
movl (%rcx,%rdi,4), %r8d
movl %r8d, %esi
shrl %esi
movq %rsi, %r9
shlq $0x6, %r9
movl (%rax,%r9), %r10d
movq 0x28(%rsp), %r9
movslq (%r9,%rsi,4), %r11
movslq (%r14,%rsi,4), %r9
addq %r9, %r11
movl %edi, %ebp
shll $0x1f, %ebp
orl %ebx, %ebp
movl %ebp, 0x4(%r12,%r11,8)
andl $0x1, %r8d
movl 0x8(%rcx,%rdi,4), %ebp
movl %r10d, %r15d
subl %ebp, %r15d
testl %r8d, %r8d
cmovel %ebp, %r15d
addl %r15d, %r15d
xorl %edi, %r8d
orl %r15d, %r8d
movl %r8d, (%r12,%r11,8)
je 0x9d07
leal 0x1(,%r10,2), %edi
cmpl %edi, %r8d
je 0x9d07
incl %r9d
movl %r9d, (%r14,%rsi,4)
movl $0x1, %edi
testb $0x1, %dl
movl $0x0, %edx
jne 0x941e
movl 0x14(%rcx), %edx
xorl %esi, %esi
cmpl 0x10(%rcx), %edx
setg %sil
addl %esi, %r13d
incq %rbx
cmpq 0x50(%rsp), %rbx
movq 0x48(%rsp), %r15
jne 0x940c
movq %r14, %rdi
callq 0x2040
xorl %r14d, %r14d
movb $0x1, %r12b
movq (%rsp), %rdx
testl %edx, %edx
movq 0x18(%rsp), %r15
je 0x95fb
movl %r13d, 0x24(%rsp)
xorl %eax, %eax
xorl %ebp, %ebp
movq 0x28(%rsp), %r13
movl 0x4(%r13,%rbp,4), %r15d
movl %r15d, %ecx
subl %eax, %ecx
cmpl $0x2, %ecx
jl 0x951a
movslq %r15d, %rcx
cltq
movq 0x8(%rsp), %rdx
leaq (%rdx,%rax,8), %rdi
leaq (%rdx,%rcx,8), %rsi
callq 0x92e5
movq 0x18(%rsp), %rax
movl 0x4(%rax), %edx
incq %rbp
movl %edx, %ebx
movl %r15d, %eax
cmpq %rbx, %rbp
jb 0x94ec
testl %edx, %edx
sete %al
je 0x9601
movb %al, 0x10(%rsp)
movq 0x8(%rsp), %rax
addq $0x8, %rax
movq %rax, (%rsp)
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rax
movl 0x4(%rax,%rdx,4), %edi
movl $0x0, %r10d
cmpl %edi, %esi
jge 0x95ce
movslq %edi, %r8
movslq %esi, %r10
subq %r10, %r8
leaq -0x1(%r8), %r9
leal 0x1(%rsi), %r11d
movq (%rsp), %rax
leaq (%rax,%r10,8), %r15
xorl %r13d, %r13d
movq %rdx, %rbp
shlq $0x6, %rbp
xorl %r10d, %r10d
movslq %esi, %r12
movq 0x8(%rsp), %rax
movl (%rax,%r12,8), %r12d
cmpq %r13, %r9
je 0x95a4
movl (%r15,%r13,8), %eax
xorl %r12d, %eax
cmpl $0x2, %eax
jb 0x95c6
leaq (%r11,%r13), %rsi
cmpl $0x1, %r12d
jbe 0x95c6
shrl %r12d
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
xorl %ecx, %ecx
cmpl (%rax,%rbp), %r12d
setne %cl
addl %ecx, %r10d
incq %r13
cmpq %r13, %r8
jne 0x9587
incq %rdx
movq 0x30(%rsp), %rax
addl %r10d, %eax
incl %eax
movl %edi, %esi
cmpq %rbx, %rdx
jne 0x9549
shlq $0x3, %rbx
movb 0x10(%rsp), %r12b
movq 0x18(%rsp), %r15
movl 0x24(%rsp), %r13d
jmp 0x960f
xorl %ebx, %ebx
xorl %eax, %eax
jmp 0x960f
xorl %ebx, %ebx
xorl %eax, %eax
movl 0x24(%rsp), %r13d
movq 0x18(%rsp), %r15
movq %rax, 0x30(%rsp)
addl %eax, %r13d
movl %r13d, 0x24(%rsp)
movslq %r13d, %rdi
movl $0x40, %esi
callq 0x21e0
movq %rax, 0x10(%rsp)
movl $0x8, %esi
movq 0x50(%rsp), %rdi
callq 0x21e0
movq %rax, %rbp
movq %rbx, %rdi
callq 0x2280
movq %rax, 0x60(%rsp)
testb %r12b, %r12b
jne 0x99b5
movq 0x8(%rsp), %rax
addq $0x4, %rax
movq %rax, 0xb8(%rsp)
xorl %ebx, %ebx
xorl %r14d, %r14d
movq %rbp, 0xb0(%rsp)
movq %rbx, 0x70(%rsp)
movq 0x10(%r15), %rcx
movq %rcx, 0x38(%rsp)
shlq $0x6, %rbx
leaq (%rcx,%rbx), %rax
movq %rax, (%rsp)
movq %r14, 0x68(%rsp)
movslq %r14d, %rax
movq %rax, %r12
shlq $0x6, %r12
movq 0x10(%rsp), %r13
leaq (%r12,%r13), %rcx
movq %rcx, 0x58(%rsp)
movq %rax, 0xa8(%rsp)
leal 0x1(%rax), %r14d
movl $0xf, %esi
leaq 0x80(%rsp), %r15
movq %r15, %rdi
leaq 0x1ee79(%rip), %rdx     # 0x28547
movl %r14d, %ecx
xorl %eax, %eax
callq 0x2140
movq %r15, %rdi
callq 0x4a43
movq %rax, 0x18(%r13,%r12)
movq 0x38(%rsp), %rcx
movq 0x8(%rcx,%rbx), %rax
movq %rax, 0x8(%r13,%r12)
movq %rbx, 0xc0(%rsp)
movl 0x10(%rcx,%rbx), %eax
movl %eax, 0x10(%r13,%r12)
movq 0x28(%rsp), %rax
movq 0x70(%rsp), %rdx
movl (%rax,%rdx,4), %ecx
movl 0x4(%rax,%rdx,4), %eax
incq %rdx
movq %rdx, 0x78(%rsp)
cmpl %eax, %ecx
jge 0x98f3
movslq %ecx, %rbx
leal 0x1(%rcx), %r13d
movq $0x0, 0x38(%rsp)
movq 0x68(%rsp), %r14
movq (%rsp), %r9
movq %rbx, %rsi
incq %rbx
cmpl %ebx, %eax
jne 0x974e
movslq %ecx, %rdx
jmp 0x9767
movslq %ecx, %rdx
movq 0x8(%rsp), %r8
movl (%r8,%rdx,8), %edi
xorl (%r8,%rbx,8), %edi
cmpl $0x2, %edi
jb 0x98da
cmpq %rsi, %rdx
movl $0x0, %r15d
jg 0x97d2
movq 0xb8(%rsp), %rcx
leaq (%rcx,%rdx,8), %rsi
movl %r13d, %edi
subl %edx, %edi
xorl %r8d, %r8d
movl -0x4(%rsi,%r8,8), %r9d
movl (%rsi,%r8,8), %r10d
testl %r10d, %r10d
setns %cl
movl %r10d, %r11d
shrl $0x1f, %r11d
movl %r9d, %r12d
andl $0x1, %r12d
cmpl $0x2, %r9d
movl %r12d, %r9d
cmovbl %r15d, %r9d
addl %r14d, %r9d
xorl %r11d, %r12d
leal (%r12,%r9,2), %r9d
shlb $0x5, %cl
shlq %cl, %r9
andl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
orq %r9, (%rbp,%r10,8)
incq %r8
cmpl %r8d, %edi
jne 0x9786
movq 0x8(%rsp), %rcx
movl (%rcx,%rdx,8), %r12d
cmpl $0x2, %r12d
jb 0x97fb
shrl %r12d
movq 0x18(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0xc0(%rsp), %rdx
cmpl (%rcx,%rdx), %r12d
jne 0x9806
movl %ebx, %ecx
movq (%rsp), %r9
jmp 0x98da
movq 0x38(%rsp), %rbp
subl %ebp, %r12d
movq 0x58(%rsp), %r15
movl %r12d, (%r15)
leal 0x1(%r12), %eax
movslq %eax, %rdi
callq 0x2280
movq %rax, 0x20(%r15)
movslq %ebp, %rbp
movq (%rsp), %rcx
movq 0x20(%rcx), %rsi
addq %rbp, %rsi
movslq %r12d, %rdx
movq %rax, %rdi
callq 0x2230
movq 0x20(%r15), %rax
movslq (%r15), %rcx
movb $0x0, (%rax,%rcx)
addl (%r15), %ebp
movslq %r14d, %rcx
incl %r14d
movq %rcx, %r12
shlq $0x6, %r12
movq 0x10(%rsp), %r15
leaq (%r12,%r15), %rax
addq $0x40, %rax
movq %rax, 0x58(%rsp)
addl $0x2, %ecx
movl $0xf, %esi
leaq 0x80(%rsp), %rdi
leaq 0x1ecc3(%rip), %rdx     # 0x28547
xorl %eax, %eax
callq 0x2140
leaq 0x80(%rsp), %rdi
callq 0x4a43
movq (%rsp), %r9
movq %rax, 0x58(%r12,%r15)
movl 0x8(%r9), %eax
movl %eax, 0x48(%r12,%r15)
movl 0xc(%r9), %eax
movq %rbp, 0x38(%rsp)
addl %ebp, %eax
movq 0xb0(%rsp), %rbp
movl %eax, 0x4c(%r12,%r15)
movl 0x10(%r9), %eax
movl %eax, 0x50(%r12,%r15)
movq 0x28(%rsp), %rax
movq 0x78(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %ebx, %ecx
movslq %eax, %rdx
incl %r13d
cmpq %rdx, %rbx
jl 0x973f
incl %r14d
movq 0x38(%rsp), %rax
jmp 0x98f9
xorl %eax, %eax
movq (%rsp), %r9
movslq (%r9), %rbx
movslq %eax, %r13
subq %r13, %rbx
movq 0x58(%rsp), %r12
movl %ebx, (%r12)
movq %rbx, %rdi
incq %rdi
movq %r9, %r15
callq 0x2280
movq %rax, 0x20(%r12)
addq 0x20(%r15), %r13
movslq %ebx, %rdx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2230
movq 0x20(%r12), %rax
movslq (%r12), %rcx
movb $0x0, (%rax,%rcx)
movq 0xa8(%rsp), %rdx
movq %rdx, %rax
shlq $0x20, %rax
movl %r14d, %ecx
subl %edx, %ecx
movslq %ecx, %rcx
orq %rcx, %rax
movq 0x60(%rsp), %rdx
movq 0x70(%rsp), %rsi
movq %rax, (%rdx,%rsi,8)
cmpl $0x2, %ecx
movq 0x10(%rsp), %r12
movq 0x68(%rsp), %rdx
movq 0x18(%rsp), %r15
jl 0x99a3
movl %edx, %ebx
notl %ebx
addl %r14d, %ebx
addl %edx, %edx
leal 0x2(%rdx), %r13d
movq (%rsp), %rax
movl 0x10(%rax), %r8d
movq %r15, %rdi
movq %r12, %rsi
movl %r13d, %ecx
callq 0x9d45
movl %r13d, %edx
decl %ebx
jne 0x9982
movl 0x4(%r15), %eax
movq 0x78(%rsp), %rbx
cmpq %rax, %rbx
jb 0x9674
movq %r15, %r12
movq 0x30(%rsp), %r15
cmpl %r15d, %r14d
movq 0x28(%rsp), %rdi
jne 0x9d26
callq 0x2040
movq 0x8(%rsp), %rdi
callq 0x2040
cmpq $0x0, 0x40(%rsp)
movq 0x48(%rsp), %r14
movq 0x10(%rsp), %r9
movq 0x60(%rsp), %rdi
je 0x9a78
movq 0x48(%r12), %rax
addq $0x8, %rax
movq 0x40(%rsp), %rcx
movq -0x8(%rax), %r8
movq %r8, %rdx
shrq $0x21, %rdx
movq (%rdi,%rdx,8), %rsi
movq %rsi, %rdx
shrq $0x20, %rdx
btq $0x20, %r8
jb 0x9a2b
addl %esi, %edx
leal -0x2(,%rdx,2), %edx
jmp 0x9a32
leal 0x1(,%rdx,2), %edx
movq %rdx, %rsi
shlq $0x20, %rsi
shrl %edx
shlq $0x6, %rdx
movslq (%r9,%rdx), %rdx
orq %rsi, %rdx
movq %rdx, -0x8(%rax)
movl (%rax), %edx
movl %edx, %esi
shrl %esi
movq (%rdi,%rsi,8), %rsi
movq %rsi, %r10
shrq $0x20, %r10
leal (%r10,%r10), %r8d
addl %r10d, %esi
testb $0x1, %dl
leal -0x1(%rsi,%rsi), %edx
cmovel %r8d, %edx
movl %edx, (%rax)
addq $0x20, %rax
decq %rcx
jne 0x9a03
callq 0x2040
xorl %ebx, %ebx
leaq (%rbx,%rbx,8), %rax
leaq (%rax,%rax,2), %r13
addq %rbx, %r13
movl 0x10(%r14,%r13), %eax
cmpl 0x14(%r14,%r13), %eax
jge 0x9c04
addq %r14, %r13
movq %r15, 0x30(%rsp)
movslq %r15d, %rcx
movq %rcx, %rax
shlq $0x6, %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdx
leaq (%rdx,%rax), %r12
incl %ecx
xorl %r14d, %r14d
movl $0xf, %esi
leaq 0x80(%rsp), %r15
movq %r15, %rdi
leaq 0x1ea71(%rip), %rdx     # 0x28547
movq %rcx, 0x28(%rsp)
xorl %eax, %eax
callq 0x2140
movq %r15, %rdi
callq 0x4a43
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rdx
movq %rax, 0x18(%rcx,%rdx)
movl 0x10(%r13), %r15d
movl 0x14(%r13), %eax
movl %eax, (%rsp)
subl %r15d, %eax
incl %eax
movslq %eax, %rdi
callq 0x2280
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rdx
movq %rax, 0x20(%rcx,%rdx)
cmpl %r15d, (%rsp)
jle 0x9b63
xorl %r14d, %r14d
movq 0x98(%rsp), %rdx
movslq 0x18(%r13), %rax
movq (%rdx,%rax,8), %rax
addl %r14d, %r15d
movslq %r15d, %rcx
movb (%rax,%rcx), %al
movq 0x20(%r12), %rcx
movb %al, (%rcx,%r14)
incq %r14
movslq 0x14(%r13), %rax
movslq 0x10(%r13), %r15
subq %r15, %rax
cmpq %rax, %r14
jl 0x9b31
movq 0x20(%r12), %rax
movl %r14d, %ecx
movb $0x0, (%rax,%rcx)
movl %r14d, (%r12)
movslq 0x18(%r13), %rax
movq 0xa0(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x4f76
movl %eax, 0x8(%r12)
movl 0x10(%r13), %eax
movl %eax, 0xc(%r12)
movl 0x8(%r14), %eax
incl %eax
movl %eax, 0x10(%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x516d
movq (%rbp,%rbx,8), %rdx
movq %rdx, 0x8(%rsp)
shrq $0x20, %rdx
movq 0x30(%rsp), %r15
addl %r15d, %r15d
movl 0x10(%r12), %r8d
movq %r14, %rdi
movq 0x10(%rsp), %r13
movq %r13, %rsi
movl %r15d, %ecx
callq 0x9d45
movl 0x10(%r12), %r8d
movq %r14, %r12
movq %r14, %rdi
movq %r13, %rsi
movl %r15d, %edx
movq 0x8(%rsp), %rcx
callq 0x9d45
movq 0x28(%rsp), %r15
movq 0x48(%rsp), %r14
jmp 0x9c25
movq (%rbp,%rbx,8), %rcx
movq %rcx, %rdx
shrq $0x20, %rdx
movq %r12, %rdi
movl 0x8(%r12), %r8d
incl %r8d
movq 0x10(%rsp), %rsi
callq 0x9d45
incq %rbx
cmpq 0x50(%rsp), %rbx
jne 0x9a7f
movq %r12, %r15
movl 0x4(%r12), %ebx
movq %rbp, %rdi
callq 0x2040
testl %ebx, %ebx
je 0x9c86
xorl %ebx, %ebx
xorl %r14d, %r14d
movq 0x10(%r15), %rax
movq 0x18(%rax,%rbx), %rdi
callq 0x2040
movq 0x10(%r15), %rax
movq 0x20(%rax,%rbx), %rdi
callq 0x2040
movq 0x10(%r15), %rax
movq 0x38(%rax,%rbx), %rdi
callq 0x2040
incq %r14
movl 0x4(%r15), %eax
addq $0x40, %rbx
cmpq %rax, %r14
jb 0x9c4c
movq 0x10(%r15), %rdi
callq 0x2040
movq 0x10(%rsp), %rax
movq %rax, 0x10(%r15)
movl 0x24(%rsp), %eax
movl %eax, (%r15)
movl %eax, 0x4(%r15)
incl 0x8(%r15)
movq 0x38(%r15), %rsi
movq 0x50(%r15), %rdi
shlq $0x4, %rsi
callq 0x22b0
movq %rax, 0x50(%r15)
movq 0x40(%rsp), %rcx
movq %rcx, %rdi
shlq $0x4, %rdi
addq %rax, %rdi
movq 0x38(%r15), %rdx
subq %rcx, %rdx
shlq $0x4, %rdx
xorl %esi, %esi
callq 0x2180
movq %r15, %rdi
callq 0x545e
movq %r15, %rdi
callq 0x54fe
movq %r15, %rdi
callq 0x5db1
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e882(%rip), %rdi     # 0x28590
leaq 0x1e836(%rip), %rsi     # 0x2854b
leaq 0x1e8a2(%rip), %rcx     # 0x285be
movl $0x3f, %edx
callq 0x2160
leaq 0x1e8fa(%rip), %rdi     # 0x28627
leaq 0x1e817(%rip), %rsi     # 0x2854b
leaq 0x1e883(%rip), %rcx     # 0x285be
movl $0x89, %edx
callq 0x2160