  Instanton partition functions of 5d N=1 gauge theories are Witten indices for
the ADHM gauged quantum mechanics with (0,4) SUSY. We derive the integral
contour prescriptions for these indices using the Jeffrey-Kirwan method, for
gauge theories with hypermultiplets in various representations. The results can
be used to study various 4d/5d/6d QFTs. In this paper, we study 5d SCFTs which
are at the UV fixed points of 5d SYM theories. In particular, we focus on the
Sp(N) theories with N_f \leq 7 fundamental and 1 antisymmetric hypermultiplets,
living on the D4-D8-O8 systems. Their superconformal indices calculated from
instantons all show E_{N_f+1} symmetry enhancements. We also discuss some
aspects of the 6d SCFTs living on the M5-M9 system. It is crucial to understand
the UV incompleteness of the 5d SYM, coming from small instantons in our
problem. We explain in our examples how to fix them. As an aside, we derive the
index for general gauged quantum mechanics with (0,2) SUSY.
