Replace XS with raw C