// File: /workspace/github_cpp_makefile_star2_O3/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, 0x74(%rsp)
movq %rcx, 0x78(%rsp)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, 0x90(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x32e2d
leaq 0xb8(%rsp), %rdi
callq 0x32e2d
xorl %r14d, %r14d
movl $0x0, %eax
movq %rax, 0x40(%rsp)
testq %r15, %r15
movq %rbx, 0x30(%rsp)
jne 0x36d39
testq %rbx, %rbx
jne 0x36d82
movq 0x78(%rsp), %rbx
testq %rbx, %rbx
jne 0x36db7
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 %ebp, %ebp
cmpq $0x0, 0x50(%r15)
movl $0x0, %r14d
movl $0x0, %eax
movq %rax, 0x40(%rsp)
jne 0x36e43
movq 0x25e283(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f9bd7(%rip), %rsi    # 0x23093e
leaq 0x1f9bf7(%rip), %rdx    # 0x230965
movq %rbp, %rcx
xorl %eax, %eax
callq 0x22b0
movq 0x30(%rsp), %rbx
jmp 0x36cee
cmpq $0x0, 0x50(%rbx)
jne 0x370e1
xorl %r15d, %r15d
movq 0x25e249(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f9c5d(%rip), %rsi    # 0x2309fe
leaq 0x1f9bbd(%rip), %rdx    # 0x230965
movq %r15, %rcx
xorl %eax, %eax
callq 0x22b0
jmp 0x36cf7
movq 0x30(%rsp), %rax
movq 0x50(%rax), %rdi
movl $0x1, %esi
callq 0x2120
movq %rax, %r12
movq (%rbx), %rax
movq (%rax), %rcx
testq %rcx, %rcx
je 0x36e14
movq 0x10(%rax), %rdx
xorl %esi, %esi
leaq (%rsi,%rsi,4), %r8
movl 0x10(%rdx,%r8,8), %edi
testq %rdi, %rdi
je 0x36e0c
leaq (%rdx,%r8,8), %r8
movq 0x18(%r8), %r8
xorl %r9d, %r9d
movq (%r8,%r9,8), %r10
shrq $0x21, %r10
movb $0x1, (%r12,%r10)
incq %r9
cmpq %r9, %rdi
jne 0x36df7
incq %rsi
cmpq %rcx, %rsi
jne 0x36dde
xorps %xmm0, %xmm0
movaps %xmm0, 0xf0(%rsp)
movaps %xmm0, 0xe0(%rsp)
movq $0x0, 0x38(%rsp)
xorl %edi, %edi
cmpq $0x0, (%rax)
jne 0x37350
xorl %ebp, %ebp
jmp 0x37aa2
movq $0x0, 0x40(%rsp)
xorl %r14d, %r14d
xorl %ebp, %ebp
xorl %r12d, %r12d
movq %r15, 0x68(%rsp)
movq $-0x1, %rbx
movq %rbx, (%rsp)
leaq 0x98(%rsp), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x35bc3
movq %rbx, (%rsp)
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r12, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x35bc3
movq 0x48(%r15), %rax
movq %r12, 0x28(%rsp)
imulq $0x58, %r12, %rbx
movl 0x18(%rax,%rbx), %edx
cmpq %rdx, 0x40(%rsp)
jae 0x36f09
leaq -0x1(%rdx), %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), %edx
movq 0xb8(%rsp), %rsi
movq %r14, %rdi
movq %rdx, %rbx
callq 0x2160
movq %r14, %rdi
movq %rbx, %rsi
callq 0x33c1d
movq 0x98(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x370bf
movq %r14, 0x48(%rsp)
movl %ebx, %eax
xorl %edx, %edx
movl 0x74(%rsp), %ecx
divl %ecx
movl %eax, %edx
cmpl %ecx, %ebx
movl $0x1, %eax
cmovbl %eax, %edx
testl %ebx, %ebx
je 0x3709e
movq %rbx, %rax
xorl %r13d, %r13d
movq %rdx, %r12
xorl %ebx, %ebx
movq %rax, 0x50(%rsp)
movq %rdx, 0x80(%rsp)
movq %rbp, 0x88(%rsp)
leaq (%rbx,%rdx), %rcx
cmpq %r12, %rax
movq %r12, %r14
cmovbq %rax, %r14
addq %r13, %r14
cmpq %rax, %rcx
movq %rcx, 0x60(%rsp)
cmovbq %rcx, %rax
movq %rax, 0x58(%rsp)
movq %r14, (%rsp)
xorl %edi, %edi
movq 0x48(%rsp), %r15
movq %r15, %rsi
movq 0x68(%rsp), %rdx
movq 0x28(%rsp), %rbp
movq %rbp, %rcx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x35bc3
movq 0x98(%rsp), %rsi
addq %rbx, %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x37051
movq %r14, (%rsp)
xorl %edi, %edi
movq %r15, %rsi
movq 0x68(%rsp), %rdx
movq %rbp, %rcx
movl $0x1, %r8d
movq %rbx, %r9
callq 0x35bc3
movq 0xb8(%rsp), %rsi
addq %rbx, %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x37079
movq 0x88(%rsp), %rbp
incq %rbp
movq 0x80(%rsp), %rdx
addq %rdx, %r12
subq %rdx, %r13
movq 0x60(%rsp), %rcx
movq %rcx, %rbx
movq 0x50(%rsp), %rax
cmpq %rax, %rcx
jb 0x36f7d
jmp 0x3709e
movq 0x25df88(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f987e(%rip), %rsi    # 0x2308e0
movq %rbp, %rdx
movq %rbx, %rcx
movq 0x58(%rsp), %r8
xorl %eax, %eax
callq 0x22b0
jmp 0x36fe7
movq 0x25df60(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f9885(%rip), %rsi    # 0x23090f
movq %rbp, %rdx
movq %rbx, %rcx
movq 0x58(%rsp), %r8
xorl %eax, %eax
callq 0x22b0
jmp 0x37020
movq 0x28(%rsp), %r12
incq %r12
movq 0x68(%rsp), %r15
cmpq 0x50(%r15), %r12
movq 0x48(%rsp), %r14
jb 0x36e59
jmp 0x36d56
movq 0x25df1a(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f97eb(%rip), %rsi    # 0x2308bb
movq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0x22b0
jmp 0x36f42
movl 0x74(%rsp), %eax
movq %rax, 0x80(%rsp)
xorl %r15d, %r15d
xorl %r12d, %r12d
leaq 0x98(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x333e0
leaq 0xb8(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x334a6
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %rdx
cmpq %rdx, 0x40(%rsp)
jae 0x37177
decq %rdx
movq %rdx, %rax
shrq %rax
orq %rdx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %r14, %rdi
movq %rsi, 0x40(%rsp)
callq 0x2370
movq %rax, %r14
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %rdx
movq 0xb8(%rsp), %rsi
movq %r14, %rdi
movq %rdx, %rbx
callq 0x2160
movq %r14, %rdi
movq %rbx, %rsi
callq 0x33c1d
movq 0x98(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x37330
movq %r12, 0x60(%rsp)
movq %r14, 0x48(%rsp)
movq %rbx, %rax
xorl %edx, %edx
movq 0x80(%rsp), %rcx
divq %rcx
movq %rax, %rdx
cmpq %rcx, %rbx
movl $0x1, %eax
cmovbq %rax, %rdx
testq %rbx, %rbx
je 0x3730f
movq %rbx, %rax
xorl %r12d, %r12d
movq %rdx, %rbp
xorl %ebx, %ebx
movq %rax, 0x28(%rsp)
movq %rdx, 0x50(%rsp)
movq %r15, 0x68(%rsp)
leaq (%rbx,%rdx), %rcx
cmpq %rbp, %rax
movq %rbp, %r13
cmovbq %rax, %r13
addq %r12, %r13
cmpq %rax, %rcx
movq %rcx, 0x88(%rsp)
cmovbq %rcx, %rax
movq %rax, 0x58(%rsp)
movq 0x48(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
movq 0x30(%rsp), %r8
movq 0x60(%rsp), %r14
movq %r14, %r9
callq 0x32ef8
movq 0x98(%rsp), %rsi
addq %rbx, %rsi
movq %r15, %rdi
movq %r13, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x372c0
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movl $0x1, %ecx
movq 0x30(%rsp), %r8
movq %r14, %r9
callq 0x32ef8
movq 0xb8(%rsp), %rsi
addq %rbx, %rsi
movq %r15, %rdi
movq %r13, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x372e8
movq 0x68(%rsp), %r15
incq %r15
movq 0x50(%rsp), %rdx
addq %rdx, %rbp
subq %rdx, %r12
movq 0x88(%rsp), %rcx
movq %rcx, %rbx
movq 0x28(%rsp), %rax
cmpq %rax, %rcx
jb 0x371f7
jmp 0x3730f
movq 0x25dd19(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f96cf(%rip), %rsi    # 0x2309a0
movq %r14, %rdx
movq %rbx, %rcx
movq 0x58(%rsp), %r8
xorl %eax, %eax
callq 0x22b0
jmp 0x3725d
movq 0x25dcf1(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f96d6(%rip), %rsi    # 0x2309cf
movq 0x60(%rsp), %rdx
movq %rbx, %rcx
movq 0x58(%rsp), %r8
xorl %eax, %eax
callq 0x22b0
jmp 0x37292
movq 0x60(%rsp), %r12
incq %r12
movq 0x30(%rsp), %rbx
cmpq 0x50(%rbx), %r12
movq 0x48(%rsp), %r14
jb 0x370f3
jmp 0x36d90
movq 0x25dca9(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f963a(%rip), %rsi    # 0x23097b
movq %r12, %rdx
xorl %eax, %eax
callq 0x22b0
jmp 0x371b0
xorl %ebp, %ebp
xorl %r13d, %r13d
movq %r12, 0x30(%rsp)
movq 0x10(%rax), %rdx
leaq (,%r13,4), %rbx
addq %r13, %rbx
movl (%rdx,%rbx,8), %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
cmpq %r15, 0x40(%rsp)
movq %rbx, 0x28(%rsp)
jae 0x373de
decq %r15
movq %r15, %rax
shrq %rax
orq %r15, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %r14, %rdi
movq %rsi, 0x40(%rsp)
callq 0x2370
movq %rax, %r14
movq 0x78(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdx
movl (%rdx,%rbx,8), %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
leaq (,%r13,8), %rax
leaq (%rax,%rax,4), %rbx
addq %rbx, %rdx
movq $0x0, (%rsp)
leaq 0x98(%rsp), %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movq $-0x1, %r9
callq 0x36049
movq 0x78(%rsp), %rax
movq (%rax), %rax
addq 0x10(%rax), %rbx
movq %r14, %rdi
movq %rbx, %rsi
leaq 0xb8(%rsp), %rbx
movq %rbx, %rdx
callq 0x36b68
movq 0x98(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x37a5a
movq 0x78(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
shlq $0x3, %rcx
movq 0x10(%rax), %rdx
movq %rcx, 0x28(%rsp)
addq %rcx, %rdx
movq $0x0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %ecx
xorl %r8d, %r8d
movq $-0x1, %r9
callq 0x36049
movq 0xb8(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x2160
movq %r14, %rdi
movq %r15, %rsi
callq 0x33c1d
movq 0x98(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x21a0
testl %eax, %eax
movq %r15, %rbx
jne 0x37a7a
movq %r14, 0x48(%rsp)
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 0x366a5
movl %ebx, %eax
xorl %edx, %edx
movl 0x74(%rsp), %ecx
divl %ecx
movl %eax, %edx
cmpl %ecx, %ebx
movl $0x1, %eax
cmovbl %eax, %edx
testl %ebx, %ebx
je 0x37a3f
xorl %eax, %eax
movq %rdx, %rcx
xorl %r12d, %r12d
movq %rbx, 0x80(%rsp)
movq %rdx, 0xd8(%rsp)
movq %r13, 0x50(%rsp)
movq %rbp, 0x68(%rsp)
addq %r12, %rdx
cmpq %rcx, %rbx
movq %rcx, 0x60(%rsp)
movq %rcx, %rbp
cmovbq %rbx, %rbp
movq %rax, 0x88(%rsp)
addq %rax, %rbp
cmpq %rbx, %rdx
movq %rdx, 0x58(%rsp)
cmovbq %rdx, %rbx
movq (%r14), %rax
movq 0x10(%rax), %rdx
movq 0x28(%rsp), %r13
addq %r13, %rdx
movq $0x0, (%rsp)
xorl %edi, %edi
movq %r14, %r15
movq 0x48(%rsp), %r14
movq %r14, %rsi
xorl %ecx, %ecx
movq %r12, %r8
movq %rbp, %r9
callq 0x36049
movq 0x98(%rsp), %rsi
addq %r12, %rsi
movq %r14, %rdi
movq %rbp, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x37855
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 0x36049
movq 0xb8(%rsp), %rsi
addq %r12, %rsi
movq %r14, %rdi
movq %rbp, %rdx
callq 0x21a0
testl %eax, %eax
jne 0x3787d
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, %r14
movq %r15, %rdi
movq 0x50(%rsp), %r13
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x366a5
movl %eax, %ebx
movl %eax, %ebp
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
xorl %r8d, %r8d
leaq 0x38(%rsp), %r15
movq %r15, %r9
callq 0x36265
cmpl %eax, %ebx
jne 0x378a5
incq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x36265
cmpl %eax, %ebp
jne 0x378ce
decq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x36265
cmpl %eax, %ebp
jne 0x378f7
incq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
movl $0x1, %r8d
movq %r15, %r9
callq 0x36265
cmpl %eax, %ebp
jne 0x37920
decq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
movl $0x1, %r8d
movq %r15, %r9
callq 0x36265
cmpl %eax, %ebp
jne 0x37949
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 0x366a5
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 0x36265
cmpl %eax, %ebx
jne 0x37972
incq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movl $0x1, %edx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x36265
cmpl %eax, %ebp
movq 0x80(%rsp), %rbx
jne 0x3799b
decq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movl $0x1, %edx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x36265
cmpl %eax, %ebp
jne 0x379c4
incq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movl $0x1, %edx
movq %r12, %rcx
movl $0x1, %r8d
movq %r15, %r9
callq 0x36265
cmpl %eax, %ebp
jne 0x379ed
decq 0x38(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movl $0x1, %edx
movq %r12, %rcx
movl $0x1, %r8d
movq %r15, %r9
callq 0x36265
cmpl %eax, %ebp
jne 0x37a16
movq 0x68(%rsp), %rbp
incq %rbp
movq 0xd8(%rsp), %rdx
movq 0x60(%rsp), %rcx
addq %rdx, %rcx
movq 0x88(%rsp), %rax
subq %rdx, %rax
movq 0x58(%rsp), %rsi
movq %rsi, %r12
cmpq %rbx, %rsi
jb 0x3754d
jmp 0x37a3f
movq 0x25d784(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f920a(%rip), %rsi    # 0x230a70
movq 0x50(%rsp), %rdx
movq %r12, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x22b0
jmp 0x375ca
movq 0x25d75c(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f9211(%rip), %rsi    # 0x230a9f
movq 0x50(%rsp), %rdx
movq %r12, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x22b0
jmp 0x3760f
movl %eax, %r8d
movq 0x25d731(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f9215(%rip), %rsi    # 0x230ace
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x3767d
movl %eax, %r8d
movq 0x25d708(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f91ec(%rip), %rsi    # 0x230ace
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x376a0
movl %eax, %r8d
movq 0x25d6df(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f91c3(%rip), %rsi    # 0x230ace
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x376c3
movl %eax, %r8d
movq 0x25d6b6(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f919a(%rip), %rsi    # 0x230ace
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x376e9
movl %eax, %r8d
movq 0x25d68d(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f9171(%rip), %rsi    # 0x230ace
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x3770f
movl %eax, %r8d
movq 0x25d664(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f9148(%rip), %rsi    # 0x230ace
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x37776
movl %eax, %r8d
movq 0x25d63b(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f911f(%rip), %rsi    # 0x230ace
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x377a4
movl %eax, %r8d
movq 0x25d612(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f90f6(%rip), %rsi    # 0x230ace
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x377ca
movl %eax, %r8d
movq 0x25d5e9(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f90cd(%rip), %rsi    # 0x230ace
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x377f3
movl %eax, %r8d
movq 0x25d5c0(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f90a4(%rip), %rsi    # 0x230ace
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r9
xorl %eax, %eax
callq 0x22b0
jmp 0x3781c
incq %r13
movq (%r14), %rax
cmpq (%rax), %r13
movq 0x48(%rsp), %r14
movq 0x30(%rsp), %r12
jb 0x3735a
jmp 0x37a9a
movq 0x25d57f(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f8fbb(%rip), %rsi    # 0x230a26
movq %r13, %rdx
xorl %eax, %eax
callq 0x22b0
jmp 0x3744d
movq 0x25d55f(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f8fc0(%rip), %rsi    # 0x230a4b
movq %r13, %rdx
xorl %eax, %eax
callq 0x22b0
jmp 0x374c7
movq 0xf0(%rsp), %rdi
callq 0x2220
movq %r12, %rdi
callq 0x2220
movq 0x25d52a(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x1f9042(%rip), %rsi    # 0x230b02
leaq 0x1f8e9e(%rip), %rdx    # 0x230965
movq %rbp, %rcx
xorl %eax, %eax
callq 0x22b0
jmp 0x36d05