@staticmethod<EOL><INDENT>def rotate_shift_mask_simplifier(a, b):<DEDENT>
<EOL>if b.op != '<STR_LIT>':<EOL><INDENT>return None<EOL><DEDENT>if a.op != '<STR_LIT>' or len(a.args) != <NUM_LIT:2>:<EOL><INDENT>return None<EOL><DEDENT>a_0, a_1 = a.args<EOL>if a_0.op != '<STR_LIT>':<EOL><INDENT>return None<EOL><DEDENT>if a_1.op != '<STR_LIT>':<EOL><INDENT>return None<EOL><DEDENT>a_00, a_01 = a_0.args<EOL>a_10, a_11 = a_1.args<EOL>if not a_00 is a_10:<EOL><INDENT>return None<EOL><DEDENT>if a_01.op != '<STR_LIT>' or a_11.op != '<STR_LIT>':<EOL><INDENT>return None<EOL><DEDENT>lshift_ = a_01.args[<NUM_LIT:0>]<EOL>rshift_ = a_11.args[<NUM_LIT:0>]<EOL>bitwidth = lshift_ + rshift_<EOL>if bitwidth not in (<NUM_LIT:32>, <NUM_LIT:64>):<EOL><INDENT>return None<EOL><DEDENT>if bitwidth == <NUM_LIT:32>:<EOL><INDENT>m = ((b.args[<NUM_LIT:0>] << rshift_) & <NUM_LIT>) | (b.args[<NUM_LIT:0>] >> lshift_)<EOL>if m != <NUM_LIT>:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>else: <EOL><INDENT>m = ((b.args[<NUM_LIT:0>] << rshift_) & <NUM_LIT>) | (b.args[<NUM_LIT:0>] >> lshift_)<EOL>if m != <NUM_LIT>:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>masked_a = (a_00 & m)<EOL>expr = (masked_a << lshift_) | (masked_a >> rshift_)<EOL>return expr<EOL>
Handles the following case:
    ((A << a) | (A >> (_N - a))) & mask, where
        A being a BVS,
        a being a integer that is less than _N,
        _N is either 32 or 64, and
        mask can be evaluated to 0xffffffff (64-bit) or 0xffff (32-bit) after reversing the rotate-shift
        operation.

It will be simplified to:
    (A & (mask >>> a)) <<< a