  We construct a pathwise integration theory, associated with a change of
variable formula, for smooth functionals of continuous paths with arbitrary
regularity defined in terms of the notion of $p$-th variation along a sequence
of time partitions. For paths with finite $p$-th variation along a sequence of
time partitions, we derive a change of variable formula for $p$ times
continuously differentiable functions and show pointwise convergence of
appropriately defined compensated Riemann sums. Results for functions are
extended to regular path-dependent functionals using the concept of vertical
derivative of a functional. We show that the pathwise integral satisfies an
`isometry' formula in terms of $p$-th order variation and obtain a `signal plus
noise' decomposition for regular functionals of paths with strictly increasing
$p$-th variation. For less regular ($C^{p-1}$) functions we obtain a
Tanaka-type change of variable formula using an appropriately defined notion of
local time. These results extend to multidimensional paths and yield a natural
higher-order extension of the concept of `reduced rough path'. We show that,
while our integral coincides with a rough-path integral for a certain rough
path, its construction is canonical and does not involve the specification of
any rough-path superstructure.
