// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/rcut.cpp
// Function: renew_mc_clus_t_adv(mc_clus_t*, unsigned int*, unsigned int)
void renew_mc_clus_t_adv(mc_clus_t *bc, uint32_t *a, uint32_t a_n)
{
	if(!bc) return;
	// fprintf(stderr, "[M::%s] a_n::%u\n", __func__, a_n);
	uint32_t k, i, *ba, bn, m, cocc, iin, /**bub_occ = 0,**/ bbn = 0, bid, bk, bl; 
	uint64_t *p; ma_utg_t *u = NULL; asg64_v *asn = bc->asn;
	kvec_t(double) sc_l; kvec_t(double) sc_r; kvec_t(double) sc_m; kvec_t(uint32_t) tmp;
	kv_init(sc_l); kv_init(sc_r); kv_init(sc_m); kv_init(tmp);
	
	bc->cc.ng.n = bc->cc.nn.n = 0;
	memset(bc->lock, 0, sizeof((*(bc->lock)))*bc->n);///bc->n: number of all nodes
	for (k = 0; k < a_n; k++) bc->lock[a[k]] = 1;///a_n: number of nodes within the cluster

	kv_resize(uint32_t, bc->cc.nn, a_n);
	for (i = bid = bk = 0; i < bc->bub->b_ug->u.n; i++) {
        u = &(bc->bub->b_ug->u.a[i]);
        if(u->n == 0) continue;
		// bub_occ += u->n;
		// fprintf(stderr, "[M::%s] i::%u, u->n::%u\n", __func__, i, (uint32_t)u->n);
        for (k = cocc = 0, iin = bc->cc.nn.n; k < u->n; k++, bid++) {
            get_bubbles(bc->bub, u->a[k]>>33, NULL, NULL, &ba, &bn, NULL);
			kv_pushp(uint64_t, bc->cc.ng, &p); bbn += bn;
			*p = bc->cc.nn.n;///a bubble
			for (m = 0; m < bn; m++) {
				if(!(bc->lock[ba[m]>>1])) continue;///if the node of bubble is not at this cluster
				kv_push(uint32_t, bc->cc.nn, (ba[m]>>1));
				bc->lock[ba[m]>>1] = 2;
            }
			if(asn) {
				for (; bk < asn->n && (asn->a[bk]>>32) < bid; bk++);
				for (; bk < asn->n && (asn->a[bk]>>32) == bid; bk++) {
					if(!(bc->lock[((uint32_t)asn->a[bk])])) continue;///if the node of bubble is not at this cluster
					kv_push(uint32_t, bc->cc.nn, ((uint32_t)asn->a[bk]));
					bc->lock[((uint32_t)asn->a[bk])] = 2;
				}
			}
			
			if(bc->cc.nn.n <= (*p)) {///no node in this bubble
				bc->cc.ng.n--;
				continue;
			}
			*p <<= 32; *p |= (bc->cc.nn.n-((*p)>>32)); cocc++;
        }
		//split the chain if there is multipe bubbles
		if(cocc > 0) {//cocc: # of bubbles in this chain
			for (k = bc->cc.ng.n - cocc; k < bc->cc.ng.n; k++) {
				kv_resize(double, sc_l, clus_n((*bc), k)); 
				kv_resize(double, sc_r, clus_n((*bc), k)); 
				kv_resize(double, sc_m, clus_n((*bc), k)); 
				kv_resize(uint32_t, tmp, clus_n((*bc), k)); 
				// prt_bub(clus_a((*bc), k), clus_n((*bc), k), "-0-"); 
				reorder_bub(bc->mg->e, clus_a((*bc), k), clus_n((*bc), k), bc->lock, 3, 2, 4, 5, 
				sc_l.a, sc_r.a, sc_m.a, tmp.a);
				// prt_bub(clus_a((*bc), k), clus_n((*bc), k), "-1-"); 
			}
			for (k = iin; k < bc->cc.nn.n; k++) bc->lock[bc->cc.nn.a[k]] = 1;//reset
			kv_pushp(uint64_t, bc->cc.ng, &p); *p = (uint64_t)-1; ///cluster
			kv_push(uint32_t, bc->cc.nn, ((uint32_t)-1)); ///split, node id
		}
    }

	if(asn) {
		for (bl = bk, bk = bk + 1; bk <= asn->n; bk++) {
			if(bk == asn->n || (asn->a[bk]>>32) != (asn->a[bl]>>32)) {
				cocc = 0; iin = bc->cc.nn.n;
				kv_pushp(uint64_t, bc->cc.ng, &p); bbn += bn;
            	*p = bc->cc.nn.n;///a bubble
				for (m = bl; m < bk; m++) {
					if(!(bc->lock[((uint32_t)asn->a[m])])) continue;///if the node of bubble is not at this cluster
                    kv_push(uint32_t, bc->cc.nn, ((uint32_t)asn->a[m]));
                    bc->lock[((uint32_t)asn->a[m])] = 2;
				}
				if(bc->cc.nn.n <= (*p)) {///no node in this bubble
					bc->cc.ng.n--; 
					bl = bk;
					continue;
				}
				*p <<= 32; *p |= (bc->cc.nn.n-((*p)>>32)); cocc++;
				if(cocc > 0) {//cocc: # of bubbles in this chain
					for (k = bc->cc.ng.n - cocc; k < bc->cc.ng.n; k++) {
						kv_resize(double, sc_l, clus_n((*bc), k)); 
						kv_resize(double, sc_r, clus_n((*bc), k)); 
						kv_resize(double, sc_m, clus_n((*bc), k)); 
						kv_resize(uint32_t, tmp, clus_n((*bc), k)); 
						// prt_bub(clus_a((*bc), k), clus_n((*bc), k), "-0-"); 
						reorder_bub(bc->mg->e, clus_a((*bc), k), clus_n((*bc), k), bc->lock, 3, 2, 4, 5, 
						sc_l.a, sc_r.a, sc_m.a, tmp.a);
						// prt_bub(clus_a((*bc), k), clus_n((*bc), k), "-1-"); 
					}
					for (k = iin; k < bc->cc.nn.n; k++) bc->lock[bc->cc.nn.a[k]] = 1;//reset
					kv_pushp(uint64_t, bc->cc.ng, &p); *p = (uint64_t)-1; ///cluster
					kv_push(uint32_t, bc->cc.nn, ((uint32_t)-1)); ///split, node id
				}

				bl = bk;
			}
		}
	}
	///need enable it later
	kv_resize(uint32_t, tmp, bc->cc.nn.n);
	kv_resize(uint64_t, bc->cc.ng, bc->cc.ng.n+bc->bub->ug->g->n_seq);
	layout_mc_clus_t(bc->mg->e, bc->cc.nn.a, bc->cc.nn.n, &(bc->sg), tmp.a, bc->cc.ng.a+bc->cc.ng.n, bc->bub->ug, 0.199999, 0.800001, 4);
	
	for (k = 0; k < a_n; k++) bc->lock[a[k]] = 0;
	kv_destroy(sc_l); kv_destroy(sc_r); kv_destroy(sc_m); kv_destroy(tmp);
	// fprintf(stderr, "[M::%s] a_n::%u, bc->cc.nn.n::%u, bc->cc.ng.n::%u, bbn::%u, bub_occ::%u, bc->bub->b_ug->u.n::%u\n", __func__, 
	// a_n, (uint32_t)bc->cc.nn.n, (uint32_t)bc->cc.ng.n, bbn, bub_occ, (uint32_t)bc->bub->b_ug->u.n);
}

// Assembly:
testq %rdi, %rdi
je 0x16642a
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x70(%rdi), %rax
movq %rax, (%rsp)
xorl %eax, %eax
movq %rax, (%rdi)
movq %rax, 0x18(%rdi)
movq 0x48(%rdi), %rdi
movl 0x54(%r14), %edx
xorl %esi, %esi
callq 0x20e0
movl %ebp, %r15d
testl %ebp, %ebp
je 0x16585f
xorl %eax, %eax
movq 0x48(%r14), %rcx
movl (%rbx,%rax,4), %edx
movb $0x1, (%rcx,%rdx)
incq %rax
cmpq %rax, %r15
jne 0x16584c
cmpq %r15, 0x8(%r14)
jae 0x1658b7
leaq -0x1(%r15), %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x8(%r14)
movq 0x10(%r14), %rdi
leaq 0x4(,%rcx,4), %rsi
callq 0x2370
movq %rax, 0x10(%r14)
movq %r15, 0x68(%rsp)
movl %ebp, 0x5c(%rsp)
movq %rbx, 0x70(%rsp)
movq 0x30(%r14), %rax
movq 0xc0(%rax), %rax
cmpq $0x0, (%rax)
je 0x165e78
xorl %ebx, %ebx
movl $0x2, %r12d
movq $0x0, 0x30(%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x10(%rsp)
xorl %r15d, %r15d
movl $0x0, 0x60(%rsp)
movq (%rsp), %r8
movq 0x10(%rax), %rax
leaq (%rbx,%rbx,4), %rcx
cmpl $0x0, 0x10(%rax,%rcx,8)
je 0x165e60
movq %rbx, 0x78(%rsp)
leaq (%rax,%rcx,8), %rcx
movq (%r14), %rax
movq %rax, 0x90(%rsp)
cmpl $0x0, 0x10(%rcx)
je 0x165b8e
xorl %r13d, %r13d
movl $0x0, 0x2c(%rsp)
movq %rcx, 0x80(%rsp)
movq 0x30(%r14), %rdi
movq 0x18(%rcx), %rax
movq (%rax,%r13,8), %rsi
shrq $0x21, %rsi
subq $0x8, %rsp
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0x90(%rsp), %r8
leaq 0x6c(%rsp), %r9
pushq $0x0
callq 0x13812e
addq $0x10, %rsp
movq 0x20(%r14), %rax
cmpq %rax, 0x18(%r14)
jne 0x1659d7
leaq (%rax,%rax), %rsi
testq %rax, %rax
cmoveq %r12, %rsi
movq %rsi, 0x20(%r14)
movq 0x28(%r14), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x28(%r14)
movq 0x28(%r14), %rdx
movq (%r14), %rax
movq 0x18(%r14), %rbp
leaq 0x1(%rbp), %rcx
movq %rcx, 0x18(%r14)
cmpl $0x0, 0x64(%rsp)
movq %rdx, 0x50(%rsp)
movq %rax, (%rdx,%rbp,8)
movq (%rsp), %r8
je 0x165a7b
xorl %ebx, %ebx
movq 0x48(%r14), %rax
movq 0x88(%rsp), %rcx
movl (%rcx,%rbx,4), %ecx
shrl %ecx
cmpb $0x0, (%rax,%rcx)
je 0x165a6f
movq 0x8(%r14), %rax
cmpq %rax, (%r14)
jne 0x165a44
leaq (%rax,%rax), %rsi
testq %rax, %rax
cmoveq %r12, %rsi
movq %rsi, 0x8(%r14)
movq 0x10(%r14), %rdi
shlq $0x2, %rsi
callq 0x2370
movq (%rsp), %r8
movq %rax, 0x10(%r14)
movq 0x88(%rsp), %rax
movl (%rax,%rbx,4), %ecx
shrl %ecx
movq (%r14), %rdx
movq 0x10(%r14), %rsi
leaq 0x1(%rdx), %rdi
movq %rdi, (%r14)
movl %ecx, (%rsi,%rdx,4)
movq 0x48(%r14), %rcx
movl (%rax,%rbx,4), %eax
shrl %eax
movb $0x2, (%rcx,%rax)
incq %rbx
movl 0x64(%rsp), %eax
cmpq %rax, %rbx
jb 0x165a00
testq %r8, %r8
je 0x165b39
movq (%r8), %rax
movl %r15d, %edx
movl 0x60(%rsp), %ebx
cmpq %rdx, %rax
jbe 0x165aa8
movq 0x10(%r8), %rcx
cmpl %ebx, 0x4(%rcx,%rdx,8)
jae 0x165aa8
incl %r15d
movq %r15, %rdx
cmpq %r15, %rax
ja 0x165a97
movl %r15d, %r12d
cmpq %r12, (%r8)
jbe 0x165b39
movq 0x10(%r8), %rax
movq (%rax,%r12,8), %rax
movq %rax, %rcx
shrq $0x20, %rcx
cmpl %ebx, %ecx
jne 0x165b39
movq 0x48(%r14), %rcx
movl %eax, %eax
cmpb $0x0, (%rcx,%rax)
je 0x165b2a
movq 0x8(%r14), %rax
cmpq %rax, (%r14)
jne 0x165b05
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r14)
movq 0x10(%r14), %rdi
shlq $0x2, %rsi
callq 0x2370
movq (%rsp), %r8
movq %rax, 0x10(%r14)
movq 0x10(%r8), %rax
movl (%rax,%r12,8), %ecx
movq (%r14), %rdx
movq 0x10(%r14), %rsi
leaq 0x1(%rdx), %rdi
movq %rdi, (%r14)
movl %ecx, (%rsi,%rdx,4)
movq 0x48(%r14), %rcx
movl (%rax,%r12,8), %eax
movb $0x2, (%rcx,%rax)
incl %r15d
movq %r15, %r12
cmpq %r15, (%r8)
ja 0x165ab4
movq 0x50(%rsp), %rsi
movq (%rsi,%rbp,8), %rax
cmpq %rax, (%r14)
jbe 0x165b67
movq %rax, %rcx
shlq $0x20, %rcx
movq %rcx, (%rsi,%rbp,8)
movq (%r14), %rdx
movl %eax, %eax
subq %rax, %rdx
orq %rcx, %rdx
movq %rdx, (%rsi,%rbp,8)
incl 0x2c(%rsp)
jmp 0x165b6b
decq 0x18(%r14)
movl $0x2, %r12d
movq 0x80(%rsp), %rcx
incq %r13
incl 0x60(%rsp)
movl 0x10(%rcx), %eax
cmpq %rax, %r13
jb 0x16597d
jmp 0x165b96
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
testl %eax, %eax
je 0x165e57
movl %eax, %ecx
movq 0x18(%r14), %rax
movl %eax, %r13d
subl %ecx, %r13d
cmpq %r13, %rax
jbe 0x165da3
movl %r13d, %ebx
incl %ebx
movq 0x28(%r14), %rax
movl (%rax,%r13,8), %eax
cmpq %rax, 0x48(%rsp)
jae 0x165c1e
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x8(,%rcx,8), %rsi
incq %rcx
movq %rcx, 0x48(%rsp)
movq 0x10(%rsp), %rdi
callq 0x2370
movq %rax, 0x10(%rsp)
movq 0x28(%r14), %rax
movl (%rax,%r13,8), %eax
cmpq %rax, 0x40(%rsp)
jae 0x165c80
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x8(,%rcx,8), %rsi
incq %rcx
movq %rcx, 0x40(%rsp)
movq 0x18(%rsp), %rdi
callq 0x2370
movq %rax, 0x18(%rsp)
movq 0x28(%r14), %rax
movl (%rax,%r13,8), %eax
cmpq %rax, 0x38(%rsp)
jae 0x165ce2
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x8(,%rcx,8), %rsi
incq %rcx
movq %rcx, 0x38(%rsp)
movq 0x20(%rsp), %rdi
callq 0x2370
movq %rax, 0x20(%rsp)
movq 0x28(%r14), %rax
movl (%rax,%r13,8), %eax
cmpq %rax, 0x30(%rsp)
jae 0x165d41
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x4(,%rcx,4), %rsi
incq %rcx
movq %rcx, 0x30(%rsp)
movq 0x8(%rsp), %rdi
callq 0x2370
jmp 0x165d46
movq 0x8(%rsp), %rax
movq 0x28(%r14), %rdx
movq 0x40(%r14), %rcx
movq 0x28(%rcx), %rdi
movq (%rdx,%r13,8), %rdx
movq %rdx, %rsi
shrq $0x1e, %rsi
andq $-0x4, %rsi
addq 0x10(%r14), %rsi
movq 0x48(%r14), %rcx
movl $0x3, %r8d
movl $0x2, %r9d
movq %rax, 0x8(%rsp)
pushq %rax
pushq 0x28(%rsp)
pushq 0x28(%rsp)
pushq 0x28(%rsp)
pushq $0x5
pushq $0x4
callq 0x164e43
addq $0x30, %rsp
movl %ebx, %r13d
incl %ebx
cmpq %r13, 0x18(%r14)
ja 0x165bbc
movq 0x90(%rsp), %rsi
movl %esi, %eax
cmpq %rax, (%r14)
jbe 0x165dcc
incl %esi
movq 0x10(%r14), %rcx
movq 0x48(%r14), %rdx
movl (%rcx,%rax,4), %eax
movb $0x1, (%rdx,%rax)
movl %esi, %eax
incl %esi
cmpq %rax, (%r14)
ja 0x165db4
movq 0x20(%r14), %rax
cmpq %rax, 0x18(%r14)
movq 0x78(%rsp), %rbx
jne 0x165dfb
leaq (%rax,%rax), %rsi
testq %rax, %rax
cmoveq %r12, %rsi
movq %rsi, 0x20(%r14)
movq 0x28(%r14), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x28(%r14)
movq 0x18(%r14), %rax
movq 0x28(%r14), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x18(%r14)
movq $-0x1, (%rcx,%rax,8)
movq 0x8(%r14), %rax
cmpq %rax, (%r14)
jne 0x165e3c
leaq (%rax,%rax), %rsi
testq %rax, %rax
cmoveq %r12, %rsi
movq %rsi, 0x8(%r14)
movq 0x10(%r14), %rdi
shlq $0x2, %rsi
callq 0x2370
movq %rax, 0x10(%r14)
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%r14)
movl $0xffffffff, (%rcx,%rax,4) # imm = 0xFFFFFFFF
movq (%rsp), %r8
jmp 0x165e60
movq (%rsp), %r8
movq 0x78(%rsp), %rbx
incl %ebx
movq 0x30(%r14), %rax
movq 0xc0(%rax), %rax
cmpq %rbx, (%rax)
ja 0x165939
jmp 0x165ec7
xorl %r15d, %r15d
movq $0x0, 0x10(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x30(%rsp)
movq (%rsp), %r8
testq %r8, %r8
je 0x1662c0
leal 0x1(%r15), %r12d
movq (%r8), %rax
cmpq %r12, %rax
jb 0x1662c0
cmpq %r12, %rax
je 0x165efe
movq 0x10(%r8), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rcx
xorq (%rax,%r12,8), %rcx
shrq $0x20, %rcx
je 0x1662b8
movq (%r14), %rbp
movq 0x20(%r14), %rax
cmpq %rax, 0x18(%r14)
jne 0x165f34
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x20(%r14)
movq 0x28(%r14), %rdi
shlq $0x3, %rsi
callq 0x2370
movq (%rsp), %r8
movq %rax, 0x28(%r14)
movq 0x28(%r14), %rbx
movq (%r14), %rax
movq 0x18(%r14), %r13
leaq 0x1(%r13), %rcx
movq %rcx, 0x18(%r14)
movq %rax, (%rbx,%r13,8)
movq %r12, 0x50(%rsp)
cmpl %r12d, %r15d
jae 0x165fce
movl 0x50(%rsp), %r12d
movl %r15d, %r15d
movq 0x48(%r14), %rax
movq 0x10(%r8), %rcx
movl (%rcx,%r15,8), %ecx
cmpb $0x0, (%rax,%rcx)
je 0x165fc6
movq 0x8(%r14), %rax
cmpq %rax, (%r14)
jne 0x165fa1
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r14)
movq 0x10(%r14), %rdi
shlq $0x2, %rsi
callq 0x2370
movq (%rsp), %r8
movq %rax, 0x10(%r14)
movq 0x10(%r8), %rax
movl (%rax,%r15,8), %ecx
movq (%r14), %rdx
movq 0x10(%r14), %rsi
leaq 0x1(%rdx), %rdi
movq %rdi, (%r14)
movl %ecx, (%rsi,%rdx,4)
movq 0x48(%r14), %rcx
movl (%rax,%r15,8), %eax
movb $0x2, (%rcx,%rax)
incq %r15
cmpq %r15, %r12
jne 0x165f5d
movq (%rbx,%r13,8), %rax
cmpq %rax, (%r14)
jbe 0x1662ac
movq %rax, %rcx
shlq $0x20, %rcx
movq %rcx, (%rbx,%r13,8)
movq (%r14), %rdx
movl %eax, %eax
subq %rax, %rdx
orq %rcx, %rdx
movq %rdx, (%rbx,%r13,8)
movq 0x18(%r14), %r12
leal -0x1(%r12), %r13d
cmpq %r13, %r12
movq 0x8(%rsp), %rbx
jbe 0x1661ed
movq 0x28(%r14), %rax
movl (%rax,%r13,8), %eax
cmpq %rax, 0x48(%rsp)
jae 0x16606e
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x8(,%rcx,8), %rsi
incq %rcx
movq %rcx, 0x48(%rsp)
movq 0x10(%rsp), %rdi
callq 0x2370
movq %rax, 0x10(%rsp)
movq 0x28(%r14), %rax
movl (%rax,%r13,8), %eax
cmpq %rax, 0x40(%rsp)
jae 0x1660d0
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x8(,%rcx,8), %rsi
incq %rcx
movq %rcx, 0x40(%rsp)
movq 0x18(%rsp), %rdi
callq 0x2370
movq %rax, 0x18(%rsp)
movq 0x28(%r14), %rax
movl (%rax,%r13,8), %eax
cmpq %rax, 0x38(%rsp)
jae 0x166132
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x8(,%rcx,8), %rsi
incq %rcx
movq %rcx, 0x38(%rsp)
movq 0x20(%rsp), %rdi
callq 0x2370
movq %rax, 0x20(%rsp)
movq 0x28(%r14), %rax
movl (%rax,%r13,8), %eax
cmpq %rax, 0x30(%rsp)
jae 0x166190
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x4(,%rcx,4), %rsi
incq %rcx
movq %rcx, 0x30(%rsp)
movq %rbx, %rdi
callq 0x2370
movq %rax, %rbx
movq 0x28(%r14), %rax
movq 0x40(%r14), %rcx
movq 0x28(%rcx), %rdi
movq (%rax,%r13,8), %rdx
movq %rdx, %rsi
shrq $0x1e, %rsi
andq $-0x4, %rsi
addq 0x10(%r14), %rsi
movq 0x48(%r14), %rcx
movl $0x3, %r8d
movl $0x2, %r9d
pushq %rbx
pushq 0x28(%rsp)
pushq 0x28(%rsp)
pushq 0x28(%rsp)
pushq $0x5
pushq $0x4
callq 0x164e43
addq $0x30, %rsp
movl %r12d, %r13d
incl %r12d
cmpq %r13, 0x18(%r14)
movq (%rsp), %r8
ja 0x16600c
movl %ebp, %eax
cmpq %rax, (%r14)
jbe 0x16620e
incl %ebp
movq 0x10(%r14), %rcx
movq 0x48(%r14), %rdx
movl (%rcx,%rax,4), %eax
movb $0x1, (%rdx,%rax)
movl %ebp, %eax
incl %ebp
cmpq %rax, (%r14)
ja 0x1661f6
movq 0x20(%r14), %rax
cmpq %rax, 0x18(%r14)
movq 0x50(%rsp), %r12
jne 0x166246
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x20(%r14)
movq 0x28(%r14), %rdi
shlq $0x3, %rsi
callq 0x2370
movq (%rsp), %r8
movq %rax, 0x28(%r14)
movq %rbx, 0x8(%rsp)
movq 0x18(%r14), %rax
movq 0x28(%r14), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x18(%r14)
movq $-0x1, (%rcx,%rax,8)
movq 0x8(%r14), %rax
cmpq %rax, (%r14)
jne 0x166295
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r14)
movq 0x10(%r14), %rdi
shlq $0x2, %rsi
callq 0x2370
movq (%rsp), %r8
movq %rax, 0x10(%r14)
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%r14)
movl $0xffffffff, (%rcx,%rax,4) # imm = 0xFFFFFFFF
jmp 0x1662b5
decq 0x18(%r14)
movq 0x50(%rsp), %r12
movl %r12d, %r15d
incl %r12d
jmp 0x165ed4
movq (%r14), %rax
cmpq %rax, 0x30(%rsp)
jae 0x166315
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x4(,%rcx,4), %rsi
movq 0x8(%rsp), %rdi
callq 0x2370
movq %rax, 0x8(%rsp)
movq 0x70(%rsp), %rbx
movl 0x5c(%rsp), %ebp
movq 0x68(%rsp), %r15
movq 0x30(%r14), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq 0x18(%r14), %rax
cmpq %rax, 0x20(%r14)
jae 0x166392
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x20(%r14)
movq 0x28(%r14), %rdi
leaq 0x8(,%rcx,8), %rsi
callq 0x2370
movq %rax, 0x28(%r14)
movq 0x40(%r14), %rax
movq 0x28(%rax), %rdi
movq 0x10(%r14), %rsi
movl (%r14), %edx
leaq 0x78(%r14), %rcx
movq 0x18(%r14), %r9
shlq $0x3, %r9
addq 0x28(%r14), %r9
movq 0x30(%r14), %rax
movsd 0xca69b(%rip), %xmm0    # 0x230a58
movsd 0xca69b(%rip), %xmm1    # 0x230a60
movq 0x8(%rsp), %r8
pushq $0x4
pushq 0x10(%rax)
callq 0x1778d7
addq $0x10, %rsp
testl %ebp, %ebp
je 0x1663f1
xorl %eax, %eax
movq 0x48(%r14), %rcx
movl (%rbx,%rax,4), %edx
movb $0x0, (%rcx,%rdx)
incq %rax
cmpq %rax, %r15
jne 0x1663de
movq 0x10(%rsp), %rdi
callq 0x2220
movq 0x18(%rsp), %rdi
callq 0x2220
movq 0x20(%rsp), %rdi
callq 0x2220
movq 0x8(%rsp), %rdi
callq 0x2220
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq