// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movsd %xmm0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jne 0x83f2
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x838d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x40(%rbp)
jmp 0x8398
movl $0x10, %eax
movq %rax, -0x40(%rbp)
jmp 0x8398
movq -0x40(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
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 -0x38(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
subq -0x38(%rbp), %rdx
shlq $0x5, %rdx
xorl %esi, %esi
callq 0x21f0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rdx
movq 0x18(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x18(%rdx)
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0xc(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x10(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movsd -0x28(%rbp), %xmm0
movq -0x30(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movq -0x30(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
cmpq $0x0, -0x18(%rbp)
jl 0x8455
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x8465
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
subq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rcx
movabsq $0x1fffffffffffffff, %rsi # imm = 0x1FFFFFFFFFFFFFFF
andq %rsi, %rdx
movabsq $-0x2000000000000000, %rsi # imm = 0xE000000000000000
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, 0x18(%rax)
cmpq $0x0, -0x18(%rbp)
jl 0x84b6
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x18(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x30(%rbp), %rax
movabsq $-0x2000000000000001, %rcx # imm = 0xDFFFFFFFFFFFFFFF
andq 0x18(%rax), %rcx
orq $0x0, %rcx
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
movabsq $-0x4000000000000001, %rcx # imm = 0xBFFFFFFFFFFFFFFF
andq 0x18(%rax), %rcx
orq $0x0, %rcx
movq %rcx, 0x18(%rax)
movslq -0x1c(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rcx
andq $0x1, %rdx
shlq $0x3f, %rdx
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)