lightweight C implementation of name collating BAM file input and BAM file output