A "mock modular form" is the holomorphic part of a harmonic Maass form f. The nonholomorphic part of f is a period integral of its "shadow," a cusp form g. A direct method for relating the coefficients of shadows and mock modular forms is not known. We solve these problems when the shadow is an integer weight newform. Our solution is p-adic, and it relies on our definition of an algebraic "regularized mock modular form." As an application, we consider the modular solution to the cubic "arithmetic-geometric mean."