// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/index/BamStandardIndex_p.cpp
// Function: BamTools::Internal::BamStandardIndex::SaveAlignmentChunkToBin(std::map<unsigned int, std::vector<BamTools::Internal::BaiAlignmentChunk, std::allocator<BamTools::Internal::BaiAlignmentChunk>>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::vector<BamTools::Internal::BaiAlignmentChunk, std::allocator<BamTools::Internal::BaiAlignmentChunk>>>>>&, unsigned int const&, unsigned long const&, unsigned long const&)
void BamStandardIndex::SaveAlignmentChunkToBin(BaiBinMap& binMap,
                                               const uint32_t& currentBin,
                                               const uint64_t& currentOffset,
                                               const uint64_t& lastOffset)
{
    // create new alignment chunk
    BaiAlignmentChunk newChunk(currentOffset, lastOffset);

    // if no entry exists yet for this bin, create one and store alignment chunk
    BaiBinMap::iterator binIter = binMap.find(currentBin);
    if ( binIter == binMap.end() ) {
        BaiAlignmentChunkVector newChunks;
        newChunks.push_back(newChunk);
        binMap.insert( pair<uint32_t, BaiAlignmentChunkVector>(currentBin, newChunks));
    }

    // otherwise, just append alignment chunk
    else {
        BaiAlignmentChunkVector& binChunks = (*binIter).second;
        binChunks.push_back( newChunk );
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq (%rcx), %rax
movq %rax, (%rsp)
movq (%r8), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsi), %rdx
leaq 0x8(%rsi), %rax
movq %rax, %rcx
testq %rdx, %rdx
je 0x3fa6f
movl (%r14), %esi
movq %rax, %rcx
xorl %edi, %edi
cmpl %esi, 0x20(%rdx)
setb %dil
cmovaeq %rdx, %rcx
movq 0x10(%rdx,%rdi,8), %rdx
testq %rdx, %rdx
jne 0x3fa58
movq %rax, %rdi
cmpq %rax, %rcx
je 0x3fa84
movl (%r14), %edx
cmpl 0x20(%rcx), %edx
cmovbq %rax, %rcx
movq %rcx, %rdi
cmpq %rax, %rdi
je 0x3faa4
movq 0x30(%rdi), %rsi
cmpq 0x38(%rdi), %rsi
je 0x3face
movups (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x30(%rdi)
jmp 0x3fb50
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x3fadc
movups (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x18(%rsp)
jmp 0x3fae9
addq $0x28, %rdi
movq %rsp, %rdx
callq 0x28550
jmp 0x3fb50
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x28550
movl (%r14), %eax
leaq 0x30(%rsp), %r14
movl %eax, -0x8(%r14)
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x28210
movl 0x28(%rsp), %eax
leaq 0x50(%rsp), %rdi
movl %eax, -0x8(%rdi)
movq %r14, %rsi
callq 0x28210
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x28520
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x3fb32
callq 0x27560
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3fb41
callq 0x27560
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3fb50
callq 0x27560
addq $0x68, %rsp
popq %rbx
popq %r14
retq
jmp 0x3fb82
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x3fb71
callq 0x27560
jmp 0x3fb71
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3fb85
callq 0x27560
jmp 0x3fb85
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3fb94
callq 0x27560
movq %rbx, %rdi
callq 0x28c20