// File: chhylp123[P]hifiasm/anchor.cpp
// Function: recalu_minimizer_non_retrieve(unsigned long, anchor1_t*, asg16_v*, long*, long*, long*, unsigned long, unsigned long, tiny_queue_t*, char*, long, unsigned long)
uint64_t recalu_minimizer_non_retrieve(uint64_t rid, anchor1_t *z, asg16_v *sc, int64_t *iok, int64_t *ink, int64_t *ick, uint64_t mz_k, uint64_t mz_h, tiny_queue_t *tq, char *tstr, int64_t tl, uint64_t trev/** , char *qstr, uint64_t qs, uint64_t qe**/)
{
	char *str = NULL; uint64_t rpos, rspan; char c;
	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, k; 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;


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

	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;
    }

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

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

	*iok = ok; *ink = nk; *ick = ck; 

	rpos = rspan = ((uint64_t)-1);
	if(weo[0] == s0 && weo[1] == e0) {
		rpos = wen[1]-1; rspan = e0 - s0;
		// 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(e1 <= s1) return 0;
		// if(s1 >= tl || e1 >= tl) return 0;
		
		if(trev) str = tstr + tl - e1;
		else str = tstr + s1; 

		if(recalu_minimizer0_adv(str, e1 - s1, !(asm_opt.flag & HA_F_NO_HPC), mz_k, mz_h, trev, 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;
		}
	}

	if(rpos != ((uint64_t)-1) && rspan != ((uint64_t)-1)) {
		e0 = rpos + 1; s0 = e0 - rspan;
		if(!(asm_opt.flag & HA_F_NO_HPC)) {
			if(!trev) {
				s1 = s0; e1 = e0; 
			} else {
				s1 = tl - e0; e1 = tl - s0;
			}

			c = tstr[s1];
			for (k = s1 - 1; k >= 0 && tstr[k] == c; k--); s1 = k + 1;

			c = tstr[e1-1];
			for (k = e1; k < tl && tstr[k] == c; k++); e1 = k;

			if(!trev) {
				s0 = s1; e0 = e1; 
			} else {
				s0 = tl - e1; e0 = tl - s1;
			}
		}
		
		rpos = e0 - 1; rspan = e0 - s0;
		if(rspan < 256) {
			z->srt >>= 32; z->srt <<= 32; z->srt |= rpos; z->other_off = rspan;
			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 $0x160, %rsp            # imm = 0x160
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 $0x0, -0x40(%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 -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 0x1b0123
movq $0x0, -0x8(%rbp)
jmp 0x1b0a34
cmpq $0x0, -0x70(%rbp)
jl 0x1b0134
movq -0x70(%rbp), %rax
cmpq -0x78(%rbp), %rax
jle 0x1b014c
movq $0x0, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x70(%rbp)
jmp 0x1b014e
xorl %eax, %eax
cmpq $0x0, -0x70(%rbp)
movb %al, -0x11d(%rbp)
jle 0x1b016e
movq -0x60(%rbp), %rax
cmpq -0x80(%rbp), %rax
setge %al
movb %al, -0x11d(%rbp)
movb -0x11d(%rbp), %al
testb $0x1, %al
jne 0x1b017d
jmp 0x1b0268
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 0x1b01bb
movzwl -0x112(%rbp), %eax
cmpl $0x3, %eax
jne 0x1b01db
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 0x1b0227
movzwl -0x112(%rbp), %eax
cmpl $0x1, %eax
jne 0x1b0207
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 0x1b0225
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 0x1b0227
movzwl -0x112(%rbp), %eax
cmpl $0x2, %eax
je 0x1b0245
movq -0xc0(%rbp), %rcx
movq -0x60(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x60(%rbp)
movzwl -0x112(%rbp), %eax
cmpl $0x3, %eax
je 0x1b0263
movq -0xc0(%rbp), %rcx
movq -0x68(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x68(%rbp)
jmp 0x1b014e
jmp 0x1b026a
movq -0x70(%rbp), %rcx
xorl %eax, %eax
cmpq -0x78(%rbp), %rcx
movb %al, -0x11e(%rbp)
jge 0x1b0290
movq -0x60(%rbp), %rax
cmpq -0x88(%rbp), %rax
setl %al
movb %al, -0x11e(%rbp)
movb -0x11e(%rbp), %al
testb $0x1, %al
jne 0x1b029f
jmp 0x1b0518
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 0x1b0300
movl -0x11c(%rbp), %eax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movzwl -0x112(%rbp), %eax
cmpl $0x3, %eax
je 0x1b031a
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 0x1b034a
movq -0x80(%rbp), %rax
movq %rax, -0x128(%rbp)
jmp 0x1b0358
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 0x1b0386
movq -0x88(%rbp), %rax
movq %rax, -0x130(%rbp)
jmp 0x1b0394
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 0x1b03c9
movq -0xa8(%rbp), %rax
subq -0xa0(%rbp), %rax
movq %rax, -0x138(%rbp)
jmp 0x1b03d4
xorl %eax, %eax
movq %rax, -0x138(%rbp)
jmp 0x1b03d4
movq -0x138(%rbp), %rax
movq %rax, -0x108(%rbp)
movzwl -0x112(%rbp), %eax
cmpl $0x2, %eax
je 0x1b03ff
cmpq $0x0, -0x108(%rbp)
jne 0x1b03fd
jmp 0x1b026a
jmp 0x1b0423
movq -0xd0(%rbp), %rax
cmpq -0x80(%rbp), %rax
jl 0x1b041c
movq -0xd0(%rbp), %rax
cmpq -0x88(%rbp), %rax
jl 0x1b0421
jmp 0x1b026a
jmp 0x1b0423
movzwl -0x112(%rbp), %eax
cmpl $0x2, %eax
jge 0x1b0469
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 0x1b0485
movq -0xe0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0xb8(%rbp)
cmpq $-0x1, -0x90(%rbp)
jne 0x1b049d
movq -0xb0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x98(%rbp)
movzwl -0x112(%rbp), %eax
cmpl $0x0, %eax
jne 0x1b0513
cmpq $0x0, -0x108(%rbp)
jle 0x1b0513
movq -0x108(%rbp), %rax
movq -0xe8(%rbp), %rcx
subq -0xf0(%rbp), %rcx
cmpq %rcx, %rax
jle 0x1b0513
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 0x1b026a
jmp 0x1b051a
movq -0x70(%rbp), %rcx
xorl %eax, %eax
cmpq -0x78(%rbp), %rcx
movb %al, -0x139(%rbp)
jge 0x1b0540
movq -0x60(%rbp), %rax
cmpq -0x88(%rbp), %rax
setle %al
movb %al, -0x139(%rbp)
movb -0x139(%rbp), %al
testb $0x1, %al
jne 0x1b054f
jmp 0x1b065a
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 0x1b05a1
jmp 0x1b065a
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 0x1b0655
movq -0xd0(%rbp), %rax
cmpq -0x88(%rbp), %rax
jg 0x1b0655
movq -0xe0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0xb8(%rbp)
cmpq $-0x1, -0x90(%rbp)
jne 0x1b0647
movq -0xb0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x98(%rbp)
jmp 0x1b051a
movq -0xf8(%rbp), %rax
cmpq 0x30(%rbp), %rax
jg 0x1b0669
jmp 0x1b0688
leaq 0x1db6e6(%rip), %rdi    # 0x38bd56
leaq 0x1db228(%rip), %rsi    # 0x38b89f
movl $0xbbc, %edx            # imm = 0xBBC
leaq 0x1db6e0(%rip), %rcx    # 0x38bd63
callq 0x2130
movq -0x98(%rbp), %rax
cmpq 0x30(%rbp), %rax
jg 0x1b0697
jmp 0x1b06b6
leaq 0x1db76e(%rip), %rdi    # 0x38be0c
leaq 0x1db1fa(%rip), %rsi    # 0x38b89f
movl $0xbbd, %edx            # imm = 0xBBD
leaq 0x1db6b2(%rip), %rcx    # 0x38bd63
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 $-0x1, -0x50(%rbp)
movq $-0x1, -0x48(%rbp)
movq -0xf0(%rbp), %rax
cmpq -0x80(%rbp), %rax
jne 0x1b0727
movq -0xe8(%rbp), %rax
cmpq -0x88(%rbp), %rax
jne 0x1b0727
movq -0xf8(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x88(%rbp), %rax
subq -0x80(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x1b07e3
movq -0x98(%rbp), %rax
cmpq -0x90(%rbp), %rax
jg 0x1b0744
movq $0x0, -0x8(%rbp)
jmp 0x1b0a34
cmpq $0x0, 0x38(%rbp)
je 0x1b0765
movq 0x28(%rbp), %rax
addq 0x30(%rbp), %rax
xorl %ecx, %ecx
subq -0x98(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
jmp 0x1b0774
movq 0x28(%rbp), %rax
addq -0x90(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x98(%rbp), %rsi
subq -0x90(%rbp), %rsi
leaq 0x21406b(%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 0x10(%rbp), %rcx
movq 0x18(%rbp), %r8
movq 0x38(%rbp), %r9
movq 0x20(%rbp), %r11
leaq -0x48(%rbp), %r10
leaq -0x50(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1ad870
cmpq $0x0, %rax
je 0x1b07e1
movq -0x90(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x1b07e3
cmpq $-0x1, -0x48(%rbp)
je 0x1b0a2c
cmpq $-0x1, -0x50(%rbp)
je 0x1b0a2c
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
subq -0x50(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq 0x213fda(%rip), %rax    # 0x3c47f8
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1b09c1
cmpq $0x0, 0x38(%rbp)
jne 0x1b084e
movq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
jmp 0x1b086f
movq 0x30(%rbp), %rax
subq -0x88(%rbp), %rax
movq %rax, -0x90(%rbp)
movq 0x30(%rbp), %rax
subq -0x80(%rbp), %rax
movq %rax, -0x98(%rbp)
movq 0x28(%rbp), %rax
movq -0x90(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x51(%rbp)
movq -0x90(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x110(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x110(%rbp)
movb %al, -0x13a(%rbp)
jl 0x1b08c2
movq 0x28(%rbp), %rax
movq -0x110(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movsbl -0x51(%rbp), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x13a(%rbp)
movb -0x13a(%rbp), %al
testb $0x1, %al
jne 0x1b08ce
jmp 0x1b08e4
jmp 0x1b08d0
movq -0x110(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x110(%rbp)
jmp 0x1b0892
movq -0x110(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
movq 0x28(%rbp), %rax
movq -0x98(%rbp), %rcx
subq $0x1, %rcx
movb (%rax,%rcx), %al
movb %al, -0x51(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rcx
xorl %eax, %eax
cmpq 0x30(%rbp), %rcx
movb %al, -0x13b(%rbp)
jge 0x1b094c
movq 0x28(%rbp), %rax
movq -0x110(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movsbl -0x51(%rbp), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x13b(%rbp)
movb -0x13b(%rbp), %al
testb $0x1, %al
jne 0x1b0958
jmp 0x1b096e
jmp 0x1b095a
movq -0x110(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x110(%rbp)
jmp 0x1b0919
movq -0x110(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpq $0x0, 0x38(%rbp)
jne 0x1b099e
movq -0x90(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x1b09bf
movq 0x30(%rbp), %rax
subq -0x98(%rbp), %rax
movq %rax, -0x80(%rbp)
movq 0x30(%rbp), %rax
subq -0x90(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x1b09c1
movq -0x88(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x88(%rbp), %rax
subq -0x80(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x100, -0x50(%rbp)     # imm = 0x100
jae 0x1b0a2a
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 -0x48(%rbp), %rcx
movq -0x18(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movq -0x50(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movq $0x1, -0x8(%rbp)
jmp 0x1b0a34
jmp 0x1b0a2c
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopw %cs:(%rax,%rax)