// File: tedsharpe[P]ORFCall/ORFCall.cc
// Function: (anonymous namespace)::ORFCaller::writeAminoAcidCounts(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void ORFCaller::writeAminoAcidCounts( std::string const& filename )
{
    std::ofstream ofs(filename);
    char const* prefixS = "";
    for ( char label : mAANamer )
    {
        ofs << prefixS << label;
        prefixS = "\t";
    }

    std::vector<size_t> aaCounts;
    for ( CodonCounts const& cCounts : mCCV )
    {
        mAANamer.getAACounts(cCounts.mCounts,&aaCounts);
        char prefix = '\n';
        for ( size_t count : aaCounts )
        {
            ofs << prefix << count;
            prefix = '\t';
        }
    }
    ofs << '\n';
    ofs.close();
    if ( !ofs )
        FatalErr("Couldn't write amino acid counts to " << filename);
}

// Assembly:
subq $0x2e8, %rsp            # imm = 0x2E8
movq %rdi, 0x2e0(%rsp)
movq %rsi, 0x2d8(%rsp)
movq 0x2e0(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x2d8(%rsp), %rsi
leaq 0xd8(%rsp), %rdi
movl $0x10, %edx
callq 0x45a0
movq 0x30(%rsp), %rax
leaq 0x1b26f(%rip), %rcx     # 0x21d89
movq %rcx, 0xd0(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x16990
movq %rax, 0x38(%rsp)
jmp 0x6b42
movq 0x38(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x169c0
movq %rax, 0x28(%rsp)
jmp 0x6b63
movq 0x28(%rsp), %rax
movq %rax, 0xa8(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x1fe00
testb $0x1, %al
jne 0x6b8b
jmp 0x6c08
leaq 0xc0(%rsp), %rdi
callq 0x1fe40
movb (%rax), %al
movb %al, 0xa7(%rsp)
movq 0xd0(%rsp), %rsi
leaq 0xd8(%rsp), %rdi
callq 0x4290
movq %rax, 0x20(%rsp)
jmp 0x6bbd
movq 0x20(%rsp), %rdi
movsbl 0xa7(%rsp), %esi
callq 0x42e0
jmp 0x6bd1
leaq 0x1b1b0(%rip), %rax     # 0x21d88
movq %rax, 0xd0(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x1fe50
jmp 0x6b70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x6e16
leaq 0x88(%rsp), %rdi
callq 0x1fe70
movq 0x30(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rdi
callq 0x145b0
movq %rax, 0x78(%rsp)
movq 0x80(%rsp), %rdi
callq 0x16950
movq %rax, 0x70(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x14620
testb $0x1, %al
jne 0x6c62
jmp 0x6d5a
leaq 0x78(%rsp), %rdi
callq 0x16980
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x68(%rsp)
movq 0x10(%rax), %rdi
movq 0x68(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x169f0
jmp 0x6c91
movb $0xa, 0x67(%rsp)
leaq 0x88(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdi
callq 0x1fe80
movq %rax, 0x50(%rsp)
movq 0x58(%rsp), %rdi
callq 0x1feb0
movq %rax, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x1fee0
testb $0x1, %al
jne 0x6cd6
jmp 0x6d49
leaq 0x50(%rsp), %rdi
callq 0x1ff20
movq (%rax), %rax
movq %rax, 0x40(%rsp)
movsbl 0x67(%rsp), %esi
leaq 0xd8(%rsp), %rdi
callq 0x42e0
movq %rax, 0x18(%rsp)
jmp 0x6d01
movq 0x18(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x4070
jmp 0x6d12
movb $0x9, 0x67(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x1ff30
jmp 0x6cc1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x1ff50
jmp 0x6e16
jmp 0x6d4b
leaq 0x78(%rsp), %rdi
callq 0x14670
jmp 0x6c4a
leaq 0xd8(%rsp), %rdi
movl $0xa, %esi
callq 0x42e0
jmp 0x6d6e
leaq 0xd8(%rsp), %rdi
callq 0x43b0
jmp 0x6d7d
movq 0xd8(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0xd8(%rsp,%rax), %rdi
callq 0x4150
movb %al, 0x17(%rsp)
jmp 0x6d9c
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x6da6
jmp 0x6df4
movq 0x26243(%rip), %rdi     # 0x2cff0
leaq 0x1afd6(%rip), %rsi     # 0x21d8a
callq 0x4290
movq %rax, 0x8(%rsp)
jmp 0x6dc0
movq 0x8(%rsp), %rdi
movq 0x2d8(%rsp), %rsi
callq 0x4260
movq %rax, (%rsp)
jmp 0x6dd8
movq (%rsp), %rdi
movq 0x261c5(%rip), %rsi     # 0x2cfa8
callq 0x42b0
jmp 0x6dea
movl $0x1, %edi
callq 0x42f0
leaq 0x88(%rsp), %rdi
callq 0x1ff50
leaq 0xd8(%rsp), %rdi
callq 0x4420
addq $0x2e8, %rsp            # imm = 0x2E8
retq
leaq 0xd8(%rsp), %rdi
callq 0x4420
movq 0xb8(%rsp), %rdi
callq 0x4510