KiTpGetRegisterAddressByIndex

NTSTATUS __stdcall KiTpGetRegisterAddressByIndex(INT64 a1, INT64 a2, UINT64 a3, CHAR a4, CHAR a5){
  int v5; 
  char v6; 
  __int64 v7; 
  NTSTATUS result; 

  v5 = a3 + 8;
  if( !a4 )
    v5 = a3;
  v6 = v5;
  if( !a5 || *(_BYTE *)(a1 + 25) || *(_BYTE *)(a1 + 1) != 8 )
    return *(_DWORD *)(a2 + 8) + 8 * v5 + 120;
  v7 = *(_QWORD *)(a2 + 8) + 120i64 + 8i64 * (v5 & 3);
  result = v7 + 1;
  if( (v6 & 4) == 0 )
    return v7;
  return result;
}

Referenced by:

KiTpDecodeModRmOperand
KiTpEmulateGroup0Instruction
KiTpEmulateInstruction
KiTpEmulateMovzx
KiTpEmulateRegisterPushPop
KiTpWriteRegisterValue