// File: 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
movq %rsp, %rbp
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x9850
leaq -0xa8(%rbp), %rdi
callq 0x9850
movq $0x0, -0xb8(%rbp)
movq $0x0, -0xc0(%rbp)
movq $0x0, -0xb0(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x12794
movq $0x0, -0x38(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x12771
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq -0x88(%rbp), %rdi
xorl %eax, %eax
movl %eax, %r9d
xorl %r8d, %r8d
movq %r9, %rsi
movq $-0x1, (%rsp)
callq 0xfef0
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq -0xa8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %r9d
movl $0x1, %r8d
movq %r9, %rsi
movq $-0x1, (%rsp)
callq 0xfef0
movq -0xb8(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x48(%rcx), %rcx
imulq $0x58, -0x38(%rbp), %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
cmpq %rcx, %rax
jae 0x12562
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
imulq $0x58, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq $0x2, %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq $0x4, %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq $0x8, %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq $0x10, %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, -0xb0(%rbp)
jmp 0x12564
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
imulq $0x58, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movq %rax, -0xc0(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
callq 0x2180
movq -0xb0(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0xb4c0
movq -0xb0(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0xc0(%rbp), %rdx
callq 0x20b0
cmpl $0x0, %eax
je 0x125e6
movq 0x3b1a0f(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
leaq 0x36f0ab(%rip), %rsi    # 0x38168a
movb $0x0, %al
callq 0x22a0
movq -0xc0(%rbp), %rax
movl -0x2c(%rbp), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
ja 0x12608
movq $0x1, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0xc0(%rbp), %rax
jae 0x1275e
movq -0x48(%rbp), %rax
addq -0x40(%rbp), %rax
cmpq -0xc0(%rbp), %rax
ja 0x12643
movq -0x48(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0xf8(%rbp)
jmp 0x12651
movq -0xc0(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0xb0(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %r9
movq -0x50(%rbp), %rax
subq -0x48(%rbp), %rax
xorl %edi, %edi
xorl %r8d, %r8d
movq %rax, (%rsp)
callq 0xfef0
movq -0xb0(%rbp), %rdi
movq -0x88(%rbp), %rsi
addq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
subq -0x48(%rbp), %rdx
callq 0x20b0
cmpl $0x0, %eax
je 0x126cd
movq 0x3b1930(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %r8
leaq 0x36efe9(%rip), %rsi    # 0x3816af
movb $0x0, %al
callq 0x22a0
movq -0xb0(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %r9
movq -0x50(%rbp), %rax
subq -0x48(%rbp), %rax
xorl %edi, %edi
movl $0x1, %r8d
movq %rax, (%rsp)
callq 0xfef0
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
addq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
subq -0x48(%rbp), %rdx
callq 0x20b0
cmpl $0x0, %eax
je 0x12741
movq 0x3b18bc(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %r8
leaq 0x36efa4(%rip), %rsi    # 0x3816de
movb $0x0, %al
callq 0x22a0
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x12610
jmp 0x12760
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x12404
movq 0x3b1868(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x58(%rbp), %rcx
leaq 0x36ef87(%rip), %rsi    # 0x38170d
leaq 0x36efa7(%rip), %rdx    # 0x381734
movb $0x0, %al
callq 0x22a0
cmpq $0x0, -0x20(%rbp)
je 0x12afc
movq $0x0, -0x38(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x12ad9
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x88(%rbp), %rdi
callq 0xa380
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
callq 0xa500
movq -0xb8(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x38(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
jae 0x128db
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq $0x2, %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq $0x4, %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq $0x8, %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq $0x10, %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, -0xb0(%rbp)
jmp 0x128dd
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xc0(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
callq 0x2180
movq -0xb0(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0xb4c0
movq -0xb0(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0xc0(%rbp), %rdx
callq 0x20b0
cmpl $0x0, %eax
je 0x1295c
movq 0x3b1699(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
leaq 0x36edf5(%rip), %rsi    # 0x38174a
movb $0x0, %al
callq 0x22a0
movq -0xc0(%rbp), %rax
movl -0x2c(%rbp), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
ja 0x1297e
movq $0x1, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0xc0(%rbp), %rax
jae 0x12ac6
movq -0x48(%rbp), %rax
addq -0x40(%rbp), %rax
cmpq -0xc0(%rbp), %rax
ja 0x129b9
movq -0x48(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x100(%rbp)
jmp 0x129c7
movq -0xc0(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0xb0(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
subq -0x48(%rbp), %rdx
movq -0x20(%rbp), %r8
movq -0x38(%rbp), %r9
xorl %ecx, %ecx
callq 0x9a30
movq -0xb0(%rbp), %rdi
movq -0x88(%rbp), %rsi
addq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
subq -0x48(%rbp), %rdx
callq 0x20b0
cmpl $0x0, %eax
je 0x12a3c
movq 0x3b15c1(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %r8
leaq 0x36ed3a(%rip), %rsi    # 0x38176f
movb $0x0, %al
callq 0x22a0
movq -0xb0(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
subq -0x48(%rbp), %rdx
movq -0x20(%rbp), %r8
movq -0x38(%rbp), %r9
movl $0x1, %ecx
callq 0x9a30
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
addq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
subq -0x48(%rbp), %rdx
callq 0x20b0
cmpl $0x0, %eax
je 0x12aa9
movq 0x3b1554(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %r8
leaq 0x36ecfc(%rip), %rsi    # 0x38179e
movb $0x0, %al
callq 0x22a0
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x12986
jmp 0x12ac8
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x127af
movq 0x3b1500(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x58(%rbp), %rcx
leaq 0x36ecdf(%rip), %rsi    # 0x3817cd
leaq 0x36ec3f(%rip), %rdx    # 0x381734
movb $0x0, %al
callq 0x22a0
cmpq $0x0, -0x28(%rbp)
je 0x1355f
movq $0x0, -0xc8(%rbp)
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rdi
movl $0x1, %esi
callq 0x2140
movq %rax, -0xc8(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
cmpq (%rcx), %rax
jae 0x12bb9
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jae 0x12ba6
movq -0xc8(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rcx
movq 0x18(%rcx), %rcx
movq -0x48(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movb $0x1, (%rax,%rcx)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x12b4b
jmp 0x12ba8
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x12b33
leaq -0xe8(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2100
movq $0x0, -0xf0(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
cmpq (%rcx), %rax
jae 0x13524
jmp 0x12bfd
movq -0xb8(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x12d0b
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq $0x2, %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq $0x4, %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq $0x8, %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
shrq $0x10, %rax
orq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, -0xb0(%rbp)
jmp 0x12d0d
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0xc0(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdx
imulq $0x28, -0x38(%rbp), %rax
addq %rax, %rdx
leaq -0x88(%rbp), %rdi
xorl %eax, %eax
movl %eax, %r8d
xorl %ecx, %ecx
movq $-0x1, %r9
movq %r8, %rsi
movq $0x0, (%rsp)
callq 0x10980
movq -0xb0(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rsi
imulq $0x28, -0x38(%rbp), %rax
addq %rax, %rsi
leaq -0xa8(%rbp), %rdx
callq 0x121c0
movq -0xb0(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0xc0(%rbp), %rdx
callq 0x20b0
cmpl $0x0, %eax
je 0x12dc9
movq 0x3b122c(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
leaq 0x36ea33(%rip), %rsi    # 0x3817f5
movb $0x0, %al
callq 0x22a0
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdx
imulq $0x28, -0x38(%rbp), %rax
addq %rax, %rdx
leaq -0xa8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %r8d
movl $0x1, %ecx
movq $-0x1, %r9
movq %r8, %rsi
movq $0x0, (%rsp)
callq 0x10980
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
callq 0x2180
movq -0xb0(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0xb4c0
movq -0xb0(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0xc0(%rbp), %rdx
callq 0x20b0
cmpl $0x0, %eax
je 0x12e6c
movq 0x3b1189(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
leaq 0x36e9b5(%rip), %rsi    # 0x38181a
movb $0x0, %al
callq 0x22a0
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %r8
movq -0x10(%rbp), %rax
movslq 0x44(%rax), %r9
movq -0x10(%rbp), %rax
movslq 0x40(%rax), %rbx
movq -0x10(%rbp), %rax
movq 0x50(%rax), %r11
movq -0xc8(%rbp), %r10
movl $0xff, %edx
movq $-0x1, %rcx
leaq -0xe8(%rbp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x11990
movq -0xc0(%rbp), %rax
movl -0x2c(%rbp), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
ja 0x12ee8
movq $0x1, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0xc0(%rbp), %rax
jae 0x13511
movq -0x48(%rbp), %rax
addq -0x40(%rbp), %rax
cmpq -0xc0(%rbp), %rax
ja 0x12f23
movq -0x48(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x108(%rbp)
jmp 0x12f31
movq -0xc0(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0xb0(%rbp), %rsi
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdx
imulq $0x28, -0x38(%rbp), %rax
addq %rax, %rdx
movq -0x48(%rbp), %r8
movq -0x50(%rbp), %r9
subq -0x48(%rbp), %r9
xorl %eax, %eax
movl %eax, %edi
xorl %ecx, %ecx
movq $0x0, (%rsp)
callq 0x10980
movq -0xb0(%rbp), %rdi
movq -0x88(%rbp), %rsi
addq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
subq -0x48(%rbp), %rdx
callq 0x20b0
cmpl $0x0, %eax
je 0x12fbd
movq 0x3b1040(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %r8
leaq 0x36e889(%rip), %rsi    # 0x38183f
movb $0x0, %al
callq 0x22a0
movq -0xb0(%rbp), %rsi
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdx
imulq $0x28, -0x38(%rbp), %rax
addq %rax, %rdx
movq -0x48(%rbp), %r8
movq -0x50(%rbp), %r9
subq -0x48(%rbp), %r9
xorl %eax, %eax
movl %eax, %edi
movl $0x1, %ecx
movq $0x0, (%rsp)
callq 0x10980
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
addq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
subq -0x48(%rbp), %rdx
callq 0x20b0
cmpl $0x0, %eax
je 0x13041
movq 0x3b0fbc(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %r8
leaq 0x36e834(%rip), %rsi    # 0x38186e
movb $0x0, %al
callq 0x22a0
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %r8
movq -0x10(%rbp), %rax
movslq 0x44(%rax), %r9
movq -0x10(%rbp), %rax
movslq 0x40(%rax), %rbx
movq -0x10(%rbp), %rax
movq 0x50(%rax), %r11
movq -0xc8(%rbp), %r10
xorl %edx, %edx
leaq -0xe8(%rbp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x11990
movl %eax, %eax
movq %rax, -0x68(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rcx
xorl %r8d, %r8d
leaq -0xf0(%rbp), %r9
movl %r8d, %edx
callq 0x10d80
movl %eax, %eax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x60(%rbp), %rax
je 0x130f1
movq 0x3b0f10(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x48(%rbp), %r9
leaq 0x36e7b3(%rip), %rsi    # 0x38189d
movb $0x0, %al
callq 0x22a0
movq -0xf0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf0(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rcx
xorl %r8d, %r8d
leaq -0xf0(%rbp), %r9
movl %r8d, %edx
callq 0x10d80
movl %eax, %eax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x60(%rbp), %rax
je 0x13159
movq 0x3b0ea8(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x48(%rbp), %r9
leaq 0x36e74b(%rip), %rsi    # 0x38189d
movb $0x0, %al
callq 0x22a0
movq -0xf0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xf0(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rcx
xorl %r8d, %r8d
leaq -0xf0(%rbp), %r9
movl %r8d, %edx
callq 0x10d80
movl %eax, %eax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x60(%rbp), %rax
je 0x131c1
movq 0x3b0e40(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x48(%rbp), %r9
leaq 0x36e6e3(%rip), %rsi    # 0x38189d
movb $0x0, %al
callq 0x22a0
movq -0xf0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf0(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rcx
xorl %edx, %edx
movl $0x1, %r8d
leaq -0xf0(%rbp), %r9
callq 0x10d80
movl %eax, %eax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x60(%rbp), %rax
je 0x1322b
movq 0x3b0dd6(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x48(%rbp), %r9
leaq 0x36e679(%rip), %rsi    # 0x38189d
movb $0x0, %al
callq 0x22a0
movq -0xf0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xf0(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rcx
xorl %edx, %edx
movl $0x1, %r8d
leaq -0xf0(%rbp), %r9
callq 0x10d80
movl %eax, %eax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x60(%rbp), %rax
je 0x13295
movq 0x3b0d6c(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x48(%rbp), %r9
leaq 0x36e60f(%rip), %rsi    # 0x38189d
movb $0x0, %al
callq 0x22a0
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %r8
movq -0x10(%rbp), %rax
movslq 0x44(%rax), %r9
movq -0x10(%rbp), %rax
movslq 0x40(%rax), %rbx
movq -0x10(%rbp), %rax
movq 0x50(%rax), %r11
movq -0xc8(%rbp), %r10
movl $0x1, %edx
leaq -0xe8(%rbp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x11990
movl %eax, %eax
movq %rax, -0x68(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rcx
movl $0x1, %edx
xorl %r8d, %r8d
leaq -0xf0(%rbp), %r9
callq 0x10d80
movl %eax, %eax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x60(%rbp), %rax
je 0x1334a
movq 0x3b0cb7(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x48(%rbp), %r9
leaq 0x36e55a(%rip), %rsi    # 0x38189d
movb $0x0, %al
callq 0x22a0
movq -0xf0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf0(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rcx
movl $0x1, %edx
xorl %r8d, %r8d
leaq -0xf0(%rbp), %r9
callq 0x10d80
movl %eax, %eax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x60(%rbp), %rax
je 0x133b4
movq 0x3b0c4d(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x48(%rbp), %r9
leaq 0x36e4f0(%rip), %rsi    # 0x38189d
movb $0x0, %al
callq 0x22a0
movq -0xf0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xf0(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rcx
movl $0x1, %edx
xorl %r8d, %r8d
leaq -0xf0(%rbp), %r9
callq 0x10d80
movl %eax, %eax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x60(%rbp), %rax
je 0x1341e
movq 0x3b0be3(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x48(%rbp), %r9
leaq 0x36e486(%rip), %rsi    # 0x38189d
movb $0x0, %al
callq 0x22a0
movq -0xf0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf0(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rcx
movl $0x1, %r8d
leaq -0xf0(%rbp), %r9
movl %r8d, %edx
callq 0x10d80
movl %eax, %eax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x60(%rbp), %rax
je 0x13489
movq 0x3b0b78(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x48(%rbp), %r9
leaq 0x36e41b(%rip), %rsi    # 0x38189d
movb $0x0, %al
callq 0x22a0
movq -0xf0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xf0(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rcx
movl $0x1, %r8d
leaq -0xf0(%rbp), %r9
movl %r8d, %edx
callq 0x10d80
movl %eax, %eax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x60(%rbp), %rax
je 0x134f4
movq 0x3b0b0d(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x48(%rbp), %r9
leaq 0x36e3b0(%rip), %rsi    # 0x38189d
movb $0x0, %al
callq 0x22a0
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x12ef0
jmp 0x13513
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x12be7
movq -0xd8(%rbp), %rdi
callq 0x2210
movq -0xc8(%rbp), %rdi
callq 0x2210
movq 0x3b0a9d(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x58(%rbp), %rcx
leaq 0x36e380(%rip), %rsi    # 0x3818d1
leaq 0x36e1dc(%rip), %rdx    # 0x381734
movb $0x0, %al
callq 0x22a0
leaq -0x88(%rbp), %rdi
callq 0x9670
leaq -0xa8(%rbp), %rdi
callq 0x9670
movq -0xb0(%rbp), %rdi
callq 0x2210
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %rbp
retq
nopl (%rax)