// File: /workspace/github_c_makefile_star2_O3/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 %r9d, 0x24(%rsp)
movl 0x8(%rsi), %eax
movl %eax, %ebp
andl $0x3fffffff, %ebp       # imm = 0x3FFFFFFF
je 0xa61e
movq %rdx, %rbx
movl 0xb0(%rsp), %r12d
movq 0x10(%rsi), %r13
movq 0x10(%rdi), %r14
xorl %edx, %edx
movl (%r13,%rdx,4), %r9d
shrl %r9d
leaq (%r9,%r9,2), %r9
cmpq $0x0, 0x8(%r14,%r9,8)
je 0xa619
incq %rdx
cmpq %rdx, %rbp
jne 0xa13a
movq 0x20(%rdi), %r10
btl $0x1e, %eax
setae %dl
testl %r8d, %r8d
sete %r9b
orb %dl, %r9b
movq %r10, 0x28(%rsp)
jne 0xa1eb
movl -0x4(%r13,%rbp,4), %r9d
movq 0x38(%r10), %rdx
movq (%rdx,%r9,8), %r15
testq %r15, %r15
je 0xa1cc
movl (%r13), %edx
movq 0x28(%rsp), %r10
movq 0x28(%r10), %r10
movq 0x28(%rsp), %r11
movq 0x30(%r11), %r11
movq (%r11,%r9,8), %r9
leaq (%r9,%r9,2), %r9
shlq $0x4, %r9
addq %r10, %r9
addq $0x20, %r9
movq 0x28(%rsp), %r10
cmpq %rdx, -0x18(%r9)
jne 0xa1c3
testb $0x40, 0x3(%r9)
je 0xa1f4
addq $0x30, %r9
decq %r15
jne 0xa1b6
leaq 0x105da(%rip), %rdi     # 0x1a7ad
leaq 0x104ab(%rip), %rsi     # 0x1a685
leaq 0x10704(%rip), %rcx     # 0x1a8e5
movl $0x73c, %edx            # imm = 0x73C
callq 0x3190
xorpd %xmm0, %xmm0
xorl %r11d, %r11d
jmp 0xa212
movl -0x8(%r9), %r11d
movq 0x10(%r10), %r9
shrl %edx
leaq (%rdx,%rdx,4), %rdx
movl $0x3fffffff, %r10d      # imm = 0x3FFFFFFF
andl 0x20(%r9,%rdx,8), %r10d
cvtsi2sd %r10d, %xmm0
movq (%rsi), %rdx
testq %rdx, %rdx
movq %rsi, 0x60(%rsp)
movq %rdi, 0x40(%rsp)
movl %r8d, 0x4c(%rsp)
movq %r12, 0x50(%rsp)
je 0xa2a2
movl %r11d, %ecx
addl 0x18(%rsi), %r11d
btl $0x1e, %eax
leaq 0x1071a(%rip), %rax     # 0x1a95a
leaq 0x10719(%rip), %r9      # 0x1a960
cmovaeq %rax, %r9
testl %r8d, %r8d
cvtsi2sd %rcx, %xmm1
mulsd %xmm1, %xmm0
addsd 0x20(%rsi), %xmm0
cmovneq %rax, %r9
movl (%r13), %eax
movl %eax, %ecx
shrl %ecx
leaq (%rcx,%rcx,2), %rcx
movq (%r14,%rcx,8), %rcx
andl $0x1, %eax
leaq 0x105e2(%rip), %rsi     # 0x1a85c
movsbl (%rax,%rsi), %eax
movl %eax, 0x8(%rsp)
movq %rcx, (%rsp)
leaq 0x10696(%rip), %rsi     # 0x1a923
movq %rbx, %rdi
movl %r11d, %ecx
movl %ebp, %r8d
movb $0x1, %al
callq 0x3290
jmp 0xa329
testl %r8d, %r8d
setne %dl
btl $0x1e, %eax
setae %al
orb %dl, %al
movzbl %al, %edx
leal (%rdx,%rdx,8), %eax
addl $0x63, %eax
movl %r11d, %r9d
addl 0x18(%rsi), %r11d
cvtsi2sd %r9, %xmm1
mulsd %xmm1, %xmm0
addsd 0x20(%rsi), %xmm0
leaq 0x10684(%rip), %r9      # 0x1a95a
leaq 0x10683(%rip), %r10     # 0x1a960
testb %dl, %dl
cmovneq %r9, %r10
movl (%r13), %edx
movl %edx, %edi
shrl %edi
leaq (%rdi,%rdi,2), %rdi
movq (%r14,%rdi,8), %rsi
andl $0x1, %edx
leaq 0x1055f(%rip), %rdi     # 0x1a85c
movsbl (%rdx,%rdi), %edx
movl %edx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %r10, (%rsp)
leaq 0x10650(%rip), %rsi     # 0x1a965
movq %rbx, %rdi
movl %ecx, %edx
movl %eax, %ecx
movl %r11d, %r8d
movl %ebp, %r9d
movb $0x1, %al
callq 0x3290
movq %rbp, 0x38(%rsp)
cmpl $0x1, %ebp
movq 0x60(%rsp), %r15
movq 0x40(%rsp), %rbp
je 0xa397
movq 0x38(%rsp), %rax
cmpl $0x3, %eax
movl $0x2, %r14d
cmovael %eax, %r14d
movl $0x1, %r12d
leaq 0x10530(%rip), %r13     # 0x1a88c
movq 0x10(%rbp), %rax
movq 0x10(%r15), %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 0x104de(%rip), %rax     # 0x1a85c
movsbl (%rcx,%rax), %ecx
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x3290
incq %r12
cmpq %r12, %r14
jne 0xa35c
movl $0xa, %edi
movq %rbx, %rsi
callq 0x3200
xorl %ecx, %ecx
movq $0x0, 0x30(%rsp)
movq 0x10(%r15), %rax
movl (%rax), %edx
movl 0x4c(%rsp), %ebp
testl %ebp, %ebp
je 0xa3c9
movq 0x50(%rsp), %r12
movq 0x40(%rsp), %rdi
jmp 0xa418
testb $0x40, 0xb(%r15)
movq 0x50(%rsp), %r12
movq 0x40(%rsp), %rdi
je 0xa418
movq 0x38(%rsp), %rcx
movl -0x4(%rax,%rcx,4), %eax
movq 0x28(%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 0xa40f
testb $0x40, 0x3(%rax)
je 0xa415
addq $0x30, %rax
jmp 0xa403
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 0x24(%rsp), %r14d
movl %r14d, (%rsp)
leaq 0x30(%rsp), %r9
movq %rbx, %r8
callq 0xa64c
xorl %edx, %edx
movslq %r14d, %r14
movq 0x38(%rsp), %rax
cmpl $0x1, %eax
je 0xa5ca
movq $0x0, 0x58(%rsp)
leal -0x1(%r12), %ecx
incq %rcx
movq %rcx, 0x68(%rsp)
cmpl $0x3, %eax
movl $0x2, %ecx
cmovael %eax, %ecx
movq %rcx, 0x38(%rsp)
movl $0x1, %r13d
movq 0x28(%rsp), %rsi
movq 0x10(%r15), %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 0xa4d8
movq 0x28(%rsi), %rdx
movq 0x30(%rsi), %rsi
movq (%rsi,%rax,8), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
addq %rdx, %rax
addq $0x20, %rax
cmpq %rbp, -0x18(%rax)
jne 0xa4cf
testb $0x40, 0x3(%rax)
je 0xa576
addq $0x30, %rax
decq %rcx
jne 0xa4bf
testl %r12d, %r12d
jle 0xa533
movq 0x30(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x1(%rax), %r15
movl $0x4e, %edi
movq %rbx, %rsi
callq 0x3200
movq %r15, %rax
xorl %edx, %edx
divq %r14
testq %rdx, %rdx
jne 0xa512
movl $0xa, %edi
movq %rbx, %rsi
callq 0x3200
incq %r15
decl %r12d
jne 0xa4eb
movq 0x70(%rsp), %rax
addq 0x68(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x60(%rsp), %r15
movq 0x50(%rsp), %r12
movq 0x40(%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 0x24(%rsp), %eax
movl %eax, (%rsp)
movl %ebp, %edx
xorl %ecx, %ecx
movq %rbx, %r8
leaq 0x30(%rsp), %r9
callq 0xa64c
movq 0x58(%rsp), %rax
incl %eax
movq %rax, 0x58(%rsp)
jmp 0xa5ac
movq 0x40(%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 -0x8(%rax), %ecx
movl 0x24(%rsp), %eax
movl %eax, (%rsp)
movl %ebp, %edx
movq %rbx, %r8
leaq 0x30(%rsp), %r9
callq 0xa64c
incq %r13
cmpq 0x38(%rsp), %r13
movq 0x28(%rsp), %rsi
jne 0xa48a
movq 0x58(%rsp), %rdx
movl %edx, %edx
movl 0x4c(%rsp), %ebp
movq 0x30(%rsp), %rax
testl %ebp, %ebp
je 0xa5de
movl $0x40000000, %ecx       # imm = 0x40000000
andl 0x8(%r15), %ecx
jne 0xa5f4
movslq %r12d, %rcx
imulq %rcx, %rdx
movq %rax, %rcx
subq %rdx, %rcx
movl 0x18(%r15), %edx
cmpq %rdx, %rcx
jne 0xa62d
xorl %edx, %edx
divq %r14
testq %rdx, %rdx
je 0xa61e
movl $0xa, %edi
movq %rbx, %rsi
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3200
callq 0x37ea
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1036f(%rip), %rdi     # 0x1a9a3
leaq 0x1004a(%rip), %rsi     # 0x1a685
leaq 0x102a3(%rip), %rcx     # 0x1a8e5
movl $0x760, %edx            # imm = 0x760
callq 0x3190