Generalized Chinese Remainder Theorem [Thesis and C Code Implementation]