// File: chhylp123[P]hifiasm/anchor.cpp
// Function: gen_pair_chain(ha_abufl_s*, unsigned long, st_mt_t*, unsigned long, ha_mzl_t*, unsigned long, ha_mzl_t*, long, unsigned long)
void gen_pair_chain(ha_abufl_t *ab, uint64_t rid, st_mt_t *tid, uint64_t tid_n, ha_mzl_t *in, uint64_t in_n, ha_mzl_t *idx, int64_t idx_n, uint64_t mzl_cutoff)
{
	if(!tid_n) return;
	uint64_t i, l, k, n, m, rev, x, tn, kn; ha_mzl_t *z, *p, *y; int64_t zi, ns, ne; anchor1_t *an;
	for (i = tn = 0; i < in_n; ++i) {
		///z is one of the minimizer
		z = &in[i]; p = &(idx[z->x]); n = 0;
		assert(z->pos == p->pos && z->rid == p->rid && z->span == p->span && z->rev == p->rev);
		for (zi = z->x+1; zi < idx_n && idx[zi].x == p->x && n < mzl_cutoff; zi++) {
			if(idx[zi].rid == rid) continue; 
			x = idx[zi].rid; x <<= 1; x |= ((uint64_t)((z->rev == idx[zi].rev)?0:1));
			for (m = 0; m < tid_n; m++) {
				if(tid->a[m] == x) {
					n++; break;
				}
			}
		}
		for (zi = ((int64_t)z->x)-1; zi >= 0 && idx[zi].x == p->x && n < mzl_cutoff; zi--) {
			if(idx[zi].rid == rid) continue; 
			x = idx[zi].rid; x <<= 1; x |= ((uint64_t)((z->rev == idx[zi].rev)?0:1));
			for (m = 0; m < tid_n; m++) {
				if(tid->a[m] == x) {
					n++; break;
				}
			}
		}
		if((!n) || (n >= mzl_cutoff)) continue;
		tn += n;
	}
	if(!tn) return;
	ab->n_a += tn;
	if (ab->n_a > ab->m_a) {
		ab->m_a = ab->n_a;
		REALLOC(ab->a, ab->m_a);
	}


	for (i = 0, k = ab->n_a - tn; i < in_n; ++i) {
		///z is one of the minimizer
		z = &in[i]; p = &(idx[z->x]); n = 0; ns = 0; ne = -1;
		for (zi = z->x+1; zi < idx_n && idx[zi].x == p->x && n < mzl_cutoff; zi++) {
			if(idx[zi].rid == rid) continue; 
			x = idx[zi].rid; x <<= 1; x |= ((uint64_t)((z->rev == idx[zi].rev)?0:1));
			for (m = 0; m < tid_n; m++) {
				if(tid->a[m] == x) {
					n++; break;
				}
			}
		}
		ne = zi;
		for (zi = ((int64_t)z->x)-1; zi >= 0 && idx[zi].x == p->x && n < mzl_cutoff; zi--) {
			if(idx[zi].rid == rid) continue; 
			x = idx[zi].rid; x <<= 1; x |= ((uint64_t)((z->rev == idx[zi].rev)?0:1));
			for (m = 0; m < tid_n; m++) {
				if(tid->a[m] == x) {
					n++; break;
				}
			}
		}
		ns = zi + 1; 
		if((!n) || (n >= mzl_cutoff)) continue;
		n = ne - ns; if(n > ((uint32_t)(0xffffffu))) n = 0xffffffu; n<<=8;

		for (zi = z->x+1; zi < idx_n && idx[zi].x == p->x; zi++) {
			if(idx[zi].rid == rid) continue; 
			x = idx[zi].rid; x <<= 1; x |= ((uint64_t)((z->rev == idx[zi].rev)?0:1));
			for (m = 0; m < tid_n; m++) {
				if(tid->a[m] == x) break;
			}
			if(m >= tid_n) continue; 


			y = &(idx[zi]); an = &ab->a[k++];
			rev = z->rev == y->rev? 0 : 1;
			an->other_off = rev?((uint32_t)-1)-1-(y->pos+1-y->span):y->pos;
			an->self_off = z->pos;
			///an->cnt: cnt<<8|span
			an->cnt = ((z->span <= ((uint32_t)(0xffu)))?z->span:((uint32_t)(0xffu))); an->cnt |= n;
			an->srt = (uint64_t)y->rid<<33 | (uint64_t)rev<<32 | an->self_off;
		}
		for (zi = ((int64_t)z->x)-1; zi >= 0 && idx[zi].x == p->x; zi--) {
			if(idx[zi].rid == rid) continue; 
			x = idx[zi].rid; x <<= 1; x |= ((uint64_t)((z->rev == idx[zi].rev)?0:1));
			for (m = 0; m < tid_n; m++) {
				if(tid->a[m] == x) break;
			}
			if(m >= tid_n) continue; 



			y = &(idx[zi]); an = &ab->a[k++];
			rev = z->rev == y->rev? 0 : 1;
			an->other_off = rev?((uint32_t)-1)-1-(y->pos+1-y->span):y->pos;
			an->self_off = z->pos;
			///an->cnt: cnt<<8|span
			an->cnt = ((z->span <= ((uint32_t)(0xffu)))?z->span:((uint32_t)(0xffu))); an->cnt |= n;
			an->srt = (uint64_t)y->rid<<33 | (uint64_t)rev<<32 | an->self_off;
		}
	}
	assert(k == ab->n_a);
	radix_sort_ha_an1(ab->a + ab->n_a - tn, ab->a + ab->n_a); kn = 0;
	for (k = ab->n_a - tn + 1, l = ab->n_a - tn; k <= ab->n_a; ++k) {
		if (k == ab->n_a || (ab->a[k].srt>>32) != (ab->a[l].srt>>32)) {
			for (; kn < tid_n && tid->a[kn] < (ab->a[l].srt>>32); kn++);
			if(kn < tid_n && tid->a[kn] == (ab->a[l].srt>>32)) kv_push(uint64_t, *tid, l);
			for (; kn < tid_n && tid->a[kn] == (ab->a[l].srt>>32); kn++);
			l = k;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1a6a9b
jmp 0x1a7aa5
movq $0x0, -0x70(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x1a6ea2
movq -0x28(%rbp), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq 0x10(%rbp), %rax
movq -0x80(%rbp), %rcx
imulq $0x18, (%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq -0x88(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
movl %eax, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0xb1(%rbp)
jne 0x1a6b8e
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movl %eax, %ecx
movq -0x88(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movl %eax, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0xb1(%rbp)
jne 0x1a6b8e
movq -0x80(%rbp), %rax
movzbl 0x10(%rax), %ecx
movq -0x88(%rbp), %rax
movzbl 0x10(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0xb1(%rbp)
jne 0x1a6b8e
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movq -0x88(%rbp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x1f, %rcx
andq $0x1, %rcx
cmpl %ecx, %eax
sete %al
movb %al, -0xb1(%rbp)
movb -0xb1(%rbp), %al
testb $0x1, %al
jne 0x1a6b9a
jmp 0x1a6b9c
jmp 0x1a6bbb
leaq 0x1e4cad(%rip), %rdi    # 0x38b850
leaq 0x1e4cf5(%rip), %rsi    # 0x38b89f
movl $0x50b, %edx            # imm = 0x50B
leaq 0x1e4cf4(%rip), %rcx    # 0x38b8aa
callq 0x2130
movq -0x80(%rbp), %rax
movq (%rax), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rcx
xorl %eax, %eax
cmpq 0x18(%rbp), %rcx
movb %al, -0xb2(%rbp)
jge 0x1a6c19
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x88(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0xb2(%rbp)
jne 0x1a6c19
movq -0x50(%rbp), %rax
cmpq 0x20(%rbp), %rax
setb %al
movb %al, -0xb2(%rbp)
movb -0xb2(%rbp), %al
testb $0x1, %al
jne 0x1a6c28
jmp 0x1a6d18
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
cmpq -0x10(%rbp), %rax
jne 0x1a6c4c
jmp 0x1a6d01
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shlq %rax
movq %rax, -0x68(%rbp)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %edx
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %esi
movl $0x1, %eax
xorl %ecx, %ecx
cmpl %esi, %edx
cmovel %ecx, %eax
cltq
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x1a6cff
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x68(%rbp), %rax
jne 0x1a6cef
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x1a6cff
jmp 0x1a6cf1
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1a6cc1
jmp 0x1a6d01
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x1a6bcd
movq -0x80(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rax
movq %rax, -0x98(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x98(%rbp)
movb %al, -0xb3(%rbp)
jl 0x1a6d73
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x88(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0xb3(%rbp)
jne 0x1a6d73
movq -0x50(%rbp), %rax
cmpq 0x20(%rbp), %rax
setb %al
movb %al, -0xb3(%rbp)
movb -0xb3(%rbp), %al
testb $0x1, %al
jne 0x1a6d82
jmp 0x1a6e72
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
cmpq -0x10(%rbp), %rax
jne 0x1a6da6
jmp 0x1a6e5b
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shlq %rax
movq %rax, -0x68(%rbp)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %edx
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %esi
movl $0x1, %eax
xorl %ecx, %ecx
cmpl %esi, %edx
cmovel %ecx, %eax
cltq
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x1a6e59
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x68(%rbp), %rax
jne 0x1a6e49
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x1a6e59
jmp 0x1a6e4b
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1a6e1b
jmp 0x1a6e5b
movq -0x98(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x1a6d2a
cmpq $0x0, -0x50(%rbp)
je 0x1a6e83
movq -0x50(%rbp), %rax
cmpq 0x20(%rbp), %rax
jb 0x1a6e85
jmp 0x1a6e91
movq -0x50(%rbp), %rax
addq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1a6aab
cmpq $0x0, -0x70(%rbp)
jne 0x1a6eae
jmp 0x1a7aa5
movq -0x70(%rbp), %rcx
movq -0x8(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x1a6efd
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x8(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
subq -0x70(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x1a780b
movq -0x28(%rbp), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq 0x10(%rbp), %rax
movq -0x80(%rbp), %rcx
imulq $0x18, (%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0xa0(%rbp)
movq $-0x1, -0xa8(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rcx
xorl %eax, %eax
cmpq 0x18(%rbp), %rcx
movb %al, -0xb4(%rbp)
jge 0x1a6fc4
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x88(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0xb4(%rbp)
jne 0x1a6fc4
movq -0x50(%rbp), %rax
cmpq 0x20(%rbp), %rax
setb %al
movb %al, -0xb4(%rbp)
movb -0xb4(%rbp), %al
testb $0x1, %al
jne 0x1a6fd3
jmp 0x1a70c3
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
cmpq -0x10(%rbp), %rax
jne 0x1a6ff7
jmp 0x1a70ac
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shlq %rax
movq %rax, -0x68(%rbp)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %edx
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %esi
movl $0x1, %eax
xorl %ecx, %ecx
cmpl %esi, %edx
cmovel %ecx, %eax
cltq
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x1a70aa
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x68(%rbp), %rax
jne 0x1a709a
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x1a70aa
jmp 0x1a709c
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1a706c
jmp 0x1a70ac
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x1a6f78
movq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rax
movq %rax, -0x98(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x98(%rbp)
movb %al, -0xb5(%rbp)
jl 0x1a712c
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x88(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0xb5(%rbp)
jne 0x1a712c
movq -0x50(%rbp), %rax
cmpq 0x20(%rbp), %rax
setb %al
movb %al, -0xb5(%rbp)
movb -0xb5(%rbp), %al
testb $0x1, %al
jne 0x1a713b
jmp 0x1a722b
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
cmpq -0x10(%rbp), %rax
jne 0x1a715f
jmp 0x1a7214
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shlq %rax
movq %rax, -0x68(%rbp)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %edx
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %esi
movl $0x1, %eax
xorl %ecx, %ecx
cmpl %esi, %edx
cmovel %ecx, %eax
cltq
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x1a7212
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x68(%rbp), %rax
jne 0x1a7202
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x1a7212
jmp 0x1a7204
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1a71d4
jmp 0x1a7214
movq -0x98(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x1a70e3
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x1a724e
movq -0x50(%rbp), %rax
cmpq 0x20(%rbp), %rax
jb 0x1a7253
jmp 0x1a77fa
movq -0xa8(%rbp), %rax
subq -0xa0(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0xffffff, -0x50(%rbp)  # imm = 0xFFFFFF
jbe 0x1a7277
movq $0xffffff, -0x50(%rbp)  # imm = 0xFFFFFF
movq -0x50(%rbp), %rax
shlq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rcx
xorl %eax, %eax
cmpq 0x18(%rbp), %rcx
movb %al, -0xb6(%rbp)
jge 0x1a72cf
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x88(%rbp), %rcx
cmpq (%rcx), %rax
sete %al
movb %al, -0xb6(%rbp)
movb -0xb6(%rbp), %al
testb $0x1, %al
jne 0x1a72de
jmp 0x1a753f
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
cmpq -0x10(%rbp), %rax
jne 0x1a7302
jmp 0x1a7528
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shlq %rax
movq %rax, -0x68(%rbp)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %edx
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %esi
movl $0x1, %eax
xorl %ecx, %ecx
cmpl %esi, %edx
cmovel %ecx, %eax
cltq
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x1a73a9
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x68(%rbp), %rax
jne 0x1a7399
jmp 0x1a73a9
jmp 0x1a739b
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1a7377
movq -0x58(%rbp), %rax
cmpq -0x20(%rbp), %rax
jb 0x1a73b8
jmp 0x1a7528
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x48(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x48(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %edx
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %esi
movl $0x1, %eax
xorl %ecx, %ecx
cmpl %esi, %edx
cmovel %ecx, %eax
cltq
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x1a7463
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
movl %eax, %ecx
addl $0x1, %ecx
movq -0x90(%rbp), %rax
movzbl 0x10(%rax), %eax
subl %eax, %ecx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
subl %ecx, %eax
movl %eax, -0xbc(%rbp)
jmp 0x1a7478
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %ecx
movq -0xb0(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq -0xb0(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x80(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0xff, %eax
ja 0x1a74bf
movq -0x80(%rbp), %rax
movzbl 0x10(%rax), %eax
movl %eax, -0xc0(%rbp)
jmp 0x1a74cc
movl $0xff, %eax
movl %eax, -0xc0(%rbp)
jmp 0x1a74cc
movl -0xc0(%rbp), %ecx
movq -0xb0(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x50(%rbp), %rdx
movq -0xb0(%rbp), %rax
movl 0x10(%rax), %ecx
orq %rdx, %rcx
movl %ecx, 0x10(%rax)
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rcx
andq $0x7fffffff, %rcx       # imm = 0x7FFFFFFF
shlq $0x21, %rcx
movq -0x60(%rbp), %rax
shlq $0x20, %rax
orq %rax, %rcx
movq -0xb0(%rbp), %rax
movl 0x8(%rax), %eax
orq %rax, %rcx
movq -0xb0(%rbp), %rax
movq %rcx, (%rax)
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x1a7295
movq -0x80(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rax
movq %rax, -0x98(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x98(%rbp)
movb %al, -0xc1(%rbp)
jl 0x1a7588
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x88(%rbp), %rcx
cmpq (%rcx), %rax
sete %al
movb %al, -0xc1(%rbp)
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0x1a7597
jmp 0x1a77f8
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
cmpq -0x10(%rbp), %rax
jne 0x1a75bb
jmp 0x1a77e1
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shlq %rax
movq %rax, -0x68(%rbp)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %edx
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %esi
movl $0x1, %eax
xorl %ecx, %ecx
cmpl %esi, %edx
cmovel %ecx, %eax
cltq
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x1a7662
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x68(%rbp), %rax
jne 0x1a7652
jmp 0x1a7662
jmp 0x1a7654
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1a7630
movq -0x58(%rbp), %rax
cmpq -0x20(%rbp), %rax
jb 0x1a7671
jmp 0x1a77e1
movq 0x10(%rbp), %rax
imulq $0x18, -0x98(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x48(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x48(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %edx
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %esi
movl $0x1, %eax
xorl %ecx, %ecx
cmpl %esi, %edx
cmovel %ecx, %eax
cltq
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x1a771c
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
movl %eax, %ecx
addl $0x1, %ecx
movq -0x90(%rbp), %rax
movzbl 0x10(%rax), %eax
subl %eax, %ecx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
subl %ecx, %eax
movl %eax, -0xc8(%rbp)
jmp 0x1a7731
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
movl %eax, -0xc8(%rbp)
movl -0xc8(%rbp), %ecx
movq -0xb0(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq -0xb0(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x80(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0xff, %eax
ja 0x1a7778
movq -0x80(%rbp), %rax
movzbl 0x10(%rax), %eax
movl %eax, -0xcc(%rbp)
jmp 0x1a7785
movl $0xff, %eax
movl %eax, -0xcc(%rbp)
jmp 0x1a7785
movl -0xcc(%rbp), %ecx
movq -0xb0(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x50(%rbp), %rdx
movq -0xb0(%rbp), %rax
movl 0x10(%rax), %ecx
orq %rdx, %rcx
movl %ecx, 0x10(%rax)
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rcx
andq $0x7fffffff, %rcx       # imm = 0x7FFFFFFF
shlq $0x21, %rcx
movq -0x60(%rbp), %rax
shlq $0x20, %rax
orq %rax, %rcx
movq -0xb0(%rbp), %rax
movl 0x8(%rax), %eax
orq %rax, %rcx
movq -0xb0(%rbp), %rax
movq %rcx, (%rax)
movq -0x98(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x1a7551
jmp 0x1a77fa
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1a6f14
movq -0x48(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jne 0x1a781a
jmp 0x1a7839
leaq 0x1e40ff(%rip), %rdi    # 0x38b920
leaq 0x1e4077(%rip), %rsi    # 0x38b89f
movl $0x567, %edx            # imm = 0x567
leaq 0x1e4076(%rip), %rcx    # 0x38b8aa
callq 0x2130
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x8(%rbp), %rax
imulq $0x18, (%rax), %rax
addq %rax, %rdi
xorl %eax, %eax
subq -0x70(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
movq -0x8(%rbp), %rax
imulq $0x18, (%rax), %rax
addq %rax, %rsi
callq 0x19c150
movq $0x0, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
subq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
subq -0x70(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
ja 0x1a7aa5
movq -0x48(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
je 0x1a78f0
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
imulq $0x18, -0x48(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rcx
imulq $0x18, -0x40(%rbp), %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
je 0x1a7a92
jmp 0x1a78f2
movq -0x78(%rbp), %rcx
xorl %eax, %eax
cmpq -0x20(%rbp), %rcx
movb %al, -0xcd(%rbp)
jae 0x1a7937
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rcx
imulq $0x18, -0x40(%rbp), %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
setb %al
movb %al, -0xcd(%rbp)
movb -0xcd(%rbp), %al
testb $0x1, %al
jne 0x1a7943
jmp 0x1a7953
jmp 0x1a7945
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x1a78f2
movq -0x78(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x1a7a27
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rcx
imulq $0x18, -0x40(%rbp), %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
jne 0x1a7a27
jmp 0x1a7993
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1a7a04
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1a79c3
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xd8(%rbp)
jmp 0x1a79d1
movl $0x2, %eax
movq %rax, -0xd8(%rbp)
jmp 0x1a79d1
movq -0xd8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x1a7a27
jmp 0x1a7a29
movq -0x78(%rbp), %rcx
xorl %eax, %eax
cmpq -0x20(%rbp), %rcx
movb %al, -0xd9(%rbp)
jae 0x1a7a6e
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rcx
imulq $0x18, -0x40(%rbp), %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
sete %al
movb %al, -0xd9(%rbp)
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x1a7a7a
jmp 0x1a7a8a
jmp 0x1a7a7c
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x1a7a29
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x1a7a94
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x1a789b
addq $0xe0, %rsp
popq %rbp
retq
nop