// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/anchor.cpp
// Function: recalu_minimizer_bd(unsigned long, anchor1_t*, asg16_v*, long*, long*, long*, long*, long*, unsigned long, unsigned long, tiny_queue_t*, All_reads*, UC_Read*, char*, unsigned long, unsigned long)
uint64_t recalu_minimizer_bd(uint64_t rid, anchor1_t *z, asg16_v *sc, int64_t *iok, int64_t *ink, int64_t *ick, int64_t *str_s, int64_t *str_e, uint64_t mz_k, uint64_t mz_h, tiny_queue_t *tq, All_reads *rref, UC_Read *tu, char *qstr, uint64_t qs, uint64_t qe)
{
	int64_t id = z->srt>>33; char *str = NULL; uint64_t rpos, rspan;
	int64_t ok = *iok, nk = *ink, ck = *ick, cn = sc->n, s0, e0, s1, e1, si, ei, os, oe, ots, ote, ol, wo[2], wn[2], weo[2], wen[2], ovlp, len = Get_READ_LENGTH((*rref), id); uint16_t op, bq, bt; uint32_t cl;
	e0 = ((uint32_t)z->srt) + 1; s0 = e0 - z->other_off; s1 = e1 = si = ei = -1; weo[0] = weo[1] = wen[0] = wen[1] = -1; 
	if(e0 <= s0) return 0;

	///debug
	// ok = nk = ck = 0;

	if((ck < 0) || (ck > cn)) {//(*ck) == cn is allowed
        ck = ok = nk = 0;
    }

	// if(id == 1/**s0 == 10260 && e0 == 10334**/) {
	// 	fprintf(stderr, "\n\n-0-qk::%ld,\ttk::%ld,\tck::%ld,\ts0::%ld,\te0::%ld\n", ok, nk, ck, s0, e0);
	// }

	while (ck > 0 && ok >= s0) {///x -> t; y -> p; first insertion and then match/mismatch
        --ck;
        op = sc->a[ck]>>14;
        // ol = (((op == 1) || (op == 2))?(sc->a[ck]&(0xfff)):(sc->a[ck]&(0x3fff)));
		if((op == 2) || (op == 3)) {
            ol = sc->a[ck]&(0xfff);
        } else if(op == 1) {
            ol = sc->a[ck]&(0x3ff);
        } else {
            ol = sc->a[ck]&(0x3fff);
        }
        if(op != 2) ok -= ol;
        if(op != 3) nk -= ol;
    }

	// char cm[4]; cm[0] = 'M'; cm[1] = 'S'; cm[2] = 'I'; cm[3] = 'D';  
	// if(id == 1/**s0 == 10260 && e0 == 10334**/) {
	// 	fprintf(stderr, "-1-qk::%ld,\ttk::%ld,\tck::%ld\n", ok, nk, ck);
	// }
	while (ck < cn && ok < e0) { ///[s0, e0)
        wo[0] = ok; wn[0] = nk; 
        // ck = pop_trace_bp(sc, ck, &op, &b, &cl);
		ck = pop_trace_bp_f(sc, ck, &op, &bq, &bt, &cl);
        if(op != 2) ok += cl;
        if(op != 3) nk += cl;
        wo[1] = ok; wn[1] = nk;  

		os = ((s0 >= wo[0])? s0 : wo[0]);
		oe = ((e0 <= wo[1])? e0 : wo[1]);
		// os = MAX(s0, wo[0]); oe = MIN(e0, wo[1]);
        ovlp = ((oe>os)? (oe-os):0);
		// if(id == 1/**s0 == 10260 && e0 == 10334**/) {
		// 	fprintf(stderr, "%u%c(q::[%ld,%ld))(t::[%ld,%ld))(ck::%ld)\n", cl, cm[op], wo[0], wo[1], wn[0], wn[1], ck);
		// }

		if(op != 2) {
			if(!ovlp) continue;
		} else {///wo[0] == wo[1]
			if(wo[0] < s0 || wo[0] >= e0) continue;
		}

		if(op < 2) {
            ots = os - wo[0] + wn[0]; ote = oe - wo[0] + wn[0];
        } else {///op == 2: more y; p == 3: more x
            ots = wn[0]; ote = wn[1];
        } 

		if(s1 == -1) {
			s1 = ots;
			// if((op == 0) && (wn[1] > ots) && ((wn[0] < ots) || (ots == 0))) si = 1;
			if((op == 0) && (wo[1] > s0) && ((wo[0] < s0) || (s1 == 0))) si = 1;
		}
		
		e1 = ote;
		if((op == 0) && (wo[0] < e0) && ((wo[1] > e0) || (e1 == len))) ei = 1;

        if((op == 0) && (ovlp > 0) && (ovlp > weo[1] - weo[0])) {
			weo[0] = os; weo[1] = oe;
			wen[0] = ots; wen[1] = ote;
        }
    }

	while (ck < cn && ok <= e0) { ///[s0, e0)
        wo[0] = ok; wn[0] = nk; 
        // pop_trace_bp(sc, ck, &op, &b, &cl);
		pop_trace_bp_f(sc, ck, &op, &bq, &bt, &cl);
		if(op != 2) break;
		// ck = pop_trace_bp(sc, ck, &op, &b, &cl);
		ck = pop_trace_bp_f(sc, ck, &op, &bq, &bt, &cl);
        // if(op != 2) ok += cl;
        // if(op != 3) nk += cl;
		nk += cl;
        wo[1] = ok; wn[1] = nk;  

		// if(id == 1/**s0 == 10260 && e0 == 10334**/) {
		// 	fprintf(stderr, "%u%c(q::[%ld,%ld))(t::[%ld,%ld))(ck::%ld)\n", cl, cm[op], wo[0], wo[1], wn[0], wn[1], ck);
		// }

		if(wo[0] >= s0 && wo[0] <= e0) {
			ots = wn[0]; ote = wn[1];
			if(s1 == -1) s1 = ots;
			e1 = ote;
		}
    }

	assert(wen[1] <= len);
	assert(e1 <= len);

	*iok = ok; *ink = nk; *ick = ck; 
	if(e1 <= s1) return 0;
	rpos = rspan = ((uint64_t)-1);

	if(weo[0] == s0 && weo[1] == e0) {
		rpos = wen[1]-1; rspan = e0 - s0;
		/** 
		if(si == 1 && ei == 1) {
			z->srt >>= 32; z->srt <<= 32; z->srt |= ((uint64_t)(wen[1]-1));
			///debug
			// char sstr[256]; recover_UC_Read_sub_region(sstr, wen[0], wen[1] - wen[0], 0, rref, id);
			// if(recalu_minimizer0(sstr, wen[1] - wen[0], !(asm_opt.flag & HA_F_NO_HPC), mz_k, mz_h, tq, &rpos, &rspan) && (rpos + 1 == ((uint64_t)(wen[1] - wen[0]))) && (((uint64_t)(wen[1] - wen[0])) == rspan)) {
			// 	// fprintf(stderr, "-0-[M::%s]\n", __func__);
			// } else {
			// 	// if(((z->srt>>32)&1) == 0) {
			// 		fprintf(stderr, "-1-[M::%s]\trid::%lu\ttid::%ld\t%c\trg1::[%ld,%ld)\trg0::[%ld,%ld)\tspan::%ld\n", __func__, rid, id, "+-"[(z->srt>>32)&1], wen[0], wen[1], s0, e0, e0 - s0);
			// 		fprintf(stderr, "tstr::%.*s\n", ((uint32_t)(wen[1] - wen[0])), sstr);
			// 		fprintf(stderr, "qstr::%.*s\n", ((uint32_t)(qe - qs)), qstr + qs);
			// 		exit(1);
			// 	// }
			// }
			// if(rid == 3196 && id == 3199) fprintf(stderr, "-full-[M::%s]\n", __func__);
			return 1;
		} 
		**/
	} else {
		if(s1 >= (*str_s) && e1 <= (*str_e)) {
			str = tu->seq + s1 - (*str_s);
		} else {
			if(s1 >= (*str_s) && (s1 < (*str_e)) && (e1 > (*str_e))) {
				UC_Read_resize((*tu), (e1 - (*str_s))); 
				recover_UC_Read_sub_region(tu->seq + (*str_e) - (*str_s), (*str_e), e1 - (*str_e), 0, rref, id);
				str = tu->seq + s1 - (*str_s); (*str_e) = e1;
			} else {
				UC_Read_resize((*tu), (e1 - s1)); 
				recover_UC_Read_sub_region(tu->seq, s1, e1 - s1, 0, rref, id);
				str = tu->seq; (*str_s) = s1; (*str_e) = e1;
			}
		}

		if(recalu_minimizer0(str, e1 - s1, !(asm_opt.flag & HA_F_NO_HPC), mz_k, mz_h, tq, &rpos, &rspan)) {
			rpos += s1;
		}
	}

	if(rpos != ((uint64_t)-1) && rspan != ((uint64_t)-1)) {
        e0 = rpos + 1; s0 = e0 - rspan;
        if(!(asm_opt.flag & HA_F_NO_HPC)) {
			if(si == -1) {
				s0 -= hpc_minimizer_test(id, rref, tu, *str_s, *str_e, s0, len, 1, 8);
				assert(s0 >= 0 && s0 < len && s0 < e0);
			}

			if(ei == -1) {
				e0 += hpc_minimizer_test(id, rref, tu, *str_s, *str_e, e0-1, len, 0, 8);
				assert(e0 >= 0 && e0 < len && s0 < e0);
			}
        }
        
        rpos = e0 - 1; rspan = e0 - s0;
        if(rspan < 256) {
            z->srt >>= 32; z->srt <<= 32; z->srt |= rpos; z->other_off = rspan;
            return 1;
        }
    }
	/**
	if(recalu_minimizer0(str, e1 - s1, !(asm_opt.flag & HA_F_NO_HPC), mz_k, mz_h, tq, &rpos, &rspan)) {
		rpos += s1;
		z->srt >>= 32; z->srt <<= 32; z->srt |= rpos; z->other_off = rspan;
		// fprintf(stderr, "-1-[M::%s]\trid::%lu\ttid::%ld\t%c\trg1::[%ld,%ld)\trg0::[%ld,%ld)\tspan::%ld\n", __func__, rid, id, "+-"[(z->srt>>32)&1], s1, e1, s0, e0, e0 - s0);
		// if(rid == 3196 && id == 3199) fprintf(stderr, "-part-[M::%s]\n", __func__);
		return 1;
	}
	// fprintf(stderr, "-0-[M::%s]\trid::%lu\ttid::%ld\t%c\trg1::[%ld,%ld)\trg0::[%ld,%ld)\tspan::%ld\n", __func__, rid, id, "+-"[(z->srt>>32)&1], s1, e1, s0, e0, e0 - s0);
	**/

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl 0xc(%rsi), %r10d
testq %r10, %r10
je 0x12c0bd
movq 0x108(%rsp), %rdi
movq (%rsi), %r11
movq (%rdx), %r14
leal 0x1(%r11), %r12d
movq (%r9), %rax
testq %rax, %rax
sets %bl
movq %r14, 0x8(%rsp)
cmpq %r14, %rax
setg %bpl
orb %bl, %bpl
jne 0x12b84b
movq (%r8), %r13
movq (%rcx), %r15
jmp 0x12b853
xorl %eax, %eax
xorl %r13d, %r13d
xorl %r15d, %r15d
shrq $0x21, %r11
movq 0x18(%rdi), %rbx
movq %r12, %rdi
subq %r10, %rdi
testq %rax, %rax
movq %rsi, 0x80(%rsp)
movq %r11, 0x38(%rsp)
movq %r10, 0x88(%rsp)
movq %r9, 0xa0(%rsp)
movq %r8, 0x98(%rsp)
movq %rcx, 0x90(%rsp)
movq %rdx, 0x50(%rsp)
jle 0x12b90a
cmpq %rdi, %r15
movq %rdi, %rcx
jl 0x12b905
movq 0x10(%rdx), %rdx
movl $0xfff, %esi            # imm = 0xFFF
xorl %edi, %edi
movzwl -0x2(%rdx,%rax,2), %r10d
movl %r10d, %r8d
shrl $0xe, %r8d
movl $0x3ff, %r9d            # imm = 0x3FF
cmpw $0x1, %r8w
je 0x12b8cb
movl $0x3fff, %r9d           # imm = 0x3FFF
testw %r10w, %r10w
cmovsl %esi, %r9d
leaq -0x1(%rax), %r14
andl %r10d, %r9d
cmpw $0x2, %r8w
movq %r9, %r10
cmoveq %rdi, %r10
subq %r10, %r15
cmpw $0x3, %r8w
cmoveq %rdi, %r9
subq %r9, %r13
cmpq $0x2, %rax
jl 0x12b910
movq %r14, %rax
cmpq %rcx, %r15
jge 0x12b8ab
jmp 0x12b910
movq %rax, %r14
jmp 0x12b910
movq %rax, %r14
movq %rdi, %rcx
movq %rcx, 0x60(%rsp)
movq 0x38(%rsp), %rax
movq (%rbx,%rax,8), %rax
movq %rax, 0x40(%rsp)
movq $-0x1, %rbx
cmpq 0x8(%rsp), %r14
jge 0x12bbe3
cmpq %r12, %r15
jge 0x12bbe3
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rcx
movq $-0x1, 0x48(%rsp)
xorl %r9d, %r9d
movq $-0x1, 0x18(%rsp)
movq $-0x1, 0x10(%rsp)
movq $-0x1, %rax
movq $-0x1, 0x28(%rsp)
movq $-0x1, %r10
movq %r10, 0x20(%rsp)
movq %rbx, (%rsp)
movq %rax, 0x70(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movq %r15, %rbx
movq %r13, %r11
movl %r14d, %eax
movzwl (%rcx,%rax,2), %edx
movl %edx, %ebp
shrl $0xe, %ebp
leal -0x2(%rbp), %eax
cmpl $0x2, %eax
jae 0x12b9ca
movl %edx, %eax
shrl $0xc, %eax
andl $0x3, %eax
movl %edx, %esi
andl $0xfff, %esi            # imm = 0xFFF
jmp 0x12b9da
testl %ebp, %ebp
jne 0x12b9e2
movl %edx, %esi
andl $0x3fff, %esi           # imm = 0x3FFF
movw $0xffff, %ax            # imm = 0xFFFF
movl $0xffff, %r8d           # imm = 0xFFFF
jmp 0x12b9fd
movl %edx, %eax
shrl $0xc, %eax
andl $0x3, %eax
movl %edx, %r8d
shrl $0xa, %r8d
andl $0x3, %r8d
movl %edx, %esi
andl $0x3ff, %esi            # imm = 0x3FF
movzwl %si, %r15d
incl %r14d
cmpq %r14, 0x8(%rsp)
jbe 0x12ba74
movzwl (%rcx,%r14,2), %esi
movl %esi, %edi
shrl $0xe, %edi
cmpl %ebp, %edi
jne 0x12ba74
movzwl %bp, %edi
leal -0x2(%rdi), %r10d
cmpl $0x2, %r10d
jae 0x12ba36
movl %esi, %edi
shrl $0xc, %edi
andl $0x3, %edi
andl $0xfff, %esi            # imm = 0xFFF
jmp 0x12ba44
testl %edi, %edi
jne 0x12ba4c
andl $0x3fff, %esi           # imm = 0x3FFF
movw $0xffff, %di            # imm = 0xFFFF
movl $0xffff, %r10d          # imm = 0xFFFF
jmp 0x12ba65
movl %esi, %edi
shrl $0xc, %edi
andl $0x3, %edi
movl %esi, %r10d
shrl $0xa, %r10d
andl $0x3, %r10d
andl $0x3ff, %esi            # imm = 0x3FF
cmpl %r8d, %r10d
jne 0x12ba74
cmpw %di, %ax
jne 0x12ba74
addl %esi, %r15d
jmp 0x12ba01
cmpw $0x2, %bp
movl %r15d, %r13d
movq %r13, %r15
cmoveq %r9, %r15
addq %rbx, %r15
cmpw $0x3, %bp
cmoveq %r9, %r13
addq %r11, %r13
movq 0x60(%rsp), %rax
cmpq %rbx, %rax
movq %rbx, %r8
cmovgq %rax, %r8
cmpq %r15, %r12
movq %r15, %rdi
cmovlq %r12, %rdi
movq %rdi, %rsi
subq %r8, %rsi
cmovleq %r9, %rsi
movl %r14d, %r14d
cmpw $0x2, %bp
jne 0x12bac3
cmpq %rax, %rbx
jl 0x12bac8
jmp 0x12bae7
testq %rsi, %rsi
jne 0x12bae7
cmpq %r14, 0x8(%rsp)
jle 0x12bc17
movq %r15, %rbx
movq %r13, %r11
cmpq %r12, %r15
jl 0x12b9a4
jmp 0x12bc17
movq %r8, 0x18(%rsp)
movq %r8, %rax
subq %rbx, %rax
movq %rdi, 0x10(%rsp)
movq %rdi, %rbp
subq %rbx, %rbp
addq %r11, %rbp
testw %dx, %dx
cmovsq %r9, %rax
movq %r13, %rdi
cmovnsq %rbp, %rdi
movq %rdi, %r10
cmpq $-0x1, (%rsp)
jne 0x12bb4f
addq %r11, %rax
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x12bb4b
movq 0x60(%rsp), %r8
cmpq %r8, %r15
jle 0x12bb4b
testq %rax, %rax
movq 0x28(%rsp), %rdi
movl $0x1, %r11d
cmoveq %r11, %rdi
cmpq %r8, %rbx
cmovlq %r11, %rdi
movq %rdi, 0x28(%rsp)
movq %rax, (%rsp)
cmpq 0x40(%rsp), %r10
movq 0x70(%rsp), %rdi
movq %rdi, %r8
movl $0x1, %eax
cmoveq %rax, %r8
cmpq %r12, %r15
cmovgq %rax, %r8
cmpl $0x4000, %edx           # imm = 0x4000
setb %al
cmovaeq %rdi, %r8
testq %rsi, %rsi
setg %dl
movq 0x78(%rsp), %rbx
movq %rbx, %rdi
movq 0x30(%rsp), %r11
subq %r11, %rdi
cmpq %rdi, %rsi
setg %sil
andb %dl, %sil
testb %sil, %al
movq 0x10(%rsp), %rax
cmoveq %rbx, %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
cmoveq %r11, %rax
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rax
cmovneq %rbp, %rax
movq %rax, 0x48(%rsp)
cmpq %r14, 0x8(%rsp)
jle 0x12c135
cmpq %r12, %r15
movq (%rsp), %rbx
movq %r8, %rax
jl 0x12b97c
jmp 0x12bc39
movq $-0x1, %r10
movq $-0x1, 0x28(%rsp)
movq $-0x1, %rax
movq $-0x1, 0x10(%rsp)
movq $-0x1, 0x18(%rsp)
movq $-0x1, 0x48(%rsp)
jmp 0x12bc39
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq 0x30(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movq (%rsp), %rbx
movq 0x20(%rsp), %r10
cmpq 0x8(%rsp), %r14
movq %rax, 0x30(%rsp)
jge 0x12bddb
cmpq %r12, %r15
jg 0x12bddb
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rcx
movq %r12, 0x50(%rsp)
movl %r14d, %eax
movzwl (%rcx,%rax,2), %esi
movl %esi, %r9d
shrl $0xe, %r9d
movl $0xffff, %edx           # imm = 0xFFFF
leal -0x2(%r9), %eax
cmpl $0x2, %eax
movq %rbx, (%rsp)
movq %r10, 0x20(%rsp)
jae 0x12bc8f
movl %esi, %ebx
shrl $0xc, %ebx
andl $0x3, %ebx
jmp 0x12bca8
movw $0xffff, %bx            # imm = 0xFFFF
testl %r9d, %r9d
je 0x12bca8
movl %esi, %ebx
shrl $0xc, %ebx
andl $0x3, %ebx
movl %esi, %edx
shrl $0xa, %edx
andl $0x3, %edx
leal 0x1(%r14), %r11d
movzwl %r9w, %ebp
cmpq %r11, 0x8(%rsp)
jbe 0x12bd1d
leal 0x2(%r14), %r12d
leal -0x2(%rbp), %edi
movq %r11, %rax
movzwl (%rcx,%rax,2), %eax
movl %eax, %r8d
shrl $0xe, %r8d
cmpw %r9w, %r8w
jne 0x12bd1d
movl $0xffff, %r10d          # imm = 0xFFFF
cmpl $0x2, %edi
jae 0x12bce8
shrl $0xc, %eax
andl $0x3, %eax
movl %eax, %r8d
jmp 0x12bd05
movw $0xffff, %r8w           # imm = 0xFFFF
testl %ebp, %ebp
je 0x12bd05
movl %eax, %r8d
shrl $0xc, %r8d
andl $0x3, %r8d
shrl $0xa, %eax
andl $0x3, %eax
movl %eax, %r10d
cmpl %edx, %r10d
jne 0x12bd1d
cmpw %r8w, %bx
jne 0x12bd1d
movl %r12d, %eax
incl %r12d
cmpq %rax, 0x8(%rsp)
ja 0x12bcc1
cmpw $0x2, %r9w
jne 0x12bde0
movl %esi, %edx
andl $0xfff, %edx            # imm = 0xFFF
cmpq %r11, 0x8(%rsp)
movq 0x50(%rsp), %r12
jbe 0x12bda0
shrl $0xc, %esi
andl $0x3, %esi
movzwl (%rcx,%r11,2), %edi
movl %edi, %eax
shrl $0xe, %eax
cmpl %r9d, %eax
jne 0x12bda0
leal -0x2(%rbp), %eax
cmpl $0x2, %eax
jae 0x12bd69
movl %edi, %ebx
shrl $0xc, %ebx
andl $0x3, %ebx
andl $0xfff, %edi            # imm = 0xFFF
jmp 0x12bd77
testl %ebp, %ebp
jne 0x12bd7b
andl $0x3fff, %edi           # imm = 0x3FFF
movw $0xffff, %bx            # imm = 0xFFFF
movb $0x1, %al
jmp 0x12bd8b
movl %edi, %ebx
shrl $0xc, %ebx
andl $0x3, %ebx
andl $0x3ff, %edi            # imm = 0x3FF
xorl %eax, %eax
testb %al, %al
je 0x12bda0
cmpw %bx, %si
jne 0x12bda0
addl %edi, %edx
incl %r11d
cmpq %r11, 0x8(%rsp)
ja 0x12bd42
movl %edx, %edx
addq %r13, %rdx
movq (%rsp), %rbx
cmpq $-0x1, %rbx
cmovneq %rbx, %r13
cmpq 0x60(%rsp), %r15
cmovgeq %r13, %rbx
movl %r11d, %r14d
movq 0x20(%rsp), %r10
cmovgeq %rdx, %r10
cmpq %r14, 0x8(%rsp)
jle 0x12bdf1
movq %rdx, %r13
cmpq %r12, %r15
jle 0x12bc60
jmp 0x12bdf1
movq %r13, %rdx
jmp 0x12bdf1
movq %r13, %rdx
movq 0x50(%rsp), %r12
movq (%rsp), %rbx
movq 0x20(%rsp), %r10
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rsi
cmpq %rax, %rsi
jg 0x12c141
cmpq %rax, %r10
movq 0x60(%rsp), %rcx
jg 0x12c160
movq 0x90(%rsp), %rax
movq %r15, (%rax)
movq 0x98(%rsp), %rax
movq %rdx, (%rax)
movq 0xa0(%rsp), %rax
movq %r14, (%rax)
movq %r10, %r14
subq %rbx, %r14
jle 0x12c0bd
movq 0x110(%rsp), %rbp
movq 0xe8(%rsp), %r15
movq 0xe0(%rsp), %r13
movq $-0x1, %rax
movq %rax, 0x68(%rsp)
movq %rax, 0x58(%rsp)
cmpq %rcx, 0x18(%rsp)
jne 0x12be90
cmpq %r12, 0x10(%rsp)
jne 0x12be90
decq %rsi
movq %rsi, 0x58(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x68(%rsp)
jmp 0x12bfec
movq 0x100(%rsp), %r9
movq 0xf8(%rsp), %r8
movq 0xf0(%rsp), %rcx
movq (%r13), %rax
cmpq %rax, %rbx
jge 0x12bf1e
movq %r10, 0x20(%rsp)
cmpq %r14, 0x10(%rbp)
jge 0x12bed0
movq (%rbp), %rdi
movq %r14, %rsi
callq 0x2370
movq %rax, (%rbp)
movq %r14, 0x10(%rbp)
movq (%rbp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movq 0x108(%rsp), %r8
movq 0x38(%rsp), %r9
callq 0x337f7
movq %rbp, %r12
movq (%rbp), %rdi
movq %rbx, (%r13)
movq 0x20(%rsp), %rax
movq %rax, (%r15)
movq 0x100(%rsp), %r9
movq 0xf8(%rsp), %r8
movq 0xf0(%rsp), %rcx
jmp 0x12bfb8
cmpq (%r15), %r10
jle 0x12bfab
cmpq %rax, %rbx
jl 0x12beb1
movq (%r15), %rcx
cmpq %rcx, %rbx
jge 0x12beb1
cmpq %rcx, %r10
jle 0x12beb1
movq %r10, %rsi
subq %rax, %rsi
cmpq %rsi, 0x10(%rbp)
jge 0x12bf6b
movq (%rbp), %rdi
movq %r10, %r12
callq 0x2370
movq %r12, %r10
movq %rax, (%rbp)
movq %r12, %rax
subq (%r13), %rax
movq %rax, 0x10(%rbp)
movq %r10, 0x20(%rsp)
movq (%r15), %rsi
movq (%rbp), %rdi
addq %rsi, %rdi
subq (%r13), %rdi
movq %r10, %rdx
subq %rsi, %rdx
xorl %ecx, %ecx
movq 0x108(%rsp), %r8
movq 0x38(%rsp), %r9
callq 0x337f7
movq %rbp, %r12
movq (%rbp), %rdi
addq %rbx, %rdi
subq (%r13), %rdi
jmp 0x12bef9
movq %rbp, %r12
movq (%rbp), %rdi
addq %rbx, %rdi
subq %rax, %rdi
leaq 0x15e799(%rip), %rax    # 0x28a758
movl (%rax), %edx
notl %edx
andl $0x1, %edx
leaq 0x68(%rsp), %rax
leaq 0x58(%rsp), %r10
movq %r14, %rsi
pushq %rax
pushq %r10
callq 0x129fdc
addq $0x10, %rsp
testq %rax, %rax
movq %r12, %rbp
je 0x12bfec
addq %rbx, 0x58(%rsp)
movq 0x58(%rsp), %r12
cmpq $-0x1, %r12
setne %cl
movq 0x68(%rsp), %rax
cmpq $-0x1, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x12c0bd
leaq 0x1(%r12), %rbx
movq %rbx, %r14
subq %rax, %r14
leaq 0x15e737(%rip), %rax    # 0x28a758
testb $0x1, (%rax)
jne 0x12c082
cmpq $-0x1, 0x28(%rsp)
jne 0x12c07a
movq (%r13), %rcx
movq (%r15), %r8
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
movq 0x110(%rsp), %rsi
movq %rbp, %rdx
movq %r14, %r9
pushq $0x8
pushq $0x1
pushq 0x58(%rsp)
callq 0x12b3e4
addq $0x20, %rsp
subq %rax, %r14
js 0x12c17f
cmpq 0x40(%rsp), %r14
jge 0x12c17f
cmpq %rbx, %r14
jge 0x12c17f
cmpq $-0x1, 0x30(%rsp)
je 0x12c0d1
movq %rbx, %rax
leaq -0x1(%rax), %rcx
movq %rcx, 0x58(%rsp)
subq %r14, %rax
movq %rax, 0x68(%rsp)
cmpq $0xff, %rax
ja 0x12c0bd
movq 0x80(%rsp), %rsi
movl 0x4(%rsi), %edx
shlq $0x20, %rdx
orq %rcx, %rdx
movq %rdx, (%rsi)
movl %eax, 0xc(%rsi)
movl $0x1, %eax
jmp 0x12c0bf
xorl %eax, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r13), %rcx
movq (%r15), %r8
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
movq 0x110(%rsp), %rsi
movq %rbp, %rdx
movq %r12, %r9
pushq $0x8
pushq $0x0
movq 0x58(%rsp), %r15
pushq %r15
callq 0x12b3e4
addq $0x20, %rsp
addq %rbx, %rax
js 0x12c116
cmpq %r15, %rax
jge 0x12c116
cmpq %rax, %r14
jl 0x12c085
leaq 0x102d6e(%rip), %rdi    # 0x22ee8b
leaq 0x1028cf(%rip), %rsi    # 0x22e9f3
leaq 0x102c73(%rip), %rcx    # 0x22ed9e
movl $0xb52, %edx            # imm = 0xB52
callq 0x2110
movq (%rsp), %rbx
movq %r8, %rax
jmp 0x12bc39
leaq 0x102b73(%rip), %rdi    # 0x22ecbb
leaq 0x1028a4(%rip), %rsi    # 0x22e9f3
leaq 0x102c48(%rip), %rcx    # 0x22ed9e
movl $0xb18, %edx            # imm = 0xB18
callq 0x2110
leaq 0x102c2d(%rip), %rdi    # 0x22ed94
leaq 0x102885(%rip), %rsi    # 0x22e9f3
leaq 0x102c29(%rip), %rcx    # 0x22ed9e
movl $0xb19, %edx            # imm = 0xB19
callq 0x2110
leaq 0x102ce6(%rip), %rdi    # 0x22ee6c
leaq 0x102866(%rip), %rsi    # 0x22e9f3
leaq 0x102c0a(%rip), %rcx    # 0x22ed9e
movl $0xb4d, %edx            # imm = 0xB4D
callq 0x2110