// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a08, %rsp           # imm = 0x1A08
movl %r9d, 0x80(%rsp)
movq %rdi, 0x90(%rsp)
movq $-0x1, %rax
movq %rcx, 0x48(%rsp)
shlq %cl, %rax
movq %rax, 0x88(%rsp)
testl %esi, %esi
jle 0x19bf5e
movl %edx, %r14d
leal -0x1(%r14), %eax
movl %eax, 0x5c(%rsp)
cmpl $0xfe, %eax
ja 0x19bf5e
movq 0x48(%rsp), %rax
leal -0x1(%rax), %ebp
cmpl $0x3f, %ebp
jae 0x19bf5e
movl %esi, %r15d
movq 0x1a40(%rsp), %rbx
movl %r8d, %eax
movq %rax, 0xb8(%rsp)
leal (,%r14,8), %eax
leal (%rax,%rax,2), %edx
leaq 0x200(%rsp), %rdi
movl $0xff, %esi
callq 0x20e0
leaq 0x100(%rsp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x20e0
movl 0x4(%rbx), %ecx
movl %r15d, %eax
xorl %edx, %edx
divl %r14d
addl (%rbx), %eax
cmpl %eax, %ecx
jae 0x19b599
decl %eax
movl %eax, %ecx
shrl %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x8, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x10, %ecx
orl %eax, %ecx
incl %ecx
movl %ecx, 0x4(%rbx)
movq 0x8(%rbx), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq %rax, 0x8(%rbx)
movslq %ebp, %rax
movq %rax, 0xc0(%rsp)
notq 0x88(%rsp)
movabsq $0x7fffffffffffffff, %r10 # imm = 0x7FFFFFFFFFFFFFFF
movq 0x48(%rsp), %rax
leal (%rax,%r14), %ecx
movl %ecx, 0x7c(%rsp)
leal -0x1(%rax,%r14), %eax
movl %eax, 0x2c(%rsp)
movl %r15d, %eax
movq %rax, 0xc8(%rsp)
movl $0xfffffff, %r13d       # imm = 0xFFFFFFF
movq $-0x1, %rbp
leaq 0x9e635(%rip), %r11     # 0x239c20
movq $0x0, 0x70(%rsp)
movq $0x0, 0x98(%rsp)
movq $0x0, 0x68(%rsp)
movq $0x0, 0x50(%rsp)
xorl %eax, %eax
movq $0x0, 0x38(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x8(%rsp)
xorl %r8d, %r8d
xorl %r12d, %r12d
movq $0x0, 0x60(%rsp)
movq $0x0, 0xa0(%rsp)
movq %r14, 0x18(%rsp)
movl %r15d, 0x84(%rsp)
movq 0x90(%rsp), %r9
movq %rax, 0x40(%rsp)
movslq %eax, %rdx
movzbl (%r9,%rdx), %eax
movzbl (%r11,%rax), %eax
cmpl $0x3, %eax
movq %r8, 0x10(%rsp)
ja 0x19b704
cmpl $0x0, 0x80(%rsp)
je 0x19ba3b
leaq 0x1(%rdx), %rsi
movl $0x1, %ecx
cmpl %r15d, %esi
movq 0x68(%rsp), %r14
jge 0x19bc9d
movzbl (%r9,%rsi), %esi
cmpb %al, (%r11,%rsi)
jne 0x19bc9d
movq 0x40(%rsp), %rdi
leal 0x2(%rdi), %esi
movl $0x2, %ecx
cmpl %r15d, %esi
jge 0x19bc94
movl %r15d, %ecx
subl %edi, %ecx
movl %edi, %edi
movl $0x2, %esi
leal (%rdi,%rsi), %r8d
movslq %r8d, %r8
movzbl (%r9,%r8), %r8d
cmpb %al, (%r11,%r8)
jne 0x19bc88
leaq (%rdx,%rsi), %r8
incq %r8
incq %rsi
cmpq 0xc8(%rsp), %r8
jl 0x19b6d5
jmp 0x19bc8a
movq %r13, 0x30(%rsp)
movq $0x0, 0xf8(%rsp)
movq $-0x1, %r14
movl $0xfffffff, %edi        # imm = 0xFFFFFFF
movq $0x0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movq $0x0, 0x20(%rsp)
xorl %esi, %esi
xorl %ecx, %ecx
movslq %r8d, %rax
leaq (%rax,%rax,2), %rax
movq %r14, 0x200(%rsp,%rax,8)
movq %rdi, 0xb0(%rsp)
movq %rdi, 0x208(%rsp,%rax,8)
movq %rcx, 0xa8(%rsp)
movq %rcx, 0x210(%rsp,%rax,8)
movq %rsi, 0x38(%rsp)
cmpl 0x2c(%rsp), %esi
jne 0x19b8cf
cmpq $-0x1, %rbp
je 0x19b8cf
leal 0x1(%r8), %eax
cmpl 0x18(%rsp), %eax
jge 0x19b829
cltq
leaq (%rax,%rax,2), %rax
leaq (%rsp,%rax,8), %r13
addq $0x200, %r13            # imm = 0x200
movl 0x5c(%rsp), %r15d
subl %r8d, %r15d
cmpq (%r13), %rbp
jne 0x19b820
movq 0x10(%r13), %rax
xorq %r12, %rax
testq %r10, %rax
je 0x19b820
movl (%rbx), %ecx
movq 0x8(%rbx), %rax
cmpl 0x4(%rbx), %ecx
jne 0x19b801
leal (%rcx,%rcx), %edx
testl %ecx, %ecx
movl $0x2, %ecx
cmovel %ecx, %edx
movl %edx, 0x4(%rbx)
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rsi
movq %rax, %rdi
callq 0x2370
movq 0x10(%rsp), %r8
movabsq $0x7fffffffffffffff, %r10 # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
movl (%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rbx)
movl %ecx, %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%r13), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movdqu (%r13), %xmm0
movdqu %xmm0, (%rax,%rcx,8)
addq $0x18, %r13
decl %r15d
jne 0x19b7af
testl %r8d, %r8d
jle 0x19b8cf
movl %r8d, %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %r15
xorl %r13d, %r13d
cmpq 0x200(%rsp,%r13), %rbp
jne 0x19b8c2
movq 0x210(%rsp,%r13), %rax
xorq %r12, %rax
testq %r10, %rax
je 0x19b8c2
movl (%rbx), %ecx
movq 0x8(%rbx), %rax
cmpl 0x4(%rbx), %ecx
jne 0x19b89a
leal (%rcx,%rcx), %edx
testl %ecx, %ecx
movl $0x2, %ecx
cmovel %ecx, %edx
movl %edx, 0x4(%rbx)
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rsi
movq %rax, %rdi
callq 0x2370
movq 0x10(%rsp), %r8
movabsq $0x7fffffffffffffff, %r10 # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
movl (%rbx), %ecx
leaq (%rsp,%r13), %rdx
addq $0x200, %rdx            # imm = 0x200
leal 0x1(%rcx), %esi
movl %esi, (%rbx)
movl %ecx, %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rdx), %rsi
movq %rsi, 0x10(%rax,%rcx,8)
movdqu (%rdx), %xmm0
movdqu %xmm0, (%rax,%rcx,8)
addq $0x18, %r13
cmpq %r13, %r15
jne 0x19b840
cmpq %rbp, %r14
jbe 0x19b9b3
movq 0x8(%rsp), %r14
cmpl %r14d, %r8d
movq 0x30(%rsp), %r13
jne 0x19ba5c
cmpq $-0x1, %rbp
sete %al
movq 0x38(%rsp), %rcx
cmpl 0x2c(%rsp), %ecx
setl %cl
orb %al, %cl
movq 0x18(%rsp), %r15
jne 0x19b960
movl (%rbx), %ecx
movq 0x8(%rbx), %rax
cmpl 0x4(%rbx), %ecx
jne 0x19b947
leal (%rcx,%rcx), %edx
testl %ecx, %ecx
movl $0x2, %ecx
cmovel %ecx, %edx
movl %edx, 0x4(%rbx)
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rsi
movq %rax, %rdi
callq 0x2370
movq 0x10(%rsp), %r8
movabsq $0x7fffffffffffffff, %r10 # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
movl (%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rbx)
movl %ecx, %ecx
leaq (%rcx,%rcx,2), %rcx
movq %rbp, (%rax,%rcx,8)
movq %r13, 0x8(%rax,%rcx,8)
movq %r12, 0x10(%rax,%rcx,8)
leal 0x1(%r14), %edi
movq %r14, %rdx
movq $-0x1, %r14
cmpl %r15d, %edi
jge 0x19ba86
movslq %edi, %rax
leaq (%rax,%rax,2), %rax
leaq 0x210(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
movl %edi, %ecx
movl %edx, %ebp
movq -0x10(%rax), %rdx
cmpq %rdx, %r14
jb 0x19b9a3
movq -0x8(%rax), %r13
movq (%rax), %r12
movq %rdx, %r14
movl %ecx, %ebp
incl %ecx
addq $0x18, %rax
cmpl %ecx, %r15d
jne 0x19b98e
jmp 0x19ba88
cmpq $-0x1, %rbp
sete %al
movq 0x38(%rsp), %rcx
cmpl 0x7c(%rsp), %ecx
setl %cl
orb %al, %cl
movq 0x30(%rsp), %r13
jne 0x19ba64
movl (%rbx), %ecx
movq 0x8(%rbx), %rax
cmpl 0x4(%rbx), %ecx
movq 0x18(%rsp), %r15
jne 0x19ba18
leal (%rcx,%rcx), %edx
testl %ecx, %ecx
movl $0x2, %ecx
cmovel %ecx, %edx
movl %edx, 0x4(%rbx)
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rsi
movq %rax, %rdi
callq 0x2370
movq 0x10(%rsp), %r8
movabsq $0x7fffffffffffffff, %r10 # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
movl (%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rbx)
movl %ecx, %ecx
leaq (%rcx,%rcx,2), %rcx
movq %rbp, (%rax,%rcx,8)
movq %r13, 0x8(%rax,%rcx,8)
movq %r12, 0x10(%rax,%rcx,8)
movl %r8d, %eax
movq %rax, 0x8(%rsp)
jmp 0x19ba71
movq 0x38(%rsp), %rcx
leal 0x1(%rcx), %edx
movq 0x48(%rsp), %rcx
cmpl %ecx, %edx
cmovgel %ecx, %edx
movq %rdx, 0x20(%rsp)
movq 0x68(%rsp), %r14
jmp 0x19bd2b
movq %rbp, %r14
jmp 0x19bc4c
movl %r8d, %eax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %r15
movq 0xb0(%rsp), %r13
movq 0xa8(%rsp), %r12
jmp 0x19bc5a
movl %edx, %ebp
cmpl $0x0, 0x8(%rsp)
js 0x19babc
movl %edi, %eax
leaq 0x210(%rsp), %rcx
xorl %edx, %edx
movq -0x10(%rcx), %rsi
cmpq %rsi, %r14
jb 0x19bab0
movq -0x8(%rcx), %r13
movq (%rcx), %r12
movq %rsi, %r14
movl %edx, %ebp
incq %rdx
addq $0x18, %rcx
cmpq %rdx, %rax
jne 0x19ba9b
movq 0x38(%rsp), %rax
cmpl 0x2c(%rsp), %eax
jl 0x19bc53
cmpq $-0x1, %r14
je 0x19bc53
movq %r13, 0x30(%rsp)
cmpl %r15d, %edi
jge 0x19bb99
movslq %edi, %rax
leaq (%rax,%rax,2), %rax
leaq (%rsp,%rax,8), %r13
addq $0x200, %r13            # imm = 0x200
movl 0x5c(%rsp), %r15d
subl 0x8(%rsp), %r15d
cmpq (%r13), %r14
jne 0x19bb8c
movq 0x10(%r13), %rax
xorq %r12, %rax
testq %r10, %rax
je 0x19bb8c
movl (%rbx), %ecx
movq 0x8(%rbx), %rax
cmpl 0x4(%rbx), %ecx
jne 0x19bb6d
leal (%rcx,%rcx), %edx
testl %ecx, %ecx
movl $0x2, %ecx
cmovel %ecx, %edx
movl %edx, 0x4(%rbx)
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rsi
movq %r12, %rbx
movl %ebp, %r12d
movl %edi, %ebp
movq %rax, %rdi
callq 0x2370
movl %ebp, %edi
movl %r12d, %ebp
movq %rbx, %r12
movq 0x1a40(%rsp), %rbx
movq 0x10(%rsp), %r8
movabsq $0x7fffffffffffffff, %r10 # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
movl (%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rbx)
movl %ecx, %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%r13), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movdqu (%r13), %xmm0
movdqu %xmm0, (%rax,%rcx,8)
addq $0x18, %r13
decl %r15d
jne 0x19baff
cmpl $0x0, 0x8(%rsp)
js 0x19bc40
movl %edi, %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %r15
xorl %r13d, %r13d
cmpq 0x200(%rsp,%r13), %r14
jne 0x19bc33
movq 0x210(%rsp,%r13), %rax
xorq %r12, %rax
testq %r10, %rax
je 0x19bc33
movl (%rbx), %ecx
movq 0x8(%rbx), %rax
cmpl 0x4(%rbx), %ecx
jne 0x19bc0b
leal (%rcx,%rcx), %edx
testl %ecx, %ecx
movl $0x2, %ecx
cmovel %ecx, %edx
movl %edx, 0x4(%rbx)
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rsi
movq %rax, %rdi
callq 0x2370
movq 0x10(%rsp), %r8
movabsq $0x7fffffffffffffff, %r10 # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
movl (%rbx), %ecx
leaq (%rsp,%r13), %rdx
addq $0x200, %rdx            # imm = 0x200
leal 0x1(%rcx), %esi
movl %esi, (%rbx)
movl %ecx, %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rdx), %rsi
movq %rsi, 0x10(%rax,%rcx,8)
movdqu (%rdx), %xmm0
movdqu %xmm0, (%rax,%rcx,8)
addq $0x18, %r13
cmpq %r13, %r15
jne 0x19bbb1
movq 0x30(%rsp), %r13
movl %ebp, %eax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %r15
jmp 0x19bc5a
movl %ebp, %eax
movq %rax, 0x8(%rsp)
incl %r8d
cmpl %r15d, %r8d
movl $0x0, %eax
cmovel %eax, %r8d
movq %r14, %rbp
movl 0x84(%rsp), %r15d
movq 0x90(%rsp), %r9
leaq 0x9df9d(%rip), %r11     # 0x239c20
jmp 0x19bdc7
movl %esi, %ecx
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %r8
addl %ecx, %edi
decl %edi
movq %rdi, 0x40(%rsp)
movq 0x50(%rsp), %rdi
leal 0x1(%rdi), %edx
movl %edx, 0xfc(%rsp)
movq 0x60(%rsp), %rsi
addl %edi, %esi
andl $0x3f, %esi
movl %ecx, 0x100(%rsp,%rsi,4)
movq 0x20(%rsp), %rsi
addl %ecx, %esi
movq %rsi, 0x20(%rsp)
cmpl 0x48(%rsp), %edi
jge 0x19bcd8
movl %edx, %ecx
movq %rcx, 0x50(%rsp)
jmp 0x19bd2b
testl %edx, %edx
je 0x19bd11
movq 0x60(%rsp), %rdx
movslq %edx, %rcx
incl %edx
movl %edx, 0xf8(%rsp)
movl 0x100(%rsp,%rcx,4), %ecx
andl $0x3f, %edx
movl %edx, 0xf8(%rsp)
movq 0x50(%rsp), %rsi
movl %esi, 0xfc(%rsp)
movq %rdx, 0x60(%rsp)
jmp 0x19bd1f
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq $0x0, 0x50(%rsp)
movq 0x20(%rsp), %rdx
subl %ecx, %edx
movq %rdx, 0x20(%rsp)
movq 0x98(%rsp), %rdx
movl %eax, %esi
andl $0x1, %esi
movq 0xa0(%rsp), %rdi
leaq (%rsi,%rdi,2), %rdi
movq 0x88(%rsp), %rcx
andq %rcx, %rdi
movq %rdi, 0xa0(%rsp)
movq %rdi, 0xe0(%rsp)
addq %r14, %r14
shrl %eax
orq %rax, %r14
andq %rcx, %r14
xorl $0x1, %esi
movq 0xc0(%rsp), %rcx
shlq %cl, %rsi
movq %r14, 0xe8(%rsp)
shrq %rdx
orq %rdx, %rsi
movq %rsi, 0x98(%rsp)
movq %rsi, 0xd0(%rsp)
movq 0x70(%rsp), %rdx
movl $0x1, %esi
subl %eax, %esi
shlq %cl, %rsi
shrq %rdx
orq %rdx, %rsi
movq %rsi, 0xd8(%rsp)
movq %rsi, 0x70(%rsp)
cmpq %rsi, %r14
movq %r14, 0x68(%rsp)
jne 0x19bddc
movq %r14, 0x70(%rsp)
movq 0x40(%rsp), %rax
incl %eax
cmpl %r15d, %eax
jl 0x19b65f
jmp 0x19bef9
movq 0x38(%rsp), %rsi
incl %esi
movq $-0x1, %r14
cmpl 0x48(%rsp), %esi
movq %r13, 0x30(%rsp)
jl 0x19beed
movq 0x20(%rsp), %rdi
cmpl $0xff, %edi
jg 0x19beed
leaq 0x1(%r10), %rax
movq 0x70(%rsp), %rcx
cmpq %rcx, 0x68(%rsp)
leaq 0xd0(%rsp), %rcx
leaq 0xe0(%rsp), %rdx
cmovbq %rdx, %rcx
movdqa (%rcx), %xmm0
movdqa %xmm0, %xmm1
pxor 0x956e4(%rip), %xmm1    # 0x231520
psllq $0x15, %xmm0
paddq %xmm1, %xmm0
movdqa %xmm0, %xmm1
psrlq $0x18, %xmm1
pxor %xmm0, %xmm1
movdqa %xmm1, %xmm0
movdqa 0x9d552(%rip), %xmm2    # 0x2393b0
pmuludq %xmm2, %xmm0
psrlq $0x20, %xmm1
pmuludq %xmm2, %xmm1
psllq $0x20, %xmm1
paddq %xmm0, %xmm1
movdqa %xmm1, %xmm0
psrlq $0xe, %xmm0
pxor %xmm1, %xmm0
movdqa %xmm0, %xmm1
movdqa 0x9d513(%rip), %xmm2    # 0x2393a0
pmuludq %xmm2, %xmm1
psrlq $0x20, %xmm0
pmuludq %xmm2, %xmm0
psllq $0x20, %xmm0
paddq %xmm1, %xmm0
movdqa %xmm0, %xmm1
psrlq $0x1c, %xmm1
pxor %xmm0, %xmm1
pshufd $0xee, %xmm1, %xmm0     # xmm0 = xmm1[2,3,2,3]
paddq %xmm1, %xmm0
movq %xmm0, %rcx
movl $0x0, %edx
cmovaeq %rax, %rdx
movq %rcx, %r14
shlq $0x1f, %r14
addq %rcx, %r14
movslq 0x40(%rsp), %rcx
andq %r10, %rcx
orq %rdx, %rcx
shlq $0x20, %rdi
addq 0xb8(%rsp), %rdi
jmp 0x19b740
xorl %ecx, %ecx
movl $0xfffffff, %edi        # imm = 0xFFFFFFF
jmp 0x19b740
cmpq $-0x1, %rbp
je 0x19bf4c
movl (%rbx), %ecx
cmpl 0x4(%rbx), %ecx
jne 0x19bf2f
leal (%rcx,%rcx), %eax
testl %ecx, %ecx
movl $0x2, %ecx
cmovnel %eax, %ecx
movl %ecx, 0x4(%rbx)
movq 0x8(%rbx), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq %rax, 0x8(%rbx)
movl (%rbx), %ecx
jmp 0x19bf33
movq 0x8(%rbx), %rax
leal 0x1(%rcx), %edx
movl %edx, (%rbx)
movl %ecx, %ecx
leaq (%rcx,%rcx,2), %rcx
movq %rbp, (%rax,%rcx,8)
movq %r13, 0x8(%rax,%rcx,8)
movq %r12, 0x10(%rax,%rcx,8)
addq $0x1a08, %rsp           # imm = 0x1A08
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa3a54(%rip), %rdi     # 0x23f9b9
leaq 0xa3a9a(%rip), %rsi     # 0x23fa06
leaq 0xa3a9d(%rip), %rcx     # 0x23fa10
movl $0x5d4, %edx            # imm = 0x5D4
callq 0x2110