private static Pair<String,String> preIndexedASR(final long offset,final ITranslationEnvironment environment,final List<ReilInstruction> instructions,final String registerNodeValue1,final String registerNodeValue2,final String immediateNodeValue){
  final String address=environment.getNextVariableString();
  final String index=environment.getNextVariableString();
  final String tmpVar=environment.getNextVariableString();
  long baseOffset=offset;
  if (immediateNodeValue.equals("0")) {
    final String isZeroCondition=environment.getNextVariableString();
    final String tmpVar1=environment.getNextVariableString();
    instructions.add(ReilHelpers.createBsh(baseOffset++,dw,registerNodeValue2,wd,String.valueOf(-31),dw,tmpVar1));
    instructions.add(ReilHelpers.createBisz(baseOffset++,dw,tmpVar1,bt,isZeroCondition));
    instructions.add(ReilHelpers.createSub(baseOffset++,dw,String.valueOf(0x0L),bt,isZeroCondition,dw,index));
  }
 else {
    final String tmpVar1=environment.getNextVariableString();
    final String tmpVar2=environment.getNextVariableString();
    final String tmpVar3=environment.getNextVariableString();
    final String tmpVar4=environment.getNextVariableString();
    instructions.add(ReilHelpers.createAdd(baseOffset++,dw,registerNodeValue2,dw,String.valueOf(0x80000000L),dw,tmpVar1));
    instructions.add(ReilHelpers.createBsh(baseOffset++,dw,tmpVar1,dw,"-" + immediateNodeValue,dw,tmpVar2));
    instructions.add(ReilHelpers.createBsh(baseOffset++,dw,String.valueOf(0x80000000L),dw,"-" + immediateNodeValue,dw,tmpVar3));
    instructions.add(ReilHelpers.createSub(baseOffset++,dw,tmpVar2,dw,tmpVar3,qw,tmpVar4));
    instructions.add(ReilHelpers.createAnd(baseOffset++,qw,tmpVar4,dw,dWordBitMask,dw,index));
  }
  instructions.add(ReilHelpers.createAdd(baseOffset++,dw,registerNodeValue1,dw,index,dw,tmpVar));
  instructions.add(ReilHelpers.createAnd(baseOffset++,dw,tmpVar,dw,dWordBitMask,dw,address));
  instructions.add(ReilHelpers.createStr(baseOffset++,dw,address,dw,registerNodeValue1));
  return new Pair<String,String>(address,registerNodeValue1);
}

private static Pair < String , String > preIndexedASR ( final long offset , final ITranslationEnvironment environment , final List < ReilInstruction > instructions , final String registerNodeValue1 , final String registerNodeValue2 , final String immediateNodeValue ) { final String address = environment . getNextVariableString ( ) ; final String index = environment . getNextVariableString ( ) ; final String tmpVar = environment . getNextVariableString ( ) ; long baseOffset = offset ; if ( immediateNodeValue . equals ( "0" ) ) { final String isZeroCondition = environment . getNextVariableString ( ) ; final String tmpVar1 = environment . getNextVariableString ( ) ; instructions . add ( ReilHelpers . createBsh ( baseOffset ++ , dw , registerNodeValue2 , wd , String . valueOf ( - 31 ) , dw , tmpVar1 ) ) ; instructions . add ( ReilHelpers . createBisz ( baseOffset ++ , dw , tmpVar1 , bt , isZeroCondition ) ) ; instructions . add ( ReilHelpers . createSub ( baseOffset ++ , dw , String . valueOf ( 0x0L ) , bt , isZeroCondition , dw , index ) ) ; } else { final String tmpVar1 = environment . getNextVariableString ( ) ; final String tmpVar2 = environment . getNextVariableString ( ) ; final String tmpVar3 = environment . getNextVariableString ( ) ; final String tmpVar4 = environment . getNextVariableString ( ) ; instructions . add ( ReilHelpers . createAdd ( baseOffset ++ , dw , registerNodeValue2 , dw , String . valueOf ( 0x80000000L ) , dw , tmpVar1 ) ) ; instructions . add ( ReilHelpers . createBsh ( baseOffset ++ , dw , tmpVar1 , dw , "-" + immediateNodeValue , dw , tmpVar2 ) ) ; instructions . add ( ReilHelpers . createBsh ( baseOffset ++ , dw , String . valueOf ( 0x80000000L ) , dw , "-" + immediateNodeValue , dw , tmpVar3 ) ) ; instructions . add ( ReilHelpers . createSub ( baseOffset ++ , dw , tmpVar2 , dw , tmpVar3 , qw , tmpVar4 ) ) ; instructions . add ( ReilHelpers . createAnd ( baseOffset ++ , qw , tmpVar4 , dw , dWordBitMask , dw , index ) ) ; } instructions . add ( ReilHelpers . createAdd ( baseOffset ++ , dw , registerNodeValue1 , dw , index , dw , tmpVar ) ) ; instructions . add ( ReilHelpers . createAnd ( baseOffset ++ , dw , tmpVar , dw , dWordBitMask , dw , address ) ) ; instructions . add ( ReilHelpers . createStr ( baseOffset ++ , dw , address , dw , registerNodeValue1 ) ) ; return new Pair < String , String > ( address , registerNodeValue1 ) ; }
[ < rn > , + / - < rm > , asr # < shift_imm > ] ! 0b10 / asr / if shift_imm = = 0 then / asr # 32 / if rm [ 31 ] = = 1 then index = 0xffffffff else index = 0 else index = rm arithmetic_shift_right shift_imm if u = = 1 then address = rn + index else / u = = 0 / address = rn - index if conditionpassed ( cond ) then rn = address
