Egypt frees hundreds of militants