Hullin, Chapter Four, Mishnah Two
A first born animal is holy and if it dies must be buried. In contrast, the meat of other animals can be given to dogs to eat. Our mishnah deals with an animal having trouble giving birth to her first born.
1) If an animal giving birth for the first time was having difficulty, one may cut off each limb [as it comes out] and throw it to the dogs.
2) If the greater portion came forth it must be buried, and she is exempt from the law of the firstling.
Section one: This halakhah accords with the general principle we learned in yesterdays mishnah. Since the fetus is still inside the womb, it is not considered a separate life. Rather it is considered to be one of its mothers limbs. Therefore, it can be cut out and fed to the dogs. Note that the Mishnah uses the phrase throw it to the dogs because this is what the Torah states may be done with a nevelah, an animal that died without having been slaughtered.
Section two: Once the majority of the fetus has emerged from its mothers womb, it is considered as being born. From this point forth if one has to cut it up to save its mother (which is permitted) the flesh cannot be thrown to the dogs. Rather it must be buried, as is the rule for all firstlings that die.
Furthermore, once the fetus is born, the next offspring born to this mother is not considered to be a firstling. Some commentators hold that this clause she is exempt from the law of the firstling applies to both clauses of the mishnah.