// File: /workspace/github_cpp_makefile_star2_O1/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 $0x19f8, %rsp           # imm = 0x19F8
movl %r9d, 0x7c(%rsp)
movq $-0x1, %rax
movq %rcx, 0x38(%rsp)
shlq %cl, %rax
movq %rax, 0xa8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movl %esi, 0x4(%rsp)
testl %esi, %esi
jle 0x1931b3
movl %edx, %r13d
leal -0x1(%r13), %eax
movl %eax, 0x54(%rsp)
cmpl $0xfe, %eax
ja 0x1931b3
movq 0x38(%rsp), %rax
leal -0x1(%rax), %ebp
cmpl $0x3f, %ebp
jae 0x1931b3
movq %rdi, %r14
movq 0x1a30(%rsp), %rbx
movl %r8d, %eax
movq %rax, 0xd0(%rsp)
leal (,%r13,8), %eax
leal (%rax,%rax,2), %edx
leaq 0x1f0(%rsp), %rdi
movl $0xff, %esi
callq 0x20e0
leaq 0xe8(%rsp), %rdi
movl $0x108, %edx            # imm = 0x108
xorl %esi, %esi
callq 0x20e0
movl 0x4(%rbx), %ecx
movl 0x4(%rsp), %eax
xorl %edx, %edx
divl %r13d
addl (%rbx), %eax
cmpl %eax, %ecx
jae 0x192839
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, 0xd8(%rsp)
notq 0xa8(%rsp)
movabsq $0x7fffffffffffffff, %r9 # imm = 0x7FFFFFFFFFFFFFFF
movq 0x80(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x68(%rsp)
movl 0xe8(%rsp), %eax
movq %rax, 0x58(%rsp)
movl 0xec(%rsp), %eax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rax
leal (%rax,%r13), %ecx
movl %ecx, 0x78(%rsp)
leal -0x1(%rax,%r13), %eax
movl %eax, 0x34(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x60(%rsp)
movl 0x4(%rsp), %eax
movq %rax, 0xe0(%rsp)
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
movq %rax, 0x8(%rsp)
movq $-0x1, %r12
xorl %r11d, %r11d
movq $0x0, 0x10(%rsp)
xorl %r15d, %r15d
movl $0x0, (%rsp)
xorl %r8d, %r8d
xorl %ebp, %ebp
movq %r13, 0x28(%rsp)
movq %r14, 0x20(%rsp)
movslq %r11d, %rdx
movzbl (%r14,%rdx), %eax
leaq 0x9b101(%rip), %rcx     # 0x22da10
movzbl (%rcx,%rax), %eax
cmpl $0x3, %eax
movq %r8, 0x18(%rsp)
ja 0x1929a5
cmpl $0x0, 0x7c(%rsp)
je 0x1929ed
leaq 0x1(%rdx), %rsi
movl $0x1, %ecx
cmpl 0x4(%rsp), %esi
jge 0x192a1b
movzbl (%r14,%rsi), %esi
leaq 0x9b0c5(%rip), %rdi     # 0x22da10
cmpb %al, (%rdi,%rsi)
jne 0x192a1b
leal 0x2(%r11), %esi
movl $0x2, %ecx
cmpl 0x4(%rsp), %esi
jge 0x192a15
movl 0x4(%rsp), %ecx
subl %r11d, %ecx
movl %r11d, %edi
movl $0x2, %esi
leal (%rdi,%rsi), %r8d
movslq %r8d, %r8
movzbl (%r14,%r8), %r8d
leaq 0x9b087(%rip), %r10     # 0x22da10
cmpb %al, (%r10,%r8)
jne 0x192a0e
leaq (%rdx,%rsi), %r8
incq %r8
incq %rsi
cmpq 0xe0(%rsp), %r8
jl 0x192976
jmp 0x192a10
movq %r11, 0x70(%rsp)
movq $0x0, 0xe8(%rsp)
movq $-0x1, %r15
movl $0xfffffff, %ecx        # imm = 0xFFFFFFF
movq $0x0, 0x40(%rsp)
movq $0x0, 0x58(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x10(%rsp)
xorl %edx, %edx
jmp 0x192c40
movq %r11, 0x70(%rsp)
movq 0x10(%rsp), %rcx
leal 0x1(%rcx), %edx
movq 0x38(%rsp), %rcx
cmpl %ecx, %edx
cmovgel %ecx, %edx
movq %rdx, 0x48(%rsp)
jmp 0x192a97
movl %esi, %ecx
movq 0x18(%rsp), %r8
addl %ecx, %r11d
decl %r11d
movq 0x40(%rsp), %rdi
leal 0x1(%rdi), %edx
movl %edx, 0xec(%rsp)
movq 0x58(%rsp), %rsi
addl %edi, %esi
andl $0x3f, %esi
movl %ecx, 0xf0(%rsp,%rsi,4)
addl %ecx, %r15d
cmpl 0x38(%rsp), %edi
movq %r11, 0x70(%rsp)
jl 0x192a8b
testl %edx, %edx
je 0x192a83
movq 0x58(%rsp), %rdx
movslq %edx, %rcx
leal 0x1(%rdx), %esi
movl %esi, 0xe8(%rsp)
movl 0xf0(%rsp,%rcx,4), %ecx
andl $0x3f, %esi
movl %esi, 0xe8(%rsp)
movq 0x40(%rsp), %rdx
movl %edx, 0xec(%rsp)
movq %rsi, 0x58(%rsp)
jmp 0x192a88
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
subl %ecx, %r15d
movq %r15, 0x48(%rsp)
movl %edx, %ecx
movq %rcx, 0x40(%rsp)
movq 0xb0(%rsp), %rdx
movl %eax, %esi
andl $0x1, %esi
movq 0xb8(%rsp), %rdi
leaq (%rsi,%rdi,2), %rdi
movq 0xa8(%rsp), %rcx
andq %rcx, %rdi
movq %rdi, 0xb8(%rsp)
movq %rdi, 0x80(%rsp)
movq 0x68(%rsp), %rdi
addq %rdi, %rdi
shrl %eax
orq %rax, %rdi
andq %rcx, %rdi
movq %rdi, 0x88(%rsp)
shrq %rdx
xorl $0x1, %esi
movq 0xd8(%rsp), %rcx
shlq %cl, %rsi
orq %rdx, %rsi
movq %rsi, 0xb0(%rsp)
movq %rsi, 0x90(%rsp)
movq 0x60(%rsp), %rdx
shrq %rdx
movl $0x1, %esi
subl %eax, %esi
shlq %cl, %rsi
orq %rdx, %rsi
movq %rsi, 0x98(%rsp)
movq $-0x1, %r15
movl $0xfffffff, %ecx        # imm = 0xFFFFFFF
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
cmpq %rsi, %rdi
jne 0x192b46
xorl %edx, %edx
jmp 0x192c30
movq 0x10(%rsp), %rax
incl %eax
movq %rax, 0x10(%rsp)
cmpl 0x38(%rsp), %eax
jl 0x192b3f
movq 0x48(%rsp), %r10
cmpl $0xff, %r10d
jg 0x192b3f
leaq 0x1(%r9), %rcx
xorl %edx, %edx
movq 0x60(%rsp), %rax
cmpq %rax, 0x68(%rsp)
setae %dl
movl $0x0, %eax
cmovaeq %rcx, %rax
shll $0x4, %edx
movq 0x80(%rsp,%rdx), %rsi
movq 0x88(%rsp,%rdx), %rcx
movq %rsi, %rdx
notq %rdx
shlq $0x15, %rsi
addq %rdx, %rsi
movq %rsi, %rdx
shrq $0x18, %rdx
xorq %rsi, %rdx
imulq $0x109, %rdx, %rdx      # imm = 0x109
movq %rdx, %rsi
shrq $0xe, %rsi
xorq %rdx, %rsi
leaq (%rsi,%rsi,4), %rdx
leaq (%rsi,%rdx,4), %rdx
movq %rcx, %rsi
notq %rsi
movq %rdx, %rdi
shrq $0x1c, %rdi
xorq %rdx, %rdi
shlq $0x15, %rcx
addq %rsi, %rcx
movq %rcx, %rdx
shrq $0x18, %rdx
xorq %rcx, %rdx
imulq $0x109, %rdx, %rcx      # imm = 0x109
movq %rcx, %rdx
shrq $0xe, %rdx
xorq %rcx, %rdx
leaq (%rdx,%rdx,4), %rcx
leaq (%rdx,%rcx,4), %rcx
movq %rcx, %rdx
shrq $0x1c, %rdx
xorq %rcx, %rdx
addq %rdi, %rdx
movq %rdx, %r15
shlq $0x1f, %r15
addq %rdx, %r15
movslq 0x70(%rsp), %rdx
andq %r9, %rdx
orq %rax, %rdx
shlq $0x20, %r10
addq 0xd0(%rsp), %r10
movq %r10, %rcx
movq 0x60(%rsp), %rax
cmpq %rax, 0x68(%rsp)
je 0x193129
movslq %r8d, %rax
leaq (%rax,%rax,2), %rax
movq %r15, 0x1f0(%rsp,%rax,8)
movq %rcx, 0xc8(%rsp)
movq %rcx, 0x1f8(%rsp,%rax,8)
movq %rdx, 0xc0(%rsp)
movq %rdx, 0x200(%rsp,%rax,8)
movq 0x10(%rsp), %rax
cmpl 0x34(%rsp), %eax
jne 0x192dc8
cmpq $-0x1, %r12
je 0x192dc8
leal 0x1(%r8), %eax
cmpl 0x28(%rsp), %eax
jge 0x192d26
cltq
leaq (%rax,%rax,2), %rax
leaq (%rsp,%rax,8), %r13
addq $0x1f0, %r13            # imm = 0x1F0
movl 0x54(%rsp), %r14d
subl %r8d, %r14d
cmpq (%r13), %r12
jne 0x192d1d
movq 0x10(%r13), %rax
xorq %rbp, %rax
testq %r9, %rax
je 0x192d1d
movl 0x4(%rbx), %eax
cmpl %eax, (%rbx)
jne 0x192cfc
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x2, %eax
cmovel %eax, %ecx
movl %ecx, 0x4(%rbx)
movq 0x8(%rbx), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq 0x18(%rsp), %r8
movabsq $0x7fffffffffffffff, %r9 # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
movq 0x8(%rbx), %rax
movl (%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rbx)
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%r13), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movups (%r13), %xmm0
movups %xmm0, (%rax,%rcx,8)
addq $0x18, %r13
decl %r14d
jne 0x192caf
testl %r8d, %r8d
jle 0x192dc8
movl %r8d, %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %r14
xorl %r13d, %r13d
cmpq 0x1f0(%rsp,%r13), %r12
jne 0x192dbb
movq 0x200(%rsp,%r13), %rax
xorq %rbp, %rax
testq %r9, %rax
je 0x192dbb
movl 0x4(%rbx), %eax
cmpl %eax, (%rbx)
jne 0x192d92
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x2, %eax
cmovel %eax, %ecx
movl %ecx, 0x4(%rbx)
movq 0x8(%rbx), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq 0x18(%rsp), %r8
movabsq $0x7fffffffffffffff, %r9 # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
leaq (%rsp,%r13), %rax
addq $0x1f0, %rax            # imm = 0x1F0
movq 0x8(%rbx), %rcx
movl (%rbx), %edx
leal 0x1(%rdx), %esi
movl %esi, (%rbx)
leaq (%rdx,%rdx,2), %rdx
movq 0x10(%rax), %rsi
movq %rsi, 0x10(%rcx,%rdx,8)
movups (%rax), %xmm0
movups %xmm0, (%rcx,%rdx,8)
addq $0x18, %r13
cmpq %r13, %r14
jne 0x192d3d
cmpq %r12, %r15
jbe 0x192ead
cmpl (%rsp), %r8d
jne 0x192f31
cmpq $-0x1, %r12
sete %al
movq 0x10(%rsp), %rcx
cmpl 0x34(%rsp), %ecx
setl %cl
orb %al, %cl
movq 0x28(%rsp), %r13
jne 0x192e54
movl 0x4(%rbx), %eax
cmpl %eax, (%rbx)
jne 0x192e32
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x2, %eax
cmovel %eax, %ecx
movl %ecx, 0x4(%rbx)
movq 0x8(%rbx), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq 0x18(%rsp), %r8
movabsq $0x7fffffffffffffff, %r9 # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
movq 0x8(%rbx), %rax
movl (%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rbx)
leaq (%rcx,%rcx,2), %rcx
movq %r12, (%rax,%rcx,8)
movq 0x8(%rsp), %rdx
movq %rdx, 0x8(%rax,%rcx,8)
movq %rbp, 0x10(%rax,%rcx,8)
leal 0x1(%r8), %r14d
movq $-0x1, %r15
cmpl %r13d, %r14d
jge 0x192f66
movslq %r14d, %rax
leaq (%rax,%rax,2), %rax
leaq 0x200(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
movl %r14d, %ecx
movq 0x8(%rsp), %rdi
movl (%rsp), %r10d
movq -0x10(%rax), %rdx
cmpq %rdx, %r15
jb 0x192e9d
movq -0x8(%rax), %rdi
movq (%rax), %rbp
movq %rdx, %r15
movl %ecx, %r10d
incl %ecx
addq $0x18, %rax
cmpl %ecx, %r13d
jne 0x192e87
jmp 0x192f6f
cmpq $-0x1, %r12
sete %al
movq 0x10(%rsp), %rcx
cmpl 0x78(%rsp), %ecx
setl %cl
orb %al, %cl
jne 0x192f43
movl 0x4(%rbx), %eax
cmpl %eax, (%rbx)
movq 0x28(%rsp), %r13
movq 0x20(%rsp), %r14
jne 0x192f09
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x2, %eax
cmovel %eax, %ecx
movl %ecx, 0x4(%rbx)
movq 0x8(%rbx), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq 0x18(%rsp), %r8
movabsq $0x7fffffffffffffff, %r9 # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
movq 0x8(%rbx), %rax
movl (%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rbx)
leaq (%rcx,%rcx,2), %rcx
movq %r12, (%rax,%rcx,8)
movq 0x8(%rsp), %rdx
movq %rdx, 0x8(%rax,%rcx,8)
movq %rbp, 0x10(%rax,%rcx,8)
movl %r8d, (%rsp)
jmp 0x192f51
movq 0x8(%rsp), %rdi
movq %r12, %r15
movq 0x28(%rsp), %r13
jmp 0x19310d
movl %r8d, (%rsp)
movq 0x28(%rsp), %r13
movq 0x20(%rsp), %r14
movq 0xc8(%rsp), %rdi
movq 0xc0(%rsp), %rbp
jmp 0x193112
movq 0x8(%rsp), %rdi
movl (%rsp), %r10d
testl %r8d, %r8d
js 0x192fa3
movl %r14d, %eax
leaq 0x200(%rsp), %rcx
xorl %edx, %edx
movq -0x10(%rcx), %rsi
cmpq %rsi, %r15
jb 0x192f97
movq -0x8(%rcx), %rdi
movq (%rcx), %rbp
movq %rsi, %r15
movl %edx, %r10d
incq %rdx
addq $0x18, %rcx
cmpq %rdx, %rax
jne 0x192f81
movl %r10d, (%rsp)
movq 0x10(%rsp), %rax
cmpl 0x34(%rsp), %eax
jl 0x19310d
cmpq $-0x1, %r15
je 0x19310d
movq %rdi, 0x8(%rsp)
cmpl %r13d, %r14d
jge 0x193061
movslq %r14d, %rax
leaq (%rax,%rax,2), %rax
leaq (%rsp,%rax,8), %r12
addq $0x1f0, %r12            # imm = 0x1F0
movl 0x54(%rsp), %r13d
subl %r8d, %r13d
cmpq (%r12), %r15
jne 0x193058
movq 0x10(%r12), %rax
xorq %rbp, %rax
testq %r9, %rax
je 0x193058
movl 0x4(%rbx), %eax
cmpl %eax, (%rbx)
jne 0x193036
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x2, %eax
cmovel %eax, %ecx
movl %ecx, 0x4(%rbx)
movq 0x8(%rbx), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq 0x18(%rsp), %r8
movabsq $0x7fffffffffffffff, %r9 # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
movq 0x8(%rbx), %rax
movl (%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rbx)
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%r12), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movups (%r12), %xmm0
movups %xmm0, (%rax,%rcx,8)
addq $0x18, %r12
decl %r13d
jne 0x192fe8
testl %r8d, %r8d
js 0x193143
movl %r14d, %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %r14
xorl %r12d, %r12d
movq 0x28(%rsp), %r13
cmpq 0x1f0(%rsp,%r12), %r15
jne 0x1930fb
movq 0x200(%rsp,%r12), %rax
xorq %rbp, %rax
testq %r9, %rax
je 0x1930fb
movl 0x4(%rbx), %eax
cmpl %eax, (%rbx)
jne 0x1930d2
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x2, %eax
cmovel %eax, %ecx
movl %ecx, 0x4(%rbx)
movq 0x8(%rbx), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq 0x18(%rsp), %r8
movabsq $0x7fffffffffffffff, %r9 # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
leaq (%rsp,%r12), %rax
addq $0x1f0, %rax            # imm = 0x1F0
movq 0x8(%rbx), %rcx
movl (%rbx), %edx
leal 0x1(%rdx), %esi
movl %esi, (%rbx)
leaq (%rdx,%rdx,2), %rdx
movq 0x10(%rax), %rsi
movq %rsi, 0x10(%rcx,%rdx,8)
movups (%rax), %xmm0
movups %xmm0, (%rcx,%rdx,8)
addq $0x18, %r12
cmpq %r12, %r14
jne 0x19307d
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %r14
incl %r8d
cmpl %r13d, %r8d
movl $0x0, %eax
cmovel %eax, %r8d
movq %rdi, 0x8(%rsp)
movq %r15, %r12
movq 0x70(%rsp), %r11
incl %r11d
cmpl 0x4(%rsp), %r11d
movq 0x48(%rsp), %r15
jl 0x192900
jmp 0x19314d
movq 0x8(%rsp), %rdi
jmp 0x192f39
cmpq $-0x1, %r12
je 0x1931a1
movl 0x4(%rbx), %eax
cmpl %eax, (%rbx)
jne 0x19317f
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x2, %eax
cmovnel %ecx, %eax
movl %eax, 0x4(%rbx)
movq 0x8(%rbx), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
callq 0x2370
movq %rax, 0x8(%rbx)
movq 0x8(%rbx), %rax
movl (%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rbx)
leaq (%rcx,%rcx,2), %rcx
movq %r12, (%rax,%rcx,8)
movq 0x8(%rsp), %rdx
movq %rdx, 0x8(%rax,%rcx,8)
movq %rbp, 0x10(%rax,%rcx,8)
addq $0x19f8, %rsp           # imm = 0x19F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa05af(%rip), %rdi     # 0x233769
leaq 0xa05f5(%rip), %rsi     # 0x2337b6
leaq 0xa05f8(%rip), %rcx     # 0x2337c0
movl $0x5d4, %edx            # imm = 0x5D4
callq 0x2110