// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Process_Read.cpp
// Function: debug_retrieve_rc_sub(ug_opt_t const*, all_ul_t*, All_reads const*, ul_idx_t*, unsigned int)
void debug_retrieve_rc_sub(const ug_opt_t *uopt, all_ul_t *ref, const All_reads *R_INF, ul_idx_t *ul, uint32_t n_step)
{
	uint64_t i, step, s, e, occ, qc, rc;
	UC_Read f, r; 
	init_UC_Read(&f); init_UC_Read(&r);
	kvec_t(char) ss; kv_init(ss);
	if(ref) {
		for (i = 0, occ = 0; i < ref->n; i++) {
			retrieve_ul_t(&f, NULL, ref, i, 0, 0, -1);
			retrieve_ul_t(&r, NULL, ref, i, 1, 0, -1);

			kv_resize(char, ss, ref->a[i].rlen); 
			ss.n = ref->a[i].rlen;
			memcpy(ss.a, r.seq, ss.n); 
			reverse_complement(ss.a, ss.n);
			if(memcmp(ss.a, f.seq, ss.n)) {
				fprintf(stderr, "1-Wrong whole reverse-read, id: %lu\n", i);
				// for (s = 0; s < ss.n; s++) {
				// 	if(ss.a[s] != f.seq[s]) {
				// 		fprintf(stderr,"s:%lu, ss.a[s]:%c, f.seq[s]:%c, r.seq[rs]:%c\n", s, ss.a[s], f.seq[s], r.seq[ref->a[i].rlen - s - 1]);
				// 	}
				// }
			}

			step = ss.n/n_step;
			if(step <= 0) step = 1;

			for (s = 0; s < ss.n; s += step) {
				e = MIN(s+step, ss.n);
				retrieve_ul_t(NULL, ss.a, ref, i, 0, s, e-s);
				if(memcmp(ss.a, f.seq + s, e - s)) {
					fprintf(stderr, "1-Wrong sub forward-read, id: %lu, [%lu, %lu)\n", i, s, e);
				}

				retrieve_ul_t(NULL, ss.a, ref, i, 1, s, e-s);
				if(memcmp(ss.a, r.seq + s, e - s)) {
					fprintf(stderr, "1-Wrong sub reverse-read, id: %lu, [%lu, %lu)\n", i, s, e);
					// uint64_t dk; char *tf = ss.a; char *rf = r.seq + s;
					// for (dk = 0; dk < e - s; dk++) {
					// 	if(tf[dk] != rf[dk]) {
					// 		fprintf(stderr,"dk:%lu, tf[dk]:%c, rf[dk]:%c\n", 
					// 					dk, tf[dk], rf[dk]);
					// 	}
					// }
				}
				occ++;
			}
		}
		fprintf(stderr, "[M::%s::# checking: %lu] ==> all_ul_t\n", __func__, occ);
	}


	if(R_INF) {
		for (i = 0, occ = 0; i < R_INF->total_reads; i++) {
			recover_UC_Read(&f, R_INF, i);
			recover_UC_Read_RC(&r, (All_reads*)R_INF, i);
			kv_resize(char, ss, Get_READ_LENGTH((*R_INF), i)); 
			ss.n = Get_READ_LENGTH((*R_INF), i);
			memcpy(ss.a, r.seq, ss.n); 
			reverse_complement(ss.a, ss.n);
			if(memcmp(ss.a, f.seq, ss.n)) fprintf(stderr, "2-Wrong whole reverse-read, id: %lu\n", i);

			step = ss.n/n_step;
			if(step <= 0) step = 1;
			for (s = 0; s < ss.n; s += step) {
				e = MIN(s+step, ss.n);
				recover_UC_Read_sub_region(ss.a, s, e-s, 0, (All_reads*)R_INF, i);
				if(memcmp(ss.a, f.seq + s, e - s)) fprintf(stderr, "2-Wrong sub forward-read, id: %lu, [%lu, %lu)\n", i, s, e);

				recover_UC_Read_sub_region(ss.a, s, e-s, 1, (All_reads*)R_INF, i);
				if(memcmp(ss.a, r.seq + s, e - s)) fprintf(stderr, "2-Wrong sub reverse-read, id: %lu, [%lu, %lu)\n", i, s, e);
				occ++;
			}
		}
		fprintf(stderr, "[M::%s::# checking: %lu] ==> All_reads\n", __func__, occ);
	}

	if(ul) {

		uint8_t *sset = NULL; CALLOC(sset, R_INF->total_reads);
		for (i = 0; i < ul->ug->u.n; i++) {
			for (s = 0; s < ul->ug->u.a[i].n; s++){
				sset[ul->ug->u.a[i].a[s]>>33] = 1;
			}
		}

		kvec_t_u64_warp buf; memset(&buf, 0, sizeof(buf)); int64_t pi = 0;
		// produce_u_cov(ul, 0, (uint8_t)-1, (uint64_t)-1, &buf);
		// produce_u_cov(ul, 0, 0, ul->ug->u.a[0].len>>1, &buf);

		for (i = 0, occ = 0; i < ul->ug->u.n; i++) {
			kv_resize(char, ss, ul->ug->u.a[i].len); ss.n = ul->ug->u.a[i].len;
			retrieve_u_seq(&f, NULL, &(ul->ug->u.a[i]), 0, 0, -1, NULL);
			produce_u_seq(ss.a, &(ul->ug->u.a[i]), &r);
			if(memcmp(ss.a, f.seq, ss.n)) fprintf(stderr, "4-Wrong whole reverse-read, id: %lu\n", i);
			retrieve_u_seq(&r, NULL, &(ul->ug->u.a[i]), 1, 0, -1, NULL);
			
			memcpy(ss.a, r.seq, ss.n); 
			reverse_complement(ss.a, ss.n);
			if(memcmp(ss.a, f.seq, ss.n)) fprintf(stderr, "3-Wrong whole reverse-read, id: %lu\n", i);

			produce_u_cov(ul, i, (uint8_t)-1, (uint64_t)-1, uopt->sources, uopt->min_ovlp, uopt->max_hang, uopt->gap_fuzz, sset, &buf);
			step = ss.n/n_step;
    		if(step <= 0) step = 1;

			for (s = 0; s < ss.n; s += step) {
				e = MIN(s+step, ss.n);
				retrieve_u_seq(NULL, ss.a, &(ul->ug->u.a[i]), 0, s, e-s, NULL);
				if(memcmp(ss.a, f.seq + s, e - s)) fprintf(stderr, "3-Wrong sub forward-read, id: %lu, [%lu, %lu)\n", i, s, e);

				retrieve_u_seq(NULL, ss.a, &(ul->ug->u.a[i]), 1, s, e-s, NULL);
				if(memcmp(ss.a, r.seq + s, e - s)) fprintf(stderr, "3-Wrong sub reverse-read, id: %lu, [%lu, %lu)\n", i, s, e);
				
				/**if(ul->ug->u.a[i].n > 1)**/ {
					rc = produce_u_cov(ul, i, 0, s, uopt->sources, uopt->min_ovlp, uopt->max_hang, uopt->gap_fuzz, sset, &buf);

					qc = retrieve_u_cov(ul, i, 0, s, 0, &pi);
					if(rc != qc) fprintf(stderr, "4-Wrong coverage, id: %lu, rc:%lu, qc:%lu, pos:%lu\n", i, rc, qc, s);
					pi++;
					qc = retrieve_u_cov(ul, i, 0, s, 0, &pi);
					if(rc != qc) fprintf(stderr, "4-Wrong coverage, id: %lu, rc:%lu, qc:%lu, pos:%lu\n", i, rc, qc, s);
					pi--;
					qc = retrieve_u_cov(ul, i, 0, s, 0, &pi);
					if(rc != qc) fprintf(stderr, "4-Wrong coverage, id: %lu, rc:%lu, qc:%lu, pos:%lu\n", i, rc, qc, s);
					pi++;
					qc = retrieve_u_cov(ul, i, 0, s, 1, &pi);
					if(rc != qc) fprintf(stderr, "4-Wrong coverage, id: %lu, rc:%lu, qc:%lu, pos:%lu\n", i, rc, qc, s);
					pi--;
					qc = retrieve_u_cov(ul, i, 0, s, 1, &pi);
					if(rc != qc) fprintf(stderr, "4-Wrong coverage, id: %lu, rc:%lu, qc:%lu, pos:%lu\n", i, rc, qc, s);




					rc = produce_u_cov(ul, i, 1, s, uopt->sources, uopt->min_ovlp, uopt->max_hang, uopt->gap_fuzz, sset, &buf);
					qc = retrieve_u_cov(ul, i, 1, s, 0, &pi);
					if(rc != qc) fprintf(stderr, "4-Wrong coverage, id: %lu, rc:%lu, qc:%lu, pos:%lu\n", i, rc, qc, s);
					pi++;
					qc = retrieve_u_cov(ul, i, 1, s, 0, &pi);
					if(rc != qc) fprintf(stderr, "4-Wrong coverage, id: %lu, rc:%lu, qc:%lu, pos:%lu\n", i, rc, qc, s);
					pi--;
					qc = retrieve_u_cov(ul, i, 1, s, 0, &pi);
					if(rc != qc) fprintf(stderr, "4-Wrong coverage, id: %lu, rc:%lu, qc:%lu, pos:%lu\n", i, rc, qc, s);
					pi++;
					qc = retrieve_u_cov(ul, i, 1, s, 1, &pi);
					if(rc != qc) fprintf(stderr, "4-Wrong coverage, id: %lu, rc:%lu, qc:%lu, pos:%lu\n", i, rc, qc, s);
					pi--;
					qc = retrieve_u_cov(ul, i, 1, s, 1, &pi);
					if(rc != qc) fprintf(stderr, "4-Wrong coverage, id: %lu, rc:%lu, qc:%lu, pos:%lu\n", i, rc, qc, s);
				}
				occ++;
			}
		}
	
		kv_destroy(buf.a); free(sset);
		fprintf(stderr, "[M::%s::# checking: %lu] ==> ma_utg_v\n", __func__, occ);
	}

	destory_UC_Read(&f); destory_UC_Read(&r);
	kv_destroy(ss);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %r8d, 0x6c(%rsp)
movq %rcx, 0x78(%rsp)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, 0x90(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x3372c
leaq 0xb8(%rsp), %rdi
callq 0x3372c
xorl %r14d, %r14d
movl $0x0, %eax
movq %rax, 0x40(%rsp)
testq %r15, %r15
movq %rbx, 0x30(%rsp)
jne 0x37787
testq %rbx, %rbx
jne 0x377d1
movq 0x78(%rsp), %rbx
testq %rbx, %rbx
jne 0x37806
movq 0x98(%rsp), %rdi
callq 0x2220
movq 0xb8(%rsp), %rdi
callq 0x2220
movq %r14, %rdi
callq 0x2220
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
cmpq $0x0, 0x50(%r15)
movl $0x0, %r14d
movl $0x0, %eax
movq %rax, 0x40(%rsp)
jne 0x378ce
movq 0x252834(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ed178(%rip), %rsi    # 0x22492e
leaq 0x1ed198(%rip), %rdx    # 0x224955
movq %r12, %rcx
xorl %eax, %eax
callq 0x22b0
movq 0x30(%rsp), %rbx
jmp 0x3773c
cmpq $0x0, 0x50(%rbx)
jne 0x37b55
xorl %r12d, %r12d
movq 0x2527fa(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ed1fe(%rip), %rsi    # 0x2249ee
leaq 0x1ed15e(%rip), %rdx    # 0x224955
movq %r12, %rcx
xorl %eax, %eax
callq 0x22b0
jmp 0x37745
movq 0x30(%rsp), %rax
movq 0x50(%rax), %rdi
movl $0x1, %esi
callq 0x2120
movq %rax, %r12
movq (%rbx), %rcx
movq (%rcx), %rax
testq %rax, %rax
je 0x37862
movq 0x10(%rcx), %rcx
xorl %edx, %edx
leaq (%rdx,%rdx,4), %rdi
movl 0x10(%rcx,%rdi,8), %esi
testq %rsi, %rsi
je 0x3785a
leaq (%rcx,%rdi,8), %rdi
movq 0x18(%rdi), %rdi
xorl %r8d, %r8d
movq (%rdi,%r8,8), %r9
shrq $0x21, %r9
movb $0x1, (%r12,%r9)
incq %r8
cmpq %r8, %rsi
jne 0x37845
incq %rdx
cmpq %rax, %rdx
jne 0x3782d
xorps %xmm0, %xmm0
movaps %xmm0, 0xf0(%rsp)
movaps %xmm0, 0xe0(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x78(%rsp), %rax
movq (%rax), %rax
cmpq $0x0, (%rax)
jne 0x37dc4
xorl %ebp, %ebp
movq 0xf0(%rsp), %rdi
callq 0x2220
movq %r12, %rdi
callq 0x2220
movq 0x252732(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ed23a(%rip), %rsi    # 0x224af2
leaq 0x1ed096(%rip), %rdx    # 0x224955
movq %rbp, %rcx
xorl %eax, %eax
callq 0x22b0
jmp 0x37753
movq $0x0, 0x40(%rsp)
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %ebp, %ebp
movq %r15, 0x60(%rsp)
movq $-0x1, %rbx
movq %rbx, (%rsp)
leaq 0x98(%rsp), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x36695
movq %rbx, (%rsp)
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rbp, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x36695
movq 0x48(%r15), %rax
imulq $0x58, %rbp, %rbx
movl 0x18(%rax,%rbx), %eax
cmpq %rax, 0x40(%rsp)
jae 0x37986
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 %r14, %rdi
movq %rsi, 0x40(%rsp)
callq 0x2370
movq %rax, %r14
movq 0x48(%r15), %rax
movl 0x18(%rax,%rbx), %ebx
movq 0xb8(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x2160
movq %r14, %rdi
movq %rbx, %rsi
callq 0x345cf
movq 0x98(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x37b35
movq %r14, 0x28(%rsp)
movl %ebx, %eax
xorl %edx, %edx
movl 0x6c(%rsp), %ecx
divl %ecx
movl %eax, %edx
cmpl %ecx, %ebx
movl $0x1, %eax
cmovbl %eax, %edx
testq %rbx, %rbx
je 0x37b19
movq %rbx, %rax
xorl %r13d, %r13d
movq %rdx, %r15
xorl %ebx, %ebx
movq %rax, 0x48(%rsp)
movq %rdx, 0x70(%rsp)
movq %r12, 0x80(%rsp)
leaq (%rbx,%rdx), %rcx
cmpq %rax, %r15
movq %rax, %r14
cmovbq %r15, %r14
addq %r13, %r14
cmpq %rax, %rcx
movq %rcx, 0x58(%rsp)
cmovbq %rcx, %rax
movq %rax, 0x50(%rsp)
movq %r14, (%rsp)
xorl %edi, %edi
movq 0x28(%rsp), %r12
movq %r12, %rsi
movq 0x60(%rsp), %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x36695
movq 0x98(%rsp), %rsi
addq %rbx, %rsi
movq %r12, %rdi
movq %r14, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x37acc
movq %r14, (%rsp)
xorl %edi, %edi
movq %r12, %rsi
movq 0x60(%rsp), %rdx
movq %rbp, %rcx
movl $0x1, %r8d
movq %rbx, %r9
callq 0x36695
movq 0xb8(%rsp), %rsi
addq %rbx, %rsi
movq %r12, %rdi
movq %r14, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x37af4
movq 0x80(%rsp), %r12
incq %r12
movq 0x70(%rsp), %rdx
addq %rdx, %r15
subq %rdx, %r13
movq 0x58(%rsp), %rcx
movq %rcx, %rbx
movq 0x48(%rsp), %rax
cmpq %rax, %rcx
jb 0x37a00
jmp 0x37b19
movq 0x25250d(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ecdf3(%rip), %rsi    # 0x2248d0
movq %rbp, %rdx
movq %rbx, %rcx
movq 0x50(%rsp), %r8
xorl %eax, %eax
callq 0x22b0
jmp 0x37a65
movq 0x2524e5(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ecdfa(%rip), %rsi    # 0x2248ff
movq %rbp, %rdx
movq %rbx, %rcx
movq 0x50(%rsp), %r8
xorl %eax, %eax
callq 0x22b0
jmp 0x37a9e
incq %rbp
movq 0x60(%rsp), %r15
cmpq 0x50(%r15), %rbp
movq 0x28(%rsp), %r14
jb 0x378e4
jmp 0x377a5
movq 0x2524a4(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ecd65(%rip), %rsi    # 0x2248ab
movq %rbp, %rdx
xorl %eax, %eax
callq 0x22b0
jmp 0x379c7
movl 0x6c(%rsp), %eax
movq %rax, 0x88(%rsp)
xorl %r12d, %r12d
xorl %r15d, %r15d
leaq 0x98(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x33cf8
leaq 0xb8(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x33dc3
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rax
cmpq %rax, 0x40(%rsp)
jae 0x37be3
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 %r14, %rdi
movq %rsi, 0x40(%rsp)
callq 0x2370
movq %rax, %r14
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rbx
movq 0xb8(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x2160
movq %r14, %rdi
movq %rbx, %rsi
callq 0x345cf
movq 0x98(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x37da4
movq %r15, 0x58(%rsp)
movq %r14, 0x28(%rsp)
movq %rbx, %rax
xorl %edx, %edx
movq 0x88(%rsp), %rcx
divq %rcx
movq %rax, %rdx
cmpq %rcx, %rbx
movl $0x1, %eax
cmovbq %rax, %rdx
testq %rbx, %rbx
je 0x37d83
movq %rbx, %rax
xorl %r15d, %r15d
movq %rdx, %rbp
xorl %ebx, %ebx
movq %rax, 0x48(%rsp)
movq %rdx, 0x70(%rsp)
movq %r12, 0x60(%rsp)
leaq (%rbx,%rdx), %rcx
cmpq %rbp, %rax
movq %rbp, %r13
cmovbq %rax, %r13
addq %r15, %r13
cmpq %rax, %rcx
movq %rcx, 0x80(%rsp)
cmovbq %rcx, %rax
movq %rax, 0x50(%rsp)
movq 0x28(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
movq 0x30(%rsp), %r8
movq 0x58(%rsp), %r14
movq %r14, %r9
callq 0x337f7
movq 0x98(%rsp), %rsi
addq %rbx, %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x37d34
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movl $0x1, %ecx
movq 0x30(%rsp), %r8
movq %r14, %r9
callq 0x337f7
movq 0xb8(%rsp), %rsi
addq %rbx, %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x37d5c
movq 0x60(%rsp), %r12
incq %r12
movq 0x70(%rsp), %rdx
addq %rdx, %rbp
subq %rdx, %r15
movq 0x80(%rsp), %rcx
movq %rcx, %rbx
movq 0x48(%rsp), %rax
cmpq %rax, %rcx
jb 0x37c6b
jmp 0x37d83
movq 0x2522a5(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ecc4b(%rip), %rsi    # 0x224990
movq %r14, %rdx
movq %rbx, %rcx
movq 0x50(%rsp), %r8
xorl %eax, %eax
callq 0x22b0
jmp 0x37cd1
movq 0x25227d(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ecc52(%rip), %rsi    # 0x2249bf
movq 0x58(%rsp), %rdx
movq %rbx, %rcx
movq 0x50(%rsp), %r8
xorl %eax, %eax
callq 0x22b0
jmp 0x37d06
movq 0x58(%rsp), %r15
incq %r15
movq 0x30(%rsp), %rbx
cmpq 0x50(%rbx), %r15
movq 0x28(%rsp), %r14
jb 0x37b67
jmp 0x377df
movq 0x252235(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ecbb6(%rip), %rsi    # 0x22496b
movq %r15, %rdx
xorl %eax, %eax
callq 0x22b0
jmp 0x37c24
xorl %ebp, %ebp
xorl %r13d, %r13d
movq %r12, 0x30(%rsp)
movq 0x10(%rax), %rax
leaq (,%r13,4), %rcx
addq %r13, %rcx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, 0x40(%rsp)
movq %rcx, 0x48(%rsp)
jae 0x37e3c
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 %r14, %rdi
movq %rsi, 0x40(%rsp)
callq 0x2370
movq %rax, 0x28(%rsp)
jmp 0x37e41
movq %r14, 0x28(%rsp)
movq 0x78(%rsp), %r14
movq (%r14), %rax
movq 0x10(%rax), %rdx
leaq (,%r13,8), %rax
leaq (%rax,%rax,4), %rbx
movl (%rdx,%rbx), %r15d
addq %rbx, %rdx
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
movq $0x0, (%rsp)
leaq 0x98(%rsp), %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movq $-0x1, %r9
callq 0x36b0d
movq (%r14), %rax
addq 0x10(%rax), %rbx
movq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
leaq 0xb8(%rsp), %rbx
movq %rbx, %rdx
callq 0x375b6
movq 0x98(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x384da
movq 0x78(%rsp), %rax
movq (%rax), %rax
movq 0x48(%rsp), %rcx
shlq $0x3, %rcx
movq 0x10(%rax), %rdx
movq %rcx, 0x48(%rsp)
addq %rcx, %rdx
movq $0x0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %ecx
xorl %r8d, %r8d
movq $-0x1, %r9
callq 0x36b0d
movq 0xb8(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x2160
movq %r14, %rdi
movq %r15, %rsi
callq 0x345cf
movq 0x98(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x21a0
testl %eax, %eax
movq %r15, %rbx
jne 0x384fa
movq 0x90(%rsp), %rax
movq 0x8(%rax), %r8
movslq 0x44(%rax), %r9
movslq 0x40(%rax), %rax
leaq 0xe0(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movq %r12, 0x10(%rsp)
movq %rax, (%rsp)
movq 0x78(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
movl $0xff, %edx
movq $-0x1, %rcx
callq 0x3719d
movl %ebx, %eax
xorl %edx, %edx
movl 0x6c(%rsp), %ecx
divl %ecx
movl %eax, %edx
cmpl %ecx, %ebx
movl $0x1, %eax
cmovbl %eax, %edx
testl %ebx, %ebx
je 0x384bc
xorl %eax, %eax
movq %rdx, %rcx
xorl %r12d, %r12d
movq %r13, 0x70(%rsp)
movq %rbx, 0x88(%rsp)
movq %rdx, 0xd8(%rsp)
movq %rbp, 0x60(%rsp)
addq %r12, %rdx
cmpq %rbx, %rcx
movq %rbx, %rbp
movq %rcx, 0x58(%rsp)
cmovbq %rcx, %rbp
movq %rax, 0x80(%rsp)
addq %rax, %rbp
cmpq %rbx, %rdx
movq %rdx, 0x50(%rsp)
cmovbq %rdx, %rbx
movq (%r14), %rax
movq 0x10(%rax), %rdx
movq 0x48(%rsp), %r13
addq %r13, %rdx
movq $0x0, (%rsp)
xorl %edi, %edi
movq %r14, %r15
movq 0x28(%rsp), %r14
movq %r14, %rsi
xorl %ecx, %ecx
movq %r12, %r8
movq %rbp, %r9
callq 0x36b0d
movq 0x98(%rsp), %rsi
addq %r12, %rsi
movq %r14, %rdi
movq %rbp, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x382d4
movq (%r15), %rax
movq 0x10(%rax), %rdx
addq %r13, %rdx
movq $0x0, (%rsp)
xorl %edi, %edi
movq %r14, %rsi
movl $0x1, %ecx
movq %r12, %r8
movq %rbp, %r9
callq 0x36b0d
movq 0xb8(%rsp), %rsi
addq %r12, %rsi
movq %r14, %rdi
movq %rbp, %rdx
callq 0x21a0
testl %eax, %eax
movq 0x70(%rsp), %rbp
jne 0x382fc
movq 0x90(%rsp), %rax
movq 0x8(%rax), %r8
movslq 0x44(%rax), %r9
movslq 0x40(%rax), %rax
leaq 0xe0(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq %rax, (%rsp)
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x3719d
movl %eax, %ebx
movl %eax, %r14d
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
movq %r12, %rcx
xorl %r8d, %r8d
leaq 0x38(%rsp), %r13
movq %r13, %r9
callq 0x36d17
cmpl %eax, %ebx
movq %r14, %rbx
movq %r15, %r14
jne 0x38322
incq 0x38(%rsp)
movq %r14, %rdi
movq %rbp, %rsi
xorl %edx, %edx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r13, %r9
callq 0x36d17
cmpl %eax, %ebx
movq %r13, %r15
movq %rbp, %r13
jne 0x3834b
decq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x36d17
cmpl %eax, %ebx
jne 0x38374
incq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
movl $0x1, %r8d
movq %r15, %r9
callq 0x36d17
cmpl %eax, %ebx
jne 0x3839d
decq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
movl $0x1, %r8d
movq %r15, %r9
callq 0x36d17
cmpl %eax, %ebx
jne 0x383c6
movq 0x90(%rsp), %rax
movq 0x8(%rax), %r8
movslq 0x44(%rax), %r9
movslq 0x40(%rax), %rax
leaq 0xe0(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq %rax, (%rsp)
movq %r14, %rdi
movq %r13, %rsi
movl $0x1, %edx
movq %r12, %rcx
callq 0x3719d
movl %eax, %ebx
movl %eax, %ebp
movq %r14, %rdi
movq %r13, %rsi
movl $0x1, %edx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x36d17
cmpl %eax, %ebx
jne 0x383ef
incq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movl $0x1, %edx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x36d17
cmpl %eax, %ebp
movq 0x88(%rsp), %rbx
jne 0x38418
decq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movl $0x1, %edx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x36d17
cmpl %eax, %ebp
jne 0x38441
incq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movl $0x1, %edx
movq %r12, %rcx
movl $0x1, %r8d
movq %r15, %r9
callq 0x36d17
cmpl %eax, %ebp
jne 0x3846a
decq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movl $0x1, %edx
movq %r12, %rcx
movl $0x1, %r8d
movq %r15, %r9
callq 0x36d17
cmpl %eax, %ebp
jne 0x38493
movq 0x60(%rsp), %rbp
incq %rbp
movq 0xd8(%rsp), %rdx
movq 0x58(%rsp), %rcx
addq %rdx, %rcx
movq 0x80(%rsp), %rax
subq %rdx, %rax
movq 0x50(%rsp), %rsi
movq %rsi, %r12
cmpq %rbx, %rsi
jb 0x37fc2
jmp 0x384bc
movq 0x251d05(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec77b(%rip), %rsi    # 0x224a60
movq 0x70(%rsp), %rdx
movq %r12, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x22b0
jmp 0x3803f
movq 0x251cdd(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec782(%rip), %rsi    # 0x224a8f
movq %rbp, %rdx
movq %r12, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x22b0
jmp 0x38089
movl %eax, %r8d
movq 0x251cb4(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec788(%rip), %rsi    # 0x224abe
movq %rbp, %rdx
movq %rbx, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x380f6
movl %eax, %r8d
movq 0x251c8b(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec75f(%rip), %rsi    # 0x224abe
movq %r13, %rdx
movq %rbx, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x3811f
movl %eax, %r8d
movq 0x251c62(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec736(%rip), %rsi    # 0x224abe
movq %r13, %rdx
movq %rbx, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x38142
movl %eax, %r8d
movq 0x251c39(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec70d(%rip), %rsi    # 0x224abe
movq %r13, %rdx
movq %rbx, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x38168
movl %eax, %r8d
movq 0x251c10(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec6e4(%rip), %rsi    # 0x224abe
movq %r13, %rdx
movq %rbx, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x3818e
movl %eax, %r8d
movq 0x251be7(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec6bb(%rip), %rsi    # 0x224abe
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x381f5
movl %eax, %r8d
movq 0x251bbe(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec692(%rip), %rsi    # 0x224abe
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x38223
movl %eax, %r8d
movq 0x251b95(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec669(%rip), %rsi    # 0x224abe
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x38249
movl %eax, %r8d
movq 0x251b6c(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec640(%rip), %rsi    # 0x224abe
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x38272
movl %eax, %r8d
movq 0x251b43(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec617(%rip), %rsi    # 0x224abe
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x3829b
incq %r13
movq (%r14), %rax
cmpq (%rax), %r13
movq 0x28(%rsp), %r14
movq 0x30(%rsp), %r12
jb 0x37dce
jmp 0x37892
movq 0x251aff(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec52b(%rip), %rsi    # 0x224a16
movq %r13, %rdx
xorl %eax, %eax
callq 0x22b0
jmp 0x37ec7
movq 0x251adf(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x1ec530(%rip), %rsi    # 0x224a3b
movq %r13, %rdx
xorl %eax, %eax
callq 0x22b0
jmp 0x37f41