  We have determined stellar mass functions of 120 Milky Way globular clusters
and massive LMC/SMC star clusters based on a comparison of archival Hubble
Space Telescope photometry with a large grid of direct N-body simulations. We
find a strong correlation of the global mass function slopes of star clusters
with both their internal relaxation times as well as their lifetimes. Once
dynamical effects are being accounted for, the mass functions of most star
clusters are compatible with an initial mass function described by a broken
power-law distribution $N(m) \sim m^\alpha$ with break masses at 0.4 M$_\odot$
and 1.0 M$_\odot$ and mass function slopes of $\alpha_{Low}=-0.3$ for stars
with masses $m<0.4$ M$_\odot$, $\alpha_{High}=-2.30$ for stars with $m>1.0$
M$_\odot$ and $\alpha_{Med}=-1.65$ for intermediate-mass stars. Alternatively,
a log-normal mass function with a characteristic mass $\log M_C = -0.36$ and
width $\sigma_C=0.28$ for low-mass stars and a power-law mass function for
stars with $m>1$ M$_\odot$ also fits our data. We do not find a significant
environmental dependency of the initial mass function with either cluster mass,
density, global velocity dispersion or metallicity. Our results lead to a
larger fraction of high-mass stars in globular clusters compared to canonical
Kroupa/Chabrier mass functions, increasing the efficiency of self-enrichment in
clusters and helping to alleviate the mass budget problem of multiple stellar
populations in globular clusters. By comparing our results with direct N-body
simulations we finally find that only simulations in which most black holes are
ejected by natal birth kicks correctly reproduce the observed correlations.
