// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]oatk/graph.c
// Function: asmg_arc_fix_symm
static uint32_t asmg_arc_fix_symm(asmg_t *g) 
{
    uint32_t symm_fix;
    uint64_t i, v, w, n;
    asmg_arc_t *a, *a1;

    symm_fix = 0;
    for (i = 0, n = g->n_arc; i < n; ++i) {
        a = &g->arc[i];
        if (a->del)
            continue;
        v = a->v;
        w = a->w;
        a1 = asmg_arc1(g, w^1, v^1);
        if (a1 == 0) {
            // add symm arc
            a1 = asmg_arc_add(g, w^1, v^1, a->ln, a->ls, a->link_id, a->cov, a->comp^1);
            ++symm_fix;
        } else {
            // fix symm flag
            a1->comp = a->comp^1;
            // FIXME overlap length difference
            if (a->ln != a1->ln)
                a->ln = a1->ln = MIN(a->ln, a1->ln);
            if (a->ls != a1->ls)
                a->ls = a1->ls = MIN(a->ls, a1->ls);
        }
    }

    return symm_fix;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x206f0
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
imulq $0x30, -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl 0x20(%rax), %eax
shrl $0x1e, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x20570
jmp 0x206df
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
xorq $0x1, %rsi
movq -0x20(%rbp), %rdx
xorq $0x1, %rdx
callq 0x21000
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x20612
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
xorq $0x1, %rsi
movq -0x20(%rbp), %rdx
xorq $0x1, %rdx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x38(%rbp), %rax
movq 0x18(%rax), %r8
movq -0x38(%rbp), %rax
movq 0x28(%rax), %r9
movq -0x38(%rbp), %rax
movl 0x20(%rax), %r10d
andl $0x3fffffff, %r10d      # imm = 0x3FFFFFFF
movq -0x38(%rbp), %rax
movl 0x20(%rax), %eax
shrl $0x1f, %eax
xorl $0x1, %eax
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x24770
movq %rax, -0x40(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x206dd
movq -0x38(%rbp), %rax
movl 0x20(%rax), %edx
shrl $0x1f, %edx
xorl $0x1, %edx
movq -0x40(%rbp), %rax
movl 0x20(%rax), %ecx
andl $0x1, %edx
shll $0x1f, %edx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl %edx, %ecx
movl %ecx, 0x20(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
cmpq 0x10(%rcx), %rax
je 0x20689
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x20669
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x20675
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x40(%rbp), %rcx
cmpq 0x18(%rcx), %rax
je 0x206db
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x40(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x206bb
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x206c7
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x38(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x206dd
jmp 0x206df
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x20537
movl -0xc(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)