  Let G be a reductive p-adic group and let Rep(G)^s be a Bernstein block in
the category of smooth complex G-representations. We investigate the structure
of Rep(G)^s, by analysing the algebra of G-endomorphisms of a progenerator \Pi
of that category.
  We show that Rep(G)^s is "almost" Morita equivalent with a (twisted) affine
Hecke algebra. This statement is made precise in several ways, most importantly
with a family of (twisted) graded algebras. It entails that, as far as finite
length representations are concerned, Rep(G)^s and End_G (\Pi)-Mod can be
treated as the module category of a twisted affine Hecke algebra.
  We draw two consequences. Firstly, we show that the equivalence of categories
between Rep(G)^s and End_G (\Pi)-Mod preserves temperedness of finite length
representations. Secondly, we provide a classification of the irreducible
representations in Rep(G)^s, in terms of the complex torus and the finite group
canonically associated to Rep(G)^s. This proves a version of the ABPS
conjecture and enables us to express the set of irreducible $G$-representations
in terms of the supercuspidal representations of the Levi subgroups of $G$.
  Our methods are independent of the existence of types, and apply in complete
generality.
