// File: chhylp123[P]hifiasm/tovlp.cpp
// Function: pt_sketch(char const*, int, int, int, unsigned int, int, pt_mz1_v*)
void pt_sketch(const char *str, int len, int w, int k, uint32_t rid, int is_hpc, pt_mz1_v *p)
{
    static const pt_mz1_t dummy = { UINT64_MAX, (1<<28) - 1, 0, 0 };
	uint64_t shift1 = k - 1, mask = (1ULL<<k) - 1, kmer[4] = {0,0,0,0};
	int i, j, l, buf_pos, min_pos, kmer_span = 0;
	pt_mz1_t buf[256], min = dummy;
	tiny_queue_t tq;
    assert(len > 0 && rid < (uint64_t)1<<32 && (w > 0 && w < 256) && (k > 0 && k <= 63));

    memset(buf, 0xff, w * sizeof(pt_mz1_t));
    memset(&tq, 0, sizeof(tiny_queue_t));
	kv_resize(pt_mz1_t, *p, p->n + len/w);

    for (i = l = buf_pos = min_pos = 0; i < len; ++i) {
		int c = seq_nt4_table[(uint8_t)str[i]];
		pt_mz1_t info = dummy;
		if (c < 4) { // not an ambiguous base
			int z;
			if (is_hpc) {
				int skip_len = 1;
				if (i + 1 < len && seq_nt4_table[(uint8_t)str[i + 1]] == c) {
					for (skip_len = 2; i + skip_len < len; ++skip_len)
						if (seq_nt4_table[(uint8_t)str[i + skip_len]] != c)
							break;
					i += skip_len - 1; // put $i at the end of the current homopolymer run
				}
				tq_push(&tq, skip_len);
				kmer_span += skip_len;
				if (tq.count > k) kmer_span -= tq_shift(&tq);
			} else kmer_span = l + 1 < k? l + 1 : k; 

			kmer[0] = (kmer[0] << 1 | (c&1))  & mask;                  // forward k-mer
			kmer[1] = (kmer[1] << 1 | (c>>1)) & mask;
			kmer[2] = kmer[2] >> 1 | (uint64_t)(1 - (c&1))  << shift1; // reverse k-mer
			kmer[3] = kmer[3] >> 1 | (uint64_t)(1 - (c>>1)) << shift1;
			if (kmer[1] == kmer[3]) continue; // skip "symmetric k-mers" as we don't know its strand
			z = kmer[1] < kmer[3]? 0 : 1; // strand
			++l;
			if (l >= k && kmer_span < 256) {
				uint64_t y;
				y = yak_hash64_64(kmer[z<<1|0]) + yak_hash64_64(kmer[z<<1|1]);
				info.x = y, info.rid = rid, info.pos = i, info.rev = z, info.span = kmer_span; // initially pt_mz1_t::rid keeps the k-mer count
			}
		} else l = 0, tq.count = tq.front = 0, kmer_span = 0;

		buf[buf_pos] = info; // need to do this here as appropriate buf_pos and buf[buf_pos] are needed below
		if (l == w + k - 1 && min.x != UINT64_MAX) { // special case for the first window - because identical k-mers are not stored yet
			for (j = buf_pos + 1; j < w; ++j)
				if (mzcmp(&min, &buf[j]) == 0 && buf[j].pos != min.pos) kv_push(pt_mz1_t, *p, buf[j]);
			for (j = 0; j < buf_pos; ++j)
				if (mzcmp(&min, &buf[j]) == 0 && buf[j].pos != min.pos) kv_push(pt_mz1_t, *p, buf[j]);
		}
		///three cases: 1. 
		if (info.x <= min.x) { // a new minimum; then write the old min
			if (l >= w + k && min.x != UINT64_MAX) kv_push(pt_mz1_t, *p, min);
			min = info, min_pos = buf_pos;
		} else if (buf_pos == min_pos) { // old min has moved outside the window
			if (l >= w + k - 1 && min.x != UINT64_MAX) kv_push(pt_mz1_t, *p, min);
			for (j = buf_pos + 1, min.x = UINT64_MAX; j < w; ++j) // the two loops are necessary when there are identical k-mers
				if (mzcmp(&min, &buf[j]) >= 0) min = buf[j], min_pos = j; // >= is important s.t. min is always the closest k-mer
			for (j = 0; j <= buf_pos; ++j)
				if (mzcmp(&min, &buf[j]) >= 0) min = buf[j], min_pos = j;

			if (l >= w + k - 1 && min.x != UINT64_MAX) { // write identical k-mers
				for (j = buf_pos + 1; j < w; ++j) // these two loops make sure the output is sorted
					if (mzcmp(&min, &buf[j]) == 0 && min.pos != buf[j].pos) kv_push(pt_mz1_t, *p, buf[j]);
				for (j = 0; j <= buf_pos; ++j)
					if (mzcmp(&min, &buf[j]) == 0 && min.pos != buf[j].pos) kv_push(pt_mz1_t, *p, buf[j]);
			}
		}
		if (++buf_pos == w) buf_pos = 0;
	}
	if (min.x != UINT64_MAX)
		kv_push(pt_mz1_t, *p, min);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a00, %rsp           # imm = 0x1A00
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movl %r9d, -0x1c(%rbp)
movl -0x14(%rbp), %eax
subl $0x1, %eax
cltq
movq %rax, -0x28(%rbp)
movl -0x14(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
subq $0x1, %rax
movq %rax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2100
movl $0x0, -0x68(%rbp)
movq 0x11a185(%rip), %rax    # 0x3906f8
movq %rax, -0x1888(%rbp)
movq 0x11a17f(%rip), %rax    # 0x390700
movq %rax, -0x1880(%rbp)
movq 0x11a179(%rip), %rax    # 0x390708
movq %rax, -0x1878(%rbp)
xorl %eax, %eax
cmpl $0x0, -0xc(%rbp)
movb %al, -0x19c1(%rbp)
jle 0x276606
movl -0x18(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
movabsq $0x100000000, %rdx      # imm = 0x100000000
cmpq %rdx, %rcx
movb %al, -0x19c1(%rbp)
jae 0x276606
xorl %eax, %eax
cmpl $0x0, -0x10(%rbp)
movb %al, -0x19c1(%rbp)
jle 0x276606
xorl %eax, %eax
cmpl $0x100, -0x10(%rbp)     # imm = 0x100
movb %al, -0x19c1(%rbp)
jge 0x276606
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x19c2(%rbp)
jle 0x2765fa
cmpl $0x3f, -0x14(%rbp)
setle %al
movb %al, -0x19c2(%rbp)
movb -0x19c2(%rbp), %al
movb %al, -0x19c1(%rbp)
movb -0x19c1(%rbp), %al
testb $0x1, %al
jne 0x276612
jmp 0x276614
jmp 0x276633
leaq 0x119ff8(%rip), %rdi    # 0x390613
leaq 0x11a03e(%rip), %rsi    # 0x390660
movl $0x5d4, %edx            # imm = 0x5D4
leaq 0x11a03c(%rip), %rcx    # 0x39066a
callq 0x2130
leaq -0x1870(%rbp), %rdi
movslq -0x10(%rbp), %rax
imulq $0x18, %rax, %rdx
movl $0xff, %esi
callq 0x2100
leaq -0x1990(%rbp), %rdi
xorl %esi, %esi
movl $0x108, %edx            # imm = 0x108
callq 0x2100
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x19c8(%rbp)
movq 0x10(%rbp), %rax
movl (%rax), %ecx
movl -0xc(%rbp), %eax
cltd
idivl -0x10(%rbp)
movl %eax, %edx
movl -0x19c8(%rbp), %eax
addl %edx, %ecx
cmpl %ecx, %eax
jae 0x276741
movq 0x10(%rbp), %rax
movl (%rax), %ecx
movl -0xc(%rbp), %eax
cltd
idivl -0x10(%rbp)
addl %eax, %ecx
movq 0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movl 0x4(%rax), %ecx
shrl %ecx
movq 0x10(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movl 0x4(%rax), %ecx
shrl $0x2, %ecx
movq 0x10(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movl 0x4(%rax), %ecx
shrl $0x4, %ecx
movq 0x10(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movl 0x4(%rax), %ecx
shrl $0x8, %ecx
movq 0x10(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movl 0x4(%rax), %ecx
shrl $0x10, %ecx
movq 0x10(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
imulq $0x18, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x276743
movl $0x0, -0x64(%rbp)
movl $0x0, -0x60(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x27734f
movq -0x8(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x114060(%rip), %rax    # 0x38a7e0
movzbl (%rax,%rcx), %eax
movl %eax, -0x1994(%rbp)
movq 0x119f7f(%rip), %rax    # 0x390710
movq %rax, -0x19b0(%rbp)
movq 0x119f79(%rip), %rax    # 0x390718
movq %rax, -0x19a8(%rbp)
movq 0x119f73(%rip), %rax    # 0x390720
movq %rax, -0x19a0(%rbp)
cmpl $0x4, -0x1994(%rbp)
jge 0x276acf
cmpl $0x0, -0x1c(%rbp)
je 0x2768b0
movl $0x1, -0x19b8(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
cmpl -0xc(%rbp), %eax
jge 0x27686f
movq -0x8(%rbp), %rax
movl -0x54(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x113fe2(%rip), %rax    # 0x38a7e0
movzbl (%rax,%rcx), %eax
cmpl -0x1994(%rbp), %eax
jne 0x27686f
movl $0x2, -0x19b8(%rbp)
movl -0x54(%rbp), %eax
addl -0x19b8(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x276860
movq -0x8(%rbp), %rax
movl -0x54(%rbp), %ecx
addl -0x19b8(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x113fa1(%rip), %rax    # 0x38a7e0
movzbl (%rax,%rcx), %eax
cmpl -0x1994(%rbp), %eax
je 0x27684d
jmp 0x276860
jmp 0x27684f
movl -0x19b8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x19b8(%rbp)
jmp 0x276814
movl -0x19b8(%rbp), %eax
subl $0x1, %eax
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x19b8(%rbp), %esi
leaq -0x1990(%rbp), %rdi
callq 0x277410
movl -0x19b8(%rbp), %eax
addl -0x68(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x198c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jle 0x2768ae
leaq -0x1990(%rbp), %rdi
callq 0x277450
movl %eax, %ecx
movl -0x68(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x68(%rbp)
jmp 0x2768db
movl -0x5c(%rbp), %eax
addl $0x1, %eax
cmpl -0x14(%rbp), %eax
jge 0x2768c9
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x19cc(%rbp)
jmp 0x2768d2
movl -0x14(%rbp), %eax
movl %eax, -0x19cc(%rbp)
movl -0x19cc(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x50(%rbp), %rax
shlq %rax
movl -0x1994(%rbp), %ecx
andl $0x1, %ecx
movslq %ecx, %rcx
orq %rcx, %rax
andq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
shlq %rax
movl -0x1994(%rbp), %ecx
sarl %ecx
movslq %ecx, %rcx
orq %rcx, %rax
andq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
shrq %rax
movl -0x1994(%rbp), %edx
andl $0x1, %edx
movl $0x1, %ecx
subl %edx, %ecx
movslq %ecx, %rdx
movq -0x28(%rbp), %rcx
shlq %cl, %rdx
movq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
shrq %rax
movl -0x1994(%rbp), %edx
sarl %edx
movl $0x1, %ecx
subl %edx, %ecx
movslq %ecx, %rdx
movq -0x28(%rbp), %rcx
shlq %cl, %rdx
movq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jne 0x27697a
jmp 0x277341
movq -0x48(%rbp), %rdx
movq -0x38(%rbp), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovbl %ecx, %eax
movl %eax, -0x19b4(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0x276acd
cmpl $0x100, -0x68(%rbp)     # imm = 0x100
jge 0x276acd
movl -0x19b4(%rbp), %eax
shll %eax
orl $0x0, %eax
cltq
movq -0x50(%rbp,%rax,8), %rdi
callq 0x2774b0
movq %rax, -0x19d8(%rbp)
movl -0x19b4(%rbp), %eax
shll %eax
orl $0x1, %eax
cltq
movq -0x50(%rbp,%rax,8), %rdi
callq 0x2774b0
movq %rax, %rcx
movq -0x19d8(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x19c0(%rbp)
movq -0x19c0(%rbp), %rax
movq %rax, -0x19b0(%rbp)
movl -0x18(%rbp), %eax
movl %eax, %ecx
movq -0x19a8(%rbp), %rax
movabsq $0xffffffff, %rdx       # imm = 0xFFFFFFFF
andq %rdx, %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
andq %rdx, %rax
orq %rcx, %rax
movq %rax, -0x19a8(%rbp)
movslq -0x54(%rbp), %rcx
movq -0x19a0(%rbp), %rax
movabsq $0x7fffffffffffffff, %rdx # imm = 0x7FFFFFFFFFFFFFFF
andq %rdx, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
andq %rdx, %rax
orq %rcx, %rax
movq %rax, -0x19a0(%rbp)
movslq -0x19b4(%rbp), %rcx
movq -0x19a0(%rbp), %rax
andq $0x1, %rcx
shlq $0x3f, %rcx
movabsq $0x7fffffffffffffff, %rdx # imm = 0x7FFFFFFFFFFFFFFF
andq %rdx, %rax
orq %rcx, %rax
movq %rax, -0x19a0(%rbp)
movslq -0x68(%rbp), %rcx
movq -0x19a8(%rbp), %rax
movabsq $0xffffffff, %rdx       # imm = 0xFFFFFFFF
andq %rdx, %rcx
shlq $0x20, %rcx
movabsq $0xffffffff, %rdx       # imm = 0xFFFFFFFF
andq %rdx, %rax
orq %rcx, %rax
movq %rax, -0x19a8(%rbp)
jmp 0x276af1
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x1990(%rbp)
movl $0x0, -0x198c(%rbp)
movl $0x0, -0x68(%rbp)
movslq -0x60(%rbp), %rcx
leaq -0x1870(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x19b0(%rbp), %rcx
movq %rcx, (%rax)
movq -0x19a8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x19a0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl -0x5c(%rbp), %eax
movl -0x10(%rbp), %ecx
addl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x276db3
cmpq $-0x1, -0x1888(%rbp)
je 0x276db3
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x276c7c
movslq -0x58(%rbp), %rax
leaq -0x1870(%rbp), %rsi
imulq $0x18, %rax, %rax
addq %rax, %rsi
leaq -0x1888(%rbp), %rdi
callq 0x277560
cmpl $0x0, %eax
jne 0x276c6c
movslq -0x58(%rbp), %rax
leaq -0x1870(%rbp), %rcx
imulq $0x18, %rax, %rax
addq %rax, %rcx
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
andq 0x10(%rcx), %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq -0x1878(%rbp), %rcx
cmpq %rcx, %rax
je 0x276c6c
jmp 0x276bbd
movq 0x10(%rbp), %rax
movl (%rax), %eax
movq 0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x276c24
movq 0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x276be7
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
shll %eax
movl %eax, -0x19dc(%rbp)
jmp 0x276bf4
movl $0x2, %eax
movl %eax, -0x19dc(%rbp)
jmp 0x276bf4
movl -0x19dc(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
imulq $0x18, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movslq -0x58(%rbp), %rax
leaq -0x1870(%rbp), %rcx
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbp), %rsi
movl (%rsi), %edx
movl %edx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movl %edx, %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
jmp 0x276c6c
jmp 0x276c6e
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x276b4e
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0x276db1
movslq -0x58(%rbp), %rax
leaq -0x1870(%rbp), %rsi
imulq $0x18, %rax, %rax
addq %rax, %rsi
leaq -0x1888(%rbp), %rdi
callq 0x277560
cmpl $0x0, %eax
jne 0x276da1
movslq -0x58(%rbp), %rax
leaq -0x1870(%rbp), %rcx
imulq $0x18, %rax, %rax
addq %rax, %rcx
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
andq 0x10(%rcx), %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq -0x1878(%rbp), %rcx
cmpq %rcx, %rax
je 0x276da1
jmp 0x276cf2
movq 0x10(%rbp), %rax
movl (%rax), %eax
movq 0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x276d59
movq 0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x276d1c
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
shll %eax
movl %eax, -0x19e0(%rbp)
jmp 0x276d29
movl $0x2, %eax
movl %eax, -0x19e0(%rbp)
jmp 0x276d29
movl -0x19e0(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
imulq $0x18, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movslq -0x58(%rbp), %rax
leaq -0x1870(%rbp), %rcx
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbp), %rsi
movl (%rsi), %edx
movl %edx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movl %edx, %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
jmp 0x276da1
jmp 0x276da3
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x276c83
jmp 0x276db3
movq -0x19b0(%rbp), %rax
cmpq -0x1888(%rbp), %rax
ja 0x276ec4
movl -0x5c(%rbp), %eax
movl -0x10(%rbp), %ecx
addl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jl 0x276e8f
cmpq $-0x1, -0x1888(%rbp)
je 0x276e8f
jmp 0x276de8
movq 0x10(%rbp), %rax
movl (%rax), %eax
movq 0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x276e4f
movq 0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x276e12
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
shll %eax
movl %eax, -0x19e4(%rbp)
jmp 0x276e1f
movl $0x2, %eax
movl %eax, -0x19e4(%rbp)
jmp 0x276e1f
movl -0x19e4(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
imulq $0x18, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbp), %rdx
movl (%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, (%rdx)
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x1888(%rbp), %rcx
movq %rcx, (%rax)
movq -0x1880(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x1878(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x276e8f
movq -0x19b0(%rbp), %rax
movq %rax, -0x1888(%rbp)
movq -0x19a8(%rbp), %rax
movq %rax, -0x1880(%rbp)
movq -0x19a0(%rbp), %rax
movq %rax, -0x1878(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x64(%rbp)
jmp 0x27732a
movl -0x60(%rbp), %eax
cmpl -0x64(%rbp), %eax
jne 0x277328
movl -0x5c(%rbp), %eax
movl -0x10(%rbp), %ecx
addl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jl 0x276f9b
cmpq $-0x1, -0x1888(%rbp)
je 0x276f9b
jmp 0x276ef4
movq 0x10(%rbp), %rax
movl (%rax), %eax
movq 0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x276f5b
movq 0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x276f1e
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
shll %eax
movl %eax, -0x19e8(%rbp)
jmp 0x276f2b
movl $0x2, %eax
movl %eax, -0x19e8(%rbp)
jmp 0x276f2b
movl -0x19e8(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
imulq $0x18, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbp), %rdx
movl (%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, (%rdx)
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x1888(%rbp), %rcx
movq %rcx, (%rax)
movq -0x1880(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x1878(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x276f9b
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
movq $-0x1, -0x1888(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x27701f
movslq -0x58(%rbp), %rax
leaq -0x1870(%rbp), %rsi
imulq $0x18, %rax, %rax
addq %rax, %rsi
leaq -0x1888(%rbp), %rdi
callq 0x277560
cmpl $0x0, %eax
jl 0x277012
movslq -0x58(%rbp), %rcx
leaq -0x1870(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x1888(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x1880(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x1878(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x64(%rbp)
jmp 0x277014
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x276faf
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x60(%rbp), %eax
jg 0x277096
movslq -0x58(%rbp), %rax
leaq -0x1870(%rbp), %rsi
imulq $0x18, %rax, %rax
addq %rax, %rsi
leaq -0x1888(%rbp), %rdi
callq 0x277560
cmpl $0x0, %eax
jl 0x277089
movslq -0x58(%rbp), %rcx
leaq -0x1870(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x1888(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x1880(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x1878(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x64(%rbp)
jmp 0x27708b
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x277026
movl -0x5c(%rbp), %eax
movl -0x10(%rbp), %ecx
addl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jl 0x277326
cmpq $-0x1, -0x1888(%rbp)
je 0x277326
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x2771ef
movslq -0x58(%rbp), %rax
leaq -0x1870(%rbp), %rsi
imulq $0x18, %rax, %rax
addq %rax, %rsi
leaq -0x1888(%rbp), %rdi
callq 0x277560
cmpl $0x0, %eax
jne 0x2771df
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
andq -0x1878(%rbp), %rax
movslq -0x58(%rbp), %rcx
leaq -0x1870(%rbp), %rdx
imulq $0x18, %rcx, %rcx
addq %rcx, %rdx
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq 0x10(%rdx), %rcx
cmpq %rcx, %rax
je 0x2771df
jmp 0x277130
movq 0x10(%rbp), %rax
movl (%rax), %eax
movq 0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x277197
movq 0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x27715a
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
shll %eax
movl %eax, -0x19ec(%rbp)
jmp 0x277167
movl $0x2, %eax
movl %eax, -0x19ec(%rbp)
jmp 0x277167
movl -0x19ec(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
imulq $0x18, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movslq -0x58(%rbp), %rax
leaq -0x1870(%rbp), %rcx
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbp), %rsi
movl (%rsi), %edx
movl %edx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movl %edx, %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
jmp 0x2771df
jmp 0x2771e1
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x2770c1
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x60(%rbp), %eax
jg 0x277324
movslq -0x58(%rbp), %rax
leaq -0x1870(%rbp), %rsi
imulq $0x18, %rax, %rax
addq %rax, %rsi
leaq -0x1888(%rbp), %rdi
callq 0x277560
cmpl $0x0, %eax
jne 0x277314
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
andq -0x1878(%rbp), %rax
movslq -0x58(%rbp), %rcx
leaq -0x1870(%rbp), %rdx
imulq $0x18, %rcx, %rcx
addq %rcx, %rdx
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq 0x10(%rdx), %rcx
cmpq %rcx, %rax
je 0x277314
jmp 0x277265
movq 0x10(%rbp), %rax
movl (%rax), %eax
movq 0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x2772cc
movq 0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x27728f
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
shll %eax
movl %eax, -0x19f0(%rbp)
jmp 0x27729c
movl $0x2, %eax
movl %eax, -0x19f0(%rbp)
jmp 0x27729c
movl -0x19f0(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
imulq $0x18, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movslq -0x58(%rbp), %rax
leaq -0x1870(%rbp), %rcx
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbp), %rsi
movl (%rsi), %edx
movl %edx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movl %edx, %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
jmp 0x277314
jmp 0x277316
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x2771f6
jmp 0x277326
jmp 0x277328
jmp 0x27732a
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
cmpl -0x10(%rbp), %eax
jne 0x27733f
movl $0x0, -0x60(%rbp)
jmp 0x277341
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x27675f
cmpq $-0x1, -0x1888(%rbp)
je 0x277406
jmp 0x27735f
movq 0x10(%rbp), %rax
movl (%rax), %eax
movq 0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x2773c6
movq 0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x277389
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
shll %eax
movl %eax, -0x19f4(%rbp)
jmp 0x277396
movl $0x2, %eax
movl %eax, -0x19f4(%rbp)
jmp 0x277396
movl -0x19f4(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
imulq $0x18, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbp), %rdx
movl (%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, (%rdx)
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x1888(%rbp), %rcx
movq %rcx, (%rax)
movq -0x1880(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x1878(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x277406
addq $0x1a00, %rsp           # imm = 0x1A00
popq %rbp
retq
nop