// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/break.c
// Function: detect_break_points
bp_t *detect_break_points(link_mat_t *link_mat, uint32_t bin_size, uint32_t merge_size, double fold_thres, uint32_t dual_break_thres, uint32_t *bp_n)
{
    uint32_t i, j, k, n, m, d, b, b_n, b_m;
    double mcnt;
    int64_t *link;
    uint32_t s, e, t, min_c, p, bp_s, bp_e;
    kdq_t(int64_t) *q;
    bp_t *bp, *bp1;
    
    b_n = 0;
    b_m = 16;
    bp = (bp_t *) malloc(b_m * sizeof(bp_t));
    bp1 = 0;
    m = merge_size / bin_size;
    d = dual_break_thres / bin_size;
    q = kdq_init(int64_t);
    for (i = 0; i < link_mat->n; ++i) {
        link = link_mat->link[i].link;
        n = link_mat->link[i].n;
        // sort by link count
        qsort(link, n, sizeof(int64_t), cnt_cmp);
        // find median
        mcnt = n & 1? (int32_t) link[n / 2] : ((int32_t) link[n / 2] + (int32_t) link[n / 2 - 1]) / 2.;
        // find count threshold
        mcnt *= fold_thres;
        // find positions below threshold
        b = 0;
        while (b < n && (int32_t) link[b] < mcnt)
            ++b;
        if (!b || b == n)
            continue;
        // sort by position for positions below threshold
        qsort(link, b, sizeof(int64_t), pos_cmp);
        // detect blocks for break points
        kdq_clean(q);
        s = link[0] >> 32;
        e = s;
        for (j = 1; j < b; ++j) {
            t = link[j] >> 32;
            if (e + m < t) {
                // new block
                kdq_push(int64_t, q, (int64_t) s << 32 | e);
                s = t;
                e = s;
            } else {
                e = t;
            }
        }
        // add last block
        kdq_push(int64_t, q, (int64_t) s << 32 | e);
        // sort by position for all positions
        qsort(link, n, sizeof(int64_t), pos_cmp);
        // detect precise break points
        if (b_n == b_m) {
            b_m <<= 1;
            bp = (bp_t *) realloc(bp, b_m * sizeof(bp_t));
        }
        bp1 = bp + b_n;
        bp1->s = i;
        bp1->n = 0;
        bp1->m = 4;
        bp1->p = (uint64_t *) malloc(bp1->m * sizeof(uint64_t));
        ++b_n;

        for (j = 0; j < kdq_size(q); ++j) {
            s = kdq_at(q, j) >> 32;
            e = (int32_t) kdq_at(q, j);
            
            if (e - s > d && make_dual_break(link, s, e, d, fold_thres, &bp_s, &bp_e)) {
                // dual break
                if (s != 0)
                    add_break_point(bp1, bp_s);
                if (e != n - 1)
                    add_break_point(bp1, bp_e);
                continue;
            }

            // skip the first and last block
            if (s == 0 || e == n - 1)
                continue;
            
            // find the position of the minimum value in this valley
            // which will be a break point
            min_c = INT32_MAX;
            p = UINT32_MAX;
            for (k = s; k <= e; ++k) {
                if ((int32_t) link[k] < min_c) {
                    min_c = (int32_t) link[k];
                    p = k;
                }
            }

            if (p != UINT32_MAX)
                add_break_point(bp1, p);
        }

        if (bp1->n > 1) {
            // revisit to remove false positives
            kdq_clean(q);
            for (k = 0; k < bp1->n; ++k) {
                s = k > 0? bp1->p[k - 1] : 0;
                e = k < bp1->n - 1? bp1->p[k + 1] : n - 1;
                t = e - s + 1;
                qsort(link + s, t, sizeof(int64_t), cnt_cmp);
                mcnt = t & 1? (int32_t) link[(e + s) / 2] : ((int32_t) link[(e + s) / 2] + (int32_t) link[(e + s) / 2 + 1]) / 2.;
                mcnt *= fold_thres;
                qsort(link + s, t, sizeof(int64_t), pos_cmp);
                if ((int32_t) link[bp1->p[k]] > mcnt)
                    kdq_push(int64_t, q, k);
            }
            for (k = 0; k < kdq_size(q); ++k)
                bp1->p[kdq_at(q, k)] = UINT32_MAX;
        }
        
        j = 0;
        for (k = 0; k < bp1->n; ++k)
            if (bp1->p[k] != UINT32_MAX)
                bp1->p[j++] = bp1->p[k] * bin_size;
        bp1->n = j;
        
        if (!bp1->n) {
            free(bp1->p);
            --b_n;
        }
    }
    kdq_destroy(int64_t, q);
    *bp_n = b_n;
    
    return bp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r8, 0x88(%rsp)
movl %ecx, %ebp
movsd %xmm0, 0x38(%rsp)
movl %edx, %r14d
movl %esi, %ebx
movq %rdi, %r15
movl $0x180, %edi            # imm = 0x180
callq 0x2330
movq %rax, 0x58(%rsp)
xorl %r12d, %r12d
movl %r14d, %eax
xorl %edx, %edx
divl %ebx
movq %rax, 0x60(%rsp)
movl %ebp, %eax
xorl %edx, %edx
divl %ebx
movq %rax, 0x70(%rsp)
movl $0x1, %edi
movl $0x20, %esi
callq 0x2290
movq %rax, %r13
movabsq $0x800000000000000, %rax # imm = 0x800000000000000
movq %rax, (%r13)
movq $0x3, 0x10(%r13)
movl $0x20, %edi
callq 0x2330
movq %rax, 0x18(%r13)
cmpl $0x0, 0x4(%r15)
je 0x6de7
movl %ebx, %eax
movq %rax, 0x90(%rsp)
xorl %ebx, %ebx
movl $0x10, %eax
movq %rax, 0x80(%rsp)
xorl %r12d, %r12d
movq %r13, 0x18(%rsp)
movq %r15, 0x40(%rsp)
movq 0x8(%r15), %rax
movq %rbx, %rcx
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %r14
movl 0x4(%rax,%rcx), %ebp
movl $0x8, %edx
movq %r14, %rdi
movq %rbp, %rsi
leaq -0x3f7(%rip), %rcx      # 0x5f6d
callq 0x20e0
movl %ebp, %eax
shrl %eax
movl (%r14,%rax,8), %ecx
testb $0x1, %bpl
jne 0x639c
decl %eax
addl (%r14,%rax,8), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd 0x1be8c(%rip), %xmm0    # 0x22218
testq %rbp, %rbp
movsd 0x38(%rsp), %xmm1
jne 0x63a9
jmp 0x66ad
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd 0x38(%rsp), %xmm1
mulsd %xmm1, %xmm0
xorl %r15d, %r15d
xorps %xmm1, %xmm1
cvtsi2sdl (%r14,%r15,8), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x63cc
incq %r15
cmpq %r15, %rbp
jne 0x63b0
jmp 0x66ad
testq %r15, %r15
je 0x66ad
cmpl %r15d, %ebp
je 0x66ad
movq %rbx, 0x68(%rsp)
movl %r15d, %esi
movl $0x8, %edx
movq %r14, %rdi
movq %rsi, 0x30(%rsp)
leaq -0x4a0(%rip), %rcx      # 0x5f5a
callq 0x20e0
movq (%r13), %r10
movabsq $-0x400000000000000, %rax # imm = 0xFC00000000000000
andq %rax, %r10
movq %r10, (%r13)
movq (%r14), %r9
movq %r9, %rbx
shrq $0x20, %rbx
cmpq $0x2, %r15
movq %r12, 0x48(%rsp)
movq %rbp, 0x50(%rsp)
jb 0x66c7
movl $0x1, %r12d
xorl %r8d, %r8d
movl %ebx, %r9d
movq 0x60(%rsp), %rsi
movabsq $0x3ffffffffffffff, %rdi # imm = 0x3FFFFFFFFFFFFFF
movq 0x30(%rsp), %r11
movq (%r14,%r12,8), %r15
shrq $0x20, %r15
leal (%rbx,%rsi), %eax
cmpl %r15d, %eax
jae 0x6621
movq %r10, %rax
shrq $0x3a, %rax
movl $0x1, %edx
movl %eax, %ecx
shlq %cl, %rdx
cmpq %rdx, %r8
jne 0x65fd
leal 0x1(%rax), %r13d
movl $0x1, %edx
movl %r13d, %ecx
shlq %cl, %rdx
movq %rdx, 0x8(%rsp)
cmpq %r8, %rdx
movq %r8, 0x20(%rsp)
movq %r9, 0x10(%rsp)
jae 0x64e5
movq $-0x1, %r13
incq %r13
movq %r8, %rdx
movl %r13d, %ecx
shrq %cl, %rdx
cmpq $0x3f, %r13
ja 0x64c1
testq %rdx, %rdx
jne 0x64aa
cmpq %r13, %rax
jne 0x64d0
movq 0x18(%rsp), %r13
jmp 0x65fd
movl $0x1, %edx
movl %r13d, %ecx
shlq %cl, %rdx
movq %rdx, 0x8(%rsp)
cmpq %rax, %r13
jbe 0x6525
movq %r10, 0x28(%rsp)
movq 0x18(%rsp), %rbp
movq 0x18(%rbp), %rdi
movl $0x8, %esi
movl %r13d, %ecx
shlq %cl, %rsi
callq 0x2390
movq %rax, 0x18(%rbp)
movabsq $0x3ffffffffffffff, %rdi # imm = 0x3FFFFFFFFFFFFFF
movq 0x20(%rsp), %r8
movq 0x10(%rsp), %r9
movq 0x28(%rsp), %r10
movq 0x30(%rsp), %r11
movq %r10, %rbp
andq %rdi, %rbp
leaq (%r8,%rbp), %rdx
cmpq %r8, %rdx
jbe 0x658a
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq %r8, %rdx
subq %rbp, %rdx
movq 0x8(%rsp), %rcx
subq %rdx, %rcx
leaq (%rax,%rcx,8), %rdi
leaq (%rax,%rbp,8), %rsi
shlq $0x3, %rdx
movq %r10, %rbp
callq 0x23a0
movq 0x18(%rsp), %rdx
movq 0x30(%rsp), %r11
movq 0x10(%rsp), %r9
movq 0x20(%rsp), %r8
movabsq $0x3ffffffffffffff, %rdi # imm = 0x3FFFFFFFFFFFFFF
subq %r8, %rbp
addq 0x8(%rsp), %rbp
andq %rdi, %rbp
jmp 0x65cf
movq 0x8(%rsp), %rax
subq %rax, %rdx
jbe 0x65ca
movq 0x18(%rsp), %rcx
movq 0x18(%rcx), %rdi
leaq (%rdi,%rax,8), %rsi
shlq $0x3, %rdx
callq 0x23a0
movq 0x18(%rsp), %rdx
movq 0x30(%rsp), %r11
movq 0x10(%rsp), %r9
movq 0x20(%rsp), %r8
movabsq $0x3ffffffffffffff, %rdi # imm = 0x3FFFFFFFFFFFFFF
jmp 0x65cf
movq 0x18(%rsp), %rdx
movq 0x60(%rsp), %rsi
movq %r13, %r10
shlq $0x3a, %r10
movq $-0x1, %rax
movl %r13d, %ecx
shlq %cl, %rax
orq %rbp, %r10
movq %r10, (%rdx)
notq %rax
movq %rax, 0x10(%rdx)
movq %rdx, %r13
movq 0x50(%rsp), %rbp
shlq $0x20, %r9
movl %ebx, %eax
orq %r9, %rax
movq 0x18(%r13), %rcx
movq %r10, %rdx
andq %rdi, %rdx
addq %r8, %rdx
incq %r8
andq 0x10(%r13), %rdx
movq %rax, (%rcx,%rdx,8)
movl %r15d, %r9d
incq %r12
movl %r15d, %ebx
cmpq %r11, %r12
jne 0x6452
shlq $0x20, %r9
orq %r15, %r9
movq %r10, %rax
shrq $0x3a, %rax
movl $0x1, %edx
movl %eax, %ecx
shlq %cl, %rdx
cmpq %rdx, %r8
movq 0x48(%rsp), %r12
jne 0x67c4
leal 0x1(%rax), %r15d
movl $0x1, %ebx
movl %r15d, %ecx
shlq %cl, %rbx
cmpq %r8, %rbx
jae 0x66e9
movq $-0x1, %r15
incq %r15
movq %r8, %rdx
movl %r15d, %ecx
shrq %cl, %rdx
cmpq $0x3f, %r15
ja 0x6688
testq %rdx, %rdx
jne 0x6671
cmpq %r15, %rax
je 0x67c4
movl $0x1, %ebx
movl %r15d, %ecx
shlq %cl, %rbx
cmpq %rax, %r15
movq %r9, 0x10(%rsp)
jbe 0x6720
movq %r10, 0x28(%rsp)
jmp 0x66f3
movq 0x40(%rsp), %r15
incq %rbx
movl 0x4(%r15), %eax
cmpq %rax, %rbx
jb 0x633e
jmp 0x6de3
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
andq %rax, %r9
orq %rbx, %r9
xorl %r8d, %r8d
movabsq $0x3ffffffffffffff, %rdi # imm = 0x3FFFFFFFFFFFFFF
jmp 0x67c4
movq %r10, 0x28(%rsp)
movq %r9, 0x10(%rsp)
movq %r8, %r12
movq 0x18(%r13), %rdi
movl $0x8, %esi
movl %r15d, %ecx
shlq %cl, %rsi
callq 0x2390
movq %rax, 0x18(%r13)
movabsq $0x3ffffffffffffff, %rdi # imm = 0x3FFFFFFFFFFFFFF
movq %r12, %r8
movq 0x28(%rsp), %r10
movq %r10, %r12
andq %rdi, %r12
leaq (%r12,%r8), %rdx
cmpq %r8, %rdx
jbe 0x6772
movq 0x18(%r13), %rax
movq %r8, %rdx
subq %r12, %rdx
movq %rbx, %rcx
subq %rdx, %rcx
leaq (%rax,%rcx,8), %rdi
leaq (%rax,%r12,8), %rsi
shlq $0x3, %rdx
movq %r8, 0x20(%rsp)
movq %r10, %r12
callq 0x23a0
movq 0x20(%rsp), %r8
movabsq $0x3ffffffffffffff, %rdi # imm = 0x3FFFFFFFFFFFFFF
subq %r8, %r12
addq %rbx, %r12
andq %rdi, %r12
jmp 0x6798
subq %rbx, %rdx
jbe 0x6798
movq 0x18(%r13), %rdi
leaq (%rdi,%rbx,8), %rsi
shlq $0x3, %rdx
movq %r8, %rbx
callq 0x23a0
movq %rbx, %r8
movabsq $0x3ffffffffffffff, %rdi # imm = 0x3FFFFFFFFFFFFFF
movq 0x10(%rsp), %r9
movq %r15, %r10
shlq $0x3a, %r10
movq $-0x1, %rax
movl %r15d, %ecx
shlq %cl, %rax
orq %r12, %r10
movq %r10, (%r13)
notq %rax
movq %rax, 0x10(%r13)
movq 0x48(%rsp), %r12
movq 0x18(%r13), %rax
leaq 0x1(%r8), %rbx
movq %rbx, 0x8(%r13)
andq %rdi, %r10
addq %r8, %r10
andq 0x10(%r13), %r10
movq %r9, (%rax,%r10,8)
movl $0x8, %edx
movq %r14, %rdi
movq %rbp, %rsi
leaq -0x896(%rip), %rcx      # 0x5f5a
callq 0x20e0
movq 0x80(%rsp), %rax
cmpl %eax, %r12d
jne 0x6828
addl %eax, %eax
movq %rax, 0x80(%rsp)
leaq (,%rax,8), %rax
leaq (%rax,%rax,2), %rsi
movq 0x58(%rsp), %rdi
callq 0x2390
movq 0x8(%r13), %rbx
jmp 0x682d
movq 0x58(%rsp), %rax
movl %r12d, %ecx
leaq (%rcx,%rcx,2), %rcx
movq %rax, 0x58(%rsp)
leaq (%rax,%rcx,8), %r15
movq 0x68(%rsp), %rax
movl %eax, 0x8(%r15)
movabsq $0x400000000, %rax      # imm = 0x400000000
movq %rax, (%r15)
movl $0x20, %edi
callq 0x2330
movq %r15, 0x8(%rsp)
movq %rax, 0x10(%r15)
testq %rbx, %rbx
movsd 0x38(%rsp), %xmm3
movq 0x70(%rsp), %r10
movabsq $0x3ffffffffffffff, %r11 # imm = 0x3FFFFFFFFFFFFFF
movsd 0x1b99a(%rip), %xmm4    # 0x22220
je 0x6dbf
leal 0x1(%r12), %eax
movl %eax, 0x7c(%rsp)
leal -0x1(%rbp), %ebx
xorl %r15d, %r15d
movq 0x18(%r13), %rax
movq (%r13), %rcx
andq %r11, %rcx
addq %r15, %rcx
andq 0x10(%r13), %rcx
movq (%rax,%rcx,8), %r12
movq %r12, %rax
shrq $0x20, %rax
movl %r12d, %ecx
subl %eax, %ecx
cmpl %r10d, %ecx
jbe 0x6992
xorl %ecx, %ecx
movl $0x0, %ebp
cmpl %eax, %r12d
jb 0x698a
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
xorl %edi, %edi
movl %eax, %esi
movl %esi, %r8d
movl (%r14,%r8,8), %r8d
cmpl %r8d, %edx
jbe 0x68f6
movl %r8d, %edx
xorl %edi, %edi
movl %esi, %ecx
jmp 0x6925
movl %r8d, %r8d
xorps %xmm0, %xmm0
cvtsi2sd %r8, %xmm0
movl %edx, %r8d
xorps %xmm1, %xmm1
cvtsi2sd %r8, %xmm1
divsd %xmm3, %xmm1
movapd %xmm4, %xmm2
maxsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jbe 0x6925
incl %edi
cmpl %r10d, %edi
jae 0x692c
incl %esi
cmpl %r12d, %esi
jbe 0x68e1
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ebp, %ebp
movl %r12d, %esi
xorl %r8d, %r8d
movl %eax, %edi
movl %esi, %r9d
movl (%r14,%r9,8), %r9d
cmpl %r9d, %edx
jbe 0x6951
movl %r9d, %edx
xorl %r8d, %r8d
movl %esi, %ebp
jmp 0x6981
movl %r9d, %r9d
xorps %xmm0, %xmm0
cvtsi2sd %r9, %xmm0
movl %edx, %r9d
xorps %xmm1, %xmm1
cvtsi2sd %r9, %xmm1
divsd %xmm3, %xmm1
movapd %xmm4, %xmm2
maxsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jbe 0x6981
incl %r8d
cmpl %r10d, %r8d
jae 0x698a
incl %edi
decl %esi
cmpl %r12d, %edi
jbe 0x693b
leal (%rcx,%r10), %edx
cmpl %edx, %ebp
jae 0x6a06
testq %rax, %rax
sete %cl
cmpl %r12d, %ebx
sete %dl
orb %cl, %dl
cmpl %eax, %r12d
setb %cl
orb %dl, %cl
jne 0x69f7
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %eax, %edx
movl (%r14,%rdx,8), %edx
cmpl %edx, %ecx
cmoval %eax, %ebp
cmovael %edx, %ecx
incl %eax
cmpl %r12d, %eax
jbe 0x69b4
cmpl $-0x1, %ebp
je 0x69f7
movl %ebp, %esi
movq 0x8(%rsp), %rdi
callq 0x6244
movsd 0x1b83e(%rip), %xmm4    # 0x22220
movabsq $0x3ffffffffffffff, %r11 # imm = 0x3FFFFFFFFFFFFFF
movq 0x70(%rsp), %r10
movsd 0x38(%rsp), %xmm3
incl %r15d
cmpq %r15, 0x8(%r13)
ja 0x689b
jmp 0x6a3b
testq %rax, %rax
je 0x6a34
movl %ecx, %esi
movq 0x8(%rsp), %rdi
callq 0x6244
movsd 0x1b801(%rip), %xmm4    # 0x22220
movabsq $0x3ffffffffffffff, %r11 # imm = 0x3FFFFFFFFFFFFFF
movq 0x70(%rsp), %r10
movsd 0x38(%rsp), %xmm3
cmpl %r12d, %ebx
jne 0x69ce
jmp 0x69f7
movq 0x8(%rsp), %rcx
movl (%rcx), %eax
cmpl $0x2, %eax
movq 0x48(%rsp), %r12
jb 0x6d66
movq (%r13), %r15
movabsq $-0x400000000000000, %rax # imm = 0xFC00000000000000
andq %rax, %r15
movq %r15, (%r13)
movq $0x0, 0x8(%r13)
movl (%rcx), %eax
testl %eax, %eax
movq 0x50(%rsp), %rbp
je 0x6dbf
decl %ebp
xorl %r10d, %r10d
xorl %r9d, %r9d
movq 0x8(%rsp), %rdi
movq %rbp, 0x50(%rsp)
testq %r9, %r9
je 0x6a9e
movq 0x10(%rdi), %rcx
movl -0x8(%rcx,%r9,8), %ebx
jmp 0x6aa0
xorl %ebx, %ebx
movq %r15, 0x30(%rsp)
movq %r10, 0x10(%rsp)
decl %eax
cmpq %rax, %r9
jae 0x6aba
movq 0x10(%rdi), %rax
movl 0x8(%rax,%r9,8), %ebp
movq %r9, 0x20(%rsp)
movl %ebp, %r12d
subl %ebx, %r12d
leal 0x1(%r12), %r13d
movl %ebx, %eax
leaq (%r14,%rax,8), %r15
movl $0x8, %edx
movq %r15, %rdi
movq %r13, %rsi
leaq -0xb75(%rip), %rcx      # 0x5f6d
callq 0x20e0
addl %ebx, %ebp
shrl %ebp
movl (%r14,%rbp,8), %eax
testb $0x1, %r12b
jne 0x6afe
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
jmp 0x6b14
movl %ebp, %ecx
addl 0x8(%r14,%rcx,8), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd 0x1b704(%rip), %xmm1    # 0x22218
movsd 0x38(%rsp), %xmm0
movq 0x48(%rsp), %r12
movq 0x50(%rsp), %rbp
mulsd %xmm0, %xmm1
movsd %xmm1, 0x28(%rsp)
movl $0x8, %edx
movq %r15, %rdi
movq %r13, %rsi
leaq -0xbe6(%rip), %rcx      # 0x5f5a
callq 0x20e0
movq 0x8(%rsp), %rdi
movq 0x10(%rdi), %rax
movq 0x20(%rsp), %r9
movq (%rax,%r9,8), %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%r14,%rax,8), %xmm0
ucomisd 0x28(%rsp), %xmm0
jbe 0x6bda
movq 0x30(%rsp), %r15
movq %r15, %rax
shrq $0x3a, %rax
movl $0x1, %edx
movl %eax, %ecx
shlq %cl, %rdx
movq 0x10(%rsp), %r8
cmpq %rdx, %r8
movabsq $0x3ffffffffffffff, %rsi # imm = 0x3FFFFFFFFFFFFFF
jne 0x6bd0
movq %r12, %r11
leal 0x1(%rax), %r13d
movl $0x1, %r12d
movl %r13d, %ecx
shlq %cl, %r12
cmpq %r8, %r12
jae 0x6c0c
movq $-0x1, %r13
incq %r13
movq %r8, %rdx
movl %r13d, %ecx
shrq %cl, %rdx
cmpq $0x3f, %r13
ja 0x6bc8
testq %rdx, %rdx
jne 0x6bb1
cmpq %r13, %rax
jne 0x6bf8
movq %r11, %r12
movq 0x18(%rsp), %r13
jmp 0x6cfe
movq 0x18(%rsp), %r13
movabsq $0x3ffffffffffffff, %rsi # imm = 0x3FFFFFFFFFFFFFF
movq 0x10(%rsp), %r10
movq 0x30(%rsp), %r15
jmp 0x6d1e
movl $0x1, %r10d
movl %r13d, %ecx
shlq %cl, %r10
cmpq %rax, %r13
jbe 0x6c40
movq %r10, %r12
movq 0x18(%rsp), %rbx
movq 0x18(%rbx), %rdi
movl $0x8, %esi
movl %r13d, %ecx
shlq %cl, %rsi
callq 0x2390
movq %rax, 0x18(%rbx)
movabsq $0x3ffffffffffffff, %rsi # imm = 0x3FFFFFFFFFFFFFF
movq 0x10(%rsp), %r8
movq 0x20(%rsp), %r9
movq %r12, %r10
movq %r15, %r12
andq %rsi, %r12
leaq (%r12,%r8), %rdx
cmpq %r8, %rdx
jbe 0x6c9a
movq 0x18(%rsp), %rbx
movq 0x18(%rbx), %rax
movq %r8, %rdx
subq %r12, %rdx
movq %r10, %rcx
subq %rdx, %rcx
leaq (%rax,%rcx,8), %rdi
leaq (%rax,%r12,8), %rsi
shlq $0x3, %rdx
movq %r10, %r12
callq 0x23a0
movq 0x20(%rsp), %r9
movq 0x10(%rsp), %r8
movabsq $0x3ffffffffffffff, %rsi # imm = 0x3FFFFFFFFFFFFFF
subq %r8, %r15
addq %r12, %r15
andq %rsi, %r15
movq %r15, %r12
jmp 0x6cd0
subq %r10, %rdx
jbe 0x6ccb
movq 0x18(%rsp), %rbx
movq 0x18(%rbx), %rdi
leaq (%rdi,%r10,8), %rsi
shlq $0x3, %rdx
callq 0x23a0
movq 0x20(%rsp), %r9
movq 0x10(%rsp), %r8
movabsq $0x3ffffffffffffff, %rsi # imm = 0x3FFFFFFFFFFFFFF
jmp 0x6cd0
movq 0x18(%rsp), %rbx
movq 0x8(%rsp), %rdi
movq %r13, %r15
shlq $0x3a, %r15
movq $-0x1, %rax
movl %r13d, %ecx
shlq %cl, %rax
orq %r12, %r15
movq %r15, (%rbx)
notq %rax
movq %rax, 0x10(%rbx)
movq %rbx, %r13
movq 0x48(%rsp), %r12
movq 0x18(%r13), %rax
movq %r15, %rcx
andq %rsi, %rcx
addq %r8, %rcx
leaq 0x1(%r8), %rdx
movq %rdx, 0x8(%r13)
andq 0x10(%r13), %rcx
movq %r9, (%rax,%rcx,8)
movq %rdx, %r10
incq %r9
movl (%rdi), %eax
cmpq %rax, %r9
jb 0x6a8e
testq %r10, %r10
je 0x6d66
andq %rsi, %r15
movq 0x10(%rdi), %rcx
movq 0x10(%r13), %rdx
movq 0x18(%r13), %rsi
movl $0x1, %edi
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movq %r15, %r8
andq %rdx, %r8
movq (%rsi,%r8,8), %r8
movq %r9, (%rcx,%r8,8)
movl %edi, %r8d
incq %r15
incl %edi
cmpq %r8, %r10
ja 0x6d4b
testl %eax, %eax
je 0x6dbf
movq 0x8(%rsp), %r10
movq 0x10(%r10), %rcx
movl %eax, %eax
xorl %edx, %edx
xorl %esi, %esi
movq 0x40(%rsp), %r15
movq 0x68(%rsp), %rbx
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movq (%rcx,%rdx,8), %rdi
cmpq %r9, %rdi
je 0x6da4
imulq 0x90(%rsp), %rdi
movl %esi, %r8d
incl %esi
movq %rdi, (%rcx,%r8,8)
incq %rdx
cmpq %rdx, %rax
jne 0x6d89
movl %esi, (%r10)
testl %esi, %esi
je 0x6dd5
movl 0x7c(%rsp), %eax
movl %eax, %r12d
jmp 0x66b2
movq 0x8(%rsp), %r10
movl $0x0, (%r10)
movq 0x40(%rsp), %r15
movq 0x68(%rsp), %rbx
movq 0x10(%r10), %rdi
callq 0x2060
jmp 0x66b2
movq 0x18(%r13), %rax
movq %rax, %rdi
callq 0x2060
movq %r13, %rdi
callq 0x2060
movq 0x88(%rsp), %rax
movl %r12d, (%rax)
movq 0x58(%rsp), %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq