// File: chhylp123[P]hifiasm/hic.cpp
// Function: push_hc_edge(hc_linkeage*, unsigned long, double, int, unsigned long*)
hc_edge* push_hc_edge(hc_linkeage* x, uint64_t uID, double weight, int dir, uint64_t* d)
{
    uint64_t k, n;
    hc_edge* a = NULL;
    hc_edge* p = NULL;
    if(dir == 0)
    {
        a = x->e.a;
        n = x->e.n;
    }
    else
    {
        a = x->f.a;
        n = x->f.n;
    }
    
    for (k = 0; k < n; k++)
    {
        if(a[k].del) continue;
        if(a[k].uID == uID)
        {
            a[k].weight += weight;
            if(d) a[k].dis = (*d);
            return &(a[k]);
        }
    }

    if(dir == 0)
    {
        kv_pushp(hc_edge, x->e, &p);
    }
    else
    {
        kv_pushp(hc_edge, x->f, &p);
    }
    
    ///p->del = p->enzyme = 0;
    p->del = 0;
    p->uID = uID;
    p->weight = weight;
    if(d) p->dis = (*d);
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movsd %xmm0, -0x20(%rbp)
movl %edx, -0x24(%rbp)
movq %rcx, -0x30(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x1cb3cb
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x1cb3e3
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x1cb485
movq -0x48(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movb 0x18(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x1cb411
jmp 0x1cb474
movq -0x48(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpq -0x18(%rbp), %rax
jne 0x1cb472
movsd -0x20(%rbp), %xmm0
movq -0x48(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
cmpq $0x0, -0x30(%rbp)
je 0x1cb45d
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x48(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x1cb5f7
jmp 0x1cb474
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1cb3eb
cmpl $0x0, -0x24(%rbp)
jne 0x1cb51f
jmp 0x1cb491
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1cb4f6
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1cb4be
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x58(%rbp)
jmp 0x1cb4c9
movl $0x2, %eax
movq %rax, -0x58(%rbp)
jmp 0x1cb4c9
movq -0x58(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
imulq $0x28, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
jmp 0x1cb5af
jmp 0x1cb521
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jne 0x1cb587
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1cb54f
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
shlq %rax
movq %rax, -0x60(%rbp)
jmp 0x1cb55a
movl $0x2, %eax
movq %rax, -0x60(%rbp)
jmp 0x1cb55a
movq -0x60(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x10(%rbp), %rax
imulq $0x28, 0x20(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rdx
movq 0x18(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x18(%rdx)
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
jmp 0x1cb5af
movq -0x50(%rbp), %rax
movb 0x18(%rax), %cl
andb $0x7f, %cl
orb $0x0, %cl
movb %cl, 0x18(%rax)
movq -0x18(%rbp), %rax
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x8(%rax)
movsd -0x20(%rbp), %xmm0
movq -0x50(%rbp), %rax
movsd %xmm0, (%rax)
cmpq $0x0, -0x30(%rbp)
je 0x1cb5ef
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)