How can I calculate zero-coupon rates from historical IR swap rates? I have a record of IRS for the past 4000 days and I am want to compute the zero coupon rates based on them.
I assume that you are working in a single curve theory. While this theory used to do well, it is not adapted to today's market and — as Brian B pointed it out — you cannot get a useful information from swap rates alone.
The swap rate $S(t)$ at $t$ for a given tenor $T$ and period $P$ is the fixed rate such that a swap starting at $t$ and ending at $t+T$ which exchanges $S(t)$ against the LIBOR-$P$ rate $R$ has value $0$ at $t$. (I write LIBOR for the simply compounded spot rate, which is what you are looking for.)
Writing this statement in formulas gives you a linear equation whose unknowns are the rates $R(t)$, $R(t+P)$ and so on until $R(t+T)$. Considering swaps of increasingly large tenors leads to a triangular linear system that you almost can solve: but since you are likely to have much less data as what is really needed you end up using LIBOR rates to determine the zero-rate for short maturities and make simplifications to determine the zero-rate for longer maturities.
For instance if you know the swap rates for $P = 6M$ and tenors $T$ in $1Y$, $2Y$ and $5Y$, writing the equations I described leaves you with 3 equations for 10 unknowns, and you have to make some simplifying assumptions to reduce this number of unkowns.
The procedure is similar to the usual bootstrapping based on treasury bonds: the strategy is the same but the instruments used differ.