If you start off with B=0 and C=0 you can skip half those statements and only do the ones where A.x = 1