  We describe a construction of the two-loop amplitude of four graviton
supermultiplets in AdS$_5\times$S$^5$. We start from an ansatz for a
preamplitude from which we generate the full amplitude under the action of a
specific Casimir operator. The ansatz captures a recent ansatz of Huang and
Yuan and we confirm their result through similar constraints. The form of the
result suggests that all ambiguities are captured by the preamplitude which
determines the result up to tree-level ambiguities only. We identify a class of
four-dimensional `zigzag' integrals which are perfectly adapted to describing
the leading logarithmic discontinuity to all orders. We also observe that a
bonus crossing symmetry of the preamplitude follows from the transformation
properties of the Casimir operator. Combined with the zigzag integrals this
allows us to construct a crossing symmetric function with the correct leading
logarithmic discontinuities in all channels.
  From the two-loop result we extract an explicit expression for the two-loop
correction to the anomalous dimensions of twist-four operators of generic spin
which includes dependence on (alternating) nested harmonic sums up to weight
three. We also revisit the prescription of the bulk-point limit of AdS
amplitudes and show how it recovers the full flat-space amplitude, not just its
discontinuity. With this extended notion of the bulk-point limit we reproduce
the scale-dependent logarithmic threshold terms of type IIB string theory in
flat-space.
