Hard to see the KK coming, but he raised preflop, and then re-raised you post flop and you were still drawing.

I would've layed down the AT earlier.