The machine consists of a pump, which functions as the heart, and an oxygenator, which replaces the function of the lungs. During a heart-lung bypass, oxygen-poor blood is first diverted from the upper chambers of the heart and is directed to a reservoir in the heart-lung machine.