// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/gfa-base.c
// Function: gfa_add_arc1
gfa_arc_t *gfa_add_arc1(gfa_t *g, uint32_t v, uint32_t w, int32_t ov, int32_t ow, int64_t link_id, int comp)
{
	gfa_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 = (gfa_arc_t*)realloc(g->arc, g->m_arc * sizeof(gfa_arc_t));
		memset(&g->arc[old_m], 0, (g->m_arc - old_m) * sizeof(gfa_arc_t));
		g->link_aux = (gfa_aux_t*)realloc(g->link_aux, g->m_arc * sizeof(gfa_aux_t));
		memset(&g->link_aux[old_m], 0, (g->m_arc - old_m) * sizeof(gfa_aux_t));
	}
	a = &g->arc[g->n_arc++];
	a->v_lv = (uint64_t)v << 32;
	a->w = w, a->ov = ov, a->ow = ow, 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 $0x40, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movq %r9, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x40(%rcx), %rax
jne 0x5e51
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x5d9e
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
shlq %rax
movq %rax, -0x38(%rbp)
jmp 0x5da9
movl $0x10, %eax
movq %rax, -0x38(%rbp)
jmp 0x5da9
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
shlq $0x5, %rsi
callq 0x22b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x30(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdx
subq -0x30(%rbp), %rdx
shlq $0x5, %rdx
xorl %esi, %esi
callq 0x2190
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
shlq $0x4, %rsi
callq 0x22b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x30(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdx
subq -0x30(%rbp), %rdx
shlq $0x4, %rdx
xorl %esi, %esi
callq 0x2190
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x8(%rbp), %rdx
movq 0x40(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
shlq $0x20, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movl -0x10(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x14(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x18(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x28(%rbp), %rax
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
cmpq $0x0, -0x20(%rbp)
jl 0x5ec1
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x5ed1
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
subq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdx
movq -0x28(%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, -0x20(%rbp)
jl 0x5f22
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x20(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x28(%rbp), %rax
movabsq $-0x2000000000000001, %rcx # imm = 0xDFFFFFFFFFFFFFFF
andq 0x18(%rax), %rcx
orq $0x0, %rcx
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movabsq $-0x4000000000000001, %rcx # imm = 0xBFFFFFFFFFFFFFFF
andq 0x18(%rax), %rcx
orq $0x0, %rcx
movq %rcx, 0x18(%rax)
movslq 0x10(%rbp), %rdx
movq -0x28(%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 -0x28(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)