// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x90(%rbp)
cmpl $0x0, -0xc(%rbp)
jle 0xb9cc
cmpl $0x0, -0x1c(%rbp)
jg 0xb9d1
jmp 0xc929
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edi
movl $0x4, %esi
callq 0x21e0
movq %rax, -0x48(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0xba47
movq -0x48(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq -0x34(%rbp), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x48(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq -0x34(%rbp), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xb9ef
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x2280
movq %rax, -0x50(%rbp)
movl $0x1, -0x38(%rbp)
movq -0x50(%rbp), %rax
movl $0x0, (%rax)
movl -0x38(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
ja 0xbab5
movq -0x50(%rbp), %rax
movl -0x38(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x48(%rbp), %rax
movl -0x38(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
addl (%rax,%rcx,4), %edx
movq -0x50(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xba73
movq -0x50(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
movslq (%rax,%rcx,4), %rdi
shlq $0x3, %rdi
callq 0x2280
movq %rax, -0x68(%rbp)
movq -0x48(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x2190
movl $0x0, -0x34(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0xbce6
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movl $0x0, -0x3c(%rbp)
cmpl $0x2, -0x3c(%rbp)
jge 0xbcb7
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xa8(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0xac(%rbp)
movq -0x68(%rbp), %rax
movq -0x50(%rbp), %rcx
movq -0xa8(%rbp), %rdx
movslq -0x3c(%rbp), %rsi
movl (%rdx,%rsi,4), %edx
shrl %edx
movl %edx, %edx
movl (%rcx,%rdx,4), %ecx
movq -0x48(%rbp), %rdx
movq -0xa8(%rbp), %rsi
movslq -0x3c(%rbp), %rdi
movl (%rsi,%rdi,4), %esi
shrl %esi
movl %esi, %esi
addl (%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movl -0x34(%rbp), %edx
movq -0xb8(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, 0x4(%rax)
movl -0x3c(%rbp), %edx
movq -0xb8(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0x1, %edx
shll $0x1f, %edx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl %edx, %ecx
movl %ecx, 0x4(%rax)
movq -0xa8(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xbc09
movl -0xac(%rbp), %eax
movq -0xa8(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
subl 0x8(%rcx,%rdx,4), %eax
movl %eax, -0x12c(%rbp)
jmp 0xbc1e
movq -0xa8(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl 0x8(%rax,%rcx,4), %eax
movl %eax, -0x12c(%rbp)
movl -0x12c(%rbp), %ecx
shll %ecx
movq -0xa8(%rbp), %rax
movslq -0x3c(%rbp), %rdx
movl (%rax,%rdx,4), %eax
andl $0x1, %eax
xorl -0x3c(%rbp), %eax
orl %eax, %ecx
movq -0xb8(%rbp), %rax
movl %ecx, (%rax)
movq -0xb8(%rbp), %rax
cmpl $0x0, (%rax)
je 0xbc6b
movq -0xb8(%rbp), %rax
movl (%rax), %eax
movl -0xac(%rbp), %ecx
shll %ecx
orl $0x1, %ecx
cmpl %ecx, %eax
je 0xbc6b
jmp 0xbc8a
leaq 0x30900(%rip), %rdi     # 0x3c572
leaq 0x308b4(%rip), %rsi     # 0x3c52d
movl $0x3f, %edx
leaq 0x3091b(%rip), %rcx     # 0x3c5a0
callq 0x2170
movq -0x48(%rbp), %rax
movq -0xa8(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xbb20
movq -0xa8(%rbp), %rax
movl 0x14(%rax), %eax
movq -0xa8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jle 0xbcd6
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xbcd8
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xbaf7
movq -0x48(%rbp), %rdi
callq 0x2040
movl $0x0, -0x38(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x38(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0xbd6e
movq -0x50(%rbp), %rax
movl -0x38(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq -0x50(%rbp), %rcx
movslq -0x38(%rbp), %rdx
subl (%rcx,%rdx,4), %eax
cmpl $0x1, %eax
jle 0xbd61
movq -0x68(%rbp), %rdi
movq -0x50(%rbp), %rax
movslq -0x38(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x68(%rbp), %rsi
movq -0x50(%rbp), %rax
movl -0x38(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movslq (%rax,%rcx,4), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0xb930
jmp 0xbd63
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xbcfd
movl $0x0, -0x38(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x38(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0xbe77
movq -0x50(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x34(%rbp), %eax
movq -0x50(%rbp), %rcx
movl -0x38(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jg 0xbe5d
movl -0x34(%rbp), %eax
movq -0x50(%rbp), %rcx
movl -0x38(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
je 0xbdff
movq -0x68(%rbp), %rax
movslq -0xbc(%rbp), %rcx
movl (%rax,%rcx,8), %eax
shrl %eax
movq -0x68(%rbp), %rcx
movslq -0x34(%rbp), %rdx
movl (%rcx,%rdx,8), %ecx
shrl %ecx
cmpl %ecx, %eax
je 0xbe4d
movq -0x68(%rbp), %rax
movslq -0xbc(%rbp), %rcx
movl (%rax,%rcx,8), %eax
shrl %eax
cmpl $0x0, %eax
je 0xbe44
movq -0x68(%rbp), %rax
movslq -0xbc(%rbp), %rcx
movl (%rax,%rcx,8), %eax
shrl %eax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x38(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
je 0xbe44
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0xbc(%rbp)
jmp 0xbe4f
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xbdb0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
addl -0x58(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xbd7c
movl -0x58(%rbp), %eax
addl -0x54(%rbp), %eax
movl %eax, -0x5c(%rbp)
movslq -0x5c(%rbp), %rdi
movl $0x40, %esi
callq 0x21e0
movq %rax, -0x70(%rbp)
movslq -0xc(%rbp), %rdi
movl $0x8, %esi
callq 0x21e0
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edi
shlq $0x3, %rdi
callq 0x2280
movq %rax, -0xa0(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x38(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0xc3b9
movl $0x0, -0xc8(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0xcc(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x38(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0xd8(%rbp)
movq -0x70(%rbp), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
leaq -0x80(%rbp), %rdi
movl -0x3c(%rbp), %ecx
addl $0x1, %ecx
movl $0xf, %esi
leaq 0x305f2(%rip), %rdx     # 0x3c529
movb $0x0, %al
callq 0x2150
leaq -0x80(%rbp), %rdi
callq 0x5700
movq %rax, %rcx
movq -0xe0(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0xd8(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0xe0(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0xd8(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0xe0(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0xd8(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0xe0(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x50(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xc0(%rbp)
movl -0xc0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x50(%rbp), %rcx
movl -0x38(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jg 0xc29c
movl -0x34(%rbp), %eax
movq -0x50(%rbp), %rcx
movl -0x38(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
je 0xc001
movq -0x68(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,8), %eax
shrl %eax
movq -0x68(%rbp), %rcx
movslq -0xc0(%rbp), %rdx
movl (%rcx,%rdx,8), %ecx
shrl %ecx
cmpl %ecx, %eax
je 0xc28c
movq -0x68(%rbp), %rax
movslq -0xc0(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0xe8(%rbp)
movl -0xc0(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xc118
movq -0x68(%rbp), %rax
movslq -0xc4(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movl 0x4(%rax), %edx
shrl $0x1f, %edx
xorl %eax, %eax
movl $0x20, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0xf4(%rbp)
movq -0xf0(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
movl %eax, -0xf8(%rbp)
movq -0xf0(%rbp), %rax
movl (%rax), %eax
shrl %eax
cmpl $0x0, %eax
jne 0xc09a
xorl %eax, %eax
movl %eax, -0x130(%rbp)
jmp 0xc0a6
movl -0xf8(%rbp), %eax
movl %eax, -0x130(%rbp)
movl -0x130(%rbp), %eax
movl %eax, -0xfc(%rbp)
movl -0x3c(%rbp), %eax
addl -0xfc(%rbp), %eax
shll %eax
movl -0xf8(%rbp), %ecx
movq -0xf0(%rbp), %rdx
movl 0x4(%rdx), %edx
shrl $0x1f, %edx
xorl %edx, %ecx
orl %ecx, %eax
movl %eax, %eax
movl %eax, %edx
movl -0xf4(%rbp), %eax
movl %eax, %ecx
shlq %cl, %rdx
movq -0x98(%rbp), %rax
movq -0xf0(%rbp), %rcx
movl 0x4(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0xc026
movq -0xe8(%rbp), %rax
movl (%rax), %eax
shrl %eax
cmpl $0x0, %eax
je 0xc283
movq -0xe8(%rbp), %rax
movl (%rax), %eax
shrl %eax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x38(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
je 0xc283
movq -0xe8(%rbp), %rax
movl (%rax), %ecx
shrl %ecx
subl -0xc8(%rbp), %ecx
movq -0xe0(%rbp), %rax
movl %ecx, (%rax)
movq -0xe0(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x2280
movq %rax, %rcx
movq -0xe0(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0xe0(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0xd8(%rbp), %rax
movq 0x20(%rax), %rsi
movslq -0xc8(%rbp), %rax
addq %rax, %rsi
movq -0xe0(%rbp), %rax
movslq (%rax), %rdx
callq 0x2230
movq -0xe0(%rbp), %rax
movq 0x20(%rax), %rax
movq -0xe0(%rbp), %rcx
movslq (%rcx), %rcx
movb $0x0, (%rax,%rcx)
movq -0xe0(%rbp), %rax
movl (%rax), %eax
addl -0xc8(%rbp), %eax
movl %eax, -0xc8(%rbp)
movq -0x70(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x3c(%rbp)
movslq %ecx, %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
leaq -0x80(%rbp), %rdi
movl -0x3c(%rbp), %ecx
addl $0x1, %ecx
movl $0xf, %esi
leaq 0x30306(%rip), %rdx     # 0x3c529
movb $0x0, %al
callq 0x2150
leaq -0x80(%rbp), %rdi
callq 0x5700
movq %rax, %rcx
movq -0xe0(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0xd8(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0xe0(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0xd8(%rbp), %rax
movl 0xc(%rax), %ecx
addl -0xc8(%rbp), %ecx
movq -0xe0(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0xd8(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0xe0(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x34(%rbp), %eax
movl %eax, -0xc0(%rbp)
jmp 0xc28e
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xbfae
movq -0xd8(%rbp), %rax
movl (%rax), %ecx
subl -0xc8(%rbp), %ecx
movq -0xe0(%rbp), %rax
movl %ecx, (%rax)
movq -0xe0(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x2280
movq %rax, %rcx
movq -0xe0(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0xe0(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0xd8(%rbp), %rax
movq 0x20(%rax), %rsi
movslq -0xc8(%rbp), %rax
addq %rax, %rsi
movq -0xe0(%rbp), %rax
movslq (%rax), %rdx
callq 0x2230
movq -0xe0(%rbp), %rax
movq 0x20(%rax), %rax
movq -0xe0(%rbp), %rcx
movslq (%rcx), %rcx
movb $0x0, (%rax,%rcx)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movslq -0xcc(%rbp), %rdx
shlq $0x20, %rdx
movl -0x3c(%rbp), %eax
subl -0xcc(%rbp), %eax
cltq
orq %rax, %rdx
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x3c(%rbp), %ecx
subl -0xcc(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0xc3a9
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rsi
movl -0xcc(%rbp), %edx
addl -0x34(%rbp), %edx
shll %edx
movl -0xcc(%rbp), %ecx
addl -0x34(%rbp), %ecx
addl $0x1, %ecx
shll %ecx
movq -0xd8(%rbp), %rax
movl 0x10(%rax), %r8d
callq 0xc940
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xc35a
jmp 0xc3ab
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xbece
movl -0x3c(%rbp), %eax
cmpl -0x58(%rbp), %eax
jne 0xc3c3
jmp 0xc3e2
leaq 0x3023f(%rip), %rdi     # 0x3c609
leaq 0x3015c(%rip), %rsi     # 0x3c52d
movl $0x89, %edx
leaq 0x301c3(%rip), %rcx     # 0x3c5a0
callq 0x2170
movq -0x50(%rbp), %rdi
callq 0x2040
movq -0x68(%rbp), %rdi
callq 0x2040
movq $0x0, -0x88(%rbp)
movq -0x88(%rbp), %rax
cmpq -0x90(%rbp), %rax
jae 0xc598
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x88(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, -0x10c(%rbp)
movq -0xa0(%rbp), %rax
movl -0x10c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x110(%rbp)
movq -0xa0(%rbp), %rax
movl -0x10c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x114(%rbp)
movl -0x10c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xc4a5
movl -0x110(%rbp), %eax
addl -0x114(%rbp), %eax
subl $0x1, %eax
shll %eax
movl %eax, -0x134(%rbp)
jmp 0xc4b6
movl -0x110(%rbp), %eax
shll %eax
orl $0x1, %eax
movl %eax, -0x134(%rbp)
movl -0x134(%rbp), %eax
movl %eax, -0x10c(%rbp)
movl -0x10c(%rbp), %eax
movl %eax, %ecx
shlq $0x20, %rcx
movq -0x70(%rbp), %rax
movl -0x10c(%rbp), %edx
shrl %edx
movl %edx, %edx
shlq $0x6, %rdx
addq %rdx, %rax
movslq (%rax), %rax
orq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, (%rax)
movq -0xa0(%rbp), %rax
movq -0x108(%rbp), %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x110(%rbp)
movq -0xa0(%rbp), %rax
movq -0x108(%rbp), %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x114(%rbp)
movq -0x108(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xc557
movl -0x110(%rbp), %eax
shll %eax
movl %eax, -0x138(%rbp)
jmp 0xc571
movl -0x110(%rbp), %eax
addl -0x114(%rbp), %eax
subl $0x1, %eax
shll %eax
orl $0x1, %eax
movl %eax, -0x138(%rbp)
movl -0x138(%rbp), %ecx
movq -0x108(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0xc3ff
movq -0xa0(%rbp), %rdi
callq 0x2040
movl $0x0, -0x34(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0xc806
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x120(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jge 0xc7b7
movq -0x70(%rbp), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x128(%rbp)
leaq -0x80(%rbp), %rdi
movl -0x3c(%rbp), %ecx
addl $0x1, %ecx
movl $0xf, %esi
leaq 0x2ff10(%rip), %rdx     # 0x3c529
movb $0x0, %al
callq 0x2150
leaq -0x80(%rbp), %rdi
callq 0x5700
movq %rax, %rcx
movq -0x128(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x120(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x120(%rbp), %rcx
subl 0x10(%rcx), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x2280
movq %rax, %rcx
movq -0x128(%rbp), %rax
movq %rcx, 0x20(%rax)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x120(%rbp), %rcx
movl 0x14(%rcx), %ecx
movq -0x120(%rbp), %rdx
subl 0x10(%rdx), %ecx
cmpl %ecx, %eax
jge 0xc6cd
movq -0x30(%rbp), %rax
movq -0x120(%rbp), %rcx
movslq 0x18(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq -0x120(%rbp), %rcx
movl 0x10(%rcx), %ecx
addl -0x38(%rbp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x38(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xc66f
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x38(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x38(%rbp), %ecx
movq -0x128(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq -0x120(%rbp), %rcx
movslq 0x18(%rcx), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x5980
movl %eax, %ecx
movq -0x128(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x120(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x128(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movq -0x128(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movq -0x128(%rbp), %rsi
callq 0x5b90
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x98(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, %edx
movl -0x3c(%rbp), %ecx
shll %ecx
movq -0x128(%rbp), %rax
movl 0x10(%rax), %r8d
callq 0xc940
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rsi
movl -0x3c(%rbp), %edx
shll %edx
movq -0x98(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %ecx
movq -0x128(%rbp), %rax
movl 0x10(%rax), %r8d
callq 0xc940
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc7f6
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x98(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, %edx
movq -0x98(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl 0x8(%rax), %r8d
addl $0x1, %r8d
callq 0xc940
jmp 0xc7f8
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xc5b1
movq -0x98(%rbp), %rdi
callq 0x2040
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0xc884
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x38(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rdi
callq 0x2040
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x38(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rdi
callq 0x2040
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x38(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x38(%rax), %rdi
callq 0x2040
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xc819
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2040
movq -0x70(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x5c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
shlq $0x4, %rsi
callq 0x22b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x90(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdx
subq -0x90(%rbp), %rdx
shlq $0x4, %rdx
xorl %esi, %esi
callq 0x2190
movq -0x8(%rbp), %rdi
callq 0x6010
movq -0x8(%rbp), %rdi
callq 0x6140
movq -0x8(%rbp), %rdi
callq 0x6ed0
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopw %cs:(%rax,%rax)