libil port in pure C