// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]oatk/syncmer.c
// Function: sr_read_analysis_thread
static void *sr_read_analysis_thread(void *args)
{
    p_data_t *dat = (p_data_t *) args;
    
    int len, k, w; 
    uint8_t *key;
    char *seq;
    k = dat->sr_db->s, w = dat->sr_db->k;
    assert(k > 0 && k < 32 && w > k);

    MYMALLOC(key, (w - 1) / 4 + 2);
    int r;
    for (r = 0; r < dat->n_reads; ++r) {
        sr_t sr;
        sr.sid = dat->sid[r];
        sr.sname = dat->name[r];

        seq = dat->seq[r];
        len = dat->len[r];

        kvec_t(uint8_t) hoco_s, ho_rl;
        kvec_t(uint32_t) ho_l_rl, n_nucl, m_pos;
        kvec_t(uint64_t) s_mer;
        kvec_t(uint64_t) k_mer;
    
        kv_init(hoco_s);
        kv_init(ho_rl);
        kv_init(ho_l_rl);
        kv_init(n_nucl);
        kv_init(m_pos);
        kv_init(s_mer);
        kv_init(k_mer);

        int q = w - k + 1; // buf q size
        uint64_t m, s, z, mz, shift1 = 2 * (k - 1), mask = (1ULL<<2*k) - 1, kmer[2] = {0, 0}, buf_m[q], buf_s[q];
        int i, j, l, c, neq, rl, hoco_l, buf_pos, mz_pos;

        MYBONE(buf_m, q);
        MYBONE(buf_s, q);
        mz = UINT64_MAX; // minimizer
        l = hoco_l = buf_pos = mz_pos = 0;
        for (i = 0; i < len; ++i) {
            c = seq_nt4_table[(uint8_t) seq[i]];
            m = s = UINT64_MAX;
            if ((hoco_l++ & 3) == 0) kv_push(uint8_t, hoco_s, 0);
            if (c < 4) { // not an ambiguous base
                // hoco_s.a[hoco_s.n - 1] = hoco_s.a[hoco_s.n - 1] << 2 | c;
                if (c) hoco_s.a[hoco_s.n - 1] |= c << ((((hoco_l-1)&3)^3)<<1); // 6 - ((hoco_l - 1) % 4) << 1;
                rl = 1;
#ifdef DO_HOCO_COMPRESSION    
                // hpc
                if (i + 1 < len && seq_nt4_table[(uint8_t)seq[i + 1]] == c) {
                    for (rl = 2; i + rl < len; ++rl)
                        if (seq_nt4_table[(uint8_t)seq[i + rl]] != c)
                            break;
                    i += rl - 1; // put $i at the end of the current homopolymer run
                }
#endif
                if (rl > 255)
                    kv_push(uint32_t, ho_l_rl, rl - 1);
                rl = MIN(rl, 256);
                kv_push(uint8_t, ho_rl, rl - 1);
            
                ++l;
                kmer[0] = (kmer[0] << 2 | c) & mask;           // forward k-mer
                kmer[1] = (kmer[1] >> 2) | (3ULL^c) << shift1; // reverse k-mer
                if (kmer[0] != kmer[1]) { // skip "symmetric k-mers" as we don't know it strand
                    z = kmer[0] < kmer[1]? 0 : 1; // strand
                    if (l >= k) {
                        m = hash64(kmer[z], mask);
                        s = kmer[z] << 1 | z;
                    }
                }
            } else {
                // ambiguous bases are converted to base 'A'
                // ambiguous bases are not homopolymer compressed
                // hoco_s.a[hoco_s.n - 1] <<= 2;
                kv_push(uint8_t, ho_rl, 0);
                kv_push(uint32_t, n_nucl, i);
                l = 0;
            }

            if (buf_pos == mz_pos && mz != UINT64_MAX && l > w) {
                // open syncmer
                z = buf_s[buf_pos] & 1;
                kv_push(uint64_t, s_mer, buf_s[buf_pos]);
                kv_push(uint32_t, m_pos, (hoco_l - w - 1) << 1 | z);
#ifdef DEBUG_KMER_EXTRACTION
                kv_push(uint64_t, k_mer, kmer_hash64(sr.sid, hoco_s.a, m_pos.a[m_pos.n-1], w, key));
#else
                kv_push(uint64_t, k_mer, kmer_hash64(hoco_s.a, m_pos.a[m_pos.n-1], w, key));
#endif
                // remove syncmers at the same position on a read
                // this is possible as a syncmer could start and end with the same smer
                if (m_pos.n >= 2 && m_pos.a[m_pos.n-1] >> 1 == m_pos.a[m_pos.n-2] >> 1) s_mer.n -= 2, m_pos.n -= 2, k_mer.n -= 2;
            }
            
            buf_m[buf_pos] = m;
            buf_s[buf_pos] = s;
            if (m <= mz && m != UINT64_MAX) {
                if (l >= w) {
                    // close syncmer
                    z = s & 1;
                    kv_push(uint64_t, s_mer, s^1);
                    kv_push(uint32_t, m_pos, (hoco_l - w) << 1 | z);
#ifdef DEBUG_KMER_EXTRACTION
                    kv_push(uint64_t, k_mer, kmer_hash64(sr.sid, hoco_s.a, m_pos.a[m_pos.n-1], w, key));
#else
                    kv_push(uint64_t, k_mer, kmer_hash64(hoco_s.a, m_pos.a[m_pos.n-1], w, key));
#endif
                }
                if (m < mz) mz = m, mz_pos = buf_pos;
            }
            if (m >= mz && buf_pos == mz_pos) {
                // m has been processed in the last 'if' statement if m == mz
                neq = m != mz;
                // update minimizer
                // find the first for identical minimizers
                for (j = buf_pos + 1, mz = UINT64_MAX; j < q; ++j)
                    if (mz > buf_m[j]) mz = buf_m[j], mz_pos = j;
                for (j = 0; j <= buf_pos; ++j)
                    if (mz > buf_m[j]) mz = buf_m[j], mz_pos = j;
                if (neq && ((mz_pos == q_next(buf_pos, q) && mz == m) || mz_pos == buf_pos) && mz != UINT64_MAX && l >= w) {
                    // newly added S-mer is a minimizer
                    // close syncmer
                    z = s & 1;
                    kv_push(uint64_t, s_mer, s^1);
                    kv_push(uint32_t, m_pos, (hoco_l - w) << 1 | z);
#ifdef DEBUG_KMER_EXTRACTION
                    kv_push(uint64_t, k_mer, kmer_hash64(sr.sid, hoco_s.a, m_pos.a[m_pos.n-1], w, key));
#else
                    kv_push(uint64_t, k_mer, kmer_hash64(hoco_s.a, m_pos.a[m_pos.n-1], w, key));
#endif
                }
            }
            
            buf_pos = q_next(buf_pos, q);
        }

        // for the last open mer
        if (buf_pos == mz_pos && mz != UINT64_MAX && l >= w) { // not (l > w) as l no self increment yet
            // open syncmer
            z = buf_s[buf_pos] & 1;
            kv_push(uint64_t, s_mer, buf_s[buf_pos]);
            kv_push(uint32_t, m_pos, (hoco_l - w) << 1 | z); // not (hoco_l - w - 1) as hoco_l no self increment yet
#ifdef DEBUG_KMER_EXTRACTION
            kv_push(uint64_t, k_mer, kmer_hash64(sr.sid, hoco_s.a, m_pos.a[m_pos.n-1], w, key));
#else
            kv_push(uint64_t, k_mer, kmer_hash64(hoco_s.a, m_pos.a[m_pos.n-1], w, key));
#endif
            if (m_pos.n >= 2 && m_pos.a[m_pos.n-1] >> 1 == m_pos.a[m_pos.n-2] >> 1) s_mer.n -= 2, m_pos.n -= 2, k_mer.n -= 2;
        }
    
        if (hoco_s.n) MYREALLOC(hoco_s.a, hoco_s.n);
        if (ho_rl.n) MYREALLOC(ho_rl.a, ho_rl.n);
        if (ho_l_rl.n) MYREALLOC(ho_l_rl.a, ho_l_rl.n);
        if (n_nucl.n) MYREALLOC(n_nucl.a, n_nucl.n);
        if (m_pos.n) MYREALLOC(m_pos.a, m_pos.n);
        if (s_mer.n) MYREALLOC(s_mer.a, s_mer.n);
        if (k_mer.n) MYREALLOC(k_mer.a, k_mer.n);

        sr.hoco_l = hoco_l;
        sr.hoco_s = hoco_s.a;
        sr.ho_rl = ho_rl.a;
        sr.ho_l_rl = ho_l_rl.a;
        sr.n_nucl = n_nucl.a;
        sr.n = m_pos.n;
        sr.m_pos = m_pos.a;
        sr.s_mer = s_mer.a;
        sr.k_mer = k_mer.a;
        kv_push(sr_t, *dat->sr_db, sr);

        free(seq);
    }

    free(key);

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x18(%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x16869
cmpl $0x20, -0x18(%rbp)
jge 0x16869
movl -0x1c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jle 0x16869
jmp 0x16888
leaq 0x17ab4(%rip), %rdi     # 0x2e324
leaq 0x1773f(%rip), %rsi     # 0x2dfb6
movl $0xfb, %edx
leaq 0x17aba(%rip), %rcx     # 0x2e33d
callq 0x21e0
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movl $0x4, %ecx
cltd
idivl %ecx
addl $0x2, %eax
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x2320
movq %rax, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x17e8b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
movq $0x0, -0xa0(%rbp)
movq $0x0, -0xa8(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0xb8(%rbp)
movq $0x0, -0xc0(%rbp)
movq $0x0, -0xb0(%rbp)
movq $0x0, -0xd0(%rbp)
movq $0x0, -0xd8(%rbp)
movq $0x0, -0xc8(%rbp)
movq $0x0, -0xe8(%rbp)
movq $0x0, -0xf0(%rbp)
movq $0x0, -0xe0(%rbp)
movq $0x0, -0x100(%rbp)
movq $0x0, -0x108(%rbp)
movq $0x0, -0xf8(%rbp)
movq $0x0, -0x118(%rbp)
movq $0x0, -0x120(%rbp)
movq $0x0, -0x110(%rbp)
movq $0x0, -0x130(%rbp)
movq $0x0, -0x138(%rbp)
movq $0x0, -0x128(%rbp)
movl -0x1c(%rbp), %eax
movl -0x18(%rbp), %ecx
subl %ecx, %eax
incl %eax
movl %eax, -0x13c(%rbp)
movl -0x18(%rbp), %ecx
movl %ecx, %eax
leal -0x2(%rax,%rax), %eax
cltq
movq %rax, -0x168(%rbp)
movb -0x18(%rbp), %cl
addb %cl, %cl
movl $0x1, %eax
shlq %cl, %rax
decq %rax
movq %rax, -0x170(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x180(%rbp)
movl -0x13c(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x188(%rbp)
leaq 0xf(,%rax,8), %rcx
andq $-0x10, %rcx
movq %rsp, %rdi
subq %rcx, %rdi
movq %rdi, -0x1d0(%rbp)
movq %rdi, %rsp
movq %rax, -0x190(%rbp)
movl -0x13c(%rbp), %eax
leaq 0xf(,%rax,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x1c8(%rbp)
movq %rcx, %rsp
movq %rax, -0x198(%rbp)
movslq -0x13c(%rbp), %rdx
shlq $0x3, %rdx
movl $0xff, %esi
callq 0x21f0
movq -0x1c8(%rbp), %rdi
movslq -0x13c(%rbp), %rdx
shlq $0x3, %rdx
movl $0xff, %esi
callq 0x21f0
movq $-0x1, -0x160(%rbp)
movl $0x0, -0x1bc(%rbp)
movl $0x0, -0x1b8(%rbp)
movl $0x0, -0x1b4(%rbp)
movl $0x0, -0x1a4(%rbp)
movl $0x0, -0x19c(%rbp)
movl -0x19c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x17978
movq -0x30(%rbp), %rax
movslq -0x19c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x17272(%rip), %rax     # 0x2dda0
movzbl (%rax,%rcx), %eax
movl %eax, -0x1a8(%rbp)
movq $-0x1, -0x150(%rbp)
movq $-0x1, -0x148(%rbp)
movl -0x1b4(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x1b4(%rbp)
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x16bf8
jmp 0x16b6d
movq -0xa8(%rbp), %rax
cmpq -0xa0(%rbp), %rax
jne 0x16bd4
cmpq $0x0, -0xa0(%rbp)
je 0x16b9a
movq -0xa0(%rbp), %rax
shlq %rax
movq %rax, -0x1d8(%rbp)
jmp 0x16ba8
movl $0x2, %eax
movq %rax, -0x1d8(%rbp)
jmp 0x16ba8
movq -0x1d8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq -0xa8(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0xa8(%rbp)
movb $0x0, (%rax,%rcx)
jmp 0x16bf6
jmp 0x16bf8
cmpl $0x4, -0x1a8(%rbp)
jge 0x16f4a
cmpl $0x0, -0x1a8(%rbp)
je 0x16c42
movl -0x1a8(%rbp), %esi
movl -0x1b4(%rbp), %ecx
subl $0x1, %ecx
andl $0x3, %ecx
xorl $0x3, %ecx
shll %ecx
shll %cl, %esi
movq -0x98(%rbp), %rax
movq -0xa8(%rbp), %rcx
subq $0x1, %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movl $0x1, -0x1b0(%rbp)
movl -0x19c(%rbp), %eax
addl $0x1, %eax
cmpl -0x14(%rbp), %eax
jge 0x16cf8
movq -0x30(%rbp), %rax
movl -0x19c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x17125(%rip), %rax     # 0x2dda0
movzbl (%rax,%rcx), %eax
cmpl -0x1a8(%rbp), %eax
jne 0x16cf8
movl $0x2, -0x1b0(%rbp)
movl -0x19c(%rbp), %eax
addl -0x1b0(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x16ce3
movq -0x30(%rbp), %rax
movl -0x19c(%rbp), %ecx
addl -0x1b0(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x170de(%rip), %rax     # 0x2dda0
movzbl (%rax,%rcx), %eax
cmpl -0x1a8(%rbp), %eax
je 0x16cd0
jmp 0x16ce3
jmp 0x16cd2
movl -0x1b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1b0(%rbp)
jmp 0x16c91
movl -0x1b0(%rbp), %eax
subl $0x1, %eax
addl -0x19c(%rbp), %eax
movl %eax, -0x19c(%rbp)
cmpl $0xff, -0x1b0(%rbp)
jle 0x16d9d
jmp 0x16d0a
movq -0xd8(%rbp), %rax
cmpq -0xd0(%rbp), %rax
jne 0x16d71
cmpq $0x0, -0xd0(%rbp)
je 0x16d37
movq -0xd0(%rbp), %rax
shlq %rax
movq %rax, -0x1e0(%rbp)
jmp 0x16d45
movl $0x2, %eax
movq %rax, -0x1e0(%rbp)
jmp 0x16d45
movq -0x1e0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, -0xc8(%rbp)
movl -0x1b0(%rbp), %edx
subl $0x1, %edx
movq -0xc8(%rbp), %rax
movq -0xd8(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0xd8(%rbp)
movl %edx, (%rax,%rcx,4)
jmp 0x16d9b
jmp 0x16d9d
cmpl $0x100, -0x1b0(%rbp)    # imm = 0x100
jge 0x16db7
movl -0x1b0(%rbp), %eax
movl %eax, -0x1e4(%rbp)
jmp 0x16dc4
movl $0x100, %eax            # imm = 0x100
movl %eax, -0x1e4(%rbp)
jmp 0x16dc4
movl -0x1e4(%rbp), %eax
movl %eax, -0x1b0(%rbp)
movq -0xc0(%rbp), %rax
cmpq -0xb8(%rbp), %rax
jne 0x16e37
cmpq $0x0, -0xb8(%rbp)
je 0x16dfd
movq -0xb8(%rbp), %rax
shlq %rax
movq %rax, -0x1f0(%rbp)
jmp 0x16e0b
movl $0x2, %eax
movq %rax, -0x1f0(%rbp)
jmp 0x16e0b
movq -0x1f0(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, -0xb0(%rbp)
movl -0x1b0(%rbp), %eax
subl $0x1, %eax
movb %al, %dl
movq -0xb0(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0xc0(%rbp)
movb %dl, (%rax,%rcx)
jmp 0x16e63
movl -0x1a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a4(%rbp)
movq -0x180(%rbp), %rax
shlq $0x2, %rax
movslq -0x1a8(%rbp), %rcx
orq %rcx, %rax
andq -0x170(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x178(%rbp), %rax
shrq $0x2, %rax
movslq -0x1a8(%rbp), %rdx
xorq $0x3, %rdx
movq -0x168(%rbp), %rcx
shlq %cl, %rdx
movq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x178(%rbp)
movq -0x180(%rbp), %rax
cmpq -0x178(%rbp), %rax
je 0x16f45
movq -0x180(%rbp), %rdx
movq -0x178(%rbp), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovbl %ecx, %eax
cltq
movq %rax, -0x158(%rbp)
movl -0x1a4(%rbp), %eax
cmpl -0x18(%rbp), %eax
jl 0x16f43
movq -0x158(%rbp), %rax
movq -0x180(%rbp,%rax,8), %rdi
movq -0x170(%rbp), %rsi
callq 0x17ea0
movq %rax, -0x148(%rbp)
movq -0x158(%rbp), %rax
movq -0x180(%rbp,%rax,8), %rax
shlq %rax
orq -0x158(%rbp), %rax
movq %rax, -0x150(%rbp)
jmp 0x16f45
jmp 0x1706f
jmp 0x16f4c
movq -0xc0(%rbp), %rax
cmpq -0xb8(%rbp), %rax
jne 0x16fb3
cmpq $0x0, -0xb8(%rbp)
je 0x16f79
movq -0xb8(%rbp), %rax
shlq %rax
movq %rax, -0x1f8(%rbp)
jmp 0x16f87
movl $0x2, %eax
movq %rax, -0x1f8(%rbp)
jmp 0x16f87
movq -0x1f8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0xc0(%rbp)
movb $0x0, (%rax,%rcx)
jmp 0x16fd5
jmp 0x16fd7
movq -0xf0(%rbp), %rax
cmpq -0xe8(%rbp), %rax
jne 0x1703e
cmpq $0x0, -0xe8(%rbp)
je 0x17004
movq -0xe8(%rbp), %rax
shlq %rax
movq %rax, -0x200(%rbp)
jmp 0x17012
movl $0x2, %eax
movq %rax, -0x200(%rbp)
jmp 0x17012
movq -0x200(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xe0(%rbp), %rdi
movq -0xe8(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, -0xe0(%rbp)
movl -0x19c(%rbp), %edx
movq -0xe0(%rbp), %rax
movq -0xf0(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0xf0(%rbp)
movl %edx, (%rax,%rcx,4)
jmp 0x17065
movl $0x0, -0x1a4(%rbp)
movl -0x1b8(%rbp), %eax
cmpl -0x1bc(%rbp), %eax
jne 0x17323
cmpq $-0x1, -0x160(%rbp)
je 0x17323
movl -0x1a4(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jle 0x17323
movq -0x1c8(%rbp), %rax
movslq -0x1b8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
movq %rax, -0x158(%rbp)
movq -0x120(%rbp), %rax
cmpq -0x118(%rbp), %rax
jne 0x17122
cmpq $0x0, -0x118(%rbp)
je 0x170e8
movq -0x118(%rbp), %rax
shlq %rax
movq %rax, -0x208(%rbp)
jmp 0x170f6
movl $0x2, %eax
movq %rax, -0x208(%rbp)
jmp 0x170f6
movq -0x208(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rdi
movq -0x118(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x110(%rbp)
movq -0x1c8(%rbp), %rax
movslq -0x1b8(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x110(%rbp), %rax
movq -0x120(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x120(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x17156
jmp 0x17158
movq -0x108(%rbp), %rax
cmpq -0x100(%rbp), %rax
jne 0x171bf
cmpq $0x0, -0x100(%rbp)
je 0x17185
movq -0x100(%rbp), %rax
shlq %rax
movq %rax, -0x210(%rbp)
jmp 0x17193
movl $0x2, %eax
movq %rax, -0x210(%rbp)
jmp 0x17193
movq -0x210(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rdi
movq -0x100(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, -0xf8(%rbp)
movl -0x1b4(%rbp), %eax
subl -0x1c(%rbp), %eax
subl $0x1, %eax
shll %eax
cltq
orq -0x158(%rbp), %rax
movl %eax, %edx
movq -0xf8(%rbp), %rax
movq -0x108(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x108(%rbp)
movl %edx, (%rax,%rcx,4)
jmp 0x171f9
jmp 0x171fb
movq -0x138(%rbp), %rax
cmpq -0x130(%rbp), %rax
jne 0x17262
cmpq $0x0, -0x130(%rbp)
je 0x17228
movq -0x130(%rbp), %rax
shlq %rax
movq %rax, -0x218(%rbp)
jmp 0x17236
movl $0x2, %eax
movq %rax, -0x218(%rbp)
jmp 0x17236
movq -0x218(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x128(%rbp), %rdi
movq -0x130(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x128(%rbp)
movq -0x98(%rbp), %rdi
movq -0xf8(%rbp), %rax
movq -0x108(%rbp), %rcx
subq $0x1, %rcx
movl (%rax,%rcx,4), %esi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rcx
callq 0x17f70
movq %rax, %rdx
movq -0x128(%rbp), %rax
movq -0x138(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x138(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x172af
cmpq $0x2, -0x108(%rbp)
jb 0x17321
movq -0xf8(%rbp), %rax
movq -0x108(%rbp), %rcx
subq $0x1, %rcx
movl (%rax,%rcx,4), %eax
shrl %eax
movq -0xf8(%rbp), %rcx
movq -0x108(%rbp), %rdx
subq $0x2, %rdx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
cmpl %ecx, %eax
jne 0x17321
movq -0x120(%rbp), %rax
subq $0x2, %rax
movq %rax, -0x120(%rbp)
movq -0x108(%rbp), %rax
subq $0x2, %rax
movq %rax, -0x108(%rbp)
movq -0x138(%rbp), %rax
subq $0x2, %rax
movq %rax, -0x138(%rbp)
jmp 0x17323
movq -0x1c8(%rbp), %rax
movq -0x1d0(%rbp), %rcx
movq -0x148(%rbp), %rsi
movslq -0x1b8(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq -0x150(%rbp), %rdx
movslq -0x1b8(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x148(%rbp), %rax
cmpq -0x160(%rbp), %rax
ja 0x175b0
cmpq $-0x1, -0x148(%rbp)
je 0x175b0
movl -0x1a4(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0x17584
movq -0x150(%rbp), %rax
andq $0x1, %rax
movq %rax, -0x158(%rbp)
movq -0x120(%rbp), %rax
cmpq -0x118(%rbp), %rax
jne 0x173ff
cmpq $0x0, -0x118(%rbp)
je 0x173c5
movq -0x118(%rbp), %rax
shlq %rax
movq %rax, -0x220(%rbp)
jmp 0x173d3
movl $0x2, %eax
movq %rax, -0x220(%rbp)
jmp 0x173d3
movq -0x220(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rdi
movq -0x118(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x110(%rbp)
movq -0x150(%rbp), %rdx
xorq $0x1, %rdx
movq -0x110(%rbp), %rax
movq -0x120(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x120(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x1742c
jmp 0x1742e
movq -0x108(%rbp), %rax
cmpq -0x100(%rbp), %rax
jne 0x17495
cmpq $0x0, -0x100(%rbp)
je 0x1745b
movq -0x100(%rbp), %rax
shlq %rax
movq %rax, -0x228(%rbp)
jmp 0x17469
movl $0x2, %eax
movq %rax, -0x228(%rbp)
jmp 0x17469
movq -0x228(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rdi
movq -0x100(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, -0xf8(%rbp)
movl -0x1b4(%rbp), %eax
subl -0x1c(%rbp), %eax
shll %eax
cltq
orq -0x158(%rbp), %rax
movl %eax, %edx
movq -0xf8(%rbp), %rax
movq -0x108(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x108(%rbp)
movl %edx, (%rax,%rcx,4)
jmp 0x174cc
jmp 0x174ce
movq -0x138(%rbp), %rax
cmpq -0x130(%rbp), %rax
jne 0x17535
cmpq $0x0, -0x130(%rbp)
je 0x174fb
movq -0x130(%rbp), %rax
shlq %rax
movq %rax, -0x230(%rbp)
jmp 0x17509
movl $0x2, %eax
movq %rax, -0x230(%rbp)
jmp 0x17509
movq -0x230(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x128(%rbp), %rdi
movq -0x130(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x128(%rbp)
movq -0x98(%rbp), %rdi
movq -0xf8(%rbp), %rax
movq -0x108(%rbp), %rcx
subq $0x1, %rcx
movl (%rax,%rcx,4), %esi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rcx
callq 0x17f70
movq %rax, %rdx
movq -0x128(%rbp), %rax
movq -0x138(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x138(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x17582
jmp 0x17584
movq -0x148(%rbp), %rax
cmpq -0x160(%rbp), %rax
jae 0x175ae
movq -0x148(%rbp), %rax
movq %rax, -0x160(%rbp)
movl -0x1b8(%rbp), %eax
movl %eax, -0x1bc(%rbp)
jmp 0x175b0
movq -0x148(%rbp), %rax
cmpq -0x160(%rbp), %rax
jb 0x1794d
movl -0x1b8(%rbp), %eax
cmpl -0x1bc(%rbp), %eax
jne 0x1794d
movq -0x148(%rbp), %rax
cmpq -0x160(%rbp), %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x1ac(%rbp)
movl -0x1b8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a0(%rbp)
movq $-0x1, -0x160(%rbp)
movl -0x1a0(%rbp), %eax
cmpl -0x13c(%rbp), %eax
jge 0x1766d
movq -0x1d0(%rbp), %rcx
movq -0x160(%rbp), %rax
movslq -0x1a0(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
jbe 0x1765a
movq -0x1d0(%rbp), %rax
movslq -0x1a0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x160(%rbp)
movl -0x1a0(%rbp), %eax
movl %eax, -0x1bc(%rbp)
jmp 0x1765c
movl -0x1a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a0(%rbp)
jmp 0x1760c
movl $0x0, -0x1a0(%rbp)
movl -0x1a0(%rbp), %eax
cmpl -0x1b8(%rbp), %eax
jg 0x176d8
movq -0x1d0(%rbp), %rcx
movq -0x160(%rbp), %rax
movslq -0x1a0(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
jbe 0x176c5
movq -0x1d0(%rbp), %rax
movslq -0x1a0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x160(%rbp)
movl -0x1a0(%rbp), %eax
movl %eax, -0x1bc(%rbp)
jmp 0x176c7
movl -0x1a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a0(%rbp)
jmp 0x17677
cmpl $0x0, -0x1ac(%rbp)
je 0x1794b
movl -0x1bc(%rbp), %eax
movl %eax, -0x234(%rbp)
movl -0x1b8(%rbp), %edi
movl -0x13c(%rbp), %esi
callq 0x181b0
movl %eax, %ecx
movl -0x234(%rbp), %eax
cmpl %ecx, %eax
jne 0x1771e
movq -0x160(%rbp), %rax
cmpq -0x148(%rbp), %rax
je 0x17730
movl -0x1bc(%rbp), %eax
cmpl -0x1b8(%rbp), %eax
jne 0x1794b
cmpq $-0x1, -0x160(%rbp)
je 0x1794b
movl -0x1a4(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0x1794b
movq -0x150(%rbp), %rax
andq $0x1, %rax
movq %rax, -0x158(%rbp)
movq -0x120(%rbp), %rax
cmpq -0x118(%rbp), %rax
jne 0x177c6
cmpq $0x0, -0x118(%rbp)
je 0x1778c
movq -0x118(%rbp), %rax
shlq %rax
movq %rax, -0x240(%rbp)
jmp 0x1779a
movl $0x2, %eax
movq %rax, -0x240(%rbp)
jmp 0x1779a
movq -0x240(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rdi
movq -0x118(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x110(%rbp)
movq -0x150(%rbp), %rdx
xorq $0x1, %rdx
movq -0x110(%rbp), %rax
movq -0x120(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x120(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x177f3
jmp 0x177f5
movq -0x108(%rbp), %rax
cmpq -0x100(%rbp), %rax
jne 0x1785c
cmpq $0x0, -0x100(%rbp)
je 0x17822
movq -0x100(%rbp), %rax
shlq %rax
movq %rax, -0x248(%rbp)
jmp 0x17830
movl $0x2, %eax
movq %rax, -0x248(%rbp)
jmp 0x17830
movq -0x248(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rdi
movq -0x100(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, -0xf8(%rbp)
movl -0x1b4(%rbp), %eax
subl -0x1c(%rbp), %eax
shll %eax
cltq
orq -0x158(%rbp), %rax
movl %eax, %edx
movq -0xf8(%rbp), %rax
movq -0x108(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x108(%rbp)
movl %edx, (%rax,%rcx,4)
jmp 0x17893
jmp 0x17895
movq -0x138(%rbp), %rax
cmpq -0x130(%rbp), %rax
jne 0x178fc
cmpq $0x0, -0x130(%rbp)
je 0x178c2
movq -0x130(%rbp), %rax
shlq %rax
movq %rax, -0x250(%rbp)
jmp 0x178d0
movl $0x2, %eax
movq %rax, -0x250(%rbp)
jmp 0x178d0
movq -0x250(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x128(%rbp), %rdi
movq -0x130(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x128(%rbp)
movq -0x98(%rbp), %rdi
movq -0xf8(%rbp), %rax
movq -0x108(%rbp), %rcx
subq $0x1, %rcx
movl (%rax,%rcx,4), %esi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rcx
callq 0x17f70
movq %rax, %rdx
movq -0x128(%rbp), %rax
movq -0x138(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x138(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x17949
jmp 0x1794b
jmp 0x1794d
movl -0x1b8(%rbp), %edi
movl -0x13c(%rbp), %esi
callq 0x181b0
movl %eax, -0x1b8(%rbp)
movl -0x19c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x19c(%rbp)
jmp 0x16b07
movl -0x1b8(%rbp), %eax
cmpl -0x1bc(%rbp), %eax
jne 0x17c29
cmpq $-0x1, -0x160(%rbp)
je 0x17c29
movl -0x1a4(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0x17c29
movq -0x1c8(%rbp), %rax
movslq -0x1b8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
movq %rax, -0x158(%rbp)
movq -0x120(%rbp), %rax
cmpq -0x118(%rbp), %rax
jne 0x17a2b
cmpq $0x0, -0x118(%rbp)
je 0x179f1
movq -0x118(%rbp), %rax
shlq %rax
movq %rax, -0x258(%rbp)
jmp 0x179ff
movl $0x2, %eax
movq %rax, -0x258(%rbp)
jmp 0x179ff
movq -0x258(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rdi
movq -0x118(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x110(%rbp)
movq -0x1c8(%rbp), %rax
movslq -0x1b8(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x110(%rbp), %rax
movq -0x120(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x120(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x17a5f
jmp 0x17a61
movq -0x108(%rbp), %rax
cmpq -0x100(%rbp), %rax
jne 0x17ac8
cmpq $0x0, -0x100(%rbp)
je 0x17a8e
movq -0x100(%rbp), %rax
shlq %rax
movq %rax, -0x260(%rbp)
jmp 0x17a9c
movl $0x2, %eax
movq %rax, -0x260(%rbp)
jmp 0x17a9c
movq -0x260(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rdi
movq -0x100(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, -0xf8(%rbp)
movl -0x1b4(%rbp), %eax
subl -0x1c(%rbp), %eax
shll %eax
cltq
orq -0x158(%rbp), %rax
movl %eax, %edx
movq -0xf8(%rbp), %rax
movq -0x108(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x108(%rbp)
movl %edx, (%rax,%rcx,4)
jmp 0x17aff
jmp 0x17b01
movq -0x138(%rbp), %rax
cmpq -0x130(%rbp), %rax
jne 0x17b68
cmpq $0x0, -0x130(%rbp)
je 0x17b2e
movq -0x130(%rbp), %rax
shlq %rax
movq %rax, -0x268(%rbp)
jmp 0x17b3c
movl $0x2, %eax
movq %rax, -0x268(%rbp)
jmp 0x17b3c
movq -0x268(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x128(%rbp), %rdi
movq -0x130(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x128(%rbp)
movq -0x98(%rbp), %rdi
movq -0xf8(%rbp), %rax
movq -0x108(%rbp), %rcx
subq $0x1, %rcx
movl (%rax,%rcx,4), %esi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rcx
callq 0x17f70
movq %rax, %rdx
movq -0x128(%rbp), %rax
movq -0x138(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x138(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x17bb5
cmpq $0x2, -0x108(%rbp)
jb 0x17c27
movq -0xf8(%rbp), %rax
movq -0x108(%rbp), %rcx
subq $0x1, %rcx
movl (%rax,%rcx,4), %eax
shrl %eax
movq -0xf8(%rbp), %rcx
movq -0x108(%rbp), %rdx
subq $0x2, %rdx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
cmpl %ecx, %eax
jne 0x17c27
movq -0x120(%rbp), %rax
subq $0x2, %rax
movq %rax, -0x120(%rbp)
movq -0x108(%rbp), %rax
subq $0x2, %rax
movq %rax, -0x108(%rbp)
movq -0x138(%rbp), %rax
subq $0x2, %rax
movq %rax, -0x138(%rbp)
jmp 0x17c29
cmpq $0x0, -0xa8(%rbp)
je 0x17c51
movq -0x98(%rbp), %rdi
movq -0xa8(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, -0x98(%rbp)
cmpq $0x0, -0xc0(%rbp)
je 0x17c79
movq -0xb0(%rbp), %rdi
movq -0xc0(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xd8(%rbp)
je 0x17ca1
movq -0xc8(%rbp), %rdi
movq -0xd8(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, -0xc8(%rbp)
cmpq $0x0, -0xf0(%rbp)
je 0x17cc9
movq -0xe0(%rbp), %rdi
movq -0xf0(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, -0xe0(%rbp)
cmpq $0x0, -0x108(%rbp)
je 0x17cf1
movq -0xf8(%rbp), %rdi
movq -0x108(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, -0xf8(%rbp)
cmpq $0x0, -0x120(%rbp)
je 0x17d19
movq -0x110(%rbp), %rdi
movq -0x120(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x110(%rbp)
cmpq $0x0, -0x138(%rbp)
je 0x17d41
movq -0x128(%rbp), %rdi
movq -0x138(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x128(%rbp)
movl -0x1b4(%rbp), %eax
movl %eax, -0x80(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x108(%rbp), %rax
movl %eax, -0x58(%rbp)
movq -0xf8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jne 0x17e2f
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0x17de1
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x270(%rbp)
jmp 0x17def
movl $0x2, %eax
movq %rax, -0x270(%rbp)
jmp 0x17def
movq -0x270(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
imulq $0x58, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
imulq $0x58, %rax, %rax
addq %rax, %rdi
leaq -0x90(%rbp), %rsi
movl $0x58, %edx
callq 0x22c0
jmp 0x17e6a
movq -0x30(%rbp), %rdi
callq 0x2060
movq -0x188(%rbp), %rax
movq %rax, %rsp
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x168b0
movq -0x28(%rbp), %rdi
callq 0x2060
xorl %eax, %eax
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax,%rax)