def METHOD_NAME(expr) -> Optional[Tuple[bool, int, Expression]]:
    # return a tuple of ( is_signed (False for is_unsigned), bits of the expression to test for signedness, and the
    # expression itself ).
    if isinstance(expr, BinaryOp):
        eq0, eq1 = False, False
        if isinstance(expr.operands[1], Const):
            if expr.op == "CmpEQ":
                if expr.operands[1].value == 0:
                    eq0 = True
                elif expr.operands[1].value == 1:
                    eq1 = True
            elif expr.op == "CmpNE":
                if expr.operands[1].value == 1:
                    eq0 = True
                elif expr.operands[1].value == 0:
                    eq1 = True
        if not eq0 and not eq1:
            return None
        if isinstance(expr.operands[0], BinaryOp) and expr.operands[0].op == "And":
            and_expr = expr.operands[0]
            if isinstance(and_expr.operands[1], Const) and and_expr.operands[1].value == 1:
                # continue to match the shift
                if isinstance(and_expr.operands[0], BinaryOp) and and_expr.operands[0].op == "Shr":
                    rshift_expr = and_expr.operands[0]
                    inner, right = rshift_expr.operands
                    if isinstance(right, Const) and right.value in {0xF, 0x1F, 0x3F}:
                        return eq1, right.value + 1, inner
    return None