Losing weight requires a caloric deficit while gaining muscle really requires a caloric surplus. The two can be done simultaneously, although its very hard and typically requires some sort of testosterone increase. At that high of bodyfat your best bet in my opinion is to lose whatever weight you need to and try to conserve as much muscle as you can. Then you try to gain muscle post cut.