// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0xc(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x8de0
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x10(%rbp)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl $0x1, %esi
movl -0x10(%rbp), %edx
xorl $0x1, %edx
callq 0x8f10
cmpq $0x0, %rax
jne 0x8dd0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x8dd2
movq -0x28(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x28(%rbp)
jmp 0x8d82
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
addl -0x18(%rbp), %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x8e12
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
shlq %rcx
movq %rcx, 0x10(%rax)
jmp 0x8dec
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
shlq $0x5, %rsi
callq 0x23a0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x30(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
subq -0x30(%rbp), %rdx
shlq $0x5, %rdx
xorl %esi, %esi
callq 0x21f0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0xc(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x8eeb
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x10(%rbp)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl $0x1, %esi
movl -0x10(%rbp), %edx
xorl $0x1, %edx
callq 0x8f10
cmpq $0x0, %rax
je 0x8ebb
jmp 0x8edd
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl $0x1, %esi
movl -0x10(%rbp), %edx
xorl $0x1, %edx
movq $-0x1, %rcx
xorl %r8d, %r8d
xorps %xmm0, %xmm0
callq 0x8330
movq -0x28(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x28(%rbp)
jmp 0x8e74
movq -0x8(%rbp), %rdi
callq 0x85a0
movq -0x8(%rbp), %rdi
callq 0x86b0
movl -0x18(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)