  We extend and generalize many of the enumerative results concerning West's
stack-sorting map $s$. First, we prove a useful theorem that allows one to
efficiently compute $|s^{-1}(\pi)|$ for any permutation $\pi$, answering a
question of Bousquet-M\'elou. We then enumerate permutations in various sets of
the form $s^{-1}(\text{Av}(\tau^{(1)},\ldots,\tau^{(r)}))$, where
$\text{Av}(\tau^{(1)},\ldots,\tau^{(r)})$ is the set of permutations avoiding
the patterns $\tau^{(1)},\ldots,\tau^{(r)}$. These preimage sets often turn out
to be permutation classes themselves, so the current paper represents a new
approach, based on the theory of valid hook configurations, for solving
classical enumerative problems. In one case, we solve a problem previously
posed by Bruner. We are often able to refine our counts by enumerating these
permutations according to their number of descents or peaks. Our investigation
not only provides several new combinatorial interpretations and identities
involving known sequences, but also paves the way for several new enumerative
problems.
