Scalable phylogenetic analysis and functional interpretation of genomes with complex evolutionary histories