// File: /workspace/github_c_makefile_star2_O1/c-zhou[P]oatk/path.c
// Function: print_seq
void print_seq(asg_t *asg, path_t *path, FILE *fo, int id, int force_linear, int line_wd, int gap_size)
{
    uint32_t i, n, v, lo, cov, n_gap;
    uint64_t l;
    asmg_t *g;
    asmg_arc_t *a;
    
    n = path->nv;
    if (n == 0) return;

    for (i = 0; i < n; ++i) {
        v = path->v[i];
        if (!asg->seg[v>>1].seq) {
            fprintf(stderr, "[E::%s] cannot make FASTA output: sequence not included in the GFA file\n", __func__);
            return;
        }
    }

    g = asg->asmg;
    lo = 0;
    cov = 0;
    if (path->circ && force_linear) {
        a = asmg_arc1(g, path->v[n-1], path->v[0]);
        assert(!!a);
        lo = a->ls;
        cov = g->vtx[path->v[0]>>1].cov;
    }
    
    if (path->sid)
        fprintf(fo, ">%s\tlength=%u wlength=%.1f nv=%u circular=%s path=%s%c", path->sid, path->len + lo, path->wlen + (double) cov * lo,
                path->nv, (force_linear || !path->circ)? "false" : "true", asg->seg[path->v[0]>>1].name, "+-"[path->v[0]&1]);
    else
        fprintf(fo, ">ctg%06d%c\tlength=%u wlength=%.1f nv=%u circular=%s path=%s%c", id, (force_linear || !path->circ)? 'l' : 'c', 
                path->len + lo, path->wlen + (double) cov * lo, path->nv, (force_linear || !path->circ)? "false" : "true", 
                asg->seg[path->v[0]>>1].name, "+-"[path->v[0]&1]);

    for (i = 1; i < n; ++i)
        fprintf(fo, ",%s%c", asg->seg[path->v[i]>>1].name, "+-"[path->v[i]&1]);
    fprintf(fo, "\n");

    l = 0;
    v = path->v[0];
    lo = (force_linear || !path->circ)? 0 : asmg_arc1(g, path->v[n-1], v)->ls;
    put_chars(asg->seg[v>>1].seq, asg->seg[v>>1].len, v&1, lo, fo, &l, line_wd);

    n_gap = 0;
    for (i = 1; i < n; ++i) {
        v = path->v[i];
        a = asmg_arc1(g, path->v[i-1], v);
        if (!!a) {
            put_chars(asg->seg[v>>1].seq, asg->seg[v>>1].len, v&1, a->ls, fo, &l, line_wd);
        } else {
            make_gap(fo, &l, line_wd, gap_size);
            put_chars(asg->seg[v>>1].seq, asg->seg[v>>1].len, v&1, 0, fo, &l, line_wd);
            ++n_gap;
        }
    }

    if (!path->circ || !force_linear)
        assert(l - (uint64_t) n_gap * gap_size == path->len);
    if (l % line_wd != 0)
        fputc('\n', fo);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl 0x8(%rsi), %eax
movl %eax, %r12d
andl $0x3fffffff, %r12d      # imm = 0x3FFFFFFF
je 0xa0e1
movq %rdx, %rbx
movl 0xb0(%rsp), %edx
movq %rdx, 0x48(%rsp)
movq 0x10(%rsi), %rdx
movq 0x10(%rdi), %r11
xorl %r14d, %r14d
movl (%rdx,%r14,4), %r10d
shrl %r10d
leaq (%r10,%r10,2), %r10
cmpq $0x0, 0x8(%r11,%r10,8)
je 0xa0dc
incq %r14
cmpq %r14, %r12
jne 0x9bff
movq 0x20(%rdi), %r15
btl $0x1e, %eax
setae %dl
testl %r8d, %r8d
sete %r10b
orb %dl, %r10b
movq %r15, 0x58(%rsp)
jne 0x9c87
movq 0x10(%rsi), %rdx
movl %r12d, %r10d
movl -0x4(%rdx,%r10,4), %r11d
movl (%rdx), %edx
movq 0x38(%r15), %r10
movq (%r10,%r11,8), %r14
testq %r14, %r14
je 0x9c90
movq 0x30(%r15), %r10
movq (%r10,%r11,8), %r10
leaq (%r10,%r10,2), %r10
shlq $0x4, %r10
addq 0x28(%r15), %r10
movq %r15, %r11
cmpq %rdx, 0x8(%r10)
jne 0x9c79
testb $0x40, 0x23(%r10)
je 0x9c96
addq $0x30, %r10
decq %r14
jne 0x9c6c
xorl %r10d, %r10d
jmp 0x9c96
xorpd %xmm0, %xmm0
xorl %r10d, %r10d
jmp 0x9cbb
xorl %r10d, %r10d
movq %r15, %r11
testq %r10, %r10
je 0xa0f0
movl 0x18(%r10), %r10d
movq 0x10(%r11), %r11
shrl %edx
leaq (%rdx,%rdx,4), %rdx
movl $0x3fffffff, %ebp       # imm = 0x3FFFFFFF
andl 0x20(%r11,%rdx,8), %ebp
cvtsi2sd %ebp, %xmm0
movl %r9d, 0x2c(%rsp)
movq (%rsi), %rdx
movl %r10d, %r11d
testq %rdx, %rdx
movq %rsi, 0x60(%rsp)
movq %rdi, 0x38(%rsp)
movl %r8d, 0x44(%rsp)
je 0x9d51
addl 0x18(%rsi), %r10d
btl $0x1e, %eax
leaq 0xfc61(%rip), %rax      # 0x1994a
leaq 0xfc60(%rip), %r9       # 0x19950
cmovaeq %rax, %r9
cvtsi2sd %r11, %xmm1
testl %r8d, %r8d
mulsd %xmm1, %xmm0
addsd 0x20(%rsi), %xmm0
cmovneq %rax, %r9
movq 0x10(%rdi), %rax
movq 0x10(%rsi), %rcx
movl (%rcx), %ecx
movl %ecx, %esi
shrl %esi
leaq (%rsi,%rsi,2), %rsi
movq (%rax,%rsi,8), %rax
andl $0x1, %ecx
leaq 0xfb23(%rip), %rsi      # 0x1984c
movsbl (%rcx,%rsi), %ecx
movl %ecx, 0x8(%rsp)
movq %rax, (%rsp)
leaq 0xfbd7(%rip), %rsi      # 0x19913
movq %rbx, %rdi
movl %r10d, %ecx
movl %r12d, %r8d
movb $0x1, %al
callq 0x3290
jmp 0x9dde
testl %r8d, %r8d
setne %dl
btl $0x1e, %eax
setae %al
orb %dl, %al
addl 0x18(%rsi), %r10d
cvtsi2sd %r11, %xmm1
movzbl %al, %edx
mulsd %xmm1, %xmm0
addsd 0x20(%rsi), %xmm0
leal (%rdx,%rdx,8), %eax
addl $0x63, %eax
leaq 0xfbc8(%rip), %r9       # 0x1994a
leaq 0xfbc7(%rip), %r8       # 0x19950
testb %dl, %dl
cmovneq %r9, %r8
movq 0x10(%rdi), %rdx
movq 0x10(%rsi), %rsi
movl (%rsi), %esi
movl %esi, %r9d
shrl %r9d
leaq (%r9,%r9,2), %r9
movq (%rdx,%r9,8), %rdx
andl $0x1, %esi
leaq 0xfa9b(%rip), %r9       # 0x1984c
movsbl (%rsi,%r9), %esi
movl %esi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %r8, (%rsp)
leaq 0xfb8b(%rip), %rsi      # 0x19955
movq %rbx, %rdi
movl %ecx, %edx
movl %eax, %ecx
movl %r10d, %r8d
movl %r12d, %r9d
movb $0x1, %al
callq 0x3290
movq %r12, 0x30(%rsp)
cmpl $0x1, %r12d
movq 0x60(%rsp), %r13
movq 0x38(%rsp), %rbp
je 0x9e4d
movq 0x30(%rsp), %rax
cmpl $0x3, %eax
movl $0x2, %r14d
cmovael %eax, %r14d
movl $0x1, %r12d
leaq 0xfa6a(%rip), %r15      # 0x1987c
movq 0x10(%rbp), %rax
movq 0x10(%r13), %rcx
movl (%rcx,%r12,4), %ecx
movl %ecx, %edx
shrl %edx
leaq (%rdx,%rdx,2), %rdx
movq (%rax,%rdx,8), %rdx
andl $0x1, %ecx
leaq 0xfa18(%rip), %rax      # 0x1984c
movsbl (%rcx,%rax), %ecx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3290
incq %r12
cmpq %r12, %r14
jne 0x9e12
movl $0xa, %edi
movq %rbx, %rsi
callq 0x3200
xorl %ecx, %ecx
movq $0x0, 0x20(%rsp)
movq 0x10(%r13), %rax
movl (%rax), %edx
movl 0x44(%rsp), %ebp
testl %ebp, %ebp
movq %r13, %r14
je 0x9e87
movl 0x2c(%rsp), %r15d
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %r13
jmp 0x9ed9
testb $0x40, 0xb(%r14)
movl 0x2c(%rsp), %r15d
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %r13
je 0x9ed9
movl %r13d, %ecx
movl -0x4(%rax,%rcx,4), %eax
movq 0x58(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq 0x30(%rsi), %rsi
movq (%rsi,%rax,8), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
addq %rcx, %rax
addq $0x20, %rax
cmpq %rdx, -0x18(%rax)
jne 0x9ed0
testb $0x40, 0x3(%rax)
je 0x9ed6
addq $0x30, %rax
jmp 0x9ec4
movl -0x8(%rax), %ecx
movq 0x10(%rdi), %rax
movl %edx, %esi
shrl %esi
leaq (%rsi,%rsi,2), %rsi
movq 0x8(%rax,%rsi,8), %rdi
movl 0x10(%rax,%rsi,8), %esi
andl $0x1, %edx
movl %r15d, (%rsp)
leaq 0x20(%rsp), %r9
movq %rbx, %r8
callq 0xa12e
xorl %edx, %edx
movslq %r15d, %r12
cmpl $0x1, %r13d
je 0xa089
movq $0x0, 0x50(%rsp)
movq 0x48(%rsp), %rax
decl %eax
incq %rax
movq %rax, 0x68(%rsp)
cmpl $0x3, %r13d
movl $0x2, %eax
cmovael %r13d, %eax
movq %rax, 0x30(%rsp)
movl $0x1, %r13d
movq 0x58(%rsp), %rsi
movq 0x10(%r14), %rcx
movl -0x4(%rcx,%r13,4), %eax
movl (%rcx,%r13,4), %ebp
movq 0x38(%rsi), %rcx
movq (%rcx,%rax,8), %rcx
testq %rcx, %rcx
je 0x9f89
movq 0x30(%rsi), %rdx
movq (%rdx,%rax,8), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
addq 0x28(%rsi), %rax
cmpq %rbp, 0x8(%rax)
jne 0x9f80
testb $0x40, 0x23(%rax)
je 0x9f8b
addq $0x30, %rax
decq %rcx
jne 0x9f74
xorl %eax, %eax
testq %rax, %rax
je 0x9fc8
movq 0x38(%rsp), %rcx
movq 0x10(%rcx), %rcx
movl %ebp, %edx
shrl %edx
leaq (%rdx,%rdx,2), %rdx
movq 0x8(%rcx,%rdx,8), %rdi
movl 0x10(%rcx,%rdx,8), %esi
andl $0x1, %ebp
movl 0x18(%rax), %ecx
movl %r15d, (%rsp)
movl %ebp, %edx
movq %rbx, %r8
leaq 0x20(%rsp), %r9
callq 0xa12e
jmp 0xa06b
cmpl $0x0, 0x48(%rsp)
jle 0xa02d
movq 0x20(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x1(%rax), %r15
movq 0x48(%rsp), %rax
movl %eax, %r14d
movl $0x4e, %edi
movq %rbx, %rsi
callq 0x3200
movq %r15, %rax
xorl %edx, %edx
divq %r12
testq %rdx, %rdx
jne 0xa00c
movl $0xa, %edi
movq %rbx, %rsi
callq 0x3200
incq %r15
decl %r14d
jne 0x9fe5
movq 0x70(%rsp), %rax
addq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x60(%rsp), %r14
movl 0x2c(%rsp), %r15d
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movl %ebp, %ecx
shrl %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x8(%rax,%rcx,8), %rdi
movl 0x10(%rax,%rcx,8), %esi
andl $0x1, %ebp
movl %r15d, (%rsp)
movl %ebp, %edx
xorl %ecx, %ecx
movq %rbx, %r8
leaq 0x20(%rsp), %r9
callq 0xa12e
movq 0x50(%rsp), %rax
incl %eax
movq %rax, 0x50(%rsp)
incq %r13
cmpq 0x30(%rsp), %r13
movq 0x58(%rsp), %rsi
jne 0x9f46
movq 0x50(%rsp), %rdx
movl %edx, %edx
movl 0x44(%rsp), %ebp
testl %ebp, %ebp
je 0xa098
movl $0x40000000, %eax       # imm = 0x40000000
andl 0x8(%r14), %eax
jne 0xa0b2
movq 0x20(%rsp), %rax
movslq 0x48(%rsp), %rcx
imulq %rcx, %rdx
subq %rdx, %rax
movl 0x18(%r14), %ecx
cmpq %rcx, %rax
jne 0xa10f
movq 0x20(%rsp), %rax
xorl %edx, %edx
divq %r12
testq %rdx, %rdx
je 0xa0e1
movl $0xa, %edi
movq %rbx, %rsi
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3200
callq 0x382d
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf6a6(%rip), %rdi      # 0x1979d
leaq 0xf577(%rip), %rsi      # 0x19675
leaq 0xf7d0(%rip), %rcx      # 0x198d5
movl $0x73c, %edx            # imm = 0x73C
callq 0x3190
leaq 0xf87d(%rip), %rdi      # 0x19993
leaq 0xf558(%rip), %rsi      # 0x19675
leaq 0xf7b1(%rip), %rcx      # 0x198d5
movl $0x760, %edx            # imm = 0x760
callq 0x3190