The getelementptr instruction is the workhorse for address calculations. As such, it needs some more explanation. The first operand, [8…