/* This routine is called by the EBC execute functions to read EBC immediate values from the code stream. Since we can't assume alignment, each tries to read in the biggest chunks size available, but will revert to smaller reads if necessary. */
INT64 VmReadImmed64(IN VM_CONTEXT *VmPtr, IN UINT32 Offset)
/* This routine is called by the EBC execute functions to read EBC immediate values from the code stream. Since we can't assume alignment, each tries to read in the biggest chunks size available, but will revert to smaller reads if necessary. */
INT64 VmReadImmed64(IN VM_CONTEXT *VmPtr, IN UINT32 Offset)
{
  UINT64  Data64;
  UINT32  Data32;
  UINT8   *Ptr;
  if (ADDRESS_IS_ALIGNED ((UINTN)VmPtr->Ip + Offset, sizeof (UINT64))) {
    return *(UINT64 *)(VmPtr->Ip + Offset);
  }
  Ptr            = (UINT8 *)&Data64;
  Data32         = VmReadCode32 (VmPtr, Offset);
  *(UINT32 *)Ptr = Data32;
  Ptr           += sizeof (Data32);
  Data32         = VmReadCode32 (VmPtr, Offset + sizeof (UINT32));
  *(UINT32 *)Ptr = Data32;
  return Data64;
}