  In this paper, we consider the bifurcation of small-amplitude limit cycles
near the origin in perturbed pendulum systems of the form $\dot x= y$, $\dot
y=-\sin(x)+\varepsilon Q(x,y)$, where $Q(x,y)$ is a smooth or piecewise smooth
polynomial in the triple $(\sin(x),\cos(x), y)$ with free coefficients. We
obtain the sharp upper bound on the number of positive zeros of its associated
first order Melnikov function near $h=0$ for $Q(x,y)$ being smooth and
piecewise smooth with the discontinuity at $y=0$, respectively.
