When the structure and function of an organism adjusts to its environment it is adapting.
Coral reefs are built by coral polyps as they secrete layers of calcium carbonate beneath their bodies. And inside each coral poly lives single-celled algae called zooxanthellae. So basically in simplistic terms, coral polys create coral reefs and algae is in coral polys which also goes into coral reefs when they are made.
That organ is called the rectum, or more coomonly, the anus. The rectum is the final part of the large intestine and the digestive system, where food that has had all its nutrients extracted (as much as possible, anyway) is sent to be compacted and sent out through the anus in the form of excreta. The contents in the rectum is mostly indigestible fiber and other materials. The rectum at its end connects to the bodily orifice known as the anus.