Rabbi Shimon says that the heart (God) takes from the liver only that which is pure and clean, leaving all the foulness for Samael, who distributes it to the idol worshipping nations.
374. With T'ruah and T'kiah and Sh'varim, everything is perfumed, one with the other, FOR ALL OF THE JUDGMENTS ARE MITIGATED, and everything that the liver is holding it sacrifices to the heart, which is the King, to nourish him. And it is neither the way of that heart, nor its desire, the foulness of the deeds of His people, but He takes everything that is clear and pure, NAMELY all the merits and the good deeds, while all the foulness, the filth and the dirt, which are the bad deeds He leaves for the liver, WHICH IS SAMAEL, about whom it is said: "Esau...is a hairy (Heb. sair) man" (Beresheet 27:11). And all its arteries, which are the other idol-worshipping peoples, are as it is written: "And the goat (Heb. seir) shall bear upon him all their iniquities" (Vayikra 16:22). What is meant by "their iniquities" (Heb. avonotam)? avonot tam, namely the iniquities of a tam, a complete man, the reference being to the same one about whom it is said: "And Jacob was a plain (Heb. tam) man" (Beresheet 25:27). And the iniquities of His people are in the arteries AND SINEWS that pulsate in the heart.
375. And this is why boils and leprosy and skin sores of all the limbs are to be found in the liver, deriving from the filth that remains there. From the heart comes health for all the limbs, for that is how it is: since the heart took all that is pure, clean, and bright, the liver takes what is left over there of the dirt and the filth and distributes it to all the other limbs, which are the other idol worshipping nations, against their will. And from the garbage, the refuse of the liver, the spleen, WHICH IS LILIT, takes, about whom it is said: "Let there be lights" (Beresheet 1:14), where the word 'lights' is spelled without Vav, WHICH CAN ALSO BE READ AS M'ERAT, 'THE CURSE OF,' BECAUSE LILIT WAS CREATED, as in the verse: "The curse (Heb. M'erat) of Hashem is in the house of the wicked" (Mishlei 3:33).