if no set bits are left for C and there are no set bits for A and B and the carry is 0 , then this combination is possible
if ( shift == 0 and seta == 0 and setb == 0 and carry == 0 ) : NEW_LINE INDENT return 1 NEW_LINE DEDENT