LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: graph_add_arc
graph_arc_t *graph_add_arc(graph_t *g, uint32_t v, uint32_t w, int64_t link_id, int comp, double wt)
{
    graph_arc_t *a;
    if (g->m_arc == g->n_arc) {
        uint64_t old_m = g->m_arc;
        g->m_arc = g->m_arc? g->m_arc<<1 : 16;
        g->arc = (graph_arc_t *) realloc(g->arc, g->m_arc * sizeof(graph_arc_t));
        memset(&g->arc[old_m], 0, (g->m_arc - old_m) * sizeof(graph_arc_t));
    }
    a = &g->arc[g->n_arc++];
    a->v = v;
    a->w = w;
    a->wt = wt;
    a->rank = -1;
    a->link_id = link_id >= 0? link_id : g->n_arc - 1;
    if (link_id >= 0) 
        a->rank = g->arc[link_id].rank; // TODO: this is not always correct!
    a->del = a->strong = 0;
    a->comp = comp;
    return a;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %ebx
movq %rcx, %r14
movl %esi, %r12d
movq %rdi, %r15
movq 0x10(%rdi), %rbp
movq 0x18(%rdi), %rcx
cmpq %rcx, %rbp
jne 0x88bd
leaq (,%rbp,2), %rax
testq %rbp, %rbp
movl $0x10, %esi
cmovneq %rax, %rsi
movq %rsi, 0x10(%r15)
movq 0x20(%r15), %rdi
shlq $0x5, %rsi
movsd %xmm0, 0x10(%rsp)
movl %edx, 0xc(%rsp)
callq 0x2390
movq %rax, %r13
movq %rax, 0x20(%r15)
movq %rbp, %rdi
shlq $0x5, %rdi
addq %rax, %rdi
movq 0x10(%r15), %rdx
subq %rbp, %rdx
shlq $0x5, %rdx
xorl %esi, %esi
callq 0x21e0
movl 0xc(%rsp), %edx
movsd 0x10(%rsp), %xmm0
movq 0x18(%r15), %rcx
jmp 0x88c1
movq 0x20(%r15), %r13
movabsq $0x1fffffffffffffff, %rdi # imm = 0x1FFFFFFFFFFFFFFF
leaq 0x1(%rcx), %rax
movq %rax, 0x18(%r15)
movq %rcx, %rsi
shlq $0x5, %rsi
leaq (%rsi,%r13), %rax
movl %r12d, (%r13,%rsi)
movl %edx, 0x4(%r13,%rsi)
movsd %xmm0, 0x10(%r13,%rsi)
movl $0xffffffff, 0x8(%r13,%rsi) # imm = 0xFFFFFFFF
testq %r14, %r14
js 0x892a
movabsq $-0x2000000000000000, %rcx # imm = 0xE000000000000000
andq 0x18(%rax), %rcx
andq %r14, %rdi
orq %rdi, %rcx
movq %rcx, 0x18(%rax)
movq 0x20(%r15), %rcx
shlq $0x5, %r14
movl 0x8(%rcx,%r14), %ecx
movl %ecx, 0x8(%rax)
movq %rdi, %rcx
jmp 0x892d
andq %rdi, %rcx
shlq $0x3f, %rbx
orq %rcx, %rbx
movq %rbx, 0x18(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: graph_arc_is_sorted
int graph_arc_is_sorted(const graph_t *g)
{
    uint64_t e;
    for (e = 1; e < g->n_arc; ++e)
        if (g->arc[e-1].v > g->arc[e].v)
            break;
    return (e == g->n_arc);
}

// Assembly:
movq 0x18(%rdi), %rcx
movl $0x1, %edx
cmpq $0x2, %rcx
jb 0x8974
movq 0x20(%rdi), %rax
addq $0x20, %rax
movl -0x20(%rax), %esi
cmpl (%rax), %esi
ja 0x8974
incq %rdx
addq $0x20, %rax
cmpq %rdx, %rcx
jne 0x895e
movq %rcx, %rdx
xorl %eax, %eax
cmpq %rcx, %rdx
sete %al
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: graph_arc_index_core
uint64_t *graph_arc_index_core(size_t max_seq, size_t n, const graph_arc_t *a)
{
    size_t i, last;
    uint64_t *idx;
    idx = (uint64_t *) calloc(max_seq * 2, 8);
    for (i = 1, last = 0; i <= n; ++i)
        if (i == n || graph_arc_head(a[i - 1]) != graph_arc_head(a[i]))
            idx[graph_arc_head(a[i - 1])] = (uint64_t) last<<32 | (i - last), last = i;
    return idx;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
addq %rdi, %rdi
movl $0x8, %esi
callq 0x2290
testq %r14, %r14
je 0x8a0d
leaq 0x1(%r14), %rdx
cmpq $0x3, %rdx
movl $0x2, %ecx
cmovaeq %rdx, %rcx
movq %r14, %rdx
shlq $0x5, %rdx
addq %rbx, %rdx
addq $-0x20, %rdx
addq $0x20, %rbx
movl $0x1, %esi
xorl %edi, %edi
cmpq %rsi, %r14
jne 0x89e1
movl (%rdx), %r8d
jmp 0x89ea
movl -0x20(%rbx), %r8d
cmpl (%rbx), %r8d
je 0x8a01
movq %rsi, %r9
subq %rdi, %r9
shlq $0x20, %rdi
orq %r9, %rdi
movl %r8d, %r8d
movq %rdi, (%rax,%r8,8)
movq %rsi, %rdi
incq %rsi
addq $0x20, %rbx
cmpq %rsi, %rcx
jne 0x89d7
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: read_graph_from_gfa
graph_t *read_graph_from_gfa(char *gfa)
{
    iostream_t *fp;
    char *line;
    char c0[1024], c1[1024], s0[4], s1[4], wts[1024];
    double wt;

    graph_t *g;
    g = graph_init();
    g->sdict = make_asm_dict_from_sdict(make_sdict_from_gfa(gfa, 0));
    
    fp = iostream_open(gfa);
    if (fp == NULL) {
        fprintf(stderr, "[E::%s] cannot open file %s for reading\n", __func__, gfa);
        exit(EXIT_FAILURE);
    }

    while ((line = iostream_getline(fp)) != NULL) {
        if (line[0] == 'L') {
            sscanf(line, "%*s %s %s %s %s %*s %s", c0, s0, c1, s1, wts);
            wt = strtof(wts + 5, NULL);
            graph_add_arc(g, (asm_sd_get(g->sdict, c0)<<1) | (s0[0]=='-'), (asm_sd_get(g->sdict, c1)<<1) | (s1[0]=='-'), -1, 0, wt);
        }
    }
    iostream_close(fp);

    graph_arc_sort(g);
    graph_arc_index(g);

    return g;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc28, %rsp            # imm = 0xC28
movq %rdi, %r15
movl $0x1, %edi
movl $0x30, %esi
callq 0x2290
movq %rax, %rbx
movq %r15, %rdi
xorl %esi, %esi
callq 0x12dfe
movq %rax, %rdi
callq 0x132af
movq %rax, 0x8(%rbx)
movq %r15, %rdi
callq 0x4c27
testq %rax, %rax
je 0x8b94
movq %rax, %r14
movq %rax, %rdi
callq 0x4d57
testq %rax, %rax
je 0x8b5b
leaq 0x820(%rsp), %r13
leaq 0x420(%rsp), %r15
cmpb $0x4c, (%rax)
jne 0x8b4a
leaq 0x20(%rsp), %rcx
movq %rcx, (%rsp)
movq %rax, %rdi
leaq 0x198b3(%rip), %rsi     # 0x22380
movq %r13, %rdx
leaq 0x14(%rsp), %rcx
movq %r15, %r8
leaq 0x10(%rsp), %r9
xorl %eax, %eax
callq 0x2350
leaq 0x25(%rsp), %rdi
xorl %esi, %esi
callq 0x21d0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x8(%rbx), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x130da
xorl %ecx, %ecx
cmpb $0x2d, 0x14(%rsp)
sete %cl
leal (%rcx,%rax,2), %r12d
movq %rbp, %rdi
movq %r15, %rsi
callq 0x130da
xorl %ecx, %ecx
cmpb $0x2d, 0x10(%rsp)
sete %cl
leal (%rcx,%rax,2), %edx
movq %rbx, %rdi
movl %r12d, %esi
movq $-0x1, %rcx
xorl %r8d, %r8d
movsd 0x18(%rsp), %xmm0
callq 0x8834
movq %r14, %rdi
callq 0x4d57
testq %rax, %rax
jne 0x8ab1
movq %r14, %rdi
callq 0x4cf5
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x8696
movq %rbx, %rdi
callq 0x8a15
movq %rbx, %rax
addq $0xc28, %rsp            # imm = 0xC28
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x27c4
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: graph_clean
void graph_clean(graph_t *g, int shear)
{
    uint64_t n_arc, n;
    graph_arc_t *arc, *a;
    arc = g->arc;
    n_arc = g->n_arc;
    n = 0;
    for(a = arc; a < arc + n_arc; ++a) {
        if (!a->del) {
            memmove(arc + n, a, sizeof(graph_arc_t));
            ++n;
        }
    }
    g->n_arc = n;
#ifdef DEBUG_GRAPH_PRUNE
    fprintf(stderr, "[DEBUG_GRAPH_PRUNE::%s] graph cleaned: #arcs %lu -> %ld\n", __func__, n_arc, n);
#endif
    if (shear) {
        uint64_t m = 16;
#ifdef DEBUG_GRAPH_PRUNE
        uint64_t m_arc = g->m_arc;
#endif
        while (m < n) 
            m <<= 1;
        g->arc = (graph_arc_t *) realloc(g->arc, m * sizeof(graph_arc_t));
        g->m_arc = m;
#ifdef DEBUG_GRAPH_PRUNE
        fprintf(stderr, "[DEBUG_GRAPH_PRUNE::%s] memory sheared: #arcs %lu -> %ld\n", __func__, m_arc, m);
#endif
    }

    graph_arc_sort(g);
    graph_arc_index(g);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %eax
movq %rdi, %rbx
movq 0x18(%rdi), %rcx
testq %rcx, %rcx
jle 0x8beb
movq 0x20(%rbx), %rdx
shlq $0x5, %rcx
addq %rdx, %rcx
xorl %esi, %esi
movq %rdx, %rdi
testb $0x40, 0x1f(%rdi)
jne 0x8be0
movq %rsi, %r8
shlq $0x5, %r8
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups %xmm1, 0x10(%rdx,%r8)
movups %xmm0, (%rdx,%r8)
incq %rsi
addq $0x20, %rdi
cmpq %rcx, %rdi
jb 0x8bbe
jmp 0x8bed
xorl %esi, %esi
movq %rsi, 0x18(%rbx)
testl %eax, %eax
je 0x8c26
movl $0x10, %eax
movq %rax, %r14
addq %rax, %rax
cmpq %rsi, %r14
jb 0x8bfa
movq 0x20(%rbx), %rdi
movq %r14, %rsi
shlq $0x5, %rsi
callq 0x2390
movq %rax, %rdi
movq %rax, 0x20(%rbx)
movq %r14, 0x10(%rbx)
movq 0x18(%rbx), %rsi
jmp 0x8c2a
movq 0x20(%rbx), %rdi
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x8696
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8a15
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: graph_print_gv
void graph_print_gv(const graph_t *g, FILE *fp)
{
    uint64_t k;
    char *seq;

    fprintf(fp, "digraph {\n");
    fprintf(fp, "\t{\n");
    for (k = 0; k < g->sdict->n; ++k) {
        seq = g->sdict->s[k].name;
        fprintf(fp, "\t\t\"%s%c\" [style=filled fillcolor = salmon];\n", seq, '-');
        fprintf(fp, "\t\t\"%s%c\";\n", seq, '+');
    }
    fprintf(fp, "\t}\n");
    for (k = 0; k < g->n_arc; ++k) {
        const graph_arc_t *a = &g->arc[k];
        if (a->del) 
            continue;
        fprintf(fp, "\t\"%s%c\" -> \"%s%c\"[label=\"%.3f\"];\n", g->sdict->s[a->v>>1].name, "+-"[a->v&1], g->sdict->s[a->w>>1].name, "+-"[a->w&1], a->wt);
    }
    fprintf(fp, "}\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1973a(%rip), %rdi     # 0x22397
movl $0xa, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x24d0
leaq 0x1972c(%rip), %rdi     # 0x223a2
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x24d0
movq 0x8(%r14), %rax
cmpl $0x0, (%rax)
je 0x8ce5
leaq 0x1973b(%rip), %r12     # 0x223d3
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x8(%rax), %rax
movq (%rax,%rbp), %r13
movq %rbx, %rdi
leaq 0x196f7(%rip), %rsi     # 0x223a6
movq %r13, %rdx
movl $0x2d, %ecx
xorl %eax, %eax
callq 0x22c0
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl $0x2b, %ecx
xorl %eax, %eax
callq 0x22c0
incq %r15
movq 0x8(%r14), %rax
movl (%rax), %ecx
addq $0x58, %rbp
cmpq %rcx, %r15
jb 0x8c9d
leaq 0x196f2(%rip), %rdi     # 0x223de
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x24d0
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x8d85
xorl %r12d, %r12d
leaq 0x1964f(%rip), %r13     # 0x22360
leaq 0x196ca(%rip), %r15     # 0x223e2
xorl %ebp, %ebp
movq 0x20(%r14), %rsi
testb $0x40, 0x1f(%rsi,%r12)
jne 0x8d79
movq 0x8(%r14), %rax
movq 0x8(%rax), %rax
movl (%rsi,%r12), %ecx
movl 0x4(%rsi,%r12), %edi
movl %ecx, %edx
shrl %edx
imulq $0x58, %rdx, %rdx
movq (%rax,%rdx), %rdx
andl $0x1, %ecx
movsbl (%rcx,%r13), %ecx
movl %edi, %r8d
shrl %r8d
imulq $0x58, %r8, %r8
movq (%rax,%r8), %r8
andl $0x1, %edi
movsbl (%rdi,%r13), %r9d
movsd 0x10(%rsi,%r12), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x22c0
movq 0x18(%r14), %rax
incq %rbp
addq $0x20, %r12
cmpq %rax, %rbp
jb 0x8d1a
leaq 0x19653(%rip), %rdi     # 0x223df
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x24d0
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: graph_remove_multi_arcs
int graph_remove_multi_arcs(graph_t *g)
{
    uint32_t nv, na, v, n_del;
    graph_arc_t *av, *a, *b;

    nv = graph_n_vtx(g);
    nv <<= 1;
    n_del = 0;
    for (v = 0; v < nv; ++v) {
        na = graph_arc_n(g, v);
        if (na > 0) {
            av = graph_arc_a(g, v);
            for (a = av; a < av + na; ++a) {
                if (a->del) 
                    continue;
                for(b = a + 1; b < av + na; ++b) {
                    if (b->del) 
                        continue;
                    if (a->w == b->w) {
                        b->del = 1;
                        ++n_del;
                    }
                }
            }
        }
    }
#ifdef DEBUG_GRAPH_PRUNE
    fprintf(stderr, "[DEBUG_GRAPH_PRUNE::%s] number multi-arcs deleted: %d\n", __func__, n_del);
#endif
    graph_clean(g, 1);
    return n_del;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
movl (%rax), %ecx
addl %ecx, %ecx
je 0x8e35
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movl %ecx, %ecx
xorl %edx, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ebx, %ebx
movq 0x28(%rdi), %r8
movq (%r8,%rdx,8), %r8
movq %r8, %r9
andq %rsi, %r9
je 0x8e2b
shrq $0x1b, %r8
andq $-0x20, %r8
addq 0x20(%rdi), %r8
shlq $0x5, %r9
addq %r8, %r9
testq %rax, 0x18(%r8)
jne 0x8e22
leaq 0x20(%r8), %r10
cmpq %r9, %r10
jae 0x8e22
movq 0x18(%r10), %r11
testq %rax, %r11
jne 0x8e1c
movl 0x4(%r8), %ebp
cmpl 0x4(%r10), %ebp
jne 0x8e1c
orq %rax, %r11
movq %r11, 0x18(%r10)
incl %ebx
addq $0x20, %r10
jmp 0x8dfb
addq $0x20, %r8
cmpq %r9, %r8
jb 0x8df1
incq %rdx
cmpq %rcx, %rdx
jne 0x8dce
jmp 0x8e37
xorl %ebx, %ebx
movl $0x1, %esi
callq 0x8b9c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: graph_add_symm_arcs
int graph_add_symm_arcs(graph_t *g)
{
    uint32_t na, v, w, n_add;
    graph_arc_t *av, *a;

    // need to do it this as graph_add_arc could reallocate g->arc
    na = g->n_arc;
    av = g->arc;
    n_add = 0;
    for (a = av; a < av + na; ++a) {
        v = a->v;
        w = a->w;
        if (!graph_arc(g, w^1, v^1))
            ++n_add;
    }
    uint64_t old_m = g->m_arc;
    while (g->m_arc < na + n_add)
        g->m_arc <<= 1;
    g->arc = (graph_arc_t *) realloc(g->arc, g->m_arc * sizeof(graph_arc_t));
    memset(&g->arc[old_m], 0, (g->m_arc - old_m) * sizeof(graph_arc_t));
    
    av = g->arc;
    for (a = av; a < av + na; ++a) {
        v = a->v;
        w = a->w;
        if (graph_arc(g, w^1, v^1))
            continue;
        graph_add_arc(g, w^1, v^1, -1, 0, .0);
    }
#ifdef DEBUG_GRAPH_PRUNE
    fprintf(stderr, "[DEBUG_GRAPH_PRUNE::%s] number symm-arcs added: %d\n", __func__, n_add);
#endif
    graph_arc_sort(g);
    graph_arc_index(g);

    return n_add;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rdi
movl %eax, %r13d
movq %r13, %r12
shlq $0x5, %r12
testq %r13, %r13
je 0x8edc
leaq (%rdi,%r12), %rcx
movq 0x28(%rbx), %rdx
xorl %r14d, %r14d
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %rdi, %r8
movl 0x4(%r8), %r9d
xorq $0x1, %r9
movq (%rdx,%r9,8), %r9
movq %r9, %r10
andq %rsi, %r10
je 0x8ec8
movl (%r8), %r11d
shrq $0x1b, %r9
andq $-0x20, %r9
addq %rdi, %r9
movl 0x4(%r9), %ebp
xorl %r11d, %ebp
cmpl $0x1, %ebp
je 0x8ebc
addq $0x20, %r9
decq %r10
jne 0x8ea4
xorl %r9d, %r9d
xorl %r10d, %r10d
testq %r9, %r9
sete %r10b
jmp 0x8ece
movl $0x1, %r10d
addl %r10d, %r14d
addq $0x20, %r8
cmpq %rcx, %r8
jb 0x8e82
jmp 0x8edf
xorl %r14d, %r14d
movq 0x10(%rbx), %rbp
addl %r14d, %eax
movq %rbp, %rsi
cmpq %rax, %rbp
jae 0x8efd
movq %rbp, %rsi
addq %rsi, %rsi
cmpq %rax, %rsi
jb 0x8ef1
movq %rsi, 0x10(%rbx)
shlq $0x5, %rsi
callq 0x2390
movq %rax, %r15
movq %rax, 0x20(%rbx)
movq %rbp, %rdi
shlq $0x5, %rdi
addq %rax, %rdi
movq 0x10(%rbx), %rdx
subq %rbp, %rdx
shlq $0x5, %rdx
xorl %esi, %esi
callq 0x21e0
testq %r13, %r13
je 0x8fa1
movq %r15, %r13
addq %r12, %r13
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl (%r15), %edx
movl 0x4(%r15), %esi
xorq $0x1, %rsi
xorl $0x1, %edx
movq 0x28(%rbx), %rax
movq (%rax,%rsi,8), %rcx
movq %rcx, %rax
andq %r12, %rax
je 0x8f7f
movq 0x20(%rbx), %rdi
shrq $0x20, %rcx
shlq $0x5, %rcx
addq %rdi, %rcx
addq $0x4, %rcx
shlq $0x5, %rax
xorl %edi, %edi
cmpl %edx, (%rcx,%rdi)
je 0x8f94
addq $0x20, %rdi
cmpq %rdi, %rax
jne 0x8f71
xorps %xmm0, %xmm0
movq %rbx, %rdi
movq $-0x1, %rcx
xorl %r8d, %r8d
callq 0x8834
addq $0x20, %r15
cmpq %r13, %r15
jb 0x8f3a
movq 0x20(%rbx), %r15
movq 0x18(%rbx), %rsi
shlq $0x5, %rsi
addq %r15, %rsi
movq %r15, %rdi
callq 0x8696
movq %rbx, %rdi
callq 0x8a15
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: trim_graph_tips
int trim_graph_tips(graph_t *g)
{
    uint32_t v, nv, n_del;
    graph_arc_t *av;
    nv = graph_n_vtx(g);
    nv <<= 1;
    n_del = 0;

    for (v = 0; v < nv; ++v) {
        if (graph_arc_n(g, v^1) != 1 || graph_arc_n(g, v) > 0)
            continue;
        av = graph_arc_a(g, v^1);
        if (graph_arc_n(g, av->w^1) > 1 && !is_mwt(g, av->w^1, v))
            n_del += graph_arc_del_existed(g, av);
    }

    graph_clean(g, 1);

#ifdef DEBUG_GRAPH_PRUNE
    fprintf(stderr, "[DEBUG_GRAPH_PRUNE::%s] #del tips: %u\n", __func__, n_del);
#endif

    return n_del;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x8(%rdi), %rax
movl (%rax), %ecx
addl %ecx, %ecx
je 0x9db1
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movl %ecx, %ecx
xorl %edx, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %r8d
xorl %ebx, %ebx
movq 0x28(%rdi), %r14
movl %edx, %r9d
xorq $0x1, %r9
movq (%r14,%r9,8), %r10
cmpl $0x1, %r10d
jne 0x9ccf
cmpl $0x0, (%r14,%rdx,8)
je 0x9cdc
incq %rdx
cmpq %rcx, %rdx
jne 0x9cb3
jmp 0x9db3
movq 0x20(%rdi), %r9
shrq $0x1b, %r10
andq $-0x20, %r10
movl 0x4(%r9,%r10), %r11d
xorq $0x1, %r11
movq (%r14,%r11,8), %r14
testl $0xfffffffe, %r14d      # imm = 0xFFFFFFFE
je 0x9ccf
movq %r14, %r15
andq %rsi, %r15
je 0x9d46
shrq $0x1b, %r14
andq $-0x20, %r14
addq %r9, %r14
shlq $0x5, %r15
addq %r14, %r15
xorl %ebp, %ebp
xorpd %xmm0, %xmm0
movsd 0x10(%r14), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x9d39
movl 0x4(%r14), %r12d
cmpq %r12, %rdx
cmovel %r8d, %ebp
movapd %xmm1, %xmm0
addq $0x20, %r14
cmpq %r15, %r14
jb 0x9d1e
testl %ebp, %ebp
jne 0x9ccf
addq %r10, %r9
movq 0x18(%r9), %r14
xorl %r10d, %r10d
testq %rax, %r14
jne 0x9da9
orq %rax, %r14
movq %r14, 0x18(%r9)
movq 0x28(%rdi), %r10
movq (%r10,%r11,8), %r14
movq %r14, %r11
movl $0x1, %r10d
andq %rsi, %r11
je 0x9da9
movl (%r9), %r9d
movq 0x20(%rdi), %r15
shrq $0x20, %r14
shlq $0x5, %r11
shlq $0x5, %r14
addq %r15, %r14
addq $0x18, %r14
xorl %r15d, %r15d
movl -0x14(%r14,%r15), %ebp
xorl %r9d, %ebp
cmpl $0x1, %ebp
jne 0x9da0
orq %rax, (%r14,%r15)
addq $0x20, %r15
cmpq %r15, %r11
jne 0x9d8f
addl %r10d, %ebx
jmp 0x9ccf
xorl %ebx, %ebx
movl $0x1, %esi
callq 0x8b9c
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: trim_graph_blunts
int trim_graph_blunts(graph_t *g)
{
    uint32_t v, nv, na, n_del;
    uint8_t del;
    graph_arc_t *a, *av;
    nv = graph_n_vtx(g);
    nv <<= 1;
    n_del = 0;

    for (v = 0; v < nv; ++v) {
        if (graph_arc_n(g, v^1) > 0)
            continue;
        na = graph_arc_n(g, v);
        if (na > 1) {
            av = graph_arc_a(g, v);
            del = 1;
            for (a = av; a < av + na; ++a) {
                if (graph_arc_n(g, a->w) < 1) {
                    del = 0;
                    break;
                }
            }
            if (del)
                for (a = av; a < av + na; ++a)
                    n_del += graph_arc_del_existed(g, a);
        }
    }

    graph_clean(g, 1);

#ifdef DEBUG_GRAPH_PRUNE
    fprintf(stderr, "[DEBUG_GRAPH_PRUNE::%s] #del blunts: %u\n", __func__, n_del);
#endif

    return n_del;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x8(%rdi), %rax
movl (%rax), %ecx
addl %ecx, %ecx
je 0x9ed3
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movl %ecx, %ecx
xorl %edx, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ebx, %ebx
movq 0x28(%rdi), %r10
movl %edx, %r8d
xorq $0x1, %r8
cmpl $0x0, (%r10,%r8,8)
je 0x9e12
incq %rdx
cmpq %rcx, %rdx
jne 0x9df3
jmp 0x9ed5
movq (%r10,%rdx,8), %r8
testl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
je 0x9e05
movl %r8d, %r11d
testq %r11, %r11
je 0x9e05
shrq $0x1b, %r8
andq $-0x20, %r8
addq 0x20(%rdi), %r8
movq %r11, %r9
shlq $0x5, %r9
addq %r8, %r9
movq %r8, %r14
movl 0x4(%r14), %r15d
cmpl $0x0, (%r10,%r15,8)
je 0x9e05
addq $0x20, %r14
cmpq %r9, %r14
jb 0x9e40
testq %r11, %r11
je 0x9e05
movq 0x18(%r8), %r11
xorl %r10d, %r10d
testq %rax, %r11
jne 0x9ec2
orq %rax, %r11
movq %r11, 0x18(%r8)
movl 0x4(%r8), %r10d
xorq $0x1, %r10
movq 0x28(%rdi), %r11
movq (%r11,%r10,8), %r14
movq %r14, %r11
movl $0x1, %r10d
andq %rsi, %r11
je 0x9ec2
movl (%r8), %ebp
movq 0x20(%rdi), %r15
shrq $0x20, %r14
shlq $0x5, %r11
shlq $0x5, %r14
addq %r15, %r14
addq $0x18, %r14
xorl %r15d, %r15d
movl -0x14(%r14,%r15), %r12d
xorl %ebp, %r12d
cmpl $0x1, %r12d
jne 0x9eb9
orq %rax, (%r14,%r15)
addq $0x20, %r15
cmpq %r15, %r11
jne 0x9ea7
addl %r10d, %ebx
addq $0x20, %r8
cmpq %r9, %r8
jb 0x9e59
jmp 0x9e05
xorl %ebx, %ebx
movl $0x1, %esi
callq 0x8b9c
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: trim_graph_self_loops
int trim_graph_self_loops(graph_t *g)
{
    uint32_t n_del;
    graph_arc_t *a, *aw;
    n_del = 0;
    for (a = g->arc; a < g->arc + g->n_arc; ++a) {
        // might have bugs here
        if (graph_arc_n(g, a->v) > 1) 
            continue;
        aw = graph_arc(g, a->w, a->v);
        if (aw) 
            n_del += graph_arc_del_existed(g, aw);
    }

    graph_clean(g, 1);

#ifdef DEBUG_GRAPH_PRUNE
    fprintf(stderr, "[DEBUG_GRAPH_PRUNE::%s] #del self loops: %u\n", __func__, n_del);
#endif

    return n_del;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x18(%rdi), %r8
testq %r8, %r8
jle 0xa358
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq 0x20(%rdi), %rsi
xorl %ebx, %ebx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rsi, %rdx
movq 0x28(%rdi), %r10
movl (%rdx), %r9d
testl $0xfffffffe, (%r10,%r9,8) # imm = 0xFFFFFFFE
je 0xa2a2
addq $0x20, %rdx
movq %r8, %r9
shlq $0x5, %r9
addq %rsi, %r9
cmpq %r9, %rdx
jb 0xa279
jmp 0xa35a
movl 0x4(%rdx), %r11d
movq (%r10,%r11,8), %r14
movq %r14, %r15
andq %rcx, %r15
je 0xa28a
shrq $0x20, %r14
shlq $0x5, %r15
shlq $0x5, %r14
leaq (%rsi,%r14), %r10
addq $0x18, %r10
xorl %r11d, %r11d
cmpl %r9d, -0x14(%r10,%r11)
je 0xa2db
addq $0x20, %r11
cmpq %r11, %r15
jne 0xa2c9
jmp 0xa28a
movq %rsi, %r8
addq %r14, %r8
movq 0x18(%r11,%r8), %r14
xorl %r8d, %r8d
testq %rax, %r14
jne 0xa34c
orq %rax, %r14
movq %r14, (%r10,%r11)
xorq $0x1, %r9
movq 0x20(%rdi), %rsi
movq 0x28(%rdi), %r8
movq (%r8,%r9,8), %r14
movq %r14, %r9
movl $0x1, %r8d
andq %rcx, %r9
je 0xa34c
movl -0x18(%r10,%r11), %r10d
shrq $0x20, %r14
shlq $0x5, %r9
shlq $0x5, %r14
addq %r14, %rsi
addq $0x18, %rsi
xorl %r11d, %r11d
movl -0x14(%rsi,%r11), %ebp
xorl %r10d, %ebp
cmpl $0x1, %ebp
jne 0xa33f
orq %rax, (%rsi,%r11)
addq $0x20, %r11
cmpq %r11, %r9
jne 0xa32e
movq 0x20(%rdi), %rsi
addl %r8d, %ebx
movq 0x18(%rdi), %r8
jmp 0xa28a
xorl %ebx, %ebx
movl $0x1, %esi
callq 0x8b9c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: trim_graph_transitive_edges
int trim_graph_transitive_edges(graph_t *g)
{
    // TODO a more sophisticated implemetation for transitive edges > 2
    uint32_t v, nv, na, n_del;
    graph_arc_t *a1, *a2, *av;
    nv = graph_n_vtx(g);
    nv <<= 1;
    n_del = 0;

    for (v = 0; v < nv; ++v) {
        na = graph_arc_n(g, v);
        if (na < 2) 
            continue;
        av = graph_arc_a(g, v);
        for (a1 = av; a1 < av + na; ++a1) {
            for (a2 = av; a2 < av + na; ++a2) {
                if (a1 == a2) 
                    continue;
                if (graph_arc(g, a1->w, a2->w))
                    n_del += graph_arc_del_existed(g, a2);
            }
        }
    }

    graph_clean(g, 1);

#ifdef DEBUG_GRAPH_PRUNE
    fprintf(stderr, "[DEBUG_GRAPH_PRUNE::%s] #del transitive edges: %u\n", __func__, n_del);
#endif

    return n_del;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
movl (%rax), %ecx
addl %ecx, %ecx
je 0xa4ba
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movl %ecx, %ecx
movq %rcx, (%rsp)
xorl %edx, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ebx, %ebx
movq 0x28(%rdi), %r8
movq (%r8,%rdx,8), %r8
testl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
je 0xa4ab
movl %r8d, %r9d
testq %r9, %r9
je 0xa4ab
shrq $0x1b, %r8
andq $-0x20, %r8
addq 0x20(%rdi), %r8
shlq $0x5, %r9
addq %r8, %r9
movq %r8, %r10
movq %r8, %r11
cmpq %r11, %r10
je 0xa491
movl 0x4(%r10), %r14d
movq 0x28(%rdi), %r15
movq (%r15,%r14,8), %r12
movq %r12, %r15
andq %rsi, %r15
je 0xa491
movl 0x4(%r11), %r14d
movq 0x20(%rdi), %r13
shrq $0x20, %r12
shlq $0x5, %r12
addq %r13, %r12
addq $0x4, %r12
shlq $0x5, %r15
xorl %r13d, %r13d
cmpl %r14d, (%r12,%r13)
je 0xa42d
addq $0x20, %r13
cmpq %r13, %r15
jne 0xa41c
jmp 0xa491
movq 0x18(%r11), %r15
xorl %ebp, %ebp
testq %rax, %r15
jne 0xa48f
orq %rax, %r15
movq %r15, 0x18(%r11)
xorq $0x1, %r14
movq 0x28(%rdi), %r15
movq (%r15,%r14,8), %r12
movq %r12, %r14
movl $0x1, %ebp
andq %rsi, %r14
je 0xa48f
movl (%r11), %r15d
movq 0x20(%rdi), %r13
shrq $0x20, %r12
shlq $0x5, %r14
shlq $0x5, %r12
addq %r13, %r12
addq $0x18, %r12
xorl %r13d, %r13d
movl -0x14(%r12,%r13), %ecx
xorl %r15d, %ecx
cmpl $0x1, %ecx
jne 0xa486
orq %rax, (%r12,%r13)
addq $0x20, %r13
cmpq %r13, %r14
jne 0xa475
addl %ebp, %ebx
addq $0x20, %r11
cmpq %r9, %r11
jb 0xa3dd
addq $0x20, %r10
cmpq %r9, %r10
jb 0xa3da
incq %rdx
cmpq (%rsp), %rdx
jne 0xa3a3
jmp 0xa4bc
xorl %ebx, %ebx
movl $0x1, %esi
callq 0x8b9c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: trim_graph_pop_undirected
int trim_graph_pop_undirected(graph_t *g)
{
    uint32_t v, w, n_del;
    graph_arc_t *a;
    n_del = 0;
    for (a = g->arc; a < g->arc + g->n_arc; ++a) {
        if (graph_arc_n(g, a->v) != 1)
            continue;
        v = a->v;
        w = a->w;
        if (graph_arc(g, v^1, w) &&
                graph_arc_n(g, v^1) > 1 &&
                graph_arc_n(g, w) > 0) {
            ++n_del;
            graph_arc_del(g, w^1, v, 1);
            graph_arc_del(g, v^1, w, 1);
        }
    }

    graph_clean(g, 1);

#ifdef DEBUG_GRAPH_PRUNE
    fprintf(stderr, "[DEBUG_GRAPH_PRUNE::%s] #solved undirected: %u\n", __func__, n_del);
#endif

    return n_del;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0x18(%rdi)
jle 0xa8b8
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq 0x20(%rdi), %rsi
movq $0x0, (%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rsi, %rdx
movq 0x28(%rdi), %r15
movl (%rdx), %r10d
cmpl $0x1, (%r15,%r10,8)
jne 0xa89e
movq %r10, %r11
xorq $0x1, %r11
movq (%r15,%r11,8), %r12
movq %r12, %r9
andq %rcx, %r9
je 0xa89e
movl 0x4(%rdx), %r8d
movq %r12, %r14
shrq $0x20, %r14
movq %r14, %rbx
shlq $0x5, %rbx
leaq (%rsi,%rbx), %r13
addq $0x4, %r13
movq %r9, %rbp
shlq $0x5, %rbp
xorl %ebx, %ebx
cmpl %r8d, (%r13,%rbx)
je 0xa7fc
addq $0x20, %rbx
cmpq %rbx, %rbp
jne 0xa7e7
jmp 0xa89e
testl $0xfffffffe, %r12d      # imm = 0xFFFFFFFE
je 0xa89e
cmpl $0x0, (%r15,%r8,8)
je 0xa89e
movq %r8, %rbx
xorq $0x1, %rbx
movq (%r15,%rbx,8), %rbx
movq %rbx, %r15
andq %rcx, %r15
je 0xa864
shrq $0x20, %rbx
shlq $0x5, %r15
shlq $0x5, %rbx
addq %rbx, %rsi
addq $0x18, %rsi
xorl %r9d, %r9d
cmpl %r10d, -0x14(%rsi,%r9)
jne 0xa848
orq %rax, (%rsi,%r9)
addq $0x20, %r9
cmpq %r9, %r15
jne 0xa83d
movq 0x20(%rdi), %rsi
movq 0x28(%rdi), %r9
movq (%r9,%r11,8), %r14
movl %r14d, %r9d
shrq $0x20, %r14
movq (%rsp), %r10
incl %r10d
movq %r10, (%rsp)
testq %r9, %r9
je 0xa89e
shlq $0x5, %r9
shlq $0x5, %r14
addq %r14, %rsi
addq $0x18, %rsi
xorl %r10d, %r10d
cmpl %r8d, -0x14(%rsi,%r10)
jne 0xa891
orq %rax, (%rsi,%r10)
addq $0x20, %r10
cmpq %r10, %r9
jne 0xa886
movq 0x20(%rdi), %rsi
addq $0x20, %rdx
movq 0x18(%rdi), %r8
shlq $0x5, %r8
addq %rsi, %r8
cmpq %r8, %rdx
jb 0xa79b
jmp 0xa8c0
movq $0x0, (%rsp)
movl $0x1, %esi
callq 0x8b9c
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: trim_graph_weak_edges
int trim_graph_weak_edges(graph_t *g)
{
    uint32_t n_del;
    graph_arc_t *a;
    n_del = 0;
    for (a = g->arc; a < g->arc + g->n_arc; ++a)
        if (exist_strong_edge(g, a->v, a->wt) && exist_strong_edge(g, a->w^1, a->wt))
            n_del += graph_arc_del_existed(g, a);

    graph_clean(g, 1);

#ifdef DEBUG_GRAPH_PRUNE
    fprintf(stderr, "[DEBUG_GRAPH_PRUNE::%s] #del weak edges: %u\n", __func__, n_del);
#endif

    return n_del;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x18(%rdi), %r8
testq %r8, %r8
jle 0xaa2a
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq 0x20(%rdi), %rsi
xorl %ebx, %ebx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rsi, %rdx
movl (%rdx), %r9d
movq 0x28(%rdi), %r11
movq (%r11,%r9,8), %r10
testl $0xfffffffe, %r10d      # imm = 0xFFFFFFFE
je 0xaa11
movl %r10d, %r14d
testq %r14, %r14
je 0xaa11
movsd 0x10(%rdx), %xmm0
shrq $0x1b, %r10
andq $-0x20, %r10
addq %rsi, %r10
shlq $0x5, %r14
addq %r10, %r14
movsd 0x10(%r10), %xmm1
ucomisd %xmm0, %xmm1
ja 0xa95b
addq $0x20, %r10
cmpq %r14, %r10
jb 0xa941
jmp 0xaa11
movl 0x4(%rdx), %r10d
xorq $0x1, %r10
movq (%r11,%r10,8), %r11
testl $0xfffffffe, %r11d      # imm = 0xFFFFFFFE
je 0xaa11
movl %r11d, %r14d
testq %r14, %r14
je 0xaa11
shrq $0x1b, %r11
andq $-0x20, %r11
addq %rsi, %r11
shlq $0x5, %r14
addq %r11, %r14
movsd 0x10(%r11), %xmm1
ucomisd %xmm0, %xmm1
ja 0xa9a9
addq $0x20, %r11
cmpq %r14, %r11
jb 0xa992
jmp 0xaa11
movq 0x18(%rdx), %r11
xorl %r8d, %r8d
testq %rax, %r11
jne 0xaa0a
orq %rax, %r11
movq %r11, 0x18(%rdx)
movq 0x20(%rdi), %rsi
movq 0x28(%rdi), %r8
movq (%r8,%r10,8), %r11
movq %r11, %r10
movl $0x1, %r8d
andq %rcx, %r10
je 0xaa0a
shrq $0x20, %r11
shlq $0x5, %r10
shlq $0x5, %r11
addq %r11, %rsi
addq $0x18, %rsi
xorl %r11d, %r11d
movl -0x14(%rsi,%r11), %ebp
xorl %r9d, %ebp
cmpl $0x1, %ebp
jne 0xa9fd
orq %rax, (%rsi,%r11)
addq $0x20, %r11
cmpq %r11, %r10
jne 0xa9ec
movq 0x20(%rdi), %rsi
addl %r8d, %ebx
movq 0x18(%rdi), %r8
addq $0x20, %rdx
movq %r8, %r9
shlq $0x5, %r9
addq %rsi, %r9
cmpq %r9, %rdx
jb 0xa906
jmp 0xaa2c
xorl %ebx, %ebx
movl $0x1, %esi
callq 0x8b9c
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/graph.c
// Function: trim_graph_ambiguous_edges
int trim_graph_ambiguous_edges(graph_t *g)
{
    uint32_t n_del;
    graph_arc_t *a;
    n_del = 0;
    for (a = g->arc; a < g->arc + g->n_arc; ++a)
        if (graph_arc_n(g, a->v) > 1 || graph_arc_n(g, a->w^1) > 1)
            n_del += graph_arc_del_existed(g, a);

    graph_clean(g, 1);

#ifdef DEBUG_GRAPH_PRUNE
    fprintf(stderr, "[DEBUG_GRAPH_PRUNE::%s] #del ambiguous edges: %u\n", __func__, n_del);
#endif

    return n_del;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq 0x18(%rdi), %r9
testq %r9, %r9
jle 0xab11
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq 0x20(%rdi), %rsi
xorl %ebx, %ebx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rsi, %rdx
movq 0x28(%rdi), %r10
movl (%rdx), %r8d
testl $0xfffffffe, (%r10,%r8,8) # imm = 0xFFFFFFFE
jne 0xaa88
movl 0x4(%rdx), %r11d
xorq $0x1, %r11
testl $0xfffffffe, (%r10,%r11,8) # imm = 0xFFFFFFFE
je 0xaaf8
movq 0x18(%rdx), %r10
xorl %r9d, %r9d
testq %rax, %r10
jne 0xaaf1
orq %rax, %r10
movq %r10, 0x18(%rdx)
movl 0x4(%rdx), %r9d
xorq $0x1, %r9
movq 0x20(%rdi), %rsi
movq 0x28(%rdi), %r10
movq (%r10,%r9,8), %r11
movq %r11, %r10
movl $0x1, %r9d
andq %rcx, %r10
je 0xaaf1
shrq $0x20, %r11
shlq $0x5, %r10
shlq $0x5, %r11
addq %r11, %rsi
addq $0x18, %rsi
xorl %r11d, %r11d
movl -0x14(%rsi,%r11), %ebp
xorl %r8d, %ebp
cmpl $0x1, %ebp
jne 0xaae4
orq %rax, (%rsi,%r11)
addq $0x20, %r11
cmpq %r11, %r10
jne 0xaad3
movq 0x20(%rdi), %rsi
addl %r9d, %ebx
movq 0x18(%rdi), %r9
addq $0x20, %rdx
movq %r9, %r8
shlq $0x5, %r8
addq %rsi, %r8
cmpq %r8, %rdx
jb 0xaa65
jmp 0xab13
xorl %ebx, %ebx
movl $0x1, %esi
callq 0x8b9c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/link.c
// Function: inter_link_mat_destroy
void inter_link_mat_destroy(inter_link_mat_t *link_mat)
{
    if (!link_mat) return;
    uint32_t i, j;
    for (i = 0; i < link_mat->n; ++i) {
        if (link_mat->links[i].n) {
            for (j = 0; j < 4; ++j) {
                free(link_mat->links[i].link[j]);
                free(link_mat->links[i].linkb[j]);
            }
        }
    }
    if (link_mat->links)
        free(link_mat->links);
    free(link_mat);
}

// Assembly:
testq %rdi, %rdi
je 0xd1dd
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
testl %eax, %eax
je 0xd1be
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rcx
movq %r15, %rdx
shlq $0x7, %rdx
cmpl $0x0, 0x14(%rcx,%rdx)
je 0xd1b0
movl $0x4, %r12d
movq %r14, %r13
movq 0x10(%rbx), %rax
movq 0x20(%rax,%r13), %rdi
callq 0x2060
movq 0x10(%rbx), %rax
movq 0x40(%rax,%r13), %rdi
callq 0x2060
addq $0x8, %r13
decq %r12
jne 0xd189
movl (%rbx), %eax
incq %r15
movl %eax, %ecx
subq $-0x80, %r14
cmpq %rcx, %r15
jb 0xd16e
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xd1cc
callq 0x2060
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2060
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/link.c
// Function: estimate_inter_link_mat_init_rss
long estimate_inter_link_mat_init_rss(asm_dict_t *dict, uint32_t resolution, uint32_t radius)
{
    long bytes, p, m;
    uint32_t i, j, b0, b1, n, r, r2;

    n = dict->n;
    m = (long) n * (n - 1) / 2;
    if (m > UINT32_MAX)
        return -1;

    r2 = resolution * 2;

    bytes = 0;
    bytes += sizeof(inter_link_mat_t);
    bytes += m * sizeof(inter_link_t);

    for (i = 0; i < n; ++i) {
        if (dict->s[i].len < r2)
            continue;

        b0 = MIN(radius, div_ceil(dict->s[i].len, r2));
        for (j = i + 1; j < n; ++j) {
            if (dict->s[j].len < r2)
                continue;

            b1 = MIN(radius, div_ceil(dict->s[j].len, r2));
            p = b0 * b1;
            if (p > UINT32_MAX)
                return -1;
            r = MIN(radius, (uint32_t) (b0 + b1 - 1));

            bytes += (p + r) * 4 * sizeof(double);
        }
    }

    return bytes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebx
movl (%rdi), %r8d
leal -0x1(%r8), %edx
movq %rdx, %rax
imulq %r8, %rax
movq %rax, %rcx
shrq $0x21, %rcx
movq $-0x1, 0x18(%rsp)
jne 0xd7c7
shlq $0x6, %rax
movabsq $0x7fffffff80, %rcx     # imm = 0x7FFFFFFF80
andq %rax, %rcx
orq $0x18, %rcx
movq %rcx, 0x18(%rsp)
testq %r8, %r8
je 0xd7c7
movq %rdi, %r14
addl %esi, %esi
movl %esi, 0x4(%rsp)
movl %esi, %r13d
movl $0x60, %ecx
xorl %ebp, %ebp
movq %r8, 0x20(%rsp)
movq 0x8(%r14), %rax
imulq $0x58, %rbp, %r15
movq 0x8(%rax,%r15), %rdi
cmpq %r13, %rdi
jae 0xd6f8
incq %rbp
jmp 0xd7b8
movq %rcx, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movl 0x4(%rsp), %esi
callq 0x4b01
movl %ebx, %r12d
cmpl %ebx, %eax
ja 0xd727
movq 0x8(%r14), %rax
movq 0x8(%rax,%r15), %rdi
movl 0x4(%rsp), %esi
callq 0x4b01
movl %eax, %r12d
incq %rbp
movq %rbp, 0x28(%rsp)
movq 0x20(%rsp), %r8
cmpq %r8, %rbp
jae 0xd7a9
leal -0x1(%r12), %eax
movq %rax, 0x30(%rsp)
movq 0x10(%rsp), %rax
movl %eax, %r15d
movq 0x8(%rsp), %rbp
movq 0x8(%r14), %rax
movq (%rax,%rbp), %rdi
cmpq %r13, %rdi
jb 0xd79b
movl 0x4(%rsp), %esi
callq 0x4b01
movl %eax, %ecx
movl %ebx, %eax
cmpl %ebx, %ecx
ja 0xd77f
movq 0x8(%r14), %rax
movq (%rax,%rbp), %rdi
movl 0x4(%rsp), %esi
callq 0x4b01
movq 0x30(%rsp), %rcx
addl %eax, %ecx
imull %r12d, %eax
cmpl %ebx, %ecx
cmovael %ebx, %ecx
addq %rax, %rcx
shlq $0x5, %rcx
addq %rcx, 0x18(%rsp)
addq $0x58, %rbp
decl %r15d
jne 0xd750
movq 0x20(%rsp), %r8
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq 0x28(%rsp), %rbp
addq $0x58, %rcx
decl %edx
cmpq %r8, %rbp
jne 0xd6de
movq 0x18(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/link.c
// Function: intra_link_mat_init
intra_link_mat_t *intra_link_mat_init(void *dict, uint32_t resolution, int use_gap_seq)
{
    intra_link_mat_t *link_mat;
    intra_link_t *link;
    uint32_t i, n, b, p;
    uint64_t len;

    n = use_gap_seq? ((asm_dict_t *) dict)->n : ((sdict_t *) dict)->n;
    link_mat = (intra_link_mat_t *) malloc(sizeof(intra_link_mat_t));
    link_mat->n = n;
    link_mat->links = (intra_link_t *) calloc(n, sizeof(intra_link_t));

    for (i = 0; i < n; ++i) {
        link = &link_mat->links[i];
        link->c = i;
        len = use_gap_seq? ((asm_dict_t *) dict)->s[i].len : ((sdict_t *) dict)->s[i].len;
        if (len < resolution) {
            link->n = 0;
            continue;
        }
        b = div_ceil(len, resolution);
        link->n = b;
        p = (long) b * (b + 1) / 2;
        link->link = (double *) calloc(p, sizeof(double));
        if (!link->link) {
            fprintf(stderr, "[E::%s] memory allocation failure\n", __func__);
            exit(EXIT_FAILURE);
        }

#ifdef DEBUG_INTRA
        fprintf(stderr, "[DEBUG_INTRA::%s] %s bins: %d\n", __func__, use_gap_seq? ((asm_dict_t *) dict)->s[i].name : ((sdict_t *) dict)->s[i].name, link->n);
#endif
    }

    return link_mat;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0x4(%rsp)
movl %esi, (%rsp)
movq %rdi, 0x10(%rsp)
movl (%rdi), %r15d
movl $0x10, %r12d
movl $0x10, %edi
callq 0x2330
movq %rax, %rbx
movl %r15d, (%rax)
movl $0x10, %esi
movq %r15, %rdi
callq 0x2290
movq %rbx, 0x8(%rsp)
movq %rax, 0x8(%rbx)
testq %r15, %r15
je 0xd8a8
movq %rax, %r13
movl (%rsp), %ebp
addq $0x8, %r13
movl $0x8, %ebx
xorl %r14d, %r14d
movl %r14d, -0x8(%r13)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x4(%rsp)
je 0xd855
movq (%rax,%rbx), %rdi
jmp 0xd859
movl (%rax,%r12), %edi
cmpq %rbp, %rdi
jae 0xd868
movl $0x0, -0x4(%r13)
jmp 0xd894
movl (%rsp), %esi
callq 0x4b01
movl %eax, -0x4(%r13)
movl %eax, %ecx
incl %eax
imulq %rcx, %rax
shrq %rax
movl %eax, %edi
movl $0x8, %esi
callq 0x2290
movq %rax, (%r13)
testq %rax, %rax
je 0xd8bc
incq %r14
addq $0x10, %r13
addq $0x18, %r12
addq $0x58, %rbx
cmpq %r14, %r15
jne 0xd83b
movq 0x8(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x28ae
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/link.c
// Function: estimate_intra_link_mat_init_rss
long estimate_intra_link_mat_init_rss(void *dict, uint32_t resolution, int use_gap_seq)
{
    long bytes, p;
    uint32_t i, n, b;
    uint64_t len;

    n = use_gap_seq? ((asm_dict_t *) dict)->n : ((sdict_t *) dict)->n;

    bytes = 0;
    bytes += sizeof(intra_link_mat_t);
    bytes += n * sizeof(intra_link_t);

    for (i = 0; i < n; ++i) {
        len = use_gap_seq? ((asm_dict_t *) dict)->s[i].len : ((sdict_t *) dict)->s[i].len;
        if (len < resolution)
            continue;
        b = div_ceil(len, resolution);
        p = (long) b * (b + 1) / 2;
        if (p > UINT32_MAX)
            return -1;

        bytes += p * sizeof(double);
    }
    return bytes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl (%rdi), %eax
movq %rax, %rbx
shlq $0x4, %rbx
addq $0x10, %rbx
testq %rax, %rax
je 0xd96a
movl %edx, %r12d
movq %rdi, %r13
movl %esi, %r8d
imulq $0x58, %rax, %r10
movl $0x10, %r14d
xorl %ebp, %ebp
movq %r8, 0x10(%rsp)
movq %r10, 0x8(%rsp)
movq 0x8(%r13), %rax
testl %r12d, %r12d
je 0xd914
movq 0x8(%rax,%rbp), %rdi
jmp 0xd918
movl (%rax,%r14), %edi
cmpq %r8, %rdi
jb 0xd954
movl %esi, %r15d
callq 0x4b01
movl %eax, %ecx
incl %eax
imulq %rcx, %rax
movq %rax, %rcx
shrq $0x21, %rcx
jne 0xd963
movabsq $0x1fffffffe, %rcx      # imm = 0x1FFFFFFFE
andq %rcx, %rax
leaq (%rbx,%rax,4), %rbx
movl %r15d, %esi
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %r10
addq $0x18, %r14
addq $0x58, %rbp
cmpq %rbp, %r10
jne 0xd904
jmp 0xd96a
movq $-0x1, %rbx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/link.c
// Function: cov_norm_from_file
cov_norm_t *cov_norm_from_file(const char *f, sdict_t *dict)
{
    uint32_t i;
    uint64_t m, n;
    double *norm_a, **norm;
    int64_t magic_number;
    cov_norm_t *cov_norm;
    FILE *fp;
    
    fp = fopen(f, "r");
    if (fp == NULL)
        return 0;

    m = fread(&magic_number, sizeof(int64_t), 1, fp);
    if (m != 1) bin_fread_error();
    if (!is_valid_bin_header(magic_number)) {
        fprintf(stderr, "[E::%s] not a valid BIN file\n", __func__);
        fclose(fp);
        return 0;
    }
    file_seek_skip_sdict(fp);
    m = fread(&n, sizeof(uint64_t), 1, fp);
    if (m != 1) bin_fread_error();
    fseek(fp, n * 17, SEEK_CUR);
    m = fread(&n, sizeof(uint64_t), 1, fp);
    if (m != 1) bin_fread_error();
    norm_a = (double *) malloc(sizeof(double) * n);
    m = fread(norm_a, sizeof(double), n, fp);
    if (m != n) bin_fread_error();
    
    norm = (double **) malloc(sizeof(double *) * dict->n);
    norm[0] = norm_a;
    for (i = 1; i < dict->n; ++i)
        norm[i] = norm[i-1] + div_ceil(dict->s[i-1].len, COV_NORM_WINDOW);
    
    fclose(fp);
    
    cov_norm = (cov_norm_t *) malloc(sizeof(cov_norm_t));
    cov_norm->n = n;
    cov_norm->w = COV_NORM_WINDOW;
    cov_norm->norm = norm;

    return cov_norm;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
leaq 0x14b7b(%rip), %rsi     # 0x23449
callq 0x23e0
testq %rax, %rax
je 0xea37
movq %rax, %r14
leaq 0x10(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x20f0
cmpq $0x1, %rax
je 0xe903
xorl %eax, %eax
callq 0x4b91
movq 0x10(%rsp), %rdi
callq 0x4b7e
testl %eax, %eax
je 0xea2f
movq %r14, %rdi
callq 0x166b8
movq %rsp, %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x20f0
cmpq $0x1, %rax
je 0xe93f
xorl %eax, %eax
callq 0x4b91
movq %rsp, %r15
movq (%r15), %rax
movq %rax, %rsi
shlq $0x4, %rsi
addq %rax, %rsi
movq %r14, %rdi
movl $0x1, %edx
callq 0x2370
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x20f0
cmpq $0x1, %rax
je 0xe97e
xorl %eax, %eax
callq 0x4b91
movq (%rsp), %r15
leaq (,%r15,8), %rdi
callq 0x2330
movq %rax, %r12
movl $0x8, %esi
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x20f0
movq %r15, 0x8(%rsp)
cmpq %r15, %rax
je 0xe9b6
xorl %eax, %eax
callq 0x4b91
movl (%rbx), %r15d
leaq (,%r15,8), %rdi
callq 0x2330
movq %rax, %r13
movq %r12, (%rax)
cmpq $0x2, %r15
jb 0xea08
movl $0x1, %ebp
movl $0x2, %r15d
movq 0x8(%rbx), %rax
movl (%rax,%r15,8), %edi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x4b01
movl %eax, %eax
leaq (%r12,%rax,8), %r12
movq %r12, (%r13,%rbp,8)
incq %rbp
movl (%rbx), %eax
addq $0x3, %r15
cmpq %rax, %rbp
jb 0xe9dd
movq %r14, %rdi
callq 0x2150
movl $0x18, %edi
callq 0x2330
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movl $0x3e8, 0x8(%rax)       # imm = 0x3E8
movq %r13, 0x10(%rax)
jmp 0xea39
movq %r14, %rdi
callq 0x2914
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/link.c
// Function: norm_destroy
void norm_destroy(norm_t *norm)
{
    if (!norm) return;
    //uint32_t i;
    free(norm->bs);
    //for (i = 0; i < norm->n; ++i)
    //    free(norm->link[i]);
    //free(norm->link);
    free(norm->linkc);
    free(norm->norms);
    free(norm);
}

// Assembly:
testq %rdi, %rdi
je 0xea75
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x2060
movq 0x18(%rbx), %rdi
callq 0x2060
movq 0x10(%rbx), %rdi
callq 0x2060
movq %rbx, %rdi
popq %rbx
jmp 0x2060
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/link.c
// Function: print_inter_link_norms
void print_inter_link_norms(FILE *fp, inter_link_mat_t *link_mat, asm_dict_t *dict)
{
    uint32_t i, n;
    inter_link_t *link;

    n = link_mat->n;
    for (i = 0; i < n; ++i) {
        link = &link_mat->links[i];
        if (link->n)
            fprintf(fp, "NORM: %s %s (%u) [%.3f %.3f %.3f %.3f]\n", dict->s[link->c0].name, dict->s[link->c1].name, link->n0, link->norms[0], link->norms[1], link->norms[2], link->norms[3]);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl (%rsi), %r13d
testq %r13, %r13
je 0xeeb2
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
shlq $0x7, %r13
xorl %ebp, %ebp
leaq 0x139c9(%rip), %r12     # 0x22822
movq 0x10(%r14), %rax
cmpl $0x0, 0x14(%rax,%rbp)
je 0xeea9
movq 0x8(%rbx), %rcx
movl (%rax,%rbp), %edx
movl 0x4(%rax,%rbp), %esi
imulq $0x58, %rdx, %rdx
movq (%rcx,%rdx), %rdx
imulq $0x58, %rsi, %rsi
movq (%rcx,%rsi), %rcx
movl 0x18(%rax,%rbp), %r8d
movsd 0x60(%rax,%rbp), %xmm0
movsd 0x68(%rax,%rbp), %xmm1
movsd 0x70(%rax,%rbp), %xmm2
movsd 0x78(%rax,%rbp), %xmm3
movq %r15, %rdi
movq %r12, %rsi
movb $0x4, %al
callq 0x22c0
subq $-0x80, %rbp
cmpq %rbp, %r13
jne 0xee59
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/link.c
// Function: print_inter_link_bands
void print_inter_link_bands(FILE *fp, inter_link_mat_t *link_mat, asm_dict_t *dict)
{
    uint32_t i, j, k, n;
    inter_link_t *link;
    
    n = link_mat->n;
    for (i = 0; i < n; ++i) {
        link = &link_mat->links[i];
        if (link->n) {
            for (j = 0; j < 4; ++j) {
                fprintf(fp, "BAND [%u %u]: %s%s %s%s (%u, %u) [%.3f]", i, j, dict->s[link->c0].name, j < 2? "-" : "+", dict->s[link->c1].name, j & 1? "-" : "+", link->n0, link->r, link->norms[j]);
                for (k = 0; k < link->r; ++k)
                    fprintf(fp, " %.0f", link->linkb[j][k]);
                fprintf(fp, "\n");
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl (%rsi), %eax
movq %rax, (%rsp)
testq %rax, %rax
je 0xefeb
movq %rdi, %r15
xorl %edx, %edx
leaq 0x13980(%rip), %rbp     # 0x22874
movq 0x8(%rsp), %rax
movq 0x10(%rax), %r13
movq %rdx, %rax
shlq $0x7, %rax
cmpl $0x0, 0x14(%r13,%rax)
je 0xefde
addq %rax, %r13
xorl %r14d, %r14d
movq %rdx, 0x18(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %r10
movl (%r13), %eax
movl 0x4(%r13), %ecx
imulq $0x58, %rax, %rax
cmpq $0x2, %r14
leaq 0x13937(%rip), %rsi     # 0x22872
movq %rsi, %r9
leaq 0x1341c(%rip), %rbx     # 0x22361
cmovbq %rbx, %r9
imulq $0x58, %rcx, %rcx
movq %rcx, 0x20(%rsp)
testb $0x1, %r14b
cmoveq %rsi, %rbx
movq (%r10,%rax), %r8
movl 0x18(%r13), %r12d
movl 0x10(%r13), %r11d
movsd 0x60(%r13,%r14,8), %xmm0
movq %r15, %rdi
leaq 0x138d3(%rip), %rsi     # 0x2284a
movl %r14d, %ecx
movb $0x1, %al
pushq %r11
pushq %r12
pushq %rbx
movq 0x38(%rsp), %r11
pushq (%r10,%r11)
callq 0x22c0
addq $0x20, %rsp
cmpl $0x0, 0x10(%r13)
je 0xefbf
xorl %ebx, %ebx
movq 0x40(%r13,%r14,8), %rax
movsd (%rax,%rbx,8), %xmm0
movq %r15, %rdi
movq %rbp, %rsi
movb $0x1, %al
callq 0x22c0
incq %rbx
movl 0x10(%r13), %eax
cmpq %rax, %rbx
jb 0xef9c
movl $0xa, %edi
movq %r15, %rsi
callq 0x2260
incq %r14
cmpq $0x4, %r14
movq 0x18(%rsp), %rdx
jne 0xef1b
incq %rdx
cmpq (%rsp), %rdx
jne 0xeef4
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]yahs/link.c
// Function: get_max_inter_norms
double *get_max_inter_norms(inter_link_mat_t *link_mat, asm_dict_t *dict)
{
    uint32_t i, j, n, c0, c1;
    double *max_norms;
    inter_link_t *link;

    n = link_mat->n;
    max_norms = (double *) calloc(dict->n, sizeof(double));
    for (i = 0; i < n; ++i) {
        link = &link_mat->links[i];
        if (link->n) {
            c0 = link->c0;
            c1 = link->c1;
            for (j = 0; j < 4; ++j) {
                max_norms[c0] = MAX(max_norms[c0], link->norms[j]);
                max_norms[c1] = MAX(max_norms[c1], link->norms[j]);
            }
        }
    }
    return max_norms;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %r14d
movl (%rsi), %edi
movl $0x8, %esi
callq 0x2290
testq %r14, %r14
je 0xf074
movq 0x10(%rbx), %rcx
leaq 0x60(%rcx), %rdx
xorl %esi, %esi
movq %rsi, %r8
shlq $0x7, %r8
cmpl $0x0, 0x14(%rcx,%r8)
je 0xf068
addq %rcx, %r8
movl (%r8), %edi
movl 0x4(%r8), %r8d
xorl %r9d, %r9d
movsd (%rax,%rdi,8), %xmm0
movsd (%rdx,%r9,8), %xmm1
maxsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rdi,8)
movsd (%rax,%r8,8), %xmm0
maxsd %xmm1, %xmm0
movsd %xmm0, (%rax,%r8,8)
incq %r9
cmpq $0x4, %r9
jne 0xf03b
incq %rsi
subq $-0x80, %rdx
cmpq %r14, %rsi
jne 0xf01f
addq $0x8, %rsp
popq %rbx
popq %r14
retq