// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Process_Read.cpp
// Function: append_ul_t(all_ul_t*, unsigned long*, char*, long, char*, long, ul_ov_t*, long, float, ug_opt_t const*, unsigned int)
void append_ul_t(all_ul_t *x, uint64_t *rid, char* id, int64_t id_l, char* str, int64_t str_l, ul_ov_t *o, int64_t on, float p_chain_rate, const ug_opt_t *uopt, uint32_t save_bases) {
	int64_t i, mine, maxs, ovlp, st, et, bl = 0, pc = 0, en = 0;
	uint32_t o_l, o_r;
	ul_vec_t *p = NULL;
	nid_t *np = NULL;
	ul_ov_t *z = NULL;
	uc_block_t *b = NULL, tt;

	if(id) {
		kv_pushp(nid_t, x->nid, &np);
		np->n = id_l; MALLOC(np->a, np->n+1); memcpy(np->a, id, id_l); np->a[id_l] = '\0';
	}

	if(str||str_l) {
		if(rid == NULL) {
			kv_pushp(ul_vec_t, *x, &p);
			memset(p, 0, sizeof(*p));
		} else {
			if((*rid) >= x->m) kv_resize(ul_vec_t, *x, (*rid) + 1);
			if((*rid) >= x->n) {
				memset(x->a+x->n, 0, sizeof(*p)*((*rid) + 1 - x->n));
				x->n = (*rid) + 1;
			}
			p = &(x->a[(*rid)]);
		}
		// if((*rid) == 23) fprintf(stderr, "#rid->%lu, on->%ld\n", *rid, on);

		p->bb.n = p->N_site.n = p->r_base.n = 0; p->dd = 0;
		p->rlen = str_l; 
		// fprintf(stderr, "str_l->%ld, str->%u\n", str_l, str?1:0);
		
		if(o == NULL || on == 0) on = 0; en = 0;
		for (i = on-1, st = et = str_l; i >= 0; i--) {
			z = &(o[i]);
			if(z->el) {
				if((z->tn&((uint32_t)(0x80000000)))) {
					mine = MIN(et, ((int64_t)z->qe)); maxs = MAX(st, ((int64_t)z->qs));
					ovlp = mine - maxs; 
					if(ovlp < 0) bl -= ovlp;
					if(save_bases && ovlp < 0) {///push original bases
						kv_pushp(uc_block_t, p->bb, &b);
						b->hid = 0/**x->mm**/; b->rev = 0; b->base = 1; b->pchain = 0; b->el = 0;
						b->qe = maxs; b->qs = b->qe + ovlp; //bl += (b->qe-b->qs);
						o_l = (b->qs >= UL_FLANK?UL_FLANK:b->qs);
						o_r = ((str_l-b->qe)>=UL_FLANK?UL_FLANK:(str_l-b->qe));
						b->pidx = b->pdis = b->aidx = (uint32_t)-1; 
						b->hid |= (o_l<<15); b->hid |= o_r;
						b->qs -= o_l; b->qe += o_r;
						b->ts = p->r_base.n; b->te = b->ts + B4L(b->qe-b->qs);
						kv_resize(uint8_t, p->r_base, b->te); p->r_base.n = b->te;
						// fprintf(stderr, "\n+rid->%lu, str_l->%ld, b->qs->%u, b->qe->%u\n", *rid, str_l, b->qs, b->qe);
						ha_encode_base(p->r_base.a+b->ts, str+b->qs, b->qe-b->qs, &(p->N_site), b->qs);
					} 

					st = MIN(st, z->qs);
				}

				///push ovlp bases
				kv_pushp(uc_block_t, p->bb, &b);
				b->hid = (z->tn<<1)>>1; b->rev = z->rev; b->base = 0; b->el = z->el;
				b->pchain = ((z->tn&((uint32_t)(0x80000000)))?1:0);
				b->qs = z->qs; b->qe = z->qe;
				b->ts = z->ts; b->te = z->te;
				if(b->pchain) pc++;				
				b->pidx = i; b->pdis = b->aidx = (uint32_t)-1; 
				en++; z->qn = p->bb.n - 1;
			}
		}

		if(st > 0) bl += st;
		if(save_bases && st > 0) {///push original bases
			kv_pushp(uc_block_t, p->bb, &b);
			b->hid = 0/**x->mm**/; b->rev = 0; b->base = 1; b->pchain = 0; b->el = 0;
			b->qe = st; b->qs = 0; //bl += (b->qe-b->qs);
			o_l = (b->qs >= UL_FLANK?UL_FLANK:b->qs);
			o_r = ((str_l-b->qe)>=UL_FLANK?UL_FLANK:(str_l-b->qe));
			b->pidx = b->pdis = b->aidx = (uint32_t)-1; 
			b->hid |= (o_l<<15); b->hid |= o_r;
			b->qs -= o_l; b->qe += o_r;
			b->ts = p->r_base.n; b->te = b->ts + B4L(b->qe-b->qs);
			kv_resize(uint8_t, p->r_base, b->te); p->r_base.n = b->te;
			// if(!str) fprintf(stderr, "-rid->%lu, st->%ld, str_l->%ld\n", *rid, st, str_l);
			ha_encode_base(p->r_base.a+b->ts, str+b->qs, b->qe-b->qs, &(p->N_site), b->qs);	
			// push_subblock_original_bases(str, x, p, end, str_l, 321);//for debug
		}

		if(pc > 0) p->dd = 3;
		if((pc == en) && ((str_l-bl) > (str_l*p_chain_rate))) p->dd = 2;
		if((pc == en) && (bl == 0)) p->dd = 1;
		// debug_append_ul_t(o, on, p);
		// char *sst = NULL; CALLOC(sst, str_l);//for debug
		// retrieve_ul_t(NULL, sst, x, rid?*rid:x->n-1, 0, 0, -1);
		// if(memcmp(sst, str, str_l)) {
		// 	fprintf(stderr, "ap-Wrong read, id: %ld, [%d, %ld)\n", (int64_t)(rid?*rid:x->n-1), 0, str_l);
		// 	for (i = 0; i < str_l; i++) {
		// 		if(sst[i] != str[i]) fprintf(stderr, "[%ld] input:%c, decompress:%c\n", i, str[i], sst[i]);
		// 	}
		// }
		// free(sst);
		ovlp = p->bb.n>>1;
		for (i = 0; i < ovlp; i++) {
			tt = p->bb.a[i]; 
			p->bb.a[i] = p->bb.a[p->bb.n-i-1];
			p->bb.a[p->bb.n-i-1] = tt;
			if(p->bb.a[i].pidx!=(uint32_t)-1) {
				o[p->bb.a[i].pidx].qn = p->bb.n-o[p->bb.a[i].pidx].qn-1;
				p->bb.a[i].pidx = (uint32_t)-1;
			}
			if(p->bb.a[p->bb.n-i-1].pidx!=(uint32_t)-1) {
				o[p->bb.a[p->bb.n-i-1].pidx].qn = p->bb.n-o[p->bb.a[p->bb.n-i-1].pidx].qn-1;
				p->bb.a[p->bb.n-i-1].pidx = (uint32_t)-1;
			}
		}
		if(((uint32_t)p->bb.n)&1) {
			o[p->bb.a[i].pidx].qn = p->bb.n-o[p->bb.a[i].pidx].qn-1;
			p->bb.a[i].pidx = (uint32_t)-1;
		}
		
		determine_chain_distance(o, on, p, uopt->sources, uopt->max_hang, uopt->min_ovlp, *rid);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movss %xmm0, 0x34(%rsp)
movq %r9, 0x10(%rsp)
movq %r8, 0x20(%rsp)
movq %rsi, %r12
movq %rdi, %rbp
testq %rdx, %rdx
je 0x35e9f
movq %rcx, %rbx
movq %rdx, %r14
movq 0x8(%rbp), %rax
cmpq %rax, (%rbp)
jne 0x35e62
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %esi
cmovneq %rcx, %rsi
movq %rsi, 0x8(%rbp)
movq 0x10(%rbp), %rdi
shlq $0x4, %rsi
callq 0x2370
movq %rax, 0x10(%rbp)
movq (%rbp), %r15
movq 0x10(%rbp), %r13
leaq 0x1(%r15), %rax
movq %rax, (%rbp)
shlq $0x4, %r15
movl %ebx, 0x8(%r13,%r15)
leal 0x1(%rbx), %edi
callq 0x2280
movq %rax, (%r13,%r15)
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2160
movq (%r13,%r15), %rax
movb $0x0, (%rax,%rbx)
movq 0x20(%rsp), %rax
orq 0x10(%rsp), %rax
je 0x36683
movq 0xc8(%rsp), %r14
movq 0xc0(%rsp), %rbx
testq %r12, %r12
je 0x35f67
movq (%r12), %rax
movq 0x58(%rbp), %rcx
cmpq %rcx, %rax
setb %dl
leaq 0x1(%rax), %rsi
cmpq %rsi, %rcx
setae %cl
orb %dl, %cl
jne 0x35f2d
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
incq %rcx
movq %rcx, 0x58(%rbp)
movq 0x48(%rbp), %rdi
imulq $0x58, %rcx, %rsi
callq 0x2370
movq %rax, 0x48(%rbp)
movq (%r12), %rax
movq 0x50(%rbp), %rcx
subq %rcx, %rax
jb 0x35f5c
imulq $0x58, %rcx, %rdi
addq 0x48(%rbp), %rdi
imulq $0x58, %rax, %rdx
addq $0x58, %rdx
xorl %esi, %esi
callq 0x20e0
movq (%r12), %rax
incq %rax
movq %rax, 0x50(%rbp)
imulq $0x58, (%r12), %r12
addq 0x48(%rbp), %r12
jmp 0x35fd2
movq 0x58(%rbp), %rax
cmpq %rax, 0x50(%rbp)
jne 0x35f96
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmovneq %rcx, %rax
movq %rax, 0x58(%rbp)
movq 0x48(%rbp), %rdi
imulq $0x58, %rax, %rsi
callq 0x2370
movq %rax, 0x48(%rbp)
movq 0x48(%rbp), %rax
movq 0x50(%rbp), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x50(%rbp)
imulq $0x58, %rcx, %rcx
leaq (%rax,%rcx), %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rax,%rcx)
movups %xmm0, 0x30(%rax,%rcx)
movups %xmm0, 0x20(%rax,%rcx)
movups %xmm0, 0x10(%rax,%rcx)
movups %xmm0, (%rax,%rcx)
movq $0x0, 0x50(%rax,%rcx)
xorl %r13d, %r13d
movq %r13, (%r12)
leaq 0x38(%r12), %rax
movq %rax, 0x40(%rsp)
movq %r13, 0x40(%r12)
movq %r13, 0x20(%r12)
movb $0x0, 0x50(%r12)
movq 0x10(%rsp), %rax
movl %eax, 0x18(%r12)
testq %rbx, %rbx
cmoveq %rbx, %r14
movq %rax, %r15
movl $0x0, %r8d
movl $0x0, %r9d
movq %r14, 0x38(%rsp)
testq %r14, %r14
jle 0x3634d
movq 0x38(%rsp), %rbp
leaq (,%rbp,8), %rax
addq %rbp, %rax
leaq (%rax,%rax,2), %rax
addq %rbp, %rax
movq 0xc0(%rsp), %rcx
leaq (%rcx,%rax), %r14
addq $-0x4, %r14
xorl %r9d, %r9d
xorl %r8d, %r8d
xorl %r13d, %r13d
movq 0x10(%rsp), %r15
testb $0x40, 0x3(%r14)
je 0x36338
cmpl $0x0, -0xc(%r14)
jns 0x36239
movq %r9, 0x58(%rsp)
movq %r13, 0x28(%rsp)
movl -0x10(%r14), %ebx
movq 0x10(%rsp), %rax
cmpq %rax, %rbx
cmovgeq %rax, %rbx
movl -0x14(%r14), %r13d
cmpq %r13, %r15
cmovgq %r15, %r13
movq %rbx, %rcx
subq %r13, %rcx
cmpl $0x0, 0xd8(%rsp)
je 0x36217
testq %rcx, %rcx
jns 0x36217
movq %rcx, 0x48(%rsp)
movq %r15, 0x50(%rsp)
movq %r8, 0x18(%rsp)
movq 0x28(%r12), %rax
cmpq %rax, 0x20(%r12)
jne 0x360f5
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq %rcx, 0x28(%r12)
movq 0x30(%r12), %rdi
shlq $0x2, %rcx
leaq (%rcx,%rcx,8), %rsi
callq 0x2370
movq %rax, 0x30(%r12)
movq 0x20(%r12), %rax
movq 0x30(%r12), %rdi
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%r12)
leaq (%rax,%rax,8), %r15
movb $0x40, 0x20(%rdi,%r15,4)
movl $0x200, %esi            # imm = 0x200
cmpl %esi, %ebx
movl $0x200, %eax            # imm = 0x200
cmovbl %ebx, %eax
movl %r13d, %ecx
movq 0x10(%rsp), %rdx
subq %rcx, %rdx
cmpq $0x200, %rdx            # imm = 0x200
cmovgel %esi, %edx
movl $0xffffffff, 0x1c(%rdi,%r15,4) # imm = 0xFFFFFFFF
movq $-0x1, 0x14(%rdi,%r15,4)
subl %eax, %ebx
shll $0xf, %eax
orl %edx, %eax
movl %eax, (%rdi,%r15,4)
movl %ebx, 0x4(%rdi,%r15,4)
addl %r13d, %edx
movl %edx, 0x8(%rdi,%r15,4)
movl (%r12), %ecx
movl %ecx, 0xc(%rdi,%r15,4)
subl %ebx, %edx
movl %edx, %eax
shrl $0x2, %eax
andl $0x3, %edx
cmpl $0x1, %edx
sbbl $-0x1, %eax
addl %ecx, %eax
movl %eax, 0x10(%rdi,%r15,4)
cmpq %rax, 0x8(%r12)
jae 0x361d8
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, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%r12)
movq %rdi, %rbx
movq 0x10(%r12), %rdi
callq 0x2370
movq %rbx, %rdi
movq %rax, 0x10(%r12)
leaq (%rdi,%r15,4), %rax
movl 0x10(%rax), %ecx
movq %rcx, (%r12)
movl 0xc(%rax), %edi
addq 0x10(%r12), %rdi
movl 0x4(%rax), %r8d
movl 0x8(%rax), %edx
movq 0x20(%rsp), %rax
leaq (%rax,%r8), %rsi
subl %r8d, %edx
movq 0x40(%rsp), %rcx
callq 0x348a1
movq 0x18(%rsp), %r8
movq 0x50(%rsp), %r15
movq 0x48(%rsp), %rcx
movq %rcx, %rax
sarq $0x3f, %rax
andq %rcx, %rax
movq 0x28(%rsp), %r13
subq %rax, %r13
movl -0x14(%r14), %eax
cmpq %rax, %r15
cmovgeq %rax, %r15
movq 0x58(%rsp), %r9
movq 0x28(%r12), %rax
cmpq %rax, 0x20(%r12)
jne 0x36292
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq %rcx, 0x28(%r12)
movq 0x30(%r12), %rdi
shlq $0x2, %rcx
leaq (%rcx,%rcx,8), %rsi
movq %r13, 0x28(%rsp)
movq %r15, %r13
movq %r8, %r15
movq %r12, %rbx
movq %r9, %r12
callq 0x2370
movq %r12, %r9
movq %rbx, %r12
movq %r15, %r8
movq %r13, %r15
movq 0x28(%rsp), %r13
movq %rax, 0x30(%rbx)
movq 0x20(%r12), %rcx
movq 0x30(%r12), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%r12)
leaq (%rcx,%rcx,8), %rcx
movl -0xc(%r14), %edx
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl %esi, %edx
movl %edx, (%rax,%rcx,4)
movl (%r14), %edx
movb 0x20(%rax,%rcx,4), %sil
shrl $0x1a, %edx
andb $0x20, %dl
andb $-0x61, %sil
orb %dl, %sil
movb %sil, 0x20(%rax,%rcx,4)
movl (%r14), %edi
shrl $0x17, %edi
andb $-0x80, %dil
andb $0x3f, %sil
orb %dil, %sil
movb %sil, 0x20(%rax,%rcx,4)
movl -0xc(%r14), %esi
shrl $0x1f, %esi
addl %esi, %edx
orb %dil, %dl
movb %dl, 0x20(%rax,%rcx,4)
movl -0x14(%r14), %edx
movl %edx, 0x4(%rax,%rcx,4)
movl -0x10(%r14), %edx
movl %edx, 0x8(%rax,%rcx,4)
movl -0x8(%r14), %edx
movl %edx, 0xc(%rax,%rcx,4)
movl -0x4(%r14), %edx
movl %edx, 0x10(%rax,%rcx,4)
addq %rsi, %r8
leal -0x1(%rbp), %edx
movl %edx, 0x14(%rax,%rcx,4)
movq $-0x1, 0x18(%rax,%rcx,4)
incq %r9
movl 0x20(%r12), %eax
decl %eax
movl %eax, -0x18(%r14)
decq %rbp
leaq 0x1(%rbp), %rax
addq $-0x1c, %r14
cmpq $0x1, %rax
jg 0x36056
movq %r9, %rbp
xorl %ebx, %ebx
testq %r15, %r15
cmovgq %r15, %rbx
cmpl $0x0, 0xd8(%rsp)
je 0x364a9
testq %r15, %r15
jle 0x364a9
movq %r8, 0x18(%rsp)
movq 0x28(%r12), %rax
cmpq %rax, 0x20(%r12)
jne 0x363ad
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmovneq %rcx, %rax
movq %rax, 0x28(%r12)
movq 0x30(%r12), %rdi
shlq $0x2, %rax
leaq (%rax,%rax,8), %rsi
callq 0x2370
movq %rax, 0x30(%r12)
movq 0x20(%r12), %rax
movq 0x30(%r12), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x20(%r12)
leaq (%rax,%rax,8), %rax
leaq (%rcx,%rax,4), %r14
movq $0x0, (%r14)
movb $0x40, 0x20(%r14)
movl %r15d, %eax
movq 0x10(%rsp), %rcx
subq %rax, %rcx
cmpq $0x200, %rcx            # imm = 0x200
movl $0x200, %edx            # imm = 0x200
cmovll %ecx, %edx
movl $0xffffffff, 0x1c(%r14) # imm = 0xFFFFFFFF
movq $-0x1, 0x14(%r14)
movl %edx, (%r14)
addl %r15d, %edx
movl %edx, 0x8(%r14)
movl (%r12), %ecx
movl %ecx, 0xc(%r14)
movl %edx, %eax
shrl $0x2, %eax
andl $0x3, %edx
cmpl $0x1, %edx
sbbl $-0x1, %eax
addl %ecx, %eax
movl %eax, 0x10(%r14)
cmpq %rax, 0x8(%r12)
jae 0x36476
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, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%r12)
movq 0x10(%r12), %rdi
callq 0x2370
movq %rax, 0x10(%r12)
movl 0x10(%r14), %eax
movq %rax, (%r12)
movl 0xc(%r14), %edi
addq 0x10(%r12), %rdi
movl 0x4(%r14), %r8d
movl 0x8(%r14), %edx
movq 0x20(%rsp), %rsi
addq %r8, %rsi
subl %r8d, %edx
movq 0x40(%rsp), %rcx
callq 0x348a1
movq 0x18(%rsp), %r8
testq %r8, %r8
movq 0xc0(%rsp), %rdi
movq 0x38(%rsp), %rsi
jle 0x364c1
movb $0x3, 0x50(%r12)
addq %rbx, %r13
cmpq %rbp, %r8
jne 0x364ef
movq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
subq %r13, %rax
cvtsi2ss %rax, %xmm1
mulss 0x34(%rsp), %xmm0
ucomiss %xmm0, %xmm1
jbe 0x364ef
movb $0x2, 0x50(%r12)
cmpq %rbp, %r8
jne 0x364ff
testq %r13, %r13
jne 0x364ff
movb $0x1, 0x50(%r12)
movq 0x20(%r12), %rcx
cmpq $0x2, %rcx
jae 0x36511
xorl %eax, %eax
jmp 0x3662d
shrq %rcx
movq $-0x10, %rdx
xorl %r14d, %r14d
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %eax, %eax
movq 0x30(%r12), %r8
movl 0x20(%r8,%r14), %r9d
movl %r9d, 0x80(%rsp)
movups (%r8,%r14), %xmm0
movups 0x10(%r8,%r14), %xmm1
movaps %xmm1, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movq 0x20(%r12), %r9
leaq (%r9,%r9,8), %r9
leaq (%r8,%r9,4), %r9
movups -0x14(%rdx,%r9), %xmm0
movups -0x4(%rdx,%r9), %xmm1
movups %xmm0, (%r8,%r14)
movups %xmm1, 0x10(%r8,%r14)
movl 0xc(%rdx,%r9), %r9d
movl %r9d, 0x20(%r8,%r14)
movq 0x20(%r12), %r8
leaq (%r8,%r8,8), %r8
shlq $0x2, %r8
addq 0x30(%r12), %r8
movl 0x80(%rsp), %r9d
movl %r9d, 0xc(%rdx,%r8)
movaps 0x60(%rsp), %xmm0
movaps 0x70(%rsp), %xmm1
movups %xmm1, -0x4(%rdx,%r8)
movups %xmm0, -0x14(%rdx,%r8)
movq 0x30(%r12), %r8
movl 0x14(%r8,%r14), %r9d
cmpq %rbx, %r9
je 0x365e2
leaq (%r9,%r9,8), %r10
leaq (%r10,%r10,2), %r10
addq %r9, %r10
movl (%rdi,%r10), %r9d
notl %r9d
addl 0x20(%r12), %r9d
movl %r9d, (%rdi,%r10)
movl $0xffffffff, 0x14(%r8,%r14) # imm = 0xFFFFFFFF
movq 0x20(%r12), %r9
leaq (%r9,%r9,8), %r10
leaq (%r8,%r10,4), %r8
movl (%rdx,%r8), %r10d
cmpq %rbx, %r10
je 0x36619
leaq (%r10,%r10,8), %r11
leaq (%r11,%r11,2), %r11
addq %r10, %r11
movl (%rdi,%r11), %r10d
notl %r10d
addl %r10d, %r9d
movl %r9d, (%rdi,%r11)
movl $0xffffffff, (%r8,%rdx) # imm = 0xFFFFFFFF
incq %rax
addq $0x24, %r14
addq $-0x24, %rdx
cmpq %rax, %rcx
jne 0x36525
movq 0xd0(%rsp), %rdx
movq 0x20(%r12), %rcx
testb $0x1, %cl
je 0x3666f
movq 0x30(%r12), %r10
leaq (%rax,%rax,8), %rax
movl 0x14(%r10,%rax,4), %r9d
leaq (%r9,%r9,8), %r8
leaq (%r8,%r8,2), %r8
addq %r9, %r8
movl (%rdi,%r8), %r9d
notl %r9d
addl %r9d, %ecx
movl %ecx, (%rdi,%r8)
movl $0xffffffff, 0x14(%r10,%rax,4) # imm = 0xFFFFFFFF
movq 0x8(%rdx), %rcx
movslq 0x40(%rdx), %r8
movslq 0x44(%rdx), %r9
movq %r12, %rdx
callq 0x35946
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq