// File: mshabbirhasan[P]ups-indel/include/seqan/bam_io/write_sam.h
// Function: int seqan::write2<std::ostream, seqan::StringSet<seqan::String<char, seqan::Alloc<void>>, seqan::Owner<seqan::Tag<seqan::Default_>>>, seqan::NameStoreCache<seqan::StringSet<seqan::String<char, seqan::Alloc<void>>, seqan::Owner<seqan::Tag<seqan::Default_>>>, seqan::String<char, seqan::Alloc<void>>>>(std::ostream&, seqan::BamAlignmentRecord const&, seqan::BamIOContext<seqan::StringSet<seqan::String<char, seqan::Alloc<void>>, seqan::Owner<seqan::Tag<seqan::Default_>>>, seqan::NameStoreCache<seqan::StringSet<seqan::String<char, seqan::Alloc<void>>, seqan::Owner<seqan::Tag<seqan::Default_>>>, seqan::String<char, seqan::Alloc<void>>>> const&, seqan::Tag<seqan::Sam_> const&)
int write2(TStream & stream,
           BamAlignmentRecord const & record,
           BamIOContext<TNameStore, TNameStoreCache> const & context,
           Sam const & /*tag*/)
{
    int res = 0;

#define SEQAN_PUT_TAB                           \
    do {                                        \
        res = streamPut(stream, '\t');      \
        if (res != 0)                       \
            return res;                     \
    } \
    while (false)

    res = streamPut(stream, record.qName);
    if (res != 0)
        return res;

    SEQAN_PUT_TAB;

    res = streamPut(stream, record.flag);
    if (res != 0)
        return res;

    SEQAN_PUT_TAB;

    if (record.rID == BamAlignmentRecord::INVALID_REFID)
        res = streamPut(stream, '*');
    else
        res = streamPut(stream, nameStore(context)[record.rID]);
    if (res != 0)
        return res;

    SEQAN_PUT_TAB;

    res = streamPut(stream, record.beginPos + 1);
    if (res != 0)
        return res;

    SEQAN_PUT_TAB;

    res = streamPut(stream, static_cast<__uint16>(record.mapQ));
    if (res != 0)
        return res;

    SEQAN_PUT_TAB;

    if (empty(record.cigar))
    {
        res = streamPut(stream, '*');
        if (res != 0)
            return res;
    }
    else
    {
        for (unsigned i = 0; i < length(record.cigar); ++i)
        {
            res = streamPut(stream, record.cigar[i].count);
            if (res != 0)
                return res;

            res = streamPut(stream, record.cigar[i].operation);
            if (res != 0)
                return res;
        }
    }

    SEQAN_PUT_TAB;

    if (record.rNextId == BamAlignmentRecord::INVALID_REFID)
        res = streamPut(stream, '*');
    else if (record.rID == record.rNextId)
        res = streamPut(stream, '=');
    else
        res = streamPut(stream, nameStore(context)[record.rNextId]);
    if (res != 0)
        return res;

    SEQAN_PUT_TAB;

    res = streamPut(stream, record.pNext + 1);
    if (res != 0)
        return res;

    SEQAN_PUT_TAB;

    if (record.tLen == BamAlignmentRecord::INVALID_LEN)
        res = streamPut(stream, '0');
    else
        res = streamPut(stream, record.tLen);
    if (res != 0)
        return res;

    SEQAN_PUT_TAB;

    if (empty(record.seq))
        res = streamPut(stream, '*');  // Case of empty seq string / "*".
    else
        res = streamPut(stream, record.seq);
    if (res != 0)
        return res;

    SEQAN_PUT_TAB;


    if (empty(record.qual))  // Case of empty quality string / "*".
        res = streamPut(stream, '*');
    else
        res = streamPut(stream, record.qual);
    if (res != 0)
        return res;

    if (!empty(record.tags))
    {
        SEQAN_PUT_TAB;
        CharString buffer;
        assignTagsBamToSam(buffer, record.tags);
        streamPut(stream, buffer);
    }

    return streamPut(stream, '\n');

#undef SEQAN_PUT_TAB
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
callq 0x21e30
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x22f77
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x22f79
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x22f9b
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x22f9d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x20, %rsi
callq 0x23510
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x22fc2
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x22fc4
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x22fe6
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x22fe8
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x24(%rax)
jne 0x23005
movq -0x10(%rbp), %rdi
movl $0x2a, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
jmp 0x23034
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rdi
callq 0x23550
movq %rax, %rdi
movq -0x18(%rbp), %rax
movl 0x24(%rax), %esi
callq 0x235b0
movq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x21e30
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x23045
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x23047
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x23069
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x2306b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
leaq -0x30(%rbp), %rsi
callq 0x21ea0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x23099
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x2309b
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x230bd
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x230bf
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl 0x2c(%rax), %eax
movw %ax, -0x32(%rbp)
leaq -0x32(%rbp), %rsi
callq 0x23510
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x230ec
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x230ee
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x23110
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x23112
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x235e0
testb $0x1, %al
jne 0x23125
jmp 0x2314c
movq -0x10(%rbp), %rdi
movl $0x2a, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x23147
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x23203
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x1e450
movq %rax, %rcx
movq -0x78(%rbp), %rax
cmpq %rcx, %rax
jae 0x23201
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
movl -0x38(%rbp), %esi
callq 0x23660
movq -0x80(%rbp), %rdi
movq %rax, %rsi
addq $0x4, %rsi
callq 0x23620
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x231b3
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
movl -0x38(%rbp), %esi
callq 0x23660
movq -0x88(%rbp), %rdi
movsbl (%rax), %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x231f1
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x231f3
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x23153
jmp 0x23203
jmp 0x23205
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x23227
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x23229
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x48(%rax)
jne 0x23246
movq -0x10(%rbp), %rdi
movl $0x2a, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
jmp 0x232a0
movq -0x18(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x48(%rcx), %eax
jne 0x23269
movq -0x10(%rbp), %rdi
movl $0x3d, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
jmp 0x2329e
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x20(%rbp), %rdi
callq 0x23550
movq %rax, %rdi
movq -0x18(%rbp), %rax
movl 0x48(%rax), %esi
callq 0x235b0
movq -0x90(%rbp), %rdi
movq %rax, %rsi
callq 0x21e30
movl %eax, -0x2c(%rbp)
jmp 0x232a0
cmpl $0x0, -0x2c(%rbp)
je 0x232b1
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x232b3
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x232d5
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x232d7
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x4c(%rax), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
leaq -0x3c(%rbp), %rsi
callq 0x21ea0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x23305
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x23307
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x23329
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x2332b
movq -0x18(%rbp), %rax
cmpl $0x0, 0x50(%rax)
jne 0x23348
movq -0x10(%rbp), %rdi
movl $0x30, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
jmp 0x2335c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x50, %rsi
callq 0x21ea0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x2336d
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x2336f
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x23391
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x23393
movq -0x18(%rbp), %rdi
addq $0x58, %rdi
callq 0xf8e0
testb $0x1, %al
jne 0x233a6
jmp 0x233b9
movq -0x10(%rbp), %rdi
movl $0x2a, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
jmp 0x233cd
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x58, %rsi
callq 0x21e30
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x233de
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x233e0
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x23402
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x23404
movq -0x18(%rbp), %rdi
addq $0x70, %rdi
callq 0xf8e0
testb $0x1, %al
jne 0x23417
jmp 0x2342a
movq -0x10(%rbp), %rdi
movl $0x2a, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
jmp 0x2343e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x70, %rsi
callq 0x21e30
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x2344f
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
movq -0x18(%rbp), %rdi
addq $0x88, %rdi
callq 0xf8e0
testb $0x1, %al
jne 0x234e0
jmp 0x23465
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x11ba0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x23484
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x234f1
jmp 0x23486
leaq -0x58(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0xb3a0
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x88, %rsi
callq 0x23690
jmp 0x234af
movq -0x10(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x21e30
jmp 0x234be
leaq -0x58(%rbp), %rdi
callq 0xb7b0
jmp 0x234e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xb7b0
jmp 0x234fd
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x11ba0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x4770
nopw %cs:(%rax,%rax)