// File: chhylp123[P]hifiasm/anchor.cpp
// Function: recalu_minimizer(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(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, 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 = -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;
		e1 = ote;

        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(weo[0] == s0 && weo[1] == e0) {
		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;
	}

	if(e1 <= s1) return 0;

	

	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;
		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
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq 0x58(%rbp), %rax
movq 0x50(%rbp), %rax
movq 0x48(%rbp), %rax
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
shrq $0x21, %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq 0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x110(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq -0x18(%rbp), %rcx
movl 0xc(%rcx), %ecx
subq %rcx, %rax
movq %rax, -0x80(%rbp)
movq $-0x1, -0x98(%rbp)
movq $-0x1, -0x90(%rbp)
movq $-0x1, -0xf8(%rbp)
movq $-0x1, -0x100(%rbp)
movq $-0x1, -0xe8(%rbp)
movq $-0x1, -0xf0(%rbp)
movq -0x88(%rbp), %rax
cmpq -0x80(%rbp), %rax
jg 0x1ae429
movq $0x0, -0x8(%rbp)
jmp 0x1aed04
cmpq $0x0, -0x70(%rbp)
jl 0x1ae43a
movq -0x70(%rbp), %rax
cmpq -0x78(%rbp), %rax
jle 0x1ae452
movq $0x0, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x70(%rbp)
jmp 0x1ae454
xorl %eax, %eax
cmpq $0x0, -0x70(%rbp)
movb %al, -0x11d(%rbp)
jle 0x1ae474
movq -0x60(%rbp), %rax
cmpq -0x80(%rbp), %rax
setge %al
movb %al, -0x11d(%rbp)
movb -0x11d(%rbp), %al
testb $0x1, %al
jne 0x1ae483
jmp 0x1ae56e
movq -0x70(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x70(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
sarl $0xe, %eax
movw %ax, -0x112(%rbp)
movzwl -0x112(%rbp), %eax
cmpl $0x2, %eax
je 0x1ae4c1
movzwl -0x112(%rbp), %eax
cmpl $0x3, %eax
jne 0x1ae4e1
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x70(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0xfff, %eax            # imm = 0xFFF
cltq
movq %rax, -0xc0(%rbp)
jmp 0x1ae52d
movzwl -0x112(%rbp), %eax
cmpl $0x1, %eax
jne 0x1ae50d
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x70(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x3ff, %eax            # imm = 0x3FF
cltq
movq %rax, -0xc0(%rbp)
jmp 0x1ae52b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x70(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x3fff, %eax           # imm = 0x3FFF
cltq
movq %rax, -0xc0(%rbp)
jmp 0x1ae52d
movzwl -0x112(%rbp), %eax
cmpl $0x2, %eax
je 0x1ae54b
movq -0xc0(%rbp), %rcx
movq -0x60(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x60(%rbp)
movzwl -0x112(%rbp), %eax
cmpl $0x3, %eax
je 0x1ae569
movq -0xc0(%rbp), %rcx
movq -0x68(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x68(%rbp)
jmp 0x1ae454
jmp 0x1ae570
movq -0x70(%rbp), %rcx
xorl %eax, %eax
cmpq -0x78(%rbp), %rcx
movb %al, -0x11e(%rbp)
jge 0x1ae596
movq -0x60(%rbp), %rax
cmpq -0x88(%rbp), %rax
setl %al
movb %al, -0x11e(%rbp)
movb -0x11e(%rbp), %al
testb $0x1, %al
jne 0x1ae5a5
jmp 0x1ae81e
movq -0x60(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x20(%rbp), %rdi
movq -0x70(%rbp), %rax
movl %eax, %esi
leaq -0x112(%rbp), %rdx
leaq -0x114(%rbp), %rcx
leaq -0x116(%rbp), %r8
leaq -0x11c(%rbp), %r9
callq 0x1b53f0
movl %eax, %eax
movq %rax, -0x70(%rbp)
movzwl -0x112(%rbp), %eax
cmpl $0x2, %eax
je 0x1ae606
movl -0x11c(%rbp), %eax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movzwl -0x112(%rbp), %eax
cmpl $0x3, %eax
je 0x1ae620
movl -0x11c(%rbp), %eax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x80(%rbp), %rax
cmpq -0xd0(%rbp), %rax
jl 0x1ae650
movq -0x80(%rbp), %rax
movq %rax, -0x128(%rbp)
jmp 0x1ae65e
movq -0xd0(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x88(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jg 0x1ae68c
movq -0x88(%rbp), %rax
movq %rax, -0x130(%rbp)
jmp 0x1ae69a
movq -0xc8(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
cmpq -0xa0(%rbp), %rax
jle 0x1ae6cf
movq -0xa8(%rbp), %rax
subq -0xa0(%rbp), %rax
movq %rax, -0x138(%rbp)
jmp 0x1ae6da
xorl %eax, %eax
movq %rax, -0x138(%rbp)
jmp 0x1ae6da
movq -0x138(%rbp), %rax
movq %rax, -0x108(%rbp)
movzwl -0x112(%rbp), %eax
cmpl $0x2, %eax
je 0x1ae705
cmpq $0x0, -0x108(%rbp)
jne 0x1ae703
jmp 0x1ae570
jmp 0x1ae729
movq -0xd0(%rbp), %rax
cmpq -0x80(%rbp), %rax
jl 0x1ae722
movq -0xd0(%rbp), %rax
cmpq -0x88(%rbp), %rax
jl 0x1ae727
jmp 0x1ae570
jmp 0x1ae729
movzwl -0x112(%rbp), %eax
cmpl $0x2, %eax
jge 0x1ae76f
movq -0xa0(%rbp), %rax
subq -0xd0(%rbp), %rax
addq -0xe0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rax
subq -0xd0(%rbp), %rax
addq -0xe0(%rbp), %rax
movq %rax, -0xb8(%rbp)
jmp 0x1ae78b
movq -0xe0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0xb8(%rbp)
cmpq $-0x1, -0x90(%rbp)
jne 0x1ae7a3
movq -0xb0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x98(%rbp)
movzwl -0x112(%rbp), %eax
cmpl $0x0, %eax
jne 0x1ae819
cmpq $0x0, -0x108(%rbp)
jle 0x1ae819
movq -0x108(%rbp), %rax
movq -0xe8(%rbp), %rcx
subq -0xf0(%rbp), %rcx
cmpq %rcx, %rax
jle 0x1ae819
movq -0xa0(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0xf8(%rbp)
jmp 0x1ae570
jmp 0x1ae820
movq -0x70(%rbp), %rcx
xorl %eax, %eax
cmpq -0x78(%rbp), %rcx
movb %al, -0x139(%rbp)
jge 0x1ae846
movq -0x60(%rbp), %rax
cmpq -0x88(%rbp), %rax
setle %al
movb %al, -0x139(%rbp)
movb -0x139(%rbp), %al
testb $0x1, %al
jne 0x1ae855
jmp 0x1ae960
movq -0x60(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x20(%rbp), %rdi
movq -0x70(%rbp), %rax
movl %eax, %esi
leaq -0x112(%rbp), %rdx
leaq -0x114(%rbp), %rcx
leaq -0x116(%rbp), %r8
leaq -0x11c(%rbp), %r9
callq 0x1b53f0
movzwl -0x112(%rbp), %eax
cmpl $0x2, %eax
je 0x1ae8a7
jmp 0x1ae960
movq -0x20(%rbp), %rdi
movq -0x70(%rbp), %rax
movl %eax, %esi
leaq -0x112(%rbp), %rdx
leaq -0x114(%rbp), %rcx
leaq -0x116(%rbp), %r8
leaq -0x11c(%rbp), %r9
callq 0x1b53f0
movl %eax, %eax
movq %rax, -0x70(%rbp)
movl -0x11c(%rbp), %eax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xd0(%rbp), %rax
cmpq -0x80(%rbp), %rax
jl 0x1ae95b
movq -0xd0(%rbp), %rax
cmpq -0x88(%rbp), %rax
jg 0x1ae95b
movq -0xe0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0xb8(%rbp)
cmpq $-0x1, -0x90(%rbp)
jne 0x1ae94d
movq -0xb0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x98(%rbp)
jmp 0x1ae820
movq -0xf8(%rbp), %rax
cmpq -0x110(%rbp), %rax
jg 0x1ae972
jmp 0x1ae991
leaq 0x1dd1ee(%rip), %rdi    # 0x38bb67
leaq 0x1dcf1f(%rip), %rsi    # 0x38b89f
movl $0xa2c, %edx            # imm = 0xA2C
leaq 0x1dd1e9(%rip), %rcx    # 0x38bb75
callq 0x2130
movq -0x98(%rbp), %rax
cmpq -0x110(%rbp), %rax
jg 0x1ae9a3
jmp 0x1ae9c2
leaq 0x1dd296(%rip), %rdi    # 0x38bc40
leaq 0x1dceee(%rip), %rsi    # 0x38b89f
movl $0xa2d, %edx            # imm = 0xA2D
leaq 0x1dd1b8(%rip), %rcx    # 0x38bb75
callq 0x2130
movq -0x60(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x68(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x70(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0xf0(%rbp), %rax
cmpq -0x80(%rbp), %rax
jne 0x1aea3e
movq -0xe8(%rbp), %rax
cmpq -0x88(%rbp), %rax
jne 0x1aea3e
movq -0x18(%rbp), %rax
movq (%rax), %rcx
shrq $0x20, %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
shlq $0x20, %rcx
movq %rcx, (%rax)
movq -0xf8(%rbp), %rcx
subq $0x1, %rcx
movq -0x18(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movq $0x1, -0x8(%rbp)
jmp 0x1aed04
movq -0x98(%rbp), %rax
cmpq -0x90(%rbp), %rax
jg 0x1aea5b
movq $0x0, -0x8(%rbp)
jmp 0x1aed04
movq -0x90(%rbp), %rax
movq 0x10(%rbp), %rcx
cmpq (%rcx), %rax
jl 0x1aea9e
movq -0x98(%rbp), %rax
movq 0x18(%rbp), %rcx
cmpq (%rcx), %rax
jg 0x1aea9e
movq 0x40(%rbp), %rax
movq (%rax), %rax
addq -0x90(%rbp), %rax
movq 0x10(%rbp), %rdx
xorl %ecx, %ecx
subq (%rdx), %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
jmp 0x1aec57
movq -0x90(%rbp), %rax
movq 0x10(%rbp), %rcx
cmpq (%rcx), %rax
jl 0x1aeba6
movq -0x90(%rbp), %rax
movq 0x18(%rbp), %rcx
cmpq (%rcx), %rax
jge 0x1aeba6
movq -0x98(%rbp), %rax
movq 0x18(%rbp), %rcx
cmpq (%rcx), %rax
jle 0x1aeba6
jmp 0x1aeadc
movq 0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
movq 0x10(%rbp), %rdx
subq (%rdx), %rcx
cmpq %rcx, %rax
jge 0x1aeb35
movq 0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x98(%rbp), %rsi
movq 0x10(%rbp), %rax
subq (%rax), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x98(%rbp), %rcx
movq 0x10(%rbp), %rax
subq (%rax), %rcx
movq 0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x1aeb37
movq 0x40(%rbp), %rax
movq (%rax), %rdi
movq 0x18(%rbp), %rax
addq (%rax), %rdi
movq 0x10(%rbp), %rcx
xorl %eax, %eax
subq (%rcx), %rax
addq %rax, %rdi
movq 0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x98(%rbp), %rdx
movq 0x18(%rbp), %rax
subq (%rax), %rdx
movq 0x38(%rbp), %r8
movq -0x40(%rbp), %r9
xorl %ecx, %ecx
callq 0x9a30
movq 0x40(%rbp), %rax
movq (%rax), %rax
addq -0x90(%rbp), %rax
movq 0x10(%rbp), %rdx
xorl %ecx, %ecx
subq (%rdx), %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x98(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x1aec55
jmp 0x1aeba8
movq 0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
subq -0x90(%rbp), %rcx
cmpq %rcx, %rax
jge 0x1aec01
movq 0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x98(%rbp), %rsi
subq -0x90(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x98(%rbp), %rcx
subq -0x90(%rbp), %rcx
movq 0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x1aec03
movq 0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x90(%rbp), %rsi
movq -0x98(%rbp), %rdx
subq -0x90(%rbp), %rdx
movq 0x38(%rbp), %r8
movq -0x40(%rbp), %r9
xorl %ecx, %ecx
callq 0x9a30
movq 0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x90(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x98(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x1aec57
movq -0x48(%rbp), %rdi
movq -0x98(%rbp), %rsi
subq -0x90(%rbp), %rsi
leaq 0x215b88(%rip), %rax    # 0x3c47f8
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, %edx
movq 0x20(%rbp), %rcx
movq 0x28(%rbp), %r8
movq 0x30(%rbp), %r9
leaq -0x50(%rbp), %r10
leaq -0x58(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1ad1c0
cmpq $0x0, %rax
je 0x1aecfc
movq -0x90(%rbp), %rax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
shrq $0x20, %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
shlq $0x20, %rcx
movq %rcx, (%rax)
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movq $0x1, -0x8(%rbp)
jmp 0x1aed04
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)