Regular G76 threading cycle will work just fine for this. Use M24 for Chamfering Off for straight pull out.
For chamfering (angle pull out):
At the end of the thread an optional chamfer is performed. The size and angle of the chamfer is controlled with Setting 95 (Thread Chamfer Size) and Setting 96 (Thread Chamfer Angle). The chamfer size is designated in number of threads, so that if 1.000 is recorded in Setting 95 and the feed rate is .05, then the chamfer will be .05. A chamfer can improve the appearance and functionality of threads that must be machined up to a shoulder. If relief is provided for at the end of the thread then the chamfer can be eliminated by specifying 0.000 for the chamfer size in Setting 95, or using M24. The default value for Setting 95 is 1.000 and the default angle for the thread (Setting 96) is 45 degrees.