WTF is going on here ? Is there a flange? What is that pipe connected to backwall ?

toilet 1

inside