// File: /workspace/github_c_makefile_star2_O1/c-zhou[P]oatk/path.c
// Function: path_rotate_core
static double path_rotate_core(asg_t *g, path_t *path, hmm_annot_db_t *annots, OG_TYPE_t og_type)
{
    uint32_t i, j;
    const uint32_t g_n = athaliana_pltd_g71n;
    const char *const *genes = athaliana_pltd_g71;
    kh_str_t *gene_db;
    kh_s32_t *segs;
    khint32_t k, k1;
    uint64_t v;
    hmm_annot_t *annot, *annot1;
    double coeff = .0;
    int absent;

    assert(g_n < 256);

    // add core genes to table
    gene_db = kh_str_init();
    for (i = 0; i < g_n; ++i) {
        k = kh_str_put(gene_db, genes[i], &absent);
        kh_val(gene_db, k) = (uint64_t) i << 32 | UINT32_MAX;
    }

    // only need segs in the path
    segs = kh_s32_init();
    for (i = 0; i < path->nv; ++i) {
        k = kh_s32_put(segs, path->v[i]>>1, &absent);
        if (absent)
            kh_val(segs, k) = 1;
        else
            kh_val(segs, k) += 1;
    }

    // find (best) positions for core genes
    // on segs included in the path
    for (i = 0; i < annots->n; ++i) {
        annot = &annots->a[i];
        if (annot->og_type == (uint32_t) og_type) {
            k = kh_str_get(gene_db, annot->gname);
            k1 = kh_s32_get(segs, asg_name2id(g, annot->sname)); // sid might not set
            if (k < kh_end(gene_db) && k1 < kh_end(segs) && kh_val(segs, k1) == 1) {
                v = kh_val(gene_db, k);
                annot1 = (uint32_t) v == UINT32_MAX? 0 : &annots->a[(uint32_t) v];
                if (annot1 == 0 || annot1->score < annot->score)
                    kh_val(gene_db, k) = v >> 32 << 32 | i;
            }
        }
    }

    // do rotation if path is circular
    if (path->circ) {
        uint32_t s;
        for (i = 0, s = UINT32_MAX; i < g_n; ++i) {
            k = kh_str_get(gene_db, genes[i]);
            v = kh_val(gene_db, k);
            if ((uint32_t) v != UINT32_MAX) {
                s = (uint32_t) v;
                break;
            }
        }

        if (s != UINT32_MAX) {
            s = asg_name2id(g, annots->a[s].sname);
            // find start seg
            uint32_t t;
            for (i = 0, t = UINT32_MAX; i < path->nv; ++i) {
                if (path->v[i] >> 1 == s) {
                    t = i;
                    break;
                }
            }
            assert(t != UINT32_MAX);
            // do rotation to make t the first seg
            array_left_rotate(path->v, t, path->nv);
        }
    }

    // make gene orders in path
    kvec_t(uint64_t) g_ord;
    uint64_t w;
    kv_init(g_ord);
    for (k = (khint32_t) 0; k < kh_end(gene_db); ++k) {
        if (kh_exist(gene_db, k) && (uint32_t) (v = kh_val(gene_db, k)) != UINT32_MAX) {
            annot = &annots->a[(uint32_t) v];
            w  = (uint64_t) asg_name2id(g, annot->sname) << 40;
            w |= (uint64_t) (annot->alifrom + annot->alito) >> 1 << 8;
            w |= v >> 32;
            kv_push(uint64_t, g_ord, w);
        }
    }

    if (g_ord.n == 0) goto rotate_done;

    qsort(g_ord.a, g_ord.n, sizeof(uint64_t), u64_cmpfunc);

    uint64_t *idx;
    uint32_t last;
    MYCALLOC(idx, g->n_seg);
    for (i = 1, last = 0; i <= g_ord.n; ++i) {
        if (i == g_ord.n || (g_ord.a[i-1] >> 40) != (g_ord.a[i] >> 40))
            idx[g_ord.a[i-1] >> 40] = (uint64_t) last << 32 | (i - last), last = i;
    }

    uint32_t *p_ord, s, p, n, m;
    MYMALLOC(p_ord, g_ord.n);
    m = 0;
    for (i = 0; i < path->nv; ++i) {
        s = path->v[i] >> 1;
        p = idx[s] >> 32;
        n = (uint32_t) idx[s];
        if (n == 0) continue;
        if (path->v[i] & 1) {
            for (j = 0; j < n; ++j)
                p_ord[m++] = g_ord.a[p+n-1-j] & 0xFF;
        } else {
            for (j = 0; j < n; ++j)
                p_ord[m++] = g_ord.a[p+j] & 0xFF;
        }
    }

    assert(m == g_ord.n);

    // wrap gaps
    uint32_t *p_gap;
    MYCALLOC(p_gap, g_n);
    for (i = 0; i < m; ++i)
        ++p_gap[p_ord[i]];
    for (i = 1; i < g_n; ++i)
        p_gap[i] += p_gap[i-1];
    for (i = 0; i < m; ++i)
        p_ord[i] -= p_ord[i] - p_gap[p_ord[i]] + 1;
    free(p_gap);

    // calculate Spearman's rank correlation coefficient
    double ds, srcc;
    ds = .0;
    for (i = 0; i < g_ord.n; ++i)
        ds += ((double) p_ord[i] - i) * ((double) p_ord[i] - i);
    srcc = 1. - 6 * ds / g_ord.n / ((double) g_ord.n * g_ord.n - 1);

#ifdef DEBUG_SRCC
    // calculate Kendall's tau rank correlation coefficient
    double tau;
    ds = .0;
    for (i = 0; i < g_ord.n; ++i)
        for (j = i + 1; j < g_ord.n; ++j)
            ds += p_ord[i] > p_ord[j];
    tau = 1. - 2 * ds / g_ord.n / (g_ord.n - 1);
    fprintf(stderr, "[DEBUG_SRCC::%s] SRCC, %.6f; TAU, %.6f; N, %d\n", __func__, srcc, tau, m);
    for (i = 0; i < m; ++i)
        fprintf(stderr, "[DEBUG_SRCC::%s] %d %d\n", __func__, i, p_ord[i]);
#endif

    coeff = srcc;

    free(idx);
    free(p_ord);

rotate_done:
    kv_destroy(g_ord);
    kh_str_destroy(gene_db);
    kh_s32_destroy(segs);

    return coeff;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %ecx, 0x30(%rsp)
movq %rdx, 0x38(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdi, 0x48(%rsp)
movl $0x1, %esi
movl $0x20, %edx
xorl %edi, %edi
callq 0x171c8
movq %rax, %rbx
movq $0x0, 0x18(%rax)
xorl %esi, %esi
cmpq $0x0, 0x10(%rbx)
movl $0x0, %r14d
je 0x8a1d
movb (%rbx), %cl
movl $0x1, %r14d
shll %cl, %r14d
leaq 0x1613c(%rip), %rax     # 0x1eb60
movq %rsi, 0x20(%rsp)
movq (%rax,%rsi,8), %r13
movl 0x4(%rbx), %eax
movl %r14d, %ecx
shrl %ecx
movl %r14d, %edx
shrl $0x2, %edx
addl %ecx, %edx
cmpl %edx, %eax
jae 0x8a49
movl %r14d, %ebp
jmp 0x8c93
leal 0x1(%r14), %ecx
bsrl %ecx, %edx
cmpl $0x2, %ecx
movl $0x0, %esi
cmovbl %esi, %edx
andl %r14d, %ecx
cmpl $0x1, %ecx
sbbl $-0x1, %edx
cmpl $0x3, %edx
movl $0x2, %r12d
cmovael %edx, %r12d
movl $0x1, %ebp
movl %r12d, %ecx
shll %cl, %ebp
movl %ebp, %ecx
shrl %ecx
movl %ebp, %esi
shrl $0x2, %esi
addl %ecx, %esi
cmpl %esi, %eax
ja 0x8c8a
movq 0x18(%rbx), %rdi
movq %rbp, 0x8(%rsp)
shrl $0x3, %ebp
andl $-0x4, %ebp
cmpl $0x5, %edx
movl $0x4, %eax
cmovbl %eax, %ebp
movq %rbp, %rsi
callq 0x17335
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x31b0
testq %r15, %r15
je 0x8d43
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
movl %r12d, 0x18(%rsp)
je 0x8ae2
movb (%rbx), %cl
movl $0x1, %ebp
shll %cl, %ebp
jmp 0x8ae4
xorl %ebp, %ebp
movq 0x8(%rsp), %rax
cmpl %eax, %ebp
jae 0x8b1f
movq 0x18(%rbx), %rdi
movl %eax, %edx
shlq $0x4, %rdx
callq 0x17438
movq %rax, %r12
testq %rax, %rax
je 0x8b0a
movq %r12, 0x10(%rbx)
jmp 0x8b16
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0x1726a
testq %r12, %r12
je 0x8d43
testl %ebp, %ebp
je 0x8c53
movq 0x8(%rsp), %rax
leal -0x1(%rax), %edi
movl $0x20, %eax
subl 0x18(%rsp), %eax
movl %ebp, %ecx
movq %rcx, 0x10(%rsp)
xorl %edx, %edx
movq 0x8(%rbx), %rsi
movl %edx, %r11d
shrl $0x5, %r11d
movl (%rsi,%r11,4), %r14d
movl $0x1, %r12d
movl %edx, %ecx
shll %cl, %r12d
btl %edx, %r14d
jae 0x8c45
movq 0x10(%rbx), %rcx
movq %rdx, %r9
shlq $0x4, %r9
movq (%rcx,%r9), %r10
movq 0x8(%rcx,%r9), %r8
notl %r12d
andl %r12d, %r14d
movl %r14d, (%rsi,%r11,4)
movsbl (%r10), %ecx
testl %ecx, %ecx
je 0x8bb6
movb 0x1(%r10), %sil
testb %sil, %sil
je 0x8bb8
leaq 0x2(%r10), %r11
movl %ecx, %r14d
shll $0x5, %r14d
subl %ecx, %r14d
movsbl %sil, %ecx
addl %r14d, %ecx
movb (%r11), %sil
incq %r11
testb %sil, %sil
jne 0x8b98
jmp 0x8bb8
xorl %ecx, %ecx
imull $0x9e3779b9, %ecx, %esi # imm = 0x9E3779B9
movl %eax, %ecx
shrl %cl, %esi
movl %esi, %r11d
shrl $0x5, %r11d
movl (%r15,%r11,4), %r12d
movl $0x1, %r14d
movl %esi, %ecx
shll %cl, %r14d
btl %esi, %r12d
jae 0x8be4
incl %esi
andl %edi, %esi
jmp 0x8bc2
orl %r14d, %r12d
movl %r12d, (%r15,%r11,4)
movl %esi, %ecx
cmpl %ebp, %esi
jae 0x8c2a
movq 0x8(%rbx), %rsi
testl %r14d, (%rsi,%r11,4)
je 0x8c2a
movq 0x10(%rbx), %rsi
shlq $0x4, %rcx
movq (%rsi,%rcx), %r12
movq 0x8(%rsi,%rcx), %r9
movq %r10, (%rsi,%rcx)
movq %r8, 0x8(%rsi,%rcx)
notl %r14d
movq 0x8(%rbx), %rcx
andl %r14d, (%rcx,%r11,4)
movb $0x1, %cl
movq %r9, %r8
movq %r12, %r10
jmp 0x8c3d
movq 0x10(%rbx), %rsi
shlq $0x4, %rcx
movq %r10, (%rsi,%rcx)
movq %r8, 0x8(%rsi,%rcx)
xorl %ecx, %ecx
testb %cl, %cl
jne 0x8b83
incq %rdx
cmpq 0x10(%rsp), %rdx
jne 0x8b41
movq 0x8(%rsp), %rax
cmpl %eax, %ebp
jbe 0x8c73
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdi
movl %eax, %edx
shlq $0x4, %rdx
callq 0x17438
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rsi
movq 0x18(%rbx), %rdi
callq 0x1726a
movq %r15, 0x8(%rbx)
movl 0x18(%rsp), %eax
movl %eax, (%rbx)
movb (%rbx), %cl
movl $0x1, %ebp
shll %cl, %ebp
movsbl (%r13), %eax
testl %eax, %eax
je 0x8cbf
movb 0x1(%r13), %cl
testb %cl, %cl
je 0x8cc1
leaq 0x2(%r13), %rdx
movl %eax, %esi
shll $0x5, %esi
subl %eax, %esi
movsbl %cl, %eax
addl %esi, %eax
movb (%rdx), %cl
incq %rdx
testb %cl, %cl
jne 0x8ca8
jmp 0x8cc1
xorl %eax, %eax
imull $0x9e3779b9, %eax, %r12d # imm = 0x9E3779B9
movb (%rbx), %al
xorl %ecx, %ecx
subb %al, %cl
shrl %cl, %r12d
decl %ebp
movq 0x8(%rbx), %r15
movl %r12d, %r14d
movl %r14d, %eax
shrl $0x5, %eax
movl (%r15,%rax,4), %eax
btl %r14d, %eax
jae 0x8d10
movq 0x10(%rbx), %rax
movl %r14d, %ecx
shlq $0x4, %rcx
movq (%rax,%rcx), %rdi
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x8d10
incl %r14d
andl %ebp, %r14d
cmpl %r12d, %r14d
jne 0x8cda
movl %r14d, %eax
shrl $0x5, %eax
movl (%r15,%rax,4), %esi
movl $0x1, %edx
movl %r14d, %ecx
shll %cl, %edx
btl %r14d, %esi
jb 0x8d43
movq 0x10(%rbx), %rcx
movl %r14d, %esi
shlq $0x4, %rsi
movq %r13, (%rcx,%rsi)
movq 0x8(%rbx), %rcx
orl %edx, (%rcx,%rax,4)
incl 0x4(%rbx)
movq 0x20(%rsp), %rsi
movq %rsi, %rax
shlq $0x20, %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
orq %rcx, %rax
movq 0x10(%rbx), %rcx
movl %r14d, %edx
shlq $0x4, %rdx
movq %rax, 0x8(%rcx,%rdx)
incq %rsi
cmpq $0x47, %rsi
jne 0x8a05
xorl %ebp, %ebp
movl $0x1, %esi
movl $0x20, %edx
xorl %edi, %edi
callq 0x171c8
movq %rax, %r13
movq $0x0, 0x18(%rax)
movq 0x28(%rsp), %r14
testl $0x3fffffff, 0x8(%r14)  # imm = 0x3FFFFFFF
je 0x90a6
xorl %r8d, %r8d
cmpq $0x0, 0x10(%r13)
je 0x8dbe
movb (%r13), %cl
movl $0x1, %r12d
shll %cl, %r12d
jmp 0x8dc1
xorl %r12d, %r12d
movq 0x10(%r14), %rax
movl (%rax,%r8,4), %r9d
movl 0x4(%r13), %eax
movl %r12d, %ecx
shrl %ecx
movl %r12d, %edx
shrl $0x2, %edx
addl %ecx, %edx
cmpl %edx, %eax
jb 0x8fe9
leal 0x1(%r12), %ecx
bsrl %ecx, %edx
cmpl $0x2, %ecx
cmovbl %ebp, %edx
andl %r12d, %ecx
cmpl $0x1, %ecx
sbbl $-0x1, %edx
cmpl $0x3, %edx
movl $0x2, %ecx
cmovael %edx, %ecx
movl $0x1, %r10d
shll %cl, %r10d
movl %r10d, %edi
shrl %edi
movl %r10d, %esi
shrl $0x2, %esi
addl %edi, %esi
cmpl %esi, %eax
ja 0x8fdc
movl %ecx, 0x8(%rsp)
movq %r9, 0x18(%rsp)
movq %r8, 0x20(%rsp)
movq 0x18(%r13), %rdi
movq %r10, 0x10(%rsp)
movl %r10d, %ebp
shrl $0x3, %ebp
andl $-0x4, %ebp
cmpl $0x5, %edx
movl $0x4, %eax
cmovbl %eax, %ebp
movq %rbp, %rsi
callq 0x17335
movq %rax, %r14
xorl %r15d, %r15d
movq %rax, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x31b0
testq %r14, %r14
je 0x906a
movq 0x10(%r13), %rsi
testq %rsi, %rsi
je 0x8e87
movb (%r13), %cl
movl $0x1, %r15d
shll %cl, %r15d
movq 0x10(%rsp), %rax
cmpl %eax, %r15d
jae 0x8ec3
movq 0x18(%r13), %rdi
movl %eax, %edx
shlq $0x3, %rdx
callq 0x17438
movq %rax, %rbp
testq %rax, %rax
je 0x8eae
movq %rbp, 0x10(%r13)
jmp 0x8eba
movq 0x18(%r13), %rdi
movq %r14, %rsi
callq 0x1726a
testq %rbp, %rbp
je 0x9067
testl %r15d, %r15d
je 0x8f91
movq 0x10(%rsp), %rax
leal -0x1(%rax), %edi
movl $0x20, %eax
subl 0x8(%rsp), %eax
movl %r15d, %r8d
xorl %edx, %edx
movq 0x8(%r13), %rsi
movl %edx, %r10d
shrl $0x5, %r10d
movl (%rsi,%r10,4), %r11d
movl $0x1, %ebp
movl %edx, %ecx
shll %cl, %ebp
btl %edx, %r11d
jae 0x8f85
movq 0x10(%r13), %rcx
movq (%rcx,%rdx,8), %r9
notl %ebp
andl %ebp, %r11d
movl %r11d, (%rsi,%r10,4)
imull $0x9e3779b9, %r9d, %esi # imm = 0x9E3779B9
movl %eax, %ecx
shrl %cl, %esi
movl %esi, %r10d
shrl $0x5, %r10d
movl (%r14,%r10,4), %ebp
movl $0x1, %r11d
movl %esi, %ecx
shll %cl, %r11d
btl %esi, %ebp
jae 0x8f41
incl %esi
andl %edi, %esi
jmp 0x8f20
orl %r11d, %ebp
movl %ebp, (%r14,%r10,4)
movl %esi, %ecx
cmpl %r15d, %esi
jae 0x8f77
movq 0x8(%r13), %rsi
testl %r11d, (%rsi,%r10,4)
je 0x8f77
movq 0x10(%r13), %rsi
movq (%rsi,%rcx,8), %r12
movq %r9, (%rsi,%rcx,8)
notl %r11d
movq 0x8(%r13), %rcx
andl %r11d, (%rcx,%r10,4)
movb $0x1, %cl
movq %r12, %r9
jmp 0x8f81
movq 0x10(%r13), %rsi
movq %r9, (%rsi,%rcx,8)
xorl %ecx, %ecx
testb %cl, %cl
jne 0x8f15
incq %rdx
cmpq %r8, %rdx
jne 0x8ee2
movq 0x10(%rsp), %rax
cmpl %eax, %r15d
jbe 0x8fb2
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdi
movl %eax, %edx
shlq $0x3, %rdx
callq 0x17438
movq %rax, 0x10(%r13)
movq 0x8(%r13), %rsi
movq 0x18(%r13), %rdi
callq 0x1726a
movq %r14, 0x8(%r13)
movl 0x8(%rsp), %eax
movl %eax, (%r13)
movq 0x28(%rsp), %r14
xorl %ebp, %ebp
movq 0x20(%rsp), %r8
movq 0x18(%rsp), %r9
movb (%r13), %cl
movl $0x1, %r12d
shll %cl, %r12d
shrl %r9d
imull $0x9e3779b9, %r9d, %edx # imm = 0x9E3779B9
movb (%r13), %al
xorl %ecx, %ecx
subb %al, %cl
shrl %cl, %edx
movl %r12d, %ecx
decl %ecx
movq 0x8(%r13), %rax
movl %edx, %r12d
movl %r12d, %esi
shrl $0x5, %esi
movl (%rax,%rsi,4), %esi
btl %r12d, %esi
jae 0x9030
movq 0x10(%r13), %rsi
movl %r12d, %edi
cmpl (%rsi,%rdi,8), %r9d
je 0x9030
incl %r12d
andl %ecx, %r12d
cmpl %edx, %r12d
jne 0x9009
movl %r12d, %edx
movl $0x1, %esi
movl %r12d, %ecx
shll %cl, %esi
shrl $0x5, %edx
movl (%rax,%rdx,4), %eax
movb $0x1, %r15b
btl %r12d, %eax
jb 0x9076
movq 0x10(%r13), %rax
movl %r12d, %ecx
movq %r9, (%rax,%rcx,8)
movq 0x8(%r13), %rax
orl %esi, (%rax,%rdx,4)
incl 0x4(%r13)
xorl %r15d, %r15d
jmp 0x9076
xorl %r15d, %r15d
movq 0x28(%rsp), %r14
xorl %ebp, %ebp
movq 0x20(%rsp), %r8
movq 0x10(%r13), %rax
movl %r12d, %ecx
movl $0x1, %edx
testb %r15b, %r15b
je 0x908d
movl 0x4(%rax,%rcx,8), %edx
incl %edx
movl %edx, 0x4(%rax,%rcx,8)
incq %r8
movl 0x8(%r14), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
cmpq %rax, %r8
jb 0x8da8
movq 0x38(%rsp), %rax
movq (%rax), %r15
testq %r15, %r15
je 0x92e8
movq 0x38(%rsp), %rax
movq 0x10(%rax), %r12
xorl %ebp, %ebp
movq %r15, 0x58(%rsp)
movq %r12, 0x50(%rsp)
leaq (,%rbp,4), %rax
addq %rbp, %rax
shlq $0x4, %rax
movq %rax, %rcx
movl 0x48(%r12,%rax), %eax
shrl $0x1d, %eax
andl $0x3, %eax
cmpl 0x30(%rsp), %eax
jne 0x92dd
movq %rcx, %rax
addq %r12, %rax
movq 0x10(%rbx), %rcx
movq $0x0, 0x18(%rsp)
movl $0x0, %edx
movq %rdx, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
testq %rcx, %rcx
movq %rax, 0x40(%rsp)
je 0x91e0
movl (%rbx), %ecx
movl $0x1, %edx
shll %cl, %edx
movq %rdx, 0x8(%rsp)
movq (%rax), %rsi
movsbl (%rsi), %eax
testl %eax, %eax
movq %rbp, 0x60(%rsp)
je 0x9163
movb 0x1(%rsi), %dl
testb %dl, %dl
je 0x9165
leaq 0x2(%rsi), %r8
movl %eax, %edi
shll $0x5, %edi
subl %eax, %edi
movsbl %dl, %eax
addl %edi, %eax
movb (%r8), %dl
incq %r8
testb %dl, %dl
jne 0x914b
jmp 0x9165
xorl %eax, %eax
imull $0x9e3779b9, %eax, %ebp # imm = 0x9E3779B9
negb %cl
shrl %cl, %ebp
movq 0x8(%rsp), %rax
decl %eax
movl %eax, 0x20(%rsp)
movq 0x8(%rbx), %r14
movl %ebp, %r12d
movl %r12d, %eax
shrl $0x5, %eax
movl (%r14,%rax,4), %eax
btl %r12d, %eax
jae 0x91c7
movl %r12d, %eax
shlq $0x4, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax), %rdi
movq %rsi, %r15
callq 0x3250
testl %eax, %eax
je 0x91bf
incl %r12d
andl 0x20(%rsp), %r12d
cmpl %ebp, %r12d
movq %r15, %rsi
jne 0x9181
jmp 0x91c7
movl %r12d, %eax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %r14
movq 0x58(%rsp), %r15
movq 0x50(%rsp), %r12
movq 0x60(%rsp), %rbp
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x48(%rsp), %rdi
callq 0x865c
movq 0x10(%r13), %rdx
testq %rdx, %rdx
je 0x9245
movb (%r13), %cl
movl $0x1, %edi
shll %cl, %edi
imull $0x9e3779b9, %eax, %esi # imm = 0x9E3779B9
negb %cl
shrl %cl, %esi
movq %rdi, 0x18(%rsp)
leal -0x1(%rdi), %ecx
movq 0x8(%r13), %r8
movl %esi, %edi
movl %edi, %r9d
shrl $0x5, %r9d
movl (%r8,%r9,4), %r9d
btl %edi, %r9d
jae 0x9245
movl %edi, %r9d
cmpl (%rdx,%r9,8), %eax
je 0x923e
incl %edi
andl %ecx, %edi
cmpl %esi, %edi
jne 0x921a
jmp 0x9245
movl %edi, %eax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x9258
movb (%rbx), %cl
movl $0x1, %eax
shll %cl, %eax
jmp 0x925a
xorl %eax, %eax
cmpl %eax, 0x8(%rsp)
jae 0x92dd
testq %rdx, %rdx
je 0x9272
movb (%r13), %cl
movl $0x1, %eax
shll %cl, %eax
jmp 0x9274
xorl %eax, %eax
cmpl %eax, 0x18(%rsp)
jae 0x92dd
movl 0x18(%rsp), %eax
cmpl $0x1, 0x4(%rdx,%rax,8)
jne 0x92dd
movl 0x8(%rsp), %eax
shlq $0x4, %rax
movq 0x10(%rsp), %rcx
movq 0x8(%rcx,%rax), %rcx
testq %r12, %r12
je 0x92be
movl %ecx, %edx
cmpl $-0x1, %edx
je 0x92be
leaq (%rdx,%rdx,4), %rdx
shlq $0x4, %rdx
movq 0x40(%rsp), %rsi
movsd 0x38(%rsi), %xmm0
ucomisd 0x38(%r12,%rdx), %xmm0
jbe 0x92dd
movq 0x10(%rsp), %rdx
addq %rdx, %rax
addq $0x8, %rax
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
andq %rdx, %rcx
orq %rbp, %rcx
movq %rcx, (%rax)
incl %ebp
cmpq %rbp, %r15
ja 0x90cc
movl 0x8(%r14), %eax
movq %rax, 0x30(%rsp)
btl $0x1e, %eax
jae 0x9466
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
xorl %edx, %edx
cmpq $0x0, 0x10(%rsp)
je 0x9353
movl (%rbx), %ecx
movl $0x1, %r8d
shll %cl, %r8d
leaq 0x15840(%rip), %rax     # 0x1eb60
movq (%rax,%rdx,8), %rsi
movsbl (%rsi), %eax
testl %eax, %eax
movq %rdx, 0x8(%rsp)
je 0x9357
movb 0x1(%rsi), %dl
testb %dl, %dl
je 0x9359
leaq 0x2(%rsi), %r9
movl %eax, %edi
shll $0x5, %edi
subl %eax, %edi
movsbl %dl, %eax
addl %edi, %eax
movb (%r9), %dl
incq %r9
testb %dl, %dl
jne 0x933b
jmp 0x9359
xorl %eax, %eax
jmp 0x93d0
xorl %eax, %eax
imull $0x9e3779b9, %eax, %r12d # imm = 0x9E3779B9
negb %cl
shrl %cl, %r12d
movq %r8, 0x18(%rsp)
leal -0x1(%r8), %eax
movl %eax, 0x20(%rsp)
movq 0x8(%rbx), %r15
movl %r12d, %r14d
movl %r14d, %eax
shrl $0x5, %eax
movl (%r15,%rax,4), %eax
btl %r14d, %eax
jae 0x93b5
movl %r14d, %eax
shlq $0x4, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax), %rdi
movq %rsi, %rbp
callq 0x3250
testl %eax, %eax
je 0x93c1
incl %r14d
andl 0x20(%rsp), %r14d
cmpl %r12d, %r14d
movq %rbp, %rsi
jne 0x9379
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %rax
jmp 0x93c9
movl %r14d, %eax
movq 0x8(%rsp), %rdx
movl %eax, %eax
movq 0x28(%rsp), %r14
shlq $0x4, %rax
movq 0x10(%rsp), %rcx
movl 0x8(%rcx,%rax), %eax
cmpl $-0x1, %eax
jne 0x93f4
incq %rdx
cmpq $0x47, %rdx
jne 0x9306
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x9466
movq 0x38(%rsp), %rcx
movq 0x10(%rcx), %rcx
movl %eax, %eax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
movq 0x8(%rcx,%rax), %rsi
movq 0x48(%rsp), %rdi
callq 0x865c
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq 0x30(%rsp), %rcx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
movq %rcx, 0x30(%rsp)
je 0x944f
movq 0x10(%r14), %rdx
xorl %ecx, %ecx
movl (%rdx,%rcx,4), %edi
shrl %edi
cmpl %eax, %edi
je 0x944d
incq %rcx
cmpq %rcx, 0x30(%rsp)
jne 0x9438
jmp 0x944f
movl %ecx, %esi
cmpl $-0x1, %esi
je 0x9846
movq 0x10(%r14), %rdi
movq 0x30(%rsp), %rdx
callq 0x9865
movl $0x8, %esi
xorl %edi, %edi
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
xorl %r12d, %r12d
xorl %r10d, %r10d
xorl %r8d, %r8d
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x9491
movb (%rbx), %cl
movl $0x1, %edx
shlq %cl, %rdx
jmp 0x9493
xorl %edx, %edx
cmpq %rdx, %rdi
jae 0x9584
movq 0x8(%rbx), %rcx
movl %edi, %edx
shrl $0x5, %edx
movl (%rcx,%rdx,4), %ecx
btl %edi, %ecx
jae 0x9578
movq (%rax,%rsi), %r15
movl %r15d, %eax
cmpq %r9, %rax
je 0x9578
movq %rdi, 0x18(%rsp)
movq %rsi, 0x8(%rsp)
movq %r12, 0x20(%rsp)
movq 0x38(%rsp), %rcx
movq 0x10(%rcx), %r14
leaq (%rax,%rax,4), %r12
shlq $0x4, %r12
movq 0x8(%r14,%r12), %rsi
movq 0x48(%rsp), %rdi
movq %r8, 0x10(%rsp)
movq %r10, %rbp
callq 0x865c
movq %rbp, %r10
movq 0x10(%rsp), %r8
movl 0x1c(%r14,%r12), %ebp
addl 0x18(%r14,%r12), %ebp
cmpq %r10, %r8
jne 0x9548
leaq (%r10,%r10), %r14
testq %r10, %r10
movq %rax, 0x30(%rsp)
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rsi
movq 0x20(%rsp), %rdi
callq 0x3330
movq 0x10(%rsp), %r8
movq %rax, %r12
movq 0x30(%rsp), %rax
movq %r14, %r10
jmp 0x954d
movq 0x20(%rsp), %r12
movq 0x18(%rsp), %rdi
shlq $0x28, %rax
shrl %ebp
shlq $0x8, %rbp
orq %rax, %rbp
shrq $0x20, %r15
orq %rbp, %r15
movq %r15, (%r12,%r8,8)
incq %r8
movq 0x8(%rsp), %rsi
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
incq %rdi
addq $0x10, %rsi
jmp 0x947c
testq %r8, %r8
je 0x96b2
leaq 0x7289(%rip), %rcx      # 0x1081d
movl $0x8, %edx
movq %r12, %rdi
movq %r8, %rsi
movq %r8, %rbp
callq 0x30c0
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
movl $0x8, %esi
callq 0x3240
movq %rbp, %rdi
xorl %edx, %edx
movl $0x1, %r8d
movl $0x1, %esi
movq %r12, %rcx
cmpq %rsi, %rdi
je 0x95df
movq (%r12,%rsi,8), %rsi
xorq (%rcx), %rsi
shrq $0x28, %rsi
je 0x95f9
movl %r8d, %esi
subl %edx, %esi
shlq $0x20, %rdx
orq %rdx, %rsi
movq (%rcx), %rdx
shrq $0x28, %rdx
movq %rsi, (%rax,%rdx,8)
movl %r8d, %edx
incl %r8d
addq $0x8, %rcx
movq %r8, %rsi
cmpq %r8, %rdi
jae 0x95cd
movq %rax, 0x10(%rsp)
leaq (,%rdi,4), %rdi
callq 0x32f0
movq %rax, %r14
movq 0x28(%rsp), %rcx
movl 0x8(%rcx), %eax
andq $0x3fffffff, %rax       # imm = 0x3FFFFFFF
je 0x96c1
movq 0x10(%rcx), %rcx
xorl %edx, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movq %rbp, %r11
movl (%rcx,%rdx,4), %r10d
movl %r10d, %edi
shrl %edi
movq 0x10(%rsp), %r8
movq (%r8,%rdi,8), %r9
movq %r9, %r8
andq %rsi, %r8
je 0x96a8
movq %r9, %rdi
shrq $0x20, %rdi
testb $0x1, %r10b
jne 0x9685
movl %edi, %r9d
movzbl (%r12,%r9,8), %r9d
movl %r15d, %r10d
incl %r15d
movl %r9d, (%r14,%r10,4)
incq %rdi
decq %r8
jne 0x9669
jmp 0x96a8
movl %r9d, %r8d
addq %r9, %rdi
decq %rdi
movl %edi, %r9d
movzbl (%r12,%r9,8), %r9d
movl %r15d, %r10d
incl %r15d
movl %r9d, (%r14,%r10,4)
decq %rdi
decq %r8
jne 0x968e
incq %rdx
cmpq %rax, %rdx
jne 0x9642
jmp 0x96c7
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x97b2
xorl %r15d, %r15d
movq %rbp, %r11
movq %r12, 0x20(%rsp)
movl %r15d, %r12d
cmpq %r12, %r11
jne 0x9827
movl $0x47, %edi
movl $0x4, %esi
callq 0x3240
testl %r15d, %r15d
je 0x96fd
xorl %ecx, %ecx
movl (%r14,%rcx,4), %edx
incl (%rax,%rdx,4)
incq %rcx
cmpq %rcx, %r12
jne 0x96ee
movl (%rax), %ecx
movl $0x1, %edx
addl (%rax,%rdx,4), %ecx
movl %ecx, (%rax,%rdx,4)
incq %rdx
cmpq $0x47, %rdx
jne 0x9704
testl %r15d, %r15d
je 0x972f
xorl %ecx, %ecx
movl (%r14,%rcx,4), %edx
movl (%rax,%rdx,4), %edx
decl %edx
movl %edx, (%r14,%rcx,4)
incq %rcx
cmpq %rcx, %r12
jne 0x971a
movq %rax, %rdi
callq 0x3060
xorpd %xmm2, %xmm2
xorl %eax, %eax
movl (%r14,%rax,4), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
movl %eax, %ecx
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
subsd %xmm1, %xmm0
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm2
incq %rax
movl %eax, %ecx
cmpq %rcx, %rbp
ja 0x973d
mulsd 0xfda7(%rip), %xmm2     # 0x19518
xorps %xmm0, %xmm0
cvtsi2sd %rbp, %xmm0
divsd %xmm0, %xmm2
mulsd %xmm0, %xmm0
addsd 0xfd17(%rip), %xmm0     # 0x194a0
divsd %xmm0, %xmm2
addsd 0xfd8b(%rip), %xmm2     # 0x19520
movsd %xmm2, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x3060
movq %r14, %rdi
callq 0x3060
movq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x3060
testq %rbx, %rbx
je 0x97e6
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %r14
movq %r14, %rdi
callq 0x1726a
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x1726a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1726a
testq %r13, %r13
je 0x9812
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rbx
movq %rbx, %rdi
callq 0x1726a
movq 0x8(%r13), %rsi
movq %rbx, %rdi
callq 0x1726a
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1726a
movsd 0x8(%rsp), %xmm0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10a65(%rip), %rdi     # 0x1a293
leaq 0xfe40(%rip), %rsi      # 0x19675
leaq 0x10a0f(%rip), %rcx     # 0x1a24b
movl $0x696, %edx            # imm = 0x696
callq 0x3190
leaq 0x109ee(%rip), %rdi     # 0x1a23b
leaq 0xfe21(%rip), %rsi      # 0x19675
leaq 0x109f0(%rip), %rcx     # 0x1a24b
movl $0x665, %edx            # imm = 0x665
callq 0x3190