Write a program to merge overlapping IP address ranges from a routing table to optimize firewall rules.