// File: ncbi[P]amr/stx/stxtyper.cpp
// Function: (anonymous namespace)::BlastAlignment::saveTsvOut(Common_sp::TsvOut&, bool) const
void saveTsvOut (TsvOut& td,
                   bool verboseP) const 
    { if (! td. live ())
        return;
      const string stxType_reported (verboseP ? getGenesymbol () : (stxS + stxType. substr (0, 1)));

     
      const string quality (frameshift 
                              ? "FRAMESHIFT"
                              : stopCodon 
                                ? "INTERNAL_STOP"
                                : truncated () || otherTruncated ()
                                  ? "PARTIAL_CONTIG_END"
                                  : debugP && verboseP && getRelCoverage () == 1.0
                                    ? "COMPLETE_SUBUNIT"
                                    : c_extended ()
                                      ? "EXTENDED"
                                      : "PARTIAL"
                           );

      const char strand (targetStrand ? '+' : '-');
      const double refCoverage = getRelCoverage () * 100.0;
      const double refIdentity = getIdentity ()    * 100.0; 
      // td     
      if (! input_name. empty ())
  	    td << input_name;
      if (amrfinder)
      {
        const string subunitS (1, subunit);
        string subclass (stxType_reported /*stxS + stxType*/);
        strUpper (subclass);
        td << na               // 1 "Protein identifier"  
           << targetName       // 2 "Contig id"
           << targetStart + 1  // 3 "Start"
           << targetEnd        // 4 "Stop"
           << strand           // 5 "Strand"
           << stxType_reported + "_operon" // 6 "Element symbol"
           << stxType_reported_operon2elementName (stxType_reported, quality)    // 7 "Element name"
           << "plus"           // 8 "Scope"
           << "VIRULENCE"      // 9 "Element type"
           << "STX_TYPE"       //10 "Element subtype"
           << subclass. substr (0, 4)   //11 "Class"
           << subclass         //12 "Subclass"
           << quality          //13 "Method"  
           << targetEnd - targetStart /*targetAlign*/      //14 "Target length" 
           << na /*refLen*/    //15 "Reference sequence length"
           << na /*refCoverage*/   //16 "% Coverage of reference sequence"
           << refIdentity      //17 "% Identity to reference sequence"
           << length           //18 "Alignment length"
           << refAccession     //19 "Accession of closest sequence"
           << "Shiga toxin " + stxS + stxType + " subunit " + subunitS //20 "Name of closest sequence"
           << na               //21 "HMM id"
           << na               //22 "HMM description"
           ;
        if (print_node)
          td << getGenesymbol ();
      }
      else
      {
        td << targetName
           << stxType_reported
           << quality
           << na
           << targetStart + 1
           << targetEnd
           << strand;
        if (subunit == 'B')
          td << na
             << na
             << na
             << na;
        td << refAccession
           << subClass
           << refIdentity
           << refCoverage;
        if (subunit == 'A')
          td << na
             << na
             << na
             << na;
      }
      td. newLn ();
    }

// Assembly:
subq $0x3a8, %rsp            # imm = 0x3A8
movb %dl, %al
movq %rdi, 0x3a0(%rsp)
movq %rsi, 0x398(%rsp)
andb $0x1, %al
movb %al, 0x397(%rsp)
movq 0x3a0(%rsp), %rax
movq %rax, 0x198(%rsp)
movq 0x398(%rsp), %rdi
callq 0x368a0
testb $0x1, %al
jne 0x1d3f8
jmp 0x1e058
movb 0x397(%rsp), %al
movb $0x0, 0x34f(%rsp)
testb $0x1, %al
je 0x1d422
movq 0x198(%rsp), %rsi
leaq 0x370(%rsp), %rdi
callq 0x28890
jmp 0x1d477
movq 0x198(%rsp), %rsi
addq $0xe0, %rsi
xorl %eax, %eax
movl %eax, %edx
leaq 0x350(%rsp), %rdi
movq %rdi, 0x190(%rsp)
movl $0x1, %ecx
callq 0xc720
movq 0x190(%rsp), %rdx
movb $0x1, 0x34f(%rsp)
leaq 0xe0792(%rip), %rsi     # 0xfdbf8
leaq 0x370(%rsp), %rdi
callq 0x368c0
jmp 0x1d475
jmp 0x1d477
testb $0x1, 0x34f(%rsp)
jne 0x1d483
jmp 0x1d490
leaq 0x350(%rsp), %rdi
callq 0xce58
movq 0x198(%rsp), %rax
testb $0x1, 0x51(%rax)
je 0x1d4b2
leaq 0xa7962(%rip), %rax     # 0xc4e07
movq %rax, 0x188(%rsp)
jmp 0x1d5d2
movq 0x198(%rsp), %rax
testb $0x1, 0x50(%rax)
je 0x1d4d4
leaq 0xa794b(%rip), %rax     # 0xc4e12
movq %rax, 0x180(%rsp)
jmp 0x1d5c2
movq 0x198(%rsp), %rdi
callq 0x26f60
testb $0x1, %al
jne 0x1d508
movq 0x198(%rsp), %rdi
callq 0x28930
movb %al, 0x17f(%rsp)
jmp 0x1d4fb
movb 0x17f(%rsp), %al
testb $0x1, %al
jne 0x1d508
jmp 0x1d51c
leaq 0xa7911(%rip), %rax     # 0xc4e20
movq %rax, 0x170(%rsp)
jmp 0x1d5b2
testb $0x1, 0x397(%rsp)
je 0x1d568
movq 0x198(%rsp), %rdi
callq 0x27070
movsd %xmm0, 0x168(%rsp)
jmp 0x1d53e
movsd 0x168(%rsp), %xmm0
movsd 0xa6ac1(%rip), %xmm1    # 0xc4010
ucomisd %xmm1, %xmm0
jne 0x1d568
jp 0x1d568
leaq 0xa78d5(%rip), %rax     # 0xc4e33
movq %rax, 0x160(%rsp)
jmp 0x1d5a2
movq 0x198(%rsp), %rdi
callq 0x289d0
movb %al, 0x15f(%rsp)
jmp 0x1d57e
movb 0x15f(%rsp), %dl
leaq 0xa78c1(%rip), %rax     # 0xc4e4d
leaq 0xa78b1(%rip), %rcx     # 0xc4e44
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0x160(%rsp)
movq 0x160(%rsp), %rax
movq %rax, 0x170(%rsp)
movq 0x170(%rsp), %rax
movq %rax, 0x180(%rsp)
movq 0x180(%rsp), %rax
movq %rax, 0x188(%rsp)
movq 0x188(%rsp), %rax
movq %rax, 0x148(%rsp)
leaq 0x317(%rsp), %rdi
movq %rdi, 0x150(%rsp)
callq 0xccc0
movq 0x148(%rsp), %rsi
movq 0x150(%rsp), %rdx
leaq 0x318(%rsp), %rdi
callq 0x2efd0
jmp 0x1d616
leaq 0x317(%rsp), %rdi
callq 0xc780
movq 0x198(%rsp), %rdi
movb 0x98(%rdi), %al
notb %al
andb $0x1, %al
addb %al, %al
addb $0x2b, %al
movb %al, 0x316(%rsp)
callq 0x27070
movsd %xmm0, 0x140(%rsp)
jmp 0x1d650
movq 0x198(%rsp), %rdi
movsd 0x140(%rsp), %xmm0
movsd 0xa69af(%rip), %xmm1    # 0xc4018
mulsd %xmm1, %xmm0
movsd %xmm0, 0x308(%rsp)
callq 0x26130
movsd %xmm0, 0x138(%rsp)
jmp 0x1d686
movsd 0x138(%rsp), %xmm0
movsd 0xa6981(%rip), %xmm1    # 0xc4018
mulsd %xmm1, %xmm0
movsd %xmm0, 0x300(%rsp)
leaq 0xe04fd(%rip), %rdi     # 0xfdba8
callq 0xcbd0
testb $0x1, %al
jne 0x1d75d
movq 0x398(%rsp), %rdi
leaq 0xe04e1(%rip), %rsi     # 0xfdba8
callq 0x36910
jmp 0x1d6ce
jmp 0x1d75d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
testb $0x1, 0x34f(%rsp)
jne 0x1d6f3
jmp 0x1d700
leaq 0x350(%rsp), %rdi
callq 0xce58
jmp 0x1e07a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
jmp 0x1e06d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
leaq 0x317(%rsp), %rdi
callq 0xc780
jmp 0x1e06d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
jmp 0x1e060
testb $0x1, 0xe04b4(%rip)     # 0xfdc18
je 0x1de0c
movq 0x198(%rsp), %rax
movsbl 0x140(%rax), %eax
movl %eax, 0x12c(%rsp)
leaq 0x2df(%rsp), %rdi
movq %rdi, 0x130(%rsp)
callq 0xccc0
movl 0x12c(%rsp), %edx
movq 0x130(%rsp), %rcx
leaq 0x2e0(%rsp), %rdi
movl $0x1, %esi
callq 0x34b50
jmp 0x1d7b8
leaq 0x2df(%rsp), %rdi
callq 0xc780
leaq 0x2b8(%rsp), %rdi
leaq 0x370(%rsp), %rsi
callq 0xc320
jmp 0x1d7dc
leaq 0x2b8(%rsp), %rdi
callq 0x3de60
jmp 0x1d7eb
movq 0x398(%rsp), %rdi
leaq 0xddd56(%rip), %rsi     # 0xfb550
callq 0x31d10
movq %rax, 0x120(%rsp)
jmp 0x1d809
movq 0x120(%rsp), %rdi
movq 0x198(%rsp), %rsi
addq $0x58, %rsi
callq 0x36910
movq %rax, 0x118(%rsp)
jmp 0x1d82c
movq 0x118(%rsp), %rdi
movq 0x198(%rsp), %rax
movq 0x30(%rax), %rax
incq %rax
movq %rax, 0x2b0(%rsp)
leaq 0x2b0(%rsp), %rsi
callq 0x36ab0
movq %rax, 0x110(%rsp)
jmp 0x1d862
movq 0x110(%rsp), %rdi
movq 0x198(%rsp), %rsi
addq $0x38, %rsi
callq 0x36ab0
movq %rax, 0x108(%rsp)
jmp 0x1d885
movq 0x108(%rsp), %rdi
leaq 0x316(%rsp), %rsi
callq 0x36c50
movq %rax, 0x100(%rsp)
jmp 0x1d8a4
leaq 0xa75aa(%rip), %rdx     # 0xc4e55
leaq 0x290(%rsp), %rdi
leaq 0x370(%rsp), %rsi
callq 0x31270
jmp 0x1d8c2
movq 0x100(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0x36910
movq %rax, 0xf8(%rsp)
jmp 0x1d8e1
leaq 0x270(%rsp), %rdi
leaq 0x370(%rsp), %rsi
leaq 0x318(%rsp), %rdx
callq 0x28a10
jmp 0x1d900
movq 0xf8(%rsp), %rdi
leaq 0x270(%rsp), %rsi
callq 0x36910
movq %rax, 0xf0(%rsp)
jmp 0x1d91f
movq 0xf0(%rsp), %rdi
leaq 0xa752f(%rip), %rsi     # 0xc4e5d
callq 0x31b70
movq %rax, 0xe8(%rsp)
jmp 0x1d93d
movq 0xe8(%rsp), %rdi
leaq 0xa7516(%rip), %rsi     # 0xc4e62
callq 0x36df0
movq %rax, 0xe0(%rsp)
jmp 0x1d95b
movq 0xe0(%rsp), %rdi
leaq 0xa7502(%rip), %rsi     # 0xc4e6c
callq 0x32050
movq %rax, 0xd8(%rsp)
jmp 0x1d979
xorl %eax, %eax
movl %eax, %edx
leaq 0x250(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
movl $0x4, %ecx
callq 0xc720
jmp 0x1d999
movq 0xd8(%rsp), %rdi
leaq 0x250(%rsp), %rsi
callq 0x36910
movq %rax, 0xd0(%rsp)
jmp 0x1d9b8
movq 0xd0(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x36910
movq %rax, 0xc8(%rsp)
jmp 0x1d9d7
movq 0xc8(%rsp), %rdi
leaq 0x318(%rsp), %rsi
callq 0x36910
movq %rax, 0xc0(%rsp)
jmp 0x1d9f6
movq 0xc0(%rsp), %rdi
movq 0x198(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x38(%rax), %rax
subq %rcx, %rax
movq %rax, 0x248(%rsp)
leaq 0x248(%rsp), %rsi
callq 0x36ab0
movq %rax, 0xb8(%rsp)
jmp 0x1da30
movq 0xb8(%rsp), %rdi
leaq 0xddb11(%rip), %rsi     # 0xfb550
callq 0x31d10
movq %rax, 0xb0(%rsp)
jmp 0x1da4e
movq 0xb0(%rsp), %rdi
leaq 0xddaf3(%rip), %rsi     # 0xfb550
callq 0x31d10
movq %rax, 0xa8(%rsp)
jmp 0x1da6c
movq 0xa8(%rsp), %rdi
leaq 0x300(%rsp), %rsi
callq 0x36f90
movq %rax, 0xa0(%rsp)
jmp 0x1da8b
movq 0x198(%rsp), %rsi
movq 0xa0(%rsp), %rdi
callq 0x36ab0
movq %rax, 0x98(%rsp)
jmp 0x1daaa
movq 0x98(%rsp), %rdi
movq 0x198(%rsp), %rsi
addq $0xa0, %rsi
callq 0x36910
movq %rax, 0x90(%rsp)
jmp 0x1dad0
leaq 0xa739e(%rip), %rsi     # 0xc4e75
leaq 0xe011a(%rip), %rdx     # 0xfdbf8
leaq 0x1c8(%rsp), %rdi
callq 0x331d0
jmp 0x1daed
movq 0x198(%rsp), %rdx
addq $0xe0, %rdx
leaq 0x1e8(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
callq 0x31480
jmp 0x1db13
leaq 0xa7368(%rip), %rdx     # 0xc4e82
leaq 0x208(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x31430
jmp 0x1db31
leaq 0x228(%rsp), %rdi
leaq 0x208(%rsp), %rsi
leaq 0x2e0(%rsp), %rdx
callq 0x31480
jmp 0x1db50
movq 0x90(%rsp), %rdi
leaq 0x228(%rsp), %rsi
callq 0x36910
movq %rax, 0x88(%rsp)
jmp 0x1db6f
movq 0x88(%rsp), %rdi
leaq 0xdd9d2(%rip), %rsi     # 0xfb550
callq 0x31d10
movq %rax, 0x80(%rsp)
jmp 0x1db8d
movq 0x80(%rsp), %rdi
leaq 0xdd9b4(%rip), %rsi     # 0xfb550
callq 0x31d10
jmp 0x1dba3
leaq 0x228(%rsp), %rdi
callq 0xce58
leaq 0x208(%rsp), %rdi
callq 0xce58
leaq 0x1e8(%rsp), %rdi
callq 0xce58
leaq 0x1c8(%rsp), %rdi
callq 0xce58
leaq 0x250(%rsp), %rdi
callq 0xce58
leaq 0x270(%rsp), %rdi
callq 0xce58
leaq 0x290(%rsp), %rdi
callq 0xce58
testb $0x1, 0xe0014(%rip)     # 0xfdc19
je 0x1ddce
movq 0x198(%rsp), %rsi
movq 0x398(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x1a8(%rsp), %rdi
callq 0x28890
jmp 0x1dc2f
movq 0x78(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x36910
jmp 0x1dc43
leaq 0x1a8(%rsp), %rdi
callq 0xce58
jmp 0x1ddce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
leaq 0x2df(%rsp), %rdi
callq 0xc780
jmp 0x1e060
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
jmp 0x1ddfa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
jmp 0x1dded
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
jmp 0x1dd9c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
jmp 0x1dd8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
jmp 0x1dd82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
jmp 0x1dd75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
jmp 0x1dd68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
jmp 0x1dd5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
leaq 0x228(%rsp), %rdi
callq 0xce58
leaq 0x208(%rsp), %rdi
callq 0xce58
leaq 0x1e8(%rsp), %rdi
callq 0xce58
leaq 0x1c8(%rsp), %rdi
callq 0xce58
leaq 0x250(%rsp), %rdi
callq 0xce58
leaq 0x270(%rsp), %rdi
callq 0xce58
leaq 0x290(%rsp), %rdi
callq 0xce58
jmp 0x1dded
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x340(%rsp)
movl %eax, 0x33c(%rsp)
leaq 0x1a8(%rsp), %rdi
callq 0xce58
jmp 0x1dded
leaq 0x2b8(%rsp), %rdi
callq 0xce58
leaq 0x2e0(%rsp), %rdi
callq 0xce58
jmp 0x1e02f
leaq 0x2b8(%rsp), %rdi
callq 0xce58
leaq 0x2e0(%rsp), %rdi
callq 0xce58
jmp 0x1e060
movq 0x198(%rsp), %rsi
movq 0x398(%rsp), %rdi
addq $0x58, %rsi
callq 0x36910
movq %rax, 0x70(%rsp)
jmp 0x1de2c
movq 0x70(%rsp), %rdi
leaq 0x370(%rsp), %rsi
callq 0x36910
movq %rax, 0x68(%rsp)
jmp 0x1de45
movq 0x68(%rsp), %rdi
leaq 0x318(%rsp), %rsi
callq 0x36910
movq %rax, 0x60(%rsp)
jmp 0x1de5e
movq 0x60(%rsp), %rdi
leaq 0xdd6e6(%rip), %rsi     # 0xfb550
callq 0x31d10
movq %rax, 0x58(%rsp)
jmp 0x1de76
movq 0x58(%rsp), %rdi
movq 0x198(%rsp), %rax
movq 0x30(%rax), %rax
incq %rax
movq %rax, 0x1a0(%rsp)
leaq 0x1a0(%rsp), %rsi
callq 0x36ab0
movq %rax, 0x50(%rsp)
jmp 0x1dea6
movq 0x50(%rsp), %rdi
movq 0x198(%rsp), %rsi
addq $0x38, %rsi
callq 0x36ab0
movq %rax, 0x48(%rsp)
jmp 0x1dec3
movq 0x48(%rsp), %rdi
leaq 0x316(%rsp), %rsi
callq 0x36c50
jmp 0x1ded7
movq 0x198(%rsp), %rax
movsbl 0x140(%rax), %eax
cmpl $0x42, %eax
jne 0x1df4b
movq 0x398(%rsp), %rdi
leaq 0xdd656(%rip), %rsi     # 0xfb550
callq 0x31d10
movq %rax, 0x40(%rsp)
jmp 0x1df06
movq 0x40(%rsp), %rdi
leaq 0xdd63e(%rip), %rsi     # 0xfb550
callq 0x31d10
movq %rax, 0x38(%rsp)
jmp 0x1df1e
movq 0x38(%rsp), %rdi
leaq 0xdd626(%rip), %rsi     # 0xfb550
callq 0x31d10
movq %rax, 0x30(%rsp)
jmp 0x1df36
movq 0x30(%rsp), %rdi
leaq 0xdd60e(%rip), %rsi     # 0xfb550
callq 0x31d10
jmp 0x1df49
jmp 0x1df4b
movq 0x198(%rsp), %rsi
movq 0x398(%rsp), %rdi
addq $0xa0, %rsi
callq 0x36910
movq %rax, 0x28(%rsp)
jmp 0x1df6e
movq 0x28(%rsp), %rdi
movq 0x198(%rsp), %rsi
addq $0x148, %rsi            # imm = 0x148
callq 0x36910
movq %rax, 0x20(%rsp)
jmp 0x1df8e
movq 0x20(%rsp), %rdi
leaq 0x300(%rsp), %rsi
callq 0x36f90
movq %rax, 0x18(%rsp)
jmp 0x1dfa7
movq 0x18(%rsp), %rdi
leaq 0x308(%rsp), %rsi
callq 0x36f90
jmp 0x1dfbb
movq 0x198(%rsp), %rax
movsbl 0x140(%rax), %eax
cmpl $0x41, %eax
jne 0x1e02d
movq 0x398(%rsp), %rdi
leaq 0xdd572(%rip), %rsi     # 0xfb550
callq 0x31d10
movq %rax, 0x10(%rsp)
jmp 0x1dfea
movq 0x10(%rsp), %rdi
leaq 0xdd55a(%rip), %rsi     # 0xfb550
callq 0x31d10
movq %rax, 0x8(%rsp)
jmp 0x1e002
movq 0x8(%rsp), %rdi
leaq 0xdd542(%rip), %rsi     # 0xfb550
callq 0x31d10
movq %rax, (%rsp)
jmp 0x1e019
movq (%rsp), %rdi
leaq 0xdd52c(%rip), %rsi     # 0xfb550
callq 0x31d10
jmp 0x1e02b
jmp 0x1e02d
jmp 0x1e02f
movq 0x398(%rsp), %rdi
callq 0x32a10
jmp 0x1e03e
leaq 0x318(%rsp), %rdi
callq 0xce58
leaq 0x370(%rsp), %rdi
callq 0xce58
addq $0x3a8, %rsp            # imm = 0x3A8
retq
leaq 0x318(%rsp), %rdi
callq 0xce58
leaq 0x370(%rsp), %rdi
callq 0xce58
movq 0x340(%rsp), %rdi
callq 0xccb0
nopw (%rax,%rax)