// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/gfa-base.c
// Function: gfa_fix_symm_add
uint32_t gfa_fix_symm_add(gfa_t *g)
{
	uint32_t n_err = 0, v, n_vtx = gfa_n_vtx(g);
	int i;
	for (v = 0; v < n_vtx; ++v) {
		int nv = gfa_arc_n(g, v);
		gfa_arc_t *av = gfa_arc_a(g, v);
		for (i = 0; i < nv; ++i) {
			int j, nw;
			gfa_arc_t *aw, *avi = &av[i];
			if (avi->del || avi->comp) continue;
			nw = gfa_arc_n(g, avi->w^1);
			aw = gfa_arc_a(g, avi->w^1);
			for (j = 0; j < nw; ++j) {
				gfa_arc_t *awj = &aw[j];
				if (awj->del || awj->comp) continue;
				if (awj->w == (v^1) && awj->ov == avi->ow && awj->ow == avi->ov) { // complement found
					awj->comp = 1;
					awj->link_id = avi->link_id;
					break;
				}
			}
			if (j == nw) {
				gfa_arc_t *arc_old = g->arc, *arc_new;
				arc_new = gfa_add_arc1(g, avi->w^1, v^1, avi->ow, avi->ov, avi->link_id, 1);
				if (arc_old != g->arc) av = gfa_arc_a(g, v); // g->arc may be reallocated
				arc_new->rank = av[i].rank;
			}
		}
	}
	if (n_vtx < gfa_n_vtx(g)) {
		gfa_arc_sort(g);
		gfa_arc_index(g);
	}
	return n_err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
shll %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x6a55
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl -0x10(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
movl -0x10(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x6a45
movq -0x28(%rbp), %rax
movslq -0x18(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x3e, %rax
andq $0x1, %rax
cmpl $0x0, %eax
jne 0x6846
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x3f, %rax
cmpl $0x0, %eax
je 0x684b
jmp 0x6a37
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x40(%rbp), %rcx
movl 0x8(%rcx), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
movq -0x40(%rbp), %rdx
movl 0x8(%rdx), %edx
xorl $0x1, %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x698b
movq -0x38(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x3e, %rax
andq $0x1, %rax
cmpl $0x0, %eax
jne 0x68e1
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x3f, %rax
cmpl $0x0, %eax
je 0x68e6
jmp 0x697d
movq -0x48(%rbp), %rax
movl 0x8(%rax), %eax
movl -0x10(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x697b
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x40(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jne 0x697b
movq -0x48(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x40(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jne 0x697b
movq -0x48(%rbp), %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq 0x18(%rax), %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
orq %rdx, %rcx
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
movabsq $0x1fffffffffffffff, %rdx # imm = 0x1FFFFFFFFFFFFFFF
andq 0x18(%rax), %rdx
movq -0x48(%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)
jmp 0x698b
jmp 0x697d
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x689c
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jne 0x6a35
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %esi
xorl $0x1, %esi
movl -0x10(%rbp), %edx
xorl $0x1, %edx
movq -0x40(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x40(%rbp), %rax
movl 0x10(%rax), %r8d
movq -0x40(%rbp), %rax
movabsq $0x1fffffffffffffff, %r9 # imm = 0x1FFFFFFFFFFFFFFF
andq 0x18(%rax), %r9
movl $0x1, (%rsp)
callq 0x5d40
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x48(%rcx), %rax
je 0x6a1c
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
movl -0x10(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movslq -0x18(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0xc(%rax)
jmp 0x6a37
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6801
jmp 0x6a47
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x67b6
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll %ecx
cmpl %ecx, %eax
jae 0x6a77
movq -0x8(%rbp), %rdi
callq 0x6010
movq -0x8(%rbp), %rdi
callq 0x6140
movl -0xc(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq