modified sbull.c corresponding to ldd3 example