Temurah5: 1
כֵּיצַד מַעֲרִימִים עַל הַבְּכוֹר? מְבַכֶּרֶת שֶׁהָיְתָה מְעֻבֶּרֶת, אוֹמֵר: «מַה שֶּׁבְּמֵעֶיהָ שֶׁל זוֹ, אִם זָכָר — עוֹלָה», יָלְדָה זָכָר — יִקְרַב עוֹלָה. «וְאִם נְקֵבָה — זִבְחֵי שְׁלָמִים», יָלְדָה נְקֵבָה — תִּקְרַב שְׁלָמִים. «אִם זָכָר — עוֹלָה, אִם נְקֵבָה — זִבְחֵי שְׁלָמִים», יָלְדָה זָכָר וּנְקֵבָה — הַזָּכָר יִקְרַב עוֹלָה, וְהַנְּקֵבָה תִּקְרַב שְׁלָמִים.
How does one use subterfuge regarding a bechor? [Concerning] an animal that was pregnant with her first offspring, one declares, “What is in this one’s womb, if [it is] a male, it is an olah,” [if] she gave birth to a male, it is offered as an olah. And [if he declares,] “If it is a female, it is a shelamim-offering,” if she gave birth to a female, it is offered as a shelamim. [If one declares,] “If [the fetus] is a male, it is an olah, and if [it is] a female, it is a shelamim-offering”: [If] she [then] gave birth to a male and a female, the male is offered as an olah, and the female is offered as a shelamim.
Temurah5: 2
יָלְדָה שְׁנֵי זְכָרִים — אֶחָד מֵהֶן יִקְרַב עוֹלָה, וְהַשֵּׁנִי יִמָּכֵר לְחַיָּבֵי עוֹלָה, וְדָמָיו חֻלִּין. יָלְדָה שְׁתֵּי נְקֵבוֹת — אַחַת מֵהֶן תִּקְרַב שְׁלָמִים, וְהַשְּׁנִיָּה תִּמָּכֵר לְחַיָּבֵי שְׁלָמִים, וְדָמֶיהָ חֻלִּין. יָלְדָה טֻמְטוּם וְאַנְדְּרוֹגִינוֹס — רַבָּן שִׁמְעוֹן בֶּן גַּמְלִיאֵל אוֹמֵר: אֵין קְדֻשָּׁה חָלָה עֲלֵיהֶן.
If she gave birth to two males, one of them is offered as an olah, and the second one is sold to those who have an olah obligation, and its proceeds are chullin. If she gave birth to two females, one of them is offered as a shelamim, and the second one is sold to those who have a shelamim obligation, and its proceeds are chullin.  [If] she gave birth to a tumtum or an androgyne, Rabban Shimon ben Gamliel says: No sanctity takes effect upon them.