{-# LANGUAGE PartialTypeSignatures, MultiParamTypeClasses, FlexibleContexts, Strict #-}


{-|
Module      : SimplePred
Description : Symbolic execution of sequential lists of instructions of type @"X86.Instruction"@ on predicates of type @"Pred"@.
-}

module Analysis.SymbolicExecution (
  tau_block,
  init_pred,
  gather_stateparts,
  invariant_to_finit,
  join_finit,
  get_invariant
  ) where

import Analysis.Context
import Analysis.Propagation
import Data.Binary
import Base
import Config
import Data.ControlFlow
import Data.MachineState
import Data.Pointers 
import Data.SimplePred
import X86.Conventions

import qualified Data.Map as M
import qualified Data.Set as S
import qualified Data.IntMap as IM
import qualified Data.IntSet as IS
import qualified Data.Map.Internal as MI


import Data.Maybe (fromJust)
import Data.List.Extra (firstJust)
import Data.Word
import Data.Either (partitionEithers)
import Control.Monad.State.Strict hiding (join)
import Control.Monad.Extra (anyM,whenM,mapMaybeM)
import Data.List hiding (transpose)
import Data.Maybe (mapMaybe)
import Debug.Trace
import X86.Register (Register(..))
import X86.Opcode (Opcode(..), isCondJump, isJump)
import X86.Prefix (Prefix(LOCK))
import qualified X86.Instruction as X86
import qualified X86.Operand as X86
import Typeclasses.HasSize (sizeof)
import Typeclasses.HasAddress (addressof)
import Generic.Operand (GenericOperand(..))
import Generic.Address (GenericAddress(..),AddressWord64(AddressWord64))
import Generic.Instruction (GenericInstruction(Instruction))
import qualified Generic.Instruction as Instr

-- | Forward transposition
-- If the current invariant states:
-- 		@r == r0 - i@
-- 		@x == r0@
-- 
-- In words, register r contains its initial value r0 minus some immediate i.
-- If a function is called, then a new r0 is introduced, r0', which models the initial value of r for that function.
-- In any expression we replace an occurence of r0 with @r0' + i@.
--
-- The new function initialisation thus becomes:
--    @r == r0'@
--    @x == r0' + i@
fw_transposition :: FContext -> StatePart -> (StatePart,SimpleExpr) -> Maybe SimpleExpr
fw_transposition :: FContext
-> StatePart -> (StatePart, SimpleExpr) -> Maybe SimpleExpr
fw_transposition FContext
ctxt (SP_Reg Register
r) (SP_Reg Register
r1, SE_Op (Minus Int
wsize) [SE_Var (SP_Reg Register
r2), SE_Immediate Word64
i])
  | Register
r Register -> Register -> Bool
forall a. Eq a => a -> a -> Bool
== Register
r1 Bool -> Bool -> Bool
&& Register
r1 Register -> Register -> Bool
forall a. Eq a => a -> a -> Bool
== Register
r2    = SimpleExpr -> Maybe SimpleExpr
forall a. a -> Maybe a
Just (SimpleExpr -> Maybe SimpleExpr) -> SimpleExpr -> Maybe SimpleExpr
forall a b. (a -> b) -> a -> b
$ Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Plus Int
wsize) [StatePart -> SimpleExpr
SE_Var (Register -> StatePart
SP_Reg Register
r), Word64 -> SimpleExpr
SE_Immediate Word64
i]
  | Bool
otherwise              = Maybe SimpleExpr
forall a. Maybe a
Nothing
fw_transposition FContext
_ StatePart
_ (StatePart, SimpleExpr)
_     = Maybe SimpleExpr
forall a. Maybe a
Nothing


transpose_fw_e :: FContext -> M.Map StatePart SimpleExpr -> SimpleExpr -> Maybe SimpleExpr
transpose_fw_e :: FContext
-> Map StatePart SimpleExpr -> SimpleExpr -> Maybe SimpleExpr
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p (Bottom (FromNonDeterminism Set SimpleExpr
es)) = do
  [SimpleExpr]
es' <- (SimpleExpr -> Maybe SimpleExpr)
-> [SimpleExpr] -> Maybe [SimpleExpr]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((SimpleExpr -> SimpleExpr) -> Maybe SimpleExpr -> Maybe SimpleExpr
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap SimpleExpr -> SimpleExpr
simp (Maybe SimpleExpr -> Maybe SimpleExpr)
-> (SimpleExpr -> Maybe SimpleExpr)
-> SimpleExpr
-> Maybe SimpleExpr
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FContext
-> Map StatePart SimpleExpr -> SimpleExpr -> Maybe SimpleExpr
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p) ([SimpleExpr] -> Maybe [SimpleExpr])
-> [SimpleExpr] -> Maybe [SimpleExpr]
forall a b. (a -> b) -> a -> b
$ Set SimpleExpr -> [SimpleExpr]
forall a. Set a -> [a]
S.toList Set SimpleExpr
es
  SimpleExpr -> Maybe SimpleExpr
forall (m :: * -> *) a. Monad m => a -> m a
return (SimpleExpr -> Maybe SimpleExpr) -> SimpleExpr -> Maybe SimpleExpr
forall a b. (a -> b) -> a -> b
$ [Char] -> FContext -> [SimpleExpr] -> SimpleExpr
join_exprs [Char]
"transpose_fw" FContext
ctxt ([SimpleExpr] -> SimpleExpr) -> [SimpleExpr] -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ [SimpleExpr]
es'
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p (Bottom (FromPointerBases Set PointerBase
bs)) = do
  [PointerBase]
bs' <- (PointerBase -> Maybe PointerBase)
-> [PointerBase] -> Maybe [PointerBase]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (FContext
-> Map StatePart SimpleExpr -> PointerBase -> Maybe PointerBase
forall (m :: * -> *) p p a. Monad m => p -> p -> a -> m a
transpose_fw_base FContext
ctxt Map StatePart SimpleExpr
p) ([PointerBase] -> Maybe [PointerBase])
-> [PointerBase] -> Maybe [PointerBase]
forall a b. (a -> b) -> a -> b
$ Set PointerBase -> [PointerBase]
forall a. Set a -> [a]
S.toList Set PointerBase
bs
  SimpleExpr -> Maybe SimpleExpr
forall (m :: * -> *) a. Monad m => a -> m a
return (SimpleExpr -> Maybe SimpleExpr) -> SimpleExpr -> Maybe SimpleExpr
forall a b. (a -> b) -> a -> b
$ BotTyp -> SimpleExpr
Bottom (Set PointerBase -> BotTyp
FromPointerBases (Set PointerBase -> BotTyp) -> Set PointerBase -> BotTyp
forall a b. (a -> b) -> a -> b
$ [PointerBase] -> Set PointerBase
forall a. Ord a => [a] -> Set a
S.fromList [PointerBase]
bs')
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p   (Bottom BotTyp
typ)          = Maybe SimpleExpr
forall a. Maybe a
Nothing -- TODO what if all sources are mallocs?
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p e :: SimpleExpr
e@(SE_Malloc Maybe Word64
_ Maybe [Char]
_)       = SimpleExpr -> Maybe SimpleExpr
forall (m :: * -> *) a. Monad m => a -> m a
return SimpleExpr
e
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p e :: SimpleExpr
e@(SE_Immediate Word64
i)      = SimpleExpr -> Maybe SimpleExpr
forall (m :: * -> *) a. Monad m => a -> m a
return SimpleExpr
e
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p   (SE_Var StatePart
sp)           = FContext
-> Map StatePart SimpleExpr -> StatePart -> Maybe SimpleExpr
transpose_fw_var FContext
ctxt Map StatePart SimpleExpr
p StatePart
sp
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p   (SE_StatePart StatePart
sp)     = Maybe SimpleExpr
forall a. Maybe a
Nothing
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p   (SE_Op Operator
op [SimpleExpr]
es)         = Operator -> [SimpleExpr] -> SimpleExpr
SE_Op Operator
op ([SimpleExpr] -> SimpleExpr)
-> Maybe [SimpleExpr] -> Maybe SimpleExpr
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (SimpleExpr -> Maybe SimpleExpr)
-> [SimpleExpr] -> Maybe [SimpleExpr]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (FContext
-> Map StatePart SimpleExpr -> SimpleExpr -> Maybe SimpleExpr
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p) [SimpleExpr]
es
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p   (SE_Bit Int
i SimpleExpr
e)          = Int -> SimpleExpr -> SimpleExpr
SE_Bit Int
i (SimpleExpr -> SimpleExpr) -> Maybe SimpleExpr -> Maybe SimpleExpr
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FContext
-> Map StatePart SimpleExpr -> SimpleExpr -> Maybe SimpleExpr
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p SimpleExpr
e
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p   (SE_SExtend Int
l Int
h SimpleExpr
e)    = Int -> Int -> SimpleExpr -> SimpleExpr
SE_SExtend Int
l Int
h (SimpleExpr -> SimpleExpr) -> Maybe SimpleExpr -> Maybe SimpleExpr
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FContext
-> Map StatePart SimpleExpr -> SimpleExpr -> Maybe SimpleExpr
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p SimpleExpr
e
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p   (SE_Overwrite Int
i SimpleExpr
a SimpleExpr
b)  = do
  SimpleExpr
a' <- FContext
-> Map StatePart SimpleExpr -> SimpleExpr -> Maybe SimpleExpr
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p SimpleExpr
a
  SimpleExpr
b' <- FContext
-> Map StatePart SimpleExpr -> SimpleExpr -> Maybe SimpleExpr
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p SimpleExpr
b
  SimpleExpr -> Maybe SimpleExpr
forall (m :: * -> *) a. Monad m => a -> m a
return (SimpleExpr -> Maybe SimpleExpr) -> SimpleExpr -> Maybe SimpleExpr
forall a b. (a -> b) -> a -> b
$ Int -> SimpleExpr -> SimpleExpr -> SimpleExpr
SE_Overwrite Int
i SimpleExpr
a' SimpleExpr
b'

transpose_fw_var :: FContext -> M.Map StatePart SimpleExpr -> StatePart -> Maybe SimpleExpr
transpose_fw_var :: FContext
-> Map StatePart SimpleExpr -> StatePart -> Maybe SimpleExpr
transpose_fw_var FContext
ctxt Map StatePart SimpleExpr
p (SP_Mem SimpleExpr
a Int
si) = Maybe SimpleExpr
forall a. Maybe a
Nothing -- TODO
transpose_fw_var FContext
ctxt Map StatePart SimpleExpr
p (SP_Reg Register
r)    = ((StatePart, SimpleExpr) -> Maybe SimpleExpr)
-> [(StatePart, SimpleExpr)] -> Maybe SimpleExpr
forall a b. (a -> Maybe b) -> [a] -> Maybe b
firstJust (FContext
-> StatePart -> (StatePart, SimpleExpr) -> Maybe SimpleExpr
fw_transposition FContext
ctxt (StatePart -> (StatePart, SimpleExpr) -> Maybe SimpleExpr)
-> StatePart -> (StatePart, SimpleExpr) -> Maybe SimpleExpr
forall a b. (a -> b) -> a -> b
$ Register -> StatePart
SP_Reg Register
r) ([(StatePart, SimpleExpr)] -> Maybe SimpleExpr)
-> [(StatePart, SimpleExpr)] -> Maybe SimpleExpr
forall a b. (a -> b) -> a -> b
$ Map StatePart SimpleExpr -> [(StatePart, SimpleExpr)]
forall k a. Map k a -> [(k, a)]
M.toList Map StatePart SimpleExpr
p

transpose_fw_sp :: FContext
-> Map StatePart SimpleExpr -> StatePart -> Maybe StatePart
transpose_fw_sp FContext
ctxt Map StatePart SimpleExpr
p sp :: StatePart
sp@(SP_Reg Register
r) = StatePart -> Maybe StatePart
forall a. a -> Maybe a
Just StatePart
sp
transpose_fw_sp FContext
ctxt Map StatePart SimpleExpr
p (SP_Mem SimpleExpr
a Int
si) = do
  SimpleExpr
a' <- FContext
-> Map StatePart SimpleExpr -> SimpleExpr -> Maybe SimpleExpr
transpose_fw_e FContext
ctxt Map StatePart SimpleExpr
p SimpleExpr
a
  StatePart -> Maybe StatePart
forall (m :: * -> *) a. Monad m => a -> m a
return (StatePart -> Maybe StatePart) -> StatePart -> Maybe StatePart
forall a b. (a -> b) -> a -> b
$ SimpleExpr -> Int -> StatePart
SP_Mem (SimpleExpr -> SimpleExpr
simp SimpleExpr
a') Int
si


transpose_fw_base :: p -> p -> a -> m a
transpose_fw_base p
ctxt p
p a
bs          = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return a
bs -- NOTE: no need for backward transposition here




-- | Convert the current invariant into a function initialisation
invariant_to_finit :: FContext -> Pred -> FInit
invariant_to_finit :: FContext -> Pred -> Map StatePart SimpleExpr
invariant_to_finit FContext
ctxt (Predicate Map StatePart SimpleExpr
eqs FlagStatus
_) = [(StatePart, SimpleExpr)] -> Map StatePart SimpleExpr
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList ([(StatePart, SimpleExpr)] -> Map StatePart SimpleExpr)
-> [(StatePart, SimpleExpr)] -> Map StatePart SimpleExpr
forall a b. (a -> b) -> a -> b
$ ((StatePart, SimpleExpr) -> Maybe (StatePart, SimpleExpr))
-> [(StatePart, SimpleExpr)] -> [(StatePart, SimpleExpr)]
forall a b. (a -> Maybe b) -> [a] -> [b]
mapMaybe (StatePart, SimpleExpr) -> Maybe (StatePart, SimpleExpr)
forall a. (a, SimpleExpr) -> Maybe (a, SimpleExpr)
mk_finit_entry ([(StatePart, SimpleExpr)] -> [(StatePart, SimpleExpr)])
-> [(StatePart, SimpleExpr)] -> [(StatePart, SimpleExpr)]
forall a b. (a -> b) -> a -> b
$ ((StatePart, SimpleExpr) -> Bool)
-> [(StatePart, SimpleExpr)] -> [(StatePart, SimpleExpr)]
forall a. (a -> Bool) -> [a] -> [a]
filter (StatePart, SimpleExpr) -> Bool
forall b. (StatePart, b) -> Bool
is_suitable_for_finit ([(StatePart, SimpleExpr)] -> [(StatePart, SimpleExpr)])
-> [(StatePart, SimpleExpr)] -> [(StatePart, SimpleExpr)]
forall a b. (a -> b) -> a -> b
$ Map StatePart SimpleExpr -> [(StatePart, SimpleExpr)]
forall k a. Map k a -> [(k, a)]
M.assocs Map StatePart SimpleExpr
eqs
 where
  is_suitable_for_finit :: (StatePart, b) -> Bool
is_suitable_for_finit (SP_Reg Register
r,b
_)    = Register
r Register -> [Register] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` [Register
RIP,Register
RSP,Register
RBP]
  is_suitable_for_finit (SP_Mem SimpleExpr
a Int
si,b
_) = SimpleExpr -> Bool
is_immediate SimpleExpr
a

  mk_finit_entry :: (a, SimpleExpr) -> Maybe (a, SimpleExpr)
mk_finit_entry (a
sp,SimpleExpr
v) =
    if SimpleExpr -> Bool
is_immediate_pointer SimpleExpr
v then
      (a, SimpleExpr) -> Maybe (a, SimpleExpr)
forall a. a -> Maybe a
Just (a
sp,SimpleExpr
v)
    else case FContext -> SimpleExpr -> PointerDomain
get_pointer_domain FContext
ctxt SimpleExpr
v of
      (Domain_Bases Set PointerBase
bs) -> (a, SimpleExpr) -> Maybe (a, SimpleExpr)
forall a. a -> Maybe a
Just (a
sp,BotTyp -> SimpleExpr
Bottom (BotTyp -> SimpleExpr) -> BotTyp -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ Set PointerBase -> BotTyp
FromPointerBases Set PointerBase
bs)  -- NOTE: no need for forward tranposition here
      PointerDomain
_                 -> Maybe (a, SimpleExpr)
forall a. Maybe a
Nothing

  is_immediate_pointer :: SimpleExpr -> Bool
is_immediate_pointer (SE_Immediate Word64
a) = Context -> Word64 -> Maybe ([Char], [Char], Word64, Word64)
find_section_for_address (FContext -> Context
f_ctxt FContext
ctxt) (Word64 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
a) Maybe ([Char], [Char], Word64, Word64)
-> Maybe ([Char], [Char], Word64, Word64) -> Bool
forall a. Eq a => a -> a -> Bool
/= Maybe ([Char], [Char], Word64, Word64)
forall a. Maybe a
Nothing
  is_immediate_pointer SimpleExpr
_                = Bool
False -- What if non-determinism?


-- | The join between two function initialisations
join_finit :: FContext -> FInit -> FInit -> FInit
join_finit :: FContext
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
join_finit FContext
ctxt Map StatePart SimpleExpr
f0 Map StatePart SimpleExpr
f1 = (SimpleExpr -> Bool)
-> Map StatePart SimpleExpr -> Map StatePart SimpleExpr
forall a k. (a -> Bool) -> Map k a -> Map k a
M.filter SimpleExpr -> Bool
keep (Map StatePart SimpleExpr -> Map StatePart SimpleExpr)
-> Map StatePart SimpleExpr -> Map StatePart SimpleExpr
forall a b. (a -> b) -> a -> b
$ (SimpleExpr -> SimpleExpr -> SimpleExpr)
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
forall k a b c.
Ord k =>
(a -> b -> c) -> Map k a -> Map k b -> Map k c
M.intersectionWith ([Char] -> FContext -> SimpleExpr -> SimpleExpr -> SimpleExpr
join_expr [Char]
"finit" FContext
ctxt) Map StatePart SimpleExpr
f0 Map StatePart SimpleExpr
f1
 where
  keep :: SimpleExpr -> Bool
keep (Bottom (FromPointerBases Set PointerBase
_)) = Bool
True
  keep (Bottom BotTyp
_)                    = Bool
False
  keep SimpleExpr
_                             = Bool
True






-- | Backward transposition
-- Let p be the current predicate and let trhe equality sp == v be from the predicate after execution of an internal function.
-- For example, p contains:
--   RSP == RSP0 - 64
--   RSI == 10
--
-- And after execution of the function, we have:
--   *[RSP0+16,8] == RSI0
--
-- Transposing this equality produces:
--   *[RSP0-40,8] == 10
transpose_bw :: FContext -> String -> Word64 -> Pred -> (StatePart, SimpleExpr) -> Either VerificationCondition (StatePart, SimpleExpr)
transpose_bw :: FContext
-> [Char]
-> Word64
-> Pred
-> (StatePart, SimpleExpr)
-> Either VerificationCondition (StatePart, SimpleExpr)
transpose_bw FContext
ctxt [Char]
f Word64
a Pred
p (StatePart
sp,SimpleExpr
v) =
  let sp' :: StatePart
sp' = FContext -> Pred -> StatePart -> StatePart
transpose_bw_sp FContext
ctxt Pred
p StatePart
sp
      v' :: SimpleExpr
v'  = FContext -> SimpleExpr -> SimpleExpr
trim_expr FContext
ctxt (SimpleExpr -> SimpleExpr) -> SimpleExpr -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ SimpleExpr -> SimpleExpr
simp (SimpleExpr -> SimpleExpr) -> SimpleExpr -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ FContext -> Pred -> SimpleExpr -> SimpleExpr
transpose_bw_e FContext
ctxt Pred
p SimpleExpr
v in
    if StatePart -> Bool
is_invalid StatePart
sp' then
      VerificationCondition
-> Either VerificationCondition (StatePart, SimpleExpr)
forall a b. a -> Either a b
Left (VerificationCondition
 -> Either VerificationCondition (StatePart, SimpleExpr))
-> VerificationCondition
-> Either VerificationCondition (StatePart, SimpleExpr)
forall a b. (a -> b) -> a -> b
$ MemWriteIdentifier -> VerificationCondition
SourcelessMemWrite (MemWriteIdentifier -> VerificationCondition)
-> MemWriteIdentifier -> VerificationCondition
forall a b. (a -> b) -> a -> b
$ [Char] -> Word64 -> StatePart -> MemWriteIdentifier
MemWriteFunction [Char]
f Word64
a StatePart
sp
    else
      (StatePart, SimpleExpr)
-> Either VerificationCondition (StatePart, SimpleExpr)
forall a b. b -> Either a b
Right (StatePart
sp',SimpleExpr
v')
 where
  is_invalid :: StatePart -> Bool
is_invalid (SP_Reg Register
_)   = Bool
False
  is_invalid (SP_Mem SimpleExpr
a Int
_) = FContext -> SimpleExpr -> Bool
invalid_bottom_pointer FContext
ctxt SimpleExpr
a



transpose_bw_e :: FContext -> Pred -> SimpleExpr -> SimpleExpr
transpose_bw_e :: FContext -> Pred -> SimpleExpr -> SimpleExpr
transpose_bw_e FContext
ctxt Pred
p (Bottom (FromNonDeterminism Set SimpleExpr
es)) = [Char] -> FContext -> [SimpleExpr] -> SimpleExpr
join_exprs ([Char]
"transpose_bw") FContext
ctxt ([SimpleExpr] -> SimpleExpr) -> [SimpleExpr] -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ (SimpleExpr -> SimpleExpr) -> [SimpleExpr] -> [SimpleExpr]
forall a b. (a -> b) -> [a] -> [b]
map (FContext -> Pred -> SimpleExpr -> SimpleExpr
transpose_bw_e FContext
ctxt Pred
p) ([SimpleExpr] -> [SimpleExpr]) -> [SimpleExpr] -> [SimpleExpr]
forall a b. (a -> b) -> a -> b
$ Set SimpleExpr -> [SimpleExpr]
forall a. Set a -> [a]
S.toList Set SimpleExpr
es
transpose_bw_e FContext
ctxt Pred
p (Bottom (FromPointerBases Set PointerBase
bs))   = BotTyp -> SimpleExpr
Bottom (Set PointerBase -> BotTyp
FromPointerBases (Set PointerBase -> BotTyp) -> Set PointerBase -> BotTyp
forall a b. (a -> b) -> a -> b
$ (PointerBase -> PointerBase) -> Set PointerBase -> Set PointerBase
forall b a. Ord b => (a -> b) -> Set a -> Set b
S.map (FContext -> Pred -> PointerBase -> PointerBase
forall p p. p -> p -> PointerBase -> PointerBase
transpose_bw_base FContext
ctxt Pred
p) Set PointerBase
bs)
transpose_bw_e FContext
ctxt Pred
p (Bottom BotTyp
typ)                     = BotTyp -> SimpleExpr
Bottom (BotTyp -> SimpleExpr) -> BotTyp -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ FContext -> Pred -> BotTyp -> BotTyp
transpose_bw_bottyp FContext
ctxt Pred
p BotTyp
typ
transpose_bw_e FContext
ctxt Pred
p (SE_Malloc Maybe Word64
id Maybe [Char]
hash)              = Maybe Word64 -> Maybe [Char] -> SimpleExpr
SE_Malloc Maybe Word64
id Maybe [Char]
hash
transpose_bw_e FContext
ctxt Pred
p (SE_Immediate Word64
i)                 = Word64 -> SimpleExpr
SE_Immediate Word64
i
transpose_bw_e FContext
ctxt Pred
p (SE_StatePart StatePart
sp)                = BotTyp -> SimpleExpr
Bottom (BotTyp -> SimpleExpr) -> BotTyp -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ Set BotSrc -> BotTyp
FromSemantics Set BotSrc
forall a. Set a
S.empty
transpose_bw_e FContext
ctxt Pred
p (SE_Var (SP_StackPointer [Char]
f))     = StatePart -> SimpleExpr
SE_Var ([Char] -> StatePart
SP_StackPointer [Char]
f)
transpose_bw_e FContext
ctxt Pred
p (SE_Var StatePart
sp)                      = State (Pred, VCS) SimpleExpr -> (Pred, VCS) -> SimpleExpr
forall s a. State s a -> s -> a
evalState (FContext -> StatePart -> State (Pred, VCS) SimpleExpr
read_sp FContext
ctxt (StatePart -> State (Pred, VCS) SimpleExpr)
-> StatePart -> State (Pred, VCS) SimpleExpr
forall a b. (a -> b) -> a -> b
$ FContext -> Pred -> StatePart -> StatePart
transpose_bw_sp FContext
ctxt Pred
p StatePart
sp) (Pred
p,VCS
forall a. Set a
S.empty)
transpose_bw_e FContext
ctxt Pred
p (SE_Bit Int
i SimpleExpr
e)                     = Int -> SimpleExpr -> SimpleExpr
SE_Bit Int
i (SimpleExpr -> SimpleExpr) -> SimpleExpr -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ FContext -> Pred -> SimpleExpr -> SimpleExpr
transpose_bw_e FContext
ctxt Pred
p SimpleExpr
e
transpose_bw_e FContext
ctxt Pred
p (SE_SExtend Int
l Int
h SimpleExpr
e)               = Int -> Int -> SimpleExpr -> SimpleExpr
SE_SExtend Int
l Int
h (SimpleExpr -> SimpleExpr) -> SimpleExpr -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ FContext -> Pred -> SimpleExpr -> SimpleExpr
transpose_bw_e FContext
ctxt Pred
p SimpleExpr
e
transpose_bw_e FContext
ctxt Pred
p (SE_Op Operator
op [SimpleExpr]
es)                    = Operator -> [SimpleExpr] -> SimpleExpr
SE_Op Operator
op ([SimpleExpr] -> SimpleExpr) -> [SimpleExpr] -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ (SimpleExpr -> SimpleExpr) -> [SimpleExpr] -> [SimpleExpr]
forall a b. (a -> b) -> [a] -> [b]
map (FContext -> Pred -> SimpleExpr -> SimpleExpr
transpose_bw_e FContext
ctxt Pred
p) [SimpleExpr]
es
transpose_bw_e FContext
ctxt Pred
p (SE_Overwrite Int
i SimpleExpr
a SimpleExpr
b)             = Int -> SimpleExpr -> SimpleExpr -> SimpleExpr
SE_Overwrite Int
i (FContext -> Pred -> SimpleExpr -> SimpleExpr
transpose_bw_e FContext
ctxt Pred
p SimpleExpr
a) (FContext -> Pred -> SimpleExpr -> SimpleExpr
transpose_bw_e FContext
ctxt Pred
p SimpleExpr
b)

transpose_bw_sp :: FContext -> Pred -> StatePart -> StatePart
transpose_bw_sp FContext
ctxt Pred
p sp :: StatePart
sp@(SP_Reg Register
r)          = StatePart
sp
transpose_bw_sp FContext
ctxt Pred
p sp :: StatePart
sp@(SP_StackPointer [Char]
_) = StatePart
sp
transpose_bw_sp FContext
ctxt Pred
p sp :: StatePart
sp@(SP_Mem SimpleExpr
a Int
si)       = SimpleExpr -> Int -> StatePart
SP_Mem (FContext -> SimpleExpr -> SimpleExpr
trim_expr FContext
ctxt (SimpleExpr -> SimpleExpr) -> SimpleExpr -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ SimpleExpr -> SimpleExpr
simp (SimpleExpr -> SimpleExpr) -> SimpleExpr -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ FContext -> Pred -> SimpleExpr -> SimpleExpr
transpose_bw_e FContext
ctxt Pred
p SimpleExpr
a) Int
si

transpose_bw_bottyp :: FContext -> Pred -> BotTyp -> BotTyp
transpose_bw_bottyp FContext
ctxt Pred
p (FromSources Set BotSrc
srcs)             = Set BotSrc -> BotTyp
FromSources (Set BotSrc -> BotTyp) -> Set BotSrc -> BotTyp
forall a b. (a -> b) -> a -> b
$ Set (Set BotSrc) -> Set BotSrc
forall (f :: * -> *) a. (Foldable f, Ord a) => f (Set a) -> Set a
S.unions (Set (Set BotSrc) -> Set BotSrc) -> Set (Set BotSrc) -> Set BotSrc
forall a b. (a -> b) -> a -> b
$ (BotSrc -> Set BotSrc) -> Set BotSrc -> Set (Set BotSrc)
forall b a. Ord b => (a -> b) -> Set a -> Set b
S.map (FContext -> Pred -> BotSrc -> Set BotSrc
transpose_bw_src FContext
ctxt Pred
p) Set BotSrc
srcs
transpose_bw_bottyp FContext
ctxt Pred
p (FromOverlap Set BotSrc
srcs)             = Set BotSrc -> BotTyp
FromSources (Set BotSrc -> BotTyp) -> Set BotSrc -> BotTyp
forall a b. (a -> b) -> a -> b
$ Set (Set BotSrc) -> Set BotSrc
forall (f :: * -> *) a. (Foldable f, Ord a) => f (Set a) -> Set a
S.unions (Set (Set BotSrc) -> Set BotSrc) -> Set (Set BotSrc) -> Set BotSrc
forall a b. (a -> b) -> a -> b
$ (BotSrc -> Set BotSrc) -> Set BotSrc -> Set (Set BotSrc)
forall b a. Ord b => (a -> b) -> Set a -> Set b
S.map (FContext -> Pred -> BotSrc -> Set BotSrc
transpose_bw_src FContext
ctxt Pred
p) Set BotSrc
srcs
transpose_bw_bottyp FContext
ctxt Pred
p (FromMemWrite Set BotSrc
srcs)            = Set BotSrc -> BotTyp
FromSources (Set BotSrc -> BotTyp) -> Set BotSrc -> BotTyp
forall a b. (a -> b) -> a -> b
$ Set (Set BotSrc) -> Set BotSrc
forall (f :: * -> *) a. (Foldable f, Ord a) => f (Set a) -> Set a
S.unions (Set (Set BotSrc) -> Set BotSrc) -> Set (Set BotSrc) -> Set BotSrc
forall a b. (a -> b) -> a -> b
$ (BotSrc -> Set BotSrc) -> Set BotSrc -> Set (Set BotSrc)
forall b a. Ord b => (a -> b) -> Set a -> Set b
S.map (FContext -> Pred -> BotSrc -> Set BotSrc
transpose_bw_src FContext
ctxt Pred
p) Set BotSrc
srcs
transpose_bw_bottyp FContext
ctxt Pred
p (FromSemantics Set BotSrc
srcs)           = Set BotSrc -> BotTyp
FromSources (Set BotSrc -> BotTyp) -> Set BotSrc -> BotTyp
forall a b. (a -> b) -> a -> b
$ Set (Set BotSrc) -> Set BotSrc
forall (f :: * -> *) a. (Foldable f, Ord a) => f (Set a) -> Set a
S.unions (Set (Set BotSrc) -> Set BotSrc) -> Set (Set BotSrc) -> Set BotSrc
forall a b. (a -> b) -> a -> b
$ (BotSrc -> Set BotSrc) -> Set BotSrc -> Set (Set BotSrc)
forall b a. Ord b => (a -> b) -> Set a -> Set b
S.map (FContext -> Pred -> BotSrc -> Set BotSrc
transpose_bw_src FContext
ctxt Pred
p) Set BotSrc
srcs
transpose_bw_bottyp FContext
ctxt Pred
p (FromBitMode Set BotSrc
srcs)             = Set BotSrc -> BotTyp
FromSources (Set BotSrc -> BotTyp) -> Set BotSrc -> BotTyp
forall a b. (a -> b) -> a -> b
$ Set (Set BotSrc) -> Set BotSrc
forall (f :: * -> *) a. (Foldable f, Ord a) => f (Set a) -> Set a
S.unions (Set (Set BotSrc) -> Set BotSrc) -> Set (Set BotSrc) -> Set BotSrc
forall a b. (a -> b) -> a -> b
$ (BotSrc -> Set BotSrc) -> Set BotSrc -> Set (Set BotSrc)
forall b a. Ord b => (a -> b) -> Set a -> Set b
S.map (FContext -> Pred -> BotSrc -> Set BotSrc
transpose_bw_src FContext
ctxt Pred
p) Set BotSrc
srcs
transpose_bw_bottyp FContext
ctxt Pred
p (FromUninitializedMemory Set BotSrc
srcs) = Set BotSrc -> BotTyp
FromSources (Set BotSrc -> BotTyp) -> Set BotSrc -> BotTyp
forall a b. (a -> b) -> a -> b
$ Set (Set BotSrc) -> Set BotSrc
forall (f :: * -> *) a. (Foldable f, Ord a) => f (Set a) -> Set a
S.unions (Set (Set BotSrc) -> Set BotSrc) -> Set (Set BotSrc) -> Set BotSrc
forall a b. (a -> b) -> a -> b
$ (BotSrc -> Set BotSrc) -> Set BotSrc -> Set (Set BotSrc)
forall b a. Ord b => (a -> b) -> Set a -> Set b
S.map (FContext -> Pred -> BotSrc -> Set BotSrc
transpose_bw_src FContext
ctxt Pred
p) Set BotSrc
srcs
transpose_bw_bottyp FContext
ctxt Pred
p (FromCall [Char]
f)                   = [Char] -> BotTyp
FromCall [Char]
f

transpose_bw_src :: FContext -> Pred -> BotSrc -> Set BotSrc
transpose_bw_src FContext
ctxt Pred
p src :: BotSrc
src@(Src_Var StatePart
sp)             = FContext -> SimpleExpr -> Set BotSrc
srcs_of_expr FContext
ctxt (SimpleExpr -> Set BotSrc) -> SimpleExpr -> Set BotSrc
forall a b. (a -> b) -> a -> b
$ FContext -> Pred -> SimpleExpr -> SimpleExpr
transpose_bw_e FContext
ctxt Pred
p (StatePart -> SimpleExpr
SE_Var StatePart
sp)
transpose_bw_src FContext
ctxt Pred
p src :: BotSrc
src@(Src_StackPointer [Char]
f)     = BotSrc -> Set BotSrc
forall a. a -> Set a
S.singleton BotSrc
src
transpose_bw_src FContext
ctxt Pred
p src :: BotSrc
src@(Src_Malloc Maybe Word64
id Maybe [Char]
h)        = BotSrc -> Set BotSrc
forall a. a -> Set a
S.singleton BotSrc
src
transpose_bw_src FContext
ctxt Pred
p src :: BotSrc
src@(Src_Function [Char]
f)         = BotSrc -> Set BotSrc
forall a. a -> Set a
S.singleton BotSrc
src
transpose_bw_src FContext
ctxt Pred
p src :: BotSrc
src@(Src_ImmediateAddress Word64
a) = BotSrc -> Set BotSrc
forall a. a -> Set a
S.singleton BotSrc
src


transpose_bw_base :: p -> p -> PointerBase -> PointerBase
transpose_bw_base p
ctxt p
p b :: PointerBase
b@(StackPointer [Char]
f)      = PointerBase
b
transpose_bw_base p
ctxt p
p b :: PointerBase
b@(GlobalAddress Word64
_)     = PointerBase
b
transpose_bw_base p
ctxt p
p b :: PointerBase
b@(PointerToSymbol Word64
_ [Char]
_) = PointerBase
b
transpose_bw_base p
ctxt p
p b :: PointerBase
b@(Malloc Maybe Word64
_ Maybe [Char]
_)          = PointerBase
b







-- | a list of some function that return a heap-pointer through RAX.
-- The pointer is assumed to  be fresh.
functions_returning_fresh_pointers :: [[Char]]
functions_returning_fresh_pointers = [
     [Char]
"_malloc", [Char]
"malloc", [Char]
"_malloc_create_zone", [Char]
"_malloc_default_zone", [Char]
"_malloc_zone_malloc", [Char]
"_calloc", [Char]
"calloc", [Char]
"_malloc_zone_calloc", [Char]
"_mmap", [Char]
"_av_mallocz",
     [Char]
"strdup", [Char]
"_strdup", [Char]
"___error", [Char]
"_fts_read$INODE64", [Char]
"_fts_open$INODE64", [Char]
"_opendir$INODE64", [Char]
"fopen", [Char]
"_fopen", [Char]
"_getenv", [Char]
"_open",
     [Char]
"_localeconv", [Char]
"localeconv", [Char]
"_setlocale", [Char]
"_wsetlocale", [Char]
"_fgetln", [Char]
"fgetln",
     [Char]
"strerror", [Char]
"_strerror", [Char]
"_wcserror", [Char]
"__wcserror",
     [Char]
"_EVP_CIPHER_CTX_new"
   ]

-- | A list of some functions that are assumed not to change the state in any significant way, and that return an unknown bottom value through RAX
functions_returning_bottom :: [[Char]]
functions_returning_bottom = [
     [Char]
"feof", [Char]
"_feof", [Char]
"_getc", [Char]
"getc", [Char]
"fgetc", [Char]
"_fgetc", [Char]
"_fgetwc", [Char]
"fgetwc", [Char]
"_fnmatch", [Char]
"_fputc",
     [Char]
"_close", [Char]
"_fstat$INODE64", [Char]
"_fstatfs$INODE64", [Char]
"_statfs$INODE64", [Char]
"___maskrune", [Char]
"_sysctlbyname", [Char]
"_getbsize",
     [Char]
"_printf", [Char]
"printf", [Char]
"_fprintf", [Char]
"fprintf", [Char]
"_fprintf_l", [Char]
"fwprintf", [Char]
"_fwprintf_l", [Char]
"_vsnprintf",
     [Char]
"_putchar", [Char]
"_puts",
     [Char]
"_btowc", [Char]
"btowc", [Char]
"mbtowc", [Char]
"_mbtowc", [Char]
"_mbrtowc", [Char]
"mbrtowc", [Char]
"_atof", [Char]
"atof",
     [Char]
"_strcmp", [Char]
"strcmp", [Char]
"_strlen",
     [Char]
"_ilogb", [Char]
"_atoi",
     [Char]
"_getopt", [Char]
"_free",
     [Char]
"_warn", [Char]
"_warnx", [Char]
"__errno_location"
   ]



-- | Executes semantics for some external functions.
-- Returns true iff the string corresponds to a known external function, and the semantics were applied.
function_semantics :: FContext -> X86.Instruction -> String -> State (Pred,VCS) Bool
function_semantics :: FContext -> Instruction -> [Char] -> State (Pred, VCS) Bool
function_semantics FContext
ctxt Instruction
i [Char]
"_realloc"             = FContext -> Instruction -> [Char] -> State (Pred, VCS) Bool
function_semantics FContext
ctxt Instruction
i [Char]
"realloc"
function_semantics FContext
ctxt Instruction
i [Char]
"_malloc_zone_realloc" = FContext -> Instruction -> [Char] -> State (Pred, VCS) Bool
function_semantics FContext
ctxt Instruction
i [Char]
"realloc"
function_semantics FContext
ctxt Instruction
i [Char]
"realloc"              = FContext -> Register -> State (Pred, VCS) SimpleExpr
read_reg FContext
ctxt Register
RDI State (Pred, VCS) SimpleExpr
-> (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FContext
-> Word64
-> Register
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_reg FContext
ctxt (Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i) Register
RAX StateT (Pred, VCS) Identity ()
-> State (Pred, VCS) Bool -> State (Pred, VCS) Bool
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Bool -> State (Pred, VCS) Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
True
function_semantics FContext
ctxt Instruction
i [Char]
"_recallocarray"       = FContext -> Register -> State (Pred, VCS) SimpleExpr
read_reg FContext
ctxt Register
RDI State (Pred, VCS) SimpleExpr
-> (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FContext
-> Word64
-> Register
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_reg FContext
ctxt (Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i) Register
RAX StateT (Pred, VCS) Identity ()
-> State (Pred, VCS) Bool -> State (Pred, VCS) Bool
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Bool -> State (Pred, VCS) Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
True
function_semantics FContext
ctxt Instruction
i [Char]
"_strcpy"              = FContext -> Instruction -> [Char] -> State (Pred, VCS) Bool
function_semantics FContext
ctxt Instruction
i [Char]
"strcpy"
function_semantics FContext
ctxt Instruction
i [Char]
"strcpy"               = FContext -> Register -> State (Pred, VCS) SimpleExpr
read_reg FContext
ctxt Register
RDI State (Pred, VCS) SimpleExpr
-> (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FContext
-> Word64
-> Register
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_reg FContext
ctxt (Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i) Register
RAX StateT (Pred, VCS) Identity ()
-> State (Pred, VCS) Bool -> State (Pred, VCS) Bool
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Bool -> State (Pred, VCS) Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
True
function_semantics FContext
ctxt Instruction
i [Char]
"_strrchr"             = FContext -> Instruction -> [Char] -> State (Pred, VCS) Bool
function_semantics FContext
ctxt Instruction
i [Char]
"strrchr"
function_semantics FContext
ctxt Instruction
i [Char]
"strrchr"              = FContext -> Register -> State (Pred, VCS) SimpleExpr
read_reg FContext
ctxt Register
RDI State (Pred, VCS) SimpleExpr
-> (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\SimpleExpr
rdi -> FContext
-> Word64
-> Register
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_reg FContext
ctxt (Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i) Register
RAX (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Plus Int
64) [SimpleExpr
rdi,SimpleExpr
rock_bottom]) StateT (Pred, VCS) Identity ()
-> State (Pred, VCS) Bool -> State (Pred, VCS) Bool
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Bool -> State (Pred, VCS) Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
True
function_semantics FContext
ctxt Instruction
i [Char]
f                      =
  if [Char]
f [Char] -> [[Char]] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [[Char]]
functions_returning_bottom then do  -- and exiting function calls?
    FContext
-> Word64
-> Register
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_reg FContext
ctxt (Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i) Register
RAX (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ BotTyp -> SimpleExpr
Bottom (BotTyp -> SimpleExpr) -> BotTyp -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ [Char] -> BotTyp
FromCall [Char]
f -- TODO overwrite volatile regs as well?
    Bool -> State (Pred, VCS) Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
True
  else if [Char]
f [Char] -> [[Char]] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [[Char]]
functions_returning_fresh_pointers then do
    FContext
-> Word64
-> Register
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_reg FContext
ctxt (Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i) Register
RAX (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ Maybe Word64 -> Maybe [Char] -> SimpleExpr
SE_Malloc (Word64 -> Maybe Word64
forall a. a -> Maybe a
Just (Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i)) ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"")
    Bool -> State (Pred, VCS) Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
True
  else
    Bool -> State (Pred, VCS) Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
False




-- | Add a function constraint to the given symbolic predicate
add_function_constraint :: [Char]
-> Word64
-> [(Register, SimpleExpr)]
-> Set StatePart
-> (a, VCS)
-> (a, VCS)
add_function_constraint [Char]
f Word64
a [(Register, SimpleExpr)]
ps Set StatePart
sps (a
p,VCS
vcs) = (a
p,VerificationCondition -> VCS -> VCS
forall a. Ord a => a -> Set a -> Set a
S.insert ([Char]
-> Word64
-> [(Register, SimpleExpr)]
-> Set StatePart
-> VerificationCondition
FunctionConstraint [Char]
f Word64
a [(Register, SimpleExpr)]
ps Set StatePart
sps) VCS
vcs)

-- | Add a function_pointer_intro to the given symbolic predicate
add_function_pointers :: Word64 -> IntSet -> (a, VCS) -> (a, VCS)
add_function_pointers Word64
a IntSet
ptrs (a
p,VCS
vcs) =
  if Bool -> Bool
not (Bool -> Bool) -> Bool -> Bool
forall a b. (a -> b) -> a -> b
$ IntSet -> Bool
IS.null IntSet
ptrs then
    let (VCS
match,VCS
remainder) = (VerificationCondition -> Bool) -> VCS -> (VCS, VCS)
forall a. (a -> Bool) -> Set a -> (Set a, Set a)
S.partition VerificationCondition -> Bool
belongs_to_a VCS
vcs in
      case VCS -> [VerificationCondition]
forall a. Set a -> [a]
S.toList VCS
match of
        []                         -> (a
p,VerificationCondition -> VCS -> VCS
forall a. Ord a => a -> Set a -> Set a
S.insert (Word64 -> IntSet -> VerificationCondition
FunctionPointers Word64
a IntSet
ptrs) VCS
remainder)
        [FunctionPointers Word64
_ IntSet
ptrs'] -> (a
p,VerificationCondition -> VCS -> VCS
forall a. Ord a => a -> Set a -> Set a
S.insert (Word64 -> IntSet -> VerificationCondition
FunctionPointers Word64
a (IntSet -> VerificationCondition)
-> IntSet -> VerificationCondition
forall a b. (a -> b) -> a -> b
$ IntSet -> IntSet -> IntSet
IS.union IntSet
ptrs IntSet
ptrs') VCS
remainder)
  else
    (a
p,VCS
vcs)
 where
  belongs_to_a :: VerificationCondition -> Bool
belongs_to_a (FunctionPointers Word64
a' IntSet
_) = Word64
a Word64 -> Word64 -> Bool
forall a. Eq a => a -> a -> Bool
== Word64
a'
  belongs_to_a VerificationCondition
_                       = Bool
False




get_symbolic_function_pointers :: FContext -> SimpleExpr -> IntSet
get_symbolic_function_pointers FContext
ctxt (Bottom (FromNonDeterminism Set SimpleExpr
es)) = Set IntSet -> IntSet
forall (f :: * -> *). Foldable f => f IntSet -> IntSet
IS.unions (Set IntSet -> IntSet) -> Set IntSet -> IntSet
forall a b. (a -> b) -> a -> b
$ (SimpleExpr -> IntSet) -> Set SimpleExpr -> Set IntSet
forall b a. Ord b => (a -> b) -> Set a -> Set b
S.map (FContext -> SimpleExpr -> IntSet
get_symbolic_function_pointers FContext
ctxt) Set SimpleExpr
es
get_symbolic_function_pointers FContext
ctxt (SE_Immediate Word64
a)                 = if Context -> Word64 -> Bool
forall a. Integral a => Context -> a -> Bool
address_has_instruction (FContext -> Context
f_ctxt FContext
ctxt) Word64
a then Int -> IntSet
IS.singleton (Int -> IntSet) -> Int -> IntSet
forall a b. (a -> b) -> a -> b
$ Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
a else IntSet
IS.empty
get_symbolic_function_pointers FContext
ctxt SimpleExpr
_                                = IntSet
IS.empty



evalState_discard :: State s a -> State s a
evalState_discard :: State s a -> State s a
evalState_discard State s a
ma = do
  s
s <- StateT s Identity s
forall s (m :: * -> *). MonadState s m => m s
get
  a -> State s a
forall (m :: * -> *) a. Monad m => a -> m a
return (a -> State s a) -> a -> State s a
forall a b. (a -> b) -> a -> b
$ State s a -> s -> a
forall s a. State s a -> s -> a
evalState State s a
ma s
s

-- | Symbolically execute a function call
call :: FContext -> X86.Instruction -> State (Pred,VCS) ()
call :: FContext -> Instruction -> StateT (Pred, VCS) Identity ()
call FContext
ctxt Instruction
i = do
  let f :: [Char]
f  = FContext -> [Char]
f_name FContext
ctxt
  let f' :: [Char]
f' = Context -> Instruction -> [Char]
function_name_of_instruction (FContext -> Context
f_ctxt FContext
ctxt) Instruction
i
  let i_a :: Word64
i_a = Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i
  Bool
known <- FContext -> Instruction -> [Char] -> State (Pred, VCS) Bool
function_semantics FContext
ctxt Instruction
i ([Char] -> State (Pred, VCS) Bool)
-> [Char] -> State (Pred, VCS) Bool
forall a b. (a -> b) -> a -> b
$ [Char] -> [Char] -> [Char]
takeUntilString [Char]
"@GLIBC" [Char]
f'

  Bool
-> StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Bool -> Bool
not Bool
known) (StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ())
-> StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ do
    FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
sub FContext
ctxt Word64
i_a (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RSP) (Word64 -> Operand
forall storage. Word64 -> GenericOperand storage
Immediate Word64
8)
    (p :: Pred
p@(Predicate Map StatePart SimpleExpr
p_eqs FlagStatus
_),VCS
_) <- StateT (Pred, VCS) Identity (Pred, VCS)
forall s (m :: * -> *). MonadState s m => m s
get
    [(Register, SimpleExpr)]
params <- (Register
 -> StateT (Pred, VCS) Identity (Maybe (Register, SimpleExpr)))
-> [Register]
-> StateT (Pred, VCS) Identity [(Register, SimpleExpr)]
forall (m :: * -> *) a b.
Monad m =>
(a -> m (Maybe b)) -> [a] -> m [b]
mapMaybeM (Map StatePart SimpleExpr
-> Register
-> StateT (Pred, VCS) Identity (Maybe (Register, SimpleExpr))
forall b.
Eq b =>
Map StatePart b
-> Register
-> StateT (Pred, VCS) Identity (Maybe (Register, SimpleExpr))
when_is_relevant_param Map StatePart SimpleExpr
p_eqs) [Register]
parameter_registers
    ((Pred, VCS) -> (Pred, VCS)) -> StateT (Pred, VCS) Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (((Pred, VCS) -> (Pred, VCS)) -> StateT (Pred, VCS) Identity ())
-> ((Pred, VCS) -> (Pred, VCS)) -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ Word64 -> IntSet -> (Pred, VCS) -> (Pred, VCS)
forall a. Word64 -> IntSet -> (a, VCS) -> (a, VCS)
add_function_pointers Word64
i_a ([IntSet] -> IntSet
forall (f :: * -> *). Foldable f => f IntSet -> IntSet
IS.unions ([IntSet] -> IntSet) -> [IntSet] -> IntSet
forall a b. (a -> b) -> a -> b
$ ((Register, SimpleExpr) -> IntSet)
-> [(Register, SimpleExpr)] -> [IntSet]
forall a b. (a -> b) -> [a] -> [b]
map (FContext -> SimpleExpr -> IntSet
get_symbolic_function_pointers FContext
ctxt (SimpleExpr -> IntSet)
-> ((Register, SimpleExpr) -> SimpleExpr)
-> (Register, SimpleExpr)
-> IntSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Register, SimpleExpr) -> SimpleExpr
forall a b. (a, b) -> b
snd) [(Register, SimpleExpr)]
params)


    let postconditions :: [Maybe Pred]
postconditions = (ResolvedJumpTarget -> Maybe Pred)
-> [ResolvedJumpTarget] -> [Maybe Pred]
forall a b. (a -> b) -> [a] -> [b]
map ResolvedJumpTarget -> Maybe Pred
postcondition_of_jump_target ([ResolvedJumpTarget] -> [Maybe Pred])
-> [ResolvedJumpTarget] -> [Maybe Pred]
forall a b. (a -> b) -> a -> b
$ Context -> Instruction -> [ResolvedJumpTarget]
resolve_jump_target (FContext -> Context
f_ctxt FContext
ctxt) Instruction
i
    if [Maybe Pred]
postconditions [Maybe Pred] -> [Maybe Pred] -> Bool
forall a. Eq a => a -> a -> Bool
== [] Bool -> Bool -> Bool
|| (Maybe Pred -> Bool) -> [Maybe Pred] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
any (Maybe Pred -> Maybe Pred -> Bool
forall a. Eq a => a -> a -> Bool
(==) Maybe Pred
forall a. Maybe a
Nothing) [Maybe Pred]
postconditions then do
      -- an external function, or a function that produced a verification error, or with unresolved indirections

      -- 1.) for each parameter, smudge the current state
      [(Register, SimpleExpr)]
-> ((Register, SimpleExpr) -> StateT (Pred, VCS) Identity ())
-> StateT (Pred, VCS) Identity ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
t a -> (a -> m b) -> m ()
forM_ [(Register, SimpleExpr)]
params (Register, SimpleExpr) -> StateT (Pred, VCS) Identity ()
forall a. (a, SimpleExpr) -> StateT (Pred, VCS) Identity ()
write_param
      (q :: Pred
q@(Predicate Map StatePart SimpleExpr
q_eqs FlagStatus
_),VCS
_) <- StateT (Pred, VCS) Identity (Pred, VCS)
forall s (m :: * -> *). MonadState s m => m s
get

      -- 2.) transfer stateparts that must be kept intact, and generation verification conditions if necessary
      Set StatePart
sps <- [Set StatePart] -> Set StatePart
forall (f :: * -> *) a. (Foldable f, Ord a) => f (Set a) -> Set a
S.unions ([Set StatePart] -> Set StatePart)
-> StateT (Pred, VCS) Identity [Set StatePart]
-> StateT (Pred, VCS) Identity (Set StatePart)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (((StatePart, SimpleExpr)
 -> StateT (Pred, VCS) Identity (Set StatePart))
-> [(StatePart, SimpleExpr)]
-> StateT (Pred, VCS) Identity [Set StatePart]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ([Char]
-> Instruction
-> Pred
-> Pred
-> Bool
-> (StatePart, SimpleExpr)
-> StateT (Pred, VCS) Identity (Set StatePart)
forall a.
(HasSize a, HasAddress a) =>
[Char]
-> a
-> Pred
-> Pred
-> Bool
-> (StatePart, SimpleExpr)
-> StateT (Pred, VCS) Identity (Set StatePart)
transfer_current_statepart [Char]
f' Instruction
i Pred
p Pred
q Bool
True) ([(StatePart, SimpleExpr)]
 -> StateT (Pred, VCS) Identity [Set StatePart])
-> [(StatePart, SimpleExpr)]
-> StateT (Pred, VCS) Identity [Set StatePart]
forall a b. (a -> b) -> a -> b
$ Map StatePart SimpleExpr -> [(StatePart, SimpleExpr)]
forall k a. Map k a -> [(k, a)]
M.toList Map StatePart SimpleExpr
p_eqs)
      Bool
-> StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Bool -> Bool
not (Bool -> Bool) -> Bool -> Bool
forall a b. (a -> b) -> a -> b
$ Set StatePart -> Bool
forall a. Set a -> Bool
S.null Set StatePart
sps) (StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ())
-> StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ ((Pred, VCS) -> (Pred, VCS)) -> StateT (Pred, VCS) Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (((Pred, VCS) -> (Pred, VCS)) -> StateT (Pred, VCS) Identity ())
-> ((Pred, VCS) -> (Pred, VCS)) -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ [Char]
-> Word64
-> [(Register, SimpleExpr)]
-> Set StatePart
-> (Pred, VCS)
-> (Pred, VCS)
forall a.
[Char]
-> Word64
-> [(Register, SimpleExpr)]
-> Set StatePart
-> (a, VCS)
-> (a, VCS)
add_function_constraint [Char]
f' Word64
i_a [(Register, SimpleExpr)]
params Set StatePart
sps

      -- 3.) For all return registers (RAX,XMM0), write some unknown return value
      [Register]
-> (Register -> StateT (Pred, VCS) Identity ())
-> StateT (Pred, VCS) Identity ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
t a -> (a -> m b) -> m ()
forM_ [Register]
return_registers (\Register
r -> FContext
-> Word64
-> Register
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_reg FContext
ctxt Word64
i_a Register
r (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ BotTyp -> SimpleExpr
Bottom (BotTyp -> SimpleExpr) -> BotTyp -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ [Char] -> BotTyp
FromCall ([Char] -> BotTyp) -> [Char] -> BotTyp
forall a b. (a -> b) -> a -> b
$ [Char]
f') -- TODO flags
    else do
      -- an internal function, already verified
      (p :: Pred
p@(Predicate Map StatePart SimpleExpr
p_eqs FlagStatus
_),VCS
vcs) <- StateT (Pred, VCS) Identity (Pred, VCS)
forall s (m :: * -> *). MonadState s m => m s
get

      -- 1.) obtain the postcondition of the function, and do backwards transposition
      -- TODO: first transpose then supremum
      let (q :: Pred
q@(Predicate Map StatePart SimpleExpr
q_eqs FlagStatus
_))   = FContext -> [Pred] -> Pred
forall ctxt pred. Propagator ctxt pred => ctxt -> [pred] -> pred
supremum FContext
ctxt ([Pred] -> Pred) -> [Pred] -> Pred
forall a b. (a -> b) -> a -> b
$ (Maybe Pred -> Pred) -> [Maybe Pred] -> [Pred]
forall a b. (a -> b) -> [a] -> [b]
map Maybe Pred -> Pred
forall a. HasCallStack => Maybe a -> a
fromJust [Maybe Pred]
postconditions
      let ([VerificationCondition]
vcs',[(StatePart, SimpleExpr)]
q_eqs_transposed)   = [Either VerificationCondition (StatePart, SimpleExpr)]
-> ([VerificationCondition], [(StatePart, SimpleExpr)])
forall a b. [Either a b] -> ([a], [b])
partitionEithers ([Either VerificationCondition (StatePart, SimpleExpr)]
 -> ([VerificationCondition], [(StatePart, SimpleExpr)]))
-> [Either VerificationCondition (StatePart, SimpleExpr)]
-> ([VerificationCondition], [(StatePart, SimpleExpr)])
forall a b. (a -> b) -> a -> b
$ ((StatePart, SimpleExpr)
 -> Either VerificationCondition (StatePart, SimpleExpr))
-> [(StatePart, SimpleExpr)]
-> [Either VerificationCondition (StatePart, SimpleExpr)]
forall a b. (a -> b) -> [a] -> [b]
map (FContext
-> [Char]
-> Word64
-> Pred
-> (StatePart, SimpleExpr)
-> Either VerificationCondition (StatePart, SimpleExpr)
transpose_bw FContext
ctxt [Char]
f' Word64
i_a Pred
p) ([(StatePart, SimpleExpr)]
 -> [Either VerificationCondition (StatePart, SimpleExpr)])
-> [(StatePart, SimpleExpr)]
-> [Either VerificationCondition (StatePart, SimpleExpr)]
forall a b. (a -> b) -> a -> b
$ ((StatePart, SimpleExpr) -> Bool)
-> [(StatePart, SimpleExpr)] -> [(StatePart, SimpleExpr)]
forall a. (a -> Bool) -> [a] -> [a]
filter ((StatePart -> SimpleExpr -> Bool)
-> (StatePart, SimpleExpr) -> Bool
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry StatePart -> SimpleExpr -> Bool
do_transfer) ([(StatePart, SimpleExpr)] -> [(StatePart, SimpleExpr)])
-> [(StatePart, SimpleExpr)] -> [(StatePart, SimpleExpr)]
forall a b. (a -> b) -> a -> b
$ Map StatePart SimpleExpr -> [(StatePart, SimpleExpr)]
forall k a. Map k a -> [(k, a)]
M.toList Map StatePart SimpleExpr
q_eqs
      (Pred, VCS) -> StateT (Pred, VCS) Identity ()
forall s (m :: * -> *). MonadState s m => s -> m ()
put ((Map StatePart SimpleExpr -> FlagStatus -> Pred
Predicate Map StatePart SimpleExpr
forall k a. Map k a
M.empty FlagStatus
None),VCS -> VCS -> VCS
forall a. Ord a => Set a -> Set a -> Set a
S.union VCS
vcs (VCS -> VCS) -> VCS -> VCS
forall a b. (a -> b) -> a -> b
$ [VerificationCondition] -> VCS
forall a. Ord a => [a] -> Set a
S.fromList [VerificationCondition]
vcs')
      ((StatePart, SimpleExpr) -> StateT (Pred, VCS) Identity ())
-> [(StatePart, SimpleExpr)] -> StateT (Pred, VCS) Identity ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (FContext
-> Word64
-> (Word64 -> StatePart -> MemWriteIdentifier)
-> (StatePart, SimpleExpr)
-> StateT (Pred, VCS) Identity ()
write_sp FContext
ctxt Word64
i_a Word64 -> StatePart -> MemWriteIdentifier
mk_mid) [(StatePart, SimpleExpr)]
q_eqs_transposed
      (q_transposed :: Pred
q_transposed@(Predicate Map StatePart SimpleExpr
q_eqs FlagStatus
_),VCS
vcs) <- StateT (Pred, VCS) Identity (Pred, VCS)
forall s (m :: * -> *). MonadState s m => m s
get

      -- 2.) transfer stateparts that must be kept intact, and generation verification conditions if necessary
      Set StatePart
sps <- [Set StatePart] -> Set StatePart
forall (f :: * -> *) a. (Foldable f, Ord a) => f (Set a) -> Set a
S.unions ([Set StatePart] -> Set StatePart)
-> StateT (Pred, VCS) Identity [Set StatePart]
-> StateT (Pred, VCS) Identity (Set StatePart)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (((StatePart, SimpleExpr)
 -> StateT (Pred, VCS) Identity (Set StatePart))
-> [(StatePart, SimpleExpr)]
-> StateT (Pred, VCS) Identity [Set StatePart]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ([Char]
-> Instruction
-> Pred
-> Pred
-> Bool
-> (StatePart, SimpleExpr)
-> StateT (Pred, VCS) Identity (Set StatePart)
forall a.
(HasSize a, HasAddress a) =>
[Char]
-> a
-> Pred
-> Pred
-> Bool
-> (StatePart, SimpleExpr)
-> StateT (Pred, VCS) Identity (Set StatePart)
transfer_current_statepart [Char]
f' Instruction
i Pred
p Pred
q_transposed Bool
False) ([(StatePart, SimpleExpr)]
 -> StateT (Pred, VCS) Identity [Set StatePart])
-> [(StatePart, SimpleExpr)]
-> StateT (Pred, VCS) Identity [Set StatePart]
forall a b. (a -> b) -> a -> b
$ Map StatePart SimpleExpr -> [(StatePart, SimpleExpr)]
forall k a. Map k a -> [(k, a)]
M.toList Map StatePart SimpleExpr
p_eqs)
      Bool
-> StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Bool -> Bool
not (Bool -> Bool) -> Bool -> Bool
forall a b. (a -> b) -> a -> b
$ Set StatePart -> Bool
forall a. Set a -> Bool
S.null Set StatePart
sps) (StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ())
-> StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ ((Pred, VCS) -> (Pred, VCS)) -> StateT (Pred, VCS) Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (((Pred, VCS) -> (Pred, VCS)) -> StateT (Pred, VCS) Identity ())
-> ((Pred, VCS) -> (Pred, VCS)) -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ [Char]
-> Word64
-> [(Register, SimpleExpr)]
-> Set StatePart
-> (Pred, VCS)
-> (Pred, VCS)
forall a.
[Char]
-> Word64
-> [(Register, SimpleExpr)]
-> Set StatePart
-> (a, VCS)
-> (a, VCS)
add_function_constraint [Char]
f' Word64
i_a [(Register, SimpleExpr)]
params Set StatePart
sps
 where
  -- in case of an external function f, which is passed a parameter (r,a) with r a register and a some value (likely a pointer),
  -- do a write to region [a+bot,1] to muddle the state. The value written to that region is an abstraction of what is already there.
  write_param :: (a, SimpleExpr) -> StateT (Pred, VCS) Identity ()
write_param (a
r,SimpleExpr
a) = do
    let a' :: SimpleExpr
a'  = Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Plus Int
64) [SimpleExpr
a,SimpleExpr
rock_bottom]
    let si' :: Int
si' = Int
1
    SimpleExpr
v'     <- State (Pred, VCS) SimpleExpr -> State (Pred, VCS) SimpleExpr
forall s a. State s a -> State s a
evalState_discard (State (Pred, VCS) SimpleExpr -> State (Pred, VCS) SimpleExpr)
-> State (Pred, VCS) SimpleExpr -> State (Pred, VCS) SimpleExpr
forall a b. (a -> b) -> a -> b
$ FContext -> StatePart -> State (Pred, VCS) SimpleExpr
read_sp FContext
ctxt (SimpleExpr -> Int -> StatePart
SP_Mem SimpleExpr
a Int
1)
    let bot :: SimpleExpr
bot = FContext -> SimpleExpr -> SimpleExpr
join_single FContext
ctxt SimpleExpr
v'
    FContext
-> Word64
-> (Word64 -> StatePart -> MemWriteIdentifier)
-> (StatePart, SimpleExpr)
-> StateT (Pred, VCS) Identity ()
write_sp FContext
ctxt (Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i)  Word64 -> StatePart -> MemWriteIdentifier
mk_mid (SimpleExpr -> Int -> StatePart
SP_Mem SimpleExpr
a' Int
si',SimpleExpr
bot)

  when_is_relevant_param :: Map StatePart b
-> Register
-> StateT (Pred, VCS) Identity (Maybe (Register, SimpleExpr))
when_is_relevant_param Map StatePart b
p_eqs Register
r = do
    SimpleExpr
v <- FContext -> Register -> State (Pred, VCS) SimpleExpr
read_reg FContext
ctxt Register
r
    if FContext -> SimpleExpr -> Bool
expr_highly_likely_pointer FContext
ctxt SimpleExpr
v Bool -> Bool -> Bool
|| (Map StatePart b -> SimpleExpr -> Bool
forall b. Eq b => Map StatePart b -> SimpleExpr -> Bool
is_currently_pointer Map StatePart b
p_eqs SimpleExpr
v Bool -> Bool -> Bool
&& Bool -> Bool
not (SimpleExpr -> Bool
is_immediate SimpleExpr
v)) then
      Maybe (Register, SimpleExpr)
-> StateT (Pred, VCS) Identity (Maybe (Register, SimpleExpr))
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe (Register, SimpleExpr)
 -> StateT (Pred, VCS) Identity (Maybe (Register, SimpleExpr)))
-> Maybe (Register, SimpleExpr)
-> StateT (Pred, VCS) Identity (Maybe (Register, SimpleExpr))
forall a b. (a -> b) -> a -> b
$ (Register, SimpleExpr) -> Maybe (Register, SimpleExpr)
forall a. a -> Maybe a
Just (Register
r,SimpleExpr
v)
    else
      Maybe (Register, SimpleExpr)
-> StateT (Pred, VCS) Identity (Maybe (Register, SimpleExpr))
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe (Register, SimpleExpr)
 -> StateT (Pred, VCS) Identity (Maybe (Register, SimpleExpr)))
-> Maybe (Register, SimpleExpr)
-> StateT (Pred, VCS) Identity (Maybe (Register, SimpleExpr))
forall a b. (a -> b) -> a -> b
$ Maybe (Register, SimpleExpr)
forall a. Maybe a
Nothing



  -- let the current predicate p, before the call, contain an equation sp == v
  -- q provides the predicate after the function call.
  -- We transfer the statepart sp and sometimes forcibly keep its original value v, even if we could not prove that it was preserved.
  -- In those cases, we add annotations in the form of "Function Constraints".
  transfer_current_statepart :: [Char]
-> a
-> Pred
-> Pred
-> Bool
-> (StatePart, SimpleExpr)
-> StateT (Pred, VCS) Identity (Set StatePart)
transfer_current_statepart [Char]
f' a
i p :: Pred
p@(Predicate Map StatePart SimpleExpr
p_eqs FlagStatus
_) q :: Pred
q@(Predicate Map StatePart SimpleExpr
q_eqs FlagStatus
_) Bool
is_external (StatePart
sp,SimpleExpr
v) = do
    if StatePart
sp StatePart -> StatePart -> Bool
forall a. Eq a => a -> a -> Bool
== Register -> StatePart
SP_Reg Register
RIP then do
      -- forcibly transfer and set the value of the instruction pointer
      StatePart -> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) b.
MonadState (Pred, b) m =>
StatePart -> SimpleExpr -> m ()
forced_insert_sp StatePart
sp (Word64 -> SimpleExpr
SE_Immediate (Word64 -> SimpleExpr) -> Word64 -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ a -> Word64
forall a. HasAddress a => a -> Word64
addressof a
i Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ (Int -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word64) -> Int -> Word64
forall a b. (a -> b) -> a -> b
$ a -> Int
forall a. HasSize a => a -> Int
sizeof a
i))
      Set StatePart -> StateT (Pred, VCS) Identity (Set StatePart)
forall (m :: * -> *) a. Monad m => a -> m a
return Set StatePart
forall a. Set a
S.empty
    else if (StatePart -> Bool) -> [StatePart] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
all (FContext -> StatePart -> StatePart -> Bool
necessarily_separate_stateparts FContext
ctxt StatePart
sp) ([StatePart] -> Bool) -> [StatePart] -> Bool
forall a b. (a -> b) -> a -> b
$ Map StatePart SimpleExpr -> [StatePart]
forall k a. Map k a -> [k]
M.keys Map StatePart SimpleExpr
q_eqs then do
      -- if the function did not write to the statepart, transfer it without annotations
      StatePart -> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) b.
MonadState (Pred, b) m =>
StatePart -> SimpleExpr -> m ()
forced_insert_sp StatePart
sp SimpleExpr
v
      Set StatePart -> StateT (Pred, VCS) Identity (Set StatePart)
forall (m :: * -> *) a. Monad m => a -> m a
return Set StatePart
forall a. Set a
S.empty
    else let v' :: SimpleExpr
v' = State (Pred, VCS) SimpleExpr -> (Pred, VCS) -> SimpleExpr
forall s a. State s a -> s -> a
evalState (FContext -> StatePart -> State (Pred, VCS) SimpleExpr
read_sp FContext
ctxt StatePart
sp) (Pred
q,VCS
forall a. Set a
S.empty) in
      if StatePart
sp StatePart -> StatePart -> Bool
forall a. Eq a => a -> a -> Bool
== Register -> StatePart
SP_Reg Register
RSP then do
        -- register RSP must be set to its original value + 8, force this and add an annotation
        let add_vc :: Bool
add_vc = Bool -> Bool
not Bool
is_external Bool -> Bool -> Bool
&& SimpleExpr
v' SimpleExpr -> SimpleExpr -> Bool
forall a. Eq a => a -> a -> Bool
/= SimpleExpr -> SimpleExpr
simp (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Plus Int
64) [StatePart -> SimpleExpr
SE_Var (StatePart -> SimpleExpr) -> StatePart -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ [Char] -> StatePart
SP_StackPointer [Char]
f',Word64 -> SimpleExpr
SE_Immediate Word64
8])
        StatePart -> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) b.
MonadState (Pred, b) m =>
StatePart -> SimpleExpr -> m ()
forced_insert_sp StatePart
sp (SimpleExpr -> SimpleExpr
simp (SimpleExpr -> SimpleExpr) -> SimpleExpr -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Plus Int
64) [SimpleExpr
v,Word64 -> SimpleExpr
SE_Immediate Word64
8])
        Set StatePart -> StateT (Pred, VCS) Identity (Set StatePart)
forall (m :: * -> *) a. Monad m => a -> m a
return (Set StatePart -> StateT (Pred, VCS) Identity (Set StatePart))
-> Set StatePart -> StateT (Pred, VCS) Identity (Set StatePart)
forall a b. (a -> b) -> a -> b
$ if Bool
add_vc then StatePart -> Set StatePart
forall a. a -> Set a
S.singleton StatePart
sp else Set StatePart
forall a. Set a
S.empty
      else if [Bool] -> Bool
forall (t :: * -> *). Foldable t => t Bool -> Bool
or [
           Bool
is_external Bool -> Bool -> Bool
&& FContext -> Bool -> StatePart -> Bool
statepart_preserved_after_external_function_call FContext
ctxt Bool
is_external StatePart
sp Bool -> Bool -> Bool
&& (Map StatePart SimpleExpr -> StatePart -> SimpleExpr -> Bool
forall b.
Eq b =>
Map StatePart b -> StatePart -> SimpleExpr -> Bool
must_be_preserved Map StatePart SimpleExpr
p_eqs StatePart
sp SimpleExpr
v Bool -> Bool -> Bool
|| StatePart -> Bool
is_reg_sp StatePart
sp),
           Bool -> Bool
not Bool
is_external Bool -> Bool -> Bool
&& StatePart -> Bool
is_mem_sp StatePart
sp Bool -> Bool -> Bool
&& FContext -> Bool -> StatePart -> Bool
statepart_preserved_after_external_function_call FContext
ctxt Bool
is_external StatePart
sp Bool -> Bool -> Bool
&& Map StatePart SimpleExpr -> StatePart -> SimpleExpr -> Bool
forall b.
Eq b =>
Map StatePart b -> StatePart -> SimpleExpr -> Bool
must_be_preserved Map StatePart SimpleExpr
p_eqs StatePart
sp SimpleExpr
v
          ] then do
        -- the statepart should have been preserved by the function, but that cannot be proven
        -- forcibly preserve the statepart and annotate
        StatePart -> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) b.
MonadState (Pred, b) m =>
StatePart -> SimpleExpr -> m ()
forced_insert_sp StatePart
sp SimpleExpr
v
        let add_vc :: Bool
add_vc = SimpleExpr
v SimpleExpr -> SimpleExpr -> Bool
forall a. Eq a => a -> a -> Bool
/= SimpleExpr
v' Bool -> Bool -> Bool
&& Bool -> Bool
not (SimpleExpr -> Bool
uninitialized SimpleExpr
v')
        --trace ("Preserving (" ++ show i ++ "): " ++ show (sp,v,v')) $
        Set StatePart -> StateT (Pred, VCS) Identity (Set StatePart)
forall (m :: * -> *) a. Monad m => a -> m a
return (Set StatePart -> StateT (Pred, VCS) Identity (Set StatePart))
-> Set StatePart -> StateT (Pred, VCS) Identity (Set StatePart)
forall a b. (a -> b) -> a -> b
$ if Bool
add_vc then StatePart -> Set StatePart
forall a. a -> Set a
S.singleton StatePart
sp else Set StatePart
forall a. Set a
S.empty
      else case ((StatePart, SimpleExpr) -> Bool)
-> [(StatePart, SimpleExpr)] -> Maybe (StatePart, SimpleExpr)
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find (\(StatePart
sp',SimpleExpr
v) -> StatePart -> StatePart -> Bool
necessarily_equal_stateparts StatePart
sp StatePart
sp') ([(StatePart, SimpleExpr)] -> Maybe (StatePart, SimpleExpr))
-> [(StatePart, SimpleExpr)] -> Maybe (StatePart, SimpleExpr)
forall a b. (a -> b) -> a -> b
$ Map StatePart SimpleExpr -> [(StatePart, SimpleExpr)]
forall k a. Map k a -> [(k, a)]
M.assocs Map StatePart SimpleExpr
q_eqs of
        Just (StatePart
_,SimpleExpr
v') -> do
          -- the statepart was overwritten by the function, so use its new value
          FContext
-> Word64
-> (Word64 -> StatePart -> MemWriteIdentifier)
-> (StatePart, SimpleExpr)
-> StateT (Pred, VCS) Identity ()
write_sp FContext
ctxt (a -> Word64
forall a. HasAddress a => a -> Word64
addressof a
i) Word64 -> StatePart -> MemWriteIdentifier
mk_mid (StatePart
sp,SimpleExpr
v')
          Set StatePart -> StateT (Pred, VCS) Identity (Set StatePart)
forall (m :: * -> *) a. Monad m => a -> m a
return Set StatePart
forall a. Set a
S.empty
        Maybe (StatePart, SimpleExpr)
Nothing     -> do
          -- the statepart was possibly overwritten by the function, so use its old and new value joined
          --(if v /=v' then trace ("Transferring (" ++ show i ++ ") " ++ show (sp,v) ++ " --> " ++ show (join_expr ctxt v v')) else id) $
          FContext
-> Word64
-> (Word64 -> StatePart -> MemWriteIdentifier)
-> (StatePart, SimpleExpr)
-> StateT (Pred, VCS) Identity ()
write_sp FContext
ctxt (a -> Word64
forall a. HasAddress a => a -> Word64
addressof a
i) Word64 -> StatePart -> MemWriteIdentifier
mk_mid (StatePart
sp,[Char] -> FContext -> SimpleExpr -> SimpleExpr -> SimpleExpr
join_expr [Char]
"transfer" FContext
ctxt SimpleExpr
v SimpleExpr
v')
          Set StatePart -> StateT (Pred, VCS) Identity (Set StatePart)
forall (m :: * -> *) a. Monad m => a -> m a
return Set StatePart
forall a. Set a
S.empty


  -- make a memory-write-identifier: the memroy write happened during this function call
  mk_mid :: Word64 -> StatePart -> MemWriteIdentifier
mk_mid = [Char] -> Word64 -> StatePart -> MemWriteIdentifier
MemWriteFunction (Context -> Instruction -> [Char]
function_name_of_instruction (FContext -> Context
f_ctxt FContext
ctxt) Instruction
i)

  -- forcibly insert the statepart into ther current predicate
  -- should never be done without caution, one should always use the mem_write function
  forced_insert_sp :: StatePart -> SimpleExpr -> m ()
forced_insert_sp StatePart
sp SimpleExpr
v = do
    (p :: Pred
p@(Predicate Map StatePart SimpleExpr
p_eqs FlagStatus
flg),b
vcs) <- m (Pred, b)
forall s (m :: * -> *). MonadState s m => m s
get
    (Pred, b) -> m ()
forall s (m :: * -> *). MonadState s m => s -> m ()
put (Map StatePart SimpleExpr -> FlagStatus -> Pred
Predicate (StatePart
-> SimpleExpr
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
forall k a. Ord k => k -> a -> Map k a -> Map k a
M.insert StatePart
sp SimpleExpr
v Map StatePart SimpleExpr
p_eqs) FlagStatus
flg,b
vcs)


  must_be_preserved :: Map StatePart b -> StatePart -> SimpleExpr -> Bool
must_be_preserved Map StatePart b
p_eqs (SP_Reg Register
_)                              SimpleExpr
_ = Bool
True
  must_be_preserved Map StatePart b
p_eqs (SP_Mem (SE_Var (SP_StackPointer [Char]
_)) Int
_) SimpleExpr
_ = Bool
True
  must_be_preserved Map StatePart b
p_eqs (SP_Mem SimpleExpr
a Int
si)                           SimpleExpr
v = if FContext -> SimpleExpr -> Bool
expr_is_highly_likely_local_pointer FContext
ctxt SimpleExpr
a then FContext -> SimpleExpr -> Bool
expr_highly_likely_pointer FContext
ctxt SimpleExpr
v Bool -> Bool -> Bool
|| SimpleExpr -> Bool
is_reg_var SimpleExpr
v Bool -> Bool -> Bool
|| Map StatePart b -> SimpleExpr -> Bool
forall b. Eq b => Map StatePart b -> SimpleExpr -> Bool
is_currently_pointer Map StatePart b
p_eqs SimpleExpr
v else Bool
True

  is_reg_var :: SimpleExpr -> Bool
is_reg_var (SE_Var (SP_Reg Register
r)) = Bool
True
  is_reg_var SimpleExpr
_                   = Bool
False

  is_currently_pointer :: Map StatePart b -> SimpleExpr -> Bool
is_currently_pointer Map StatePart b
p_eqs SimpleExpr
a  = ((StatePart, b) -> Bool)
-> [(StatePart, b)] -> Maybe (StatePart, b)
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find (SimpleExpr -> StatePart -> Bool
is_region_for SimpleExpr
a (StatePart -> Bool)
-> ((StatePart, b) -> StatePart) -> (StatePart, b) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (StatePart, b) -> StatePart
forall a b. (a, b) -> a
fst) (Map StatePart b -> [(StatePart, b)]
forall k a. Map k a -> [(k, a)]
M.toList Map StatePart b
p_eqs) Maybe (StatePart, b) -> Maybe (StatePart, b) -> Bool
forall a. Eq a => a -> a -> Bool
/= Maybe (StatePart, b)
forall a. Maybe a
Nothing Bool -> Bool -> Bool
|| (BotSrc -> Bool) -> Set BotSrc -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
any BotSrc -> Bool
source_in_finit (FContext -> SimpleExpr -> Set BotSrc
srcs_of_expr FContext
ctxt SimpleExpr
a)
  is_region_for :: SimpleExpr -> StatePart -> Bool
is_region_for SimpleExpr
a (SP_Reg Register
_)    = Bool
False
  is_region_for SimpleExpr
a (SP_Mem SimpleExpr
a' Int
_) = SimpleExpr
a SimpleExpr -> SimpleExpr -> Bool
forall a. Eq a => a -> a -> Bool
== SimpleExpr
a'
  source_in_finit :: BotSrc -> Bool
source_in_finit (Src_Var StatePart
sp)  = StatePart -> Map StatePart SimpleExpr -> Maybe SimpleExpr
forall k a. Ord k => k -> Map k a -> Maybe a
M.lookup StatePart
sp (FContext -> Map StatePart SimpleExpr
f_init FContext
ctxt) Maybe SimpleExpr -> Maybe SimpleExpr -> Bool
forall a. Eq a => a -> a -> Bool
/= Maybe SimpleExpr
forall a. Maybe a
Nothing
  source_in_finit BotSrc
_             = Bool
False

  uninitialized :: SimpleExpr -> Bool
uninitialized (Bottom (FromUninitializedMemory Set BotSrc
_)) = Bool
True
  uninitialized SimpleExpr
_                                    = Bool
False

  do_transfer :: StatePart -> SimpleExpr -> Bool
do_transfer sp :: StatePart
sp@(SP_Reg Register
_)    SimpleExpr
v = Bool
True
  do_transfer sp :: StatePart
sp@(SP_Mem SimpleExpr
a Int
si) SimpleExpr
v = Bool -> Bool
not ((BotSrc -> Bool) -> Set BotSrc -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
any BotSrc -> Bool
is_local_to_not_f (Set BotSrc -> Bool) -> Set BotSrc -> Bool
forall a b. (a -> b) -> a -> b
$ FContext -> SimpleExpr -> Set BotSrc
srcs_of_expr FContext
ctxt SimpleExpr
a) Bool -> Bool -> Bool
&& Bool -> Bool
not (StatePart -> SimpleExpr -> Bool
is_initial StatePart
sp SimpleExpr
v)

  is_local_to_not_f :: BotSrc -> Bool
is_local_to_not_f (Src_StackPointer [Char]
f') = FContext -> [Char]
f_name FContext
ctxt [Char] -> [Char] -> Bool
forall a. Eq a => a -> a -> Bool
/= [Char]
f' -- TODO keep when f' is from current SCC callgraph
  is_local_to_not_f BotSrc
_                     = Bool
False

  postcondition_of_jump_target :: ResolvedJumpTarget -> Maybe Pred
postcondition_of_jump_target (ImmediateAddress Word64
a) =
    case Int -> IntMap FReturnBehavior -> Maybe FReturnBehavior
forall a. Int -> IntMap a -> Maybe a
IM.lookup (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
a) (Context -> IntMap FReturnBehavior
ctxt_calls (Context -> IntMap FReturnBehavior)
-> Context -> IntMap FReturnBehavior
forall a b. (a -> b) -> a -> b
$ FContext -> Context
f_ctxt FContext
ctxt) of
      Just (ReturningWith Pred
q) -> Pred -> Maybe Pred
forall a. a -> Maybe a
Just Pred
q
      Maybe FReturnBehavior
_                      -> Maybe Pred
forall a. Maybe a
Nothing
  postcondition_of_jump_target ResolvedJumpTarget
_                    = Maybe Pred
forall a. Maybe a
Nothing



statepart_preserved_after_external_function_call ::
  FContext       -- ^ The context
  -> Bool       -- ^ Is the function external?
  -> StatePart  -- ^ A state part 
  -> Bool
statepart_preserved_after_external_function_call :: FContext -> Bool -> StatePart -> Bool
statepart_preserved_after_external_function_call FContext
ctxt Bool
is_external (SP_Reg Register
r)   = Register
r Register -> [Register] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Register]
callee_saved_registers
statepart_preserved_after_external_function_call FContext
ctxt Bool
is_external (SP_Mem SimpleExpr
a Int
_) = Bool -> Bool
not (SimpleExpr -> Bool
contains_bot SimpleExpr
a) Bool -> Bool -> Bool
&& [Bool] -> Bool
forall (t :: * -> *). Foldable t => t Bool -> Bool
or [
      FContext -> SimpleExpr -> Bool
expr_is_highly_likely_local_pointer FContext
ctxt SimpleExpr
a,
      Context -> SimpleExpr -> Bool
address_is_unwritable (FContext -> Context
f_ctxt FContext
ctxt) SimpleExpr
a,
      (Bool
is_external Bool -> Bool -> Bool
&& Context -> SimpleExpr -> Bool
expr_is_global_immediate (FContext -> Context
f_ctxt FContext
ctxt) SimpleExpr
a)
     ]




is_initial :: StatePart -> SimpleExpr -> Bool
is_initial :: StatePart -> SimpleExpr -> Bool
is_initial StatePart
sp SimpleExpr
v = SimpleExpr
v SimpleExpr -> SimpleExpr -> Bool
forall a. Eq a => a -> a -> Bool
== StatePart -> SimpleExpr
SE_Var StatePart
sp










-- | Instruction semantics
push :: FContext -> Word64 -> X86.Operand -> State (Pred,VCS) ()
push :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
push FContext
ctxt Word64
i_a (Immediate Word64
imm) = do
  let si :: Int
si = Int
8
  let address :: GenericAddress Register
address = GenericAddress Register
-> GenericAddress Register -> GenericAddress Register
forall storage.
GenericAddress storage
-> GenericAddress storage -> GenericAddress storage
AddressMinus (Register -> GenericAddress Register
forall storage. storage -> GenericAddress storage
AddressStorage Register
RSP) (Word64 -> GenericAddress Register
forall storage. Word64 -> GenericAddress storage
AddressImm (Word64 -> GenericAddress Register)
-> Word64 -> GenericAddress Register
forall a b. (a -> b) -> a -> b
$ Int -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
si)
  SimpleExpr
e1 <- FContext -> GenericAddress Register -> State (Pred, VCS) SimpleExpr
resolve_address FContext
ctxt GenericAddress Register
address
  FContext
-> Word64
-> Register
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_reg FContext
ctxt Word64
i_a Register
RSP SimpleExpr
e1
  FContext
-> MemWriteIdentifier
-> SimpleExpr
-> Int
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_mem FContext
ctxt (Word64 -> Operand -> SimpleExpr -> MemWriteIdentifier
MemWriteInstruction Word64
i_a (GenericAddress Register -> Int -> Operand
forall storage.
GenericAddress storage -> Int -> GenericOperand storage
Memory GenericAddress Register
address Int
si) SimpleExpr
e1) SimpleExpr
e1 Int
si (Word64 -> SimpleExpr
SE_Immediate Word64
imm)
push FContext
ctxt Word64
i_a Operand
op1 = do
  SimpleExpr
e0 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  let si :: Int
si = Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1
  let address :: GenericAddress Register
address = GenericAddress Register
-> GenericAddress Register -> GenericAddress Register
forall storage.
GenericAddress storage
-> GenericAddress storage -> GenericAddress storage
AddressMinus (Register -> GenericAddress Register
forall storage. storage -> GenericAddress storage
AddressStorage Register
RSP) (Word64 -> GenericAddress Register
forall storage. Word64 -> GenericAddress storage
AddressImm (Word64 -> GenericAddress Register)
-> Word64 -> GenericAddress Register
forall a b. (a -> b) -> a -> b
$ Int -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
si)
  SimpleExpr
e1 <- FContext -> GenericAddress Register -> State (Pred, VCS) SimpleExpr
resolve_address FContext
ctxt GenericAddress Register
address
  FContext
-> Word64
-> Register
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_reg FContext
ctxt Word64
i_a Register
RSP SimpleExpr
e1
  FContext
-> MemWriteIdentifier
-> SimpleExpr
-> Int
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_mem FContext
ctxt (Word64 -> Operand -> SimpleExpr -> MemWriteIdentifier
MemWriteInstruction Word64
i_a (GenericAddress Register -> Int -> Operand
forall storage.
GenericAddress storage -> Int -> GenericOperand storage
Memory GenericAddress Register
address Int
si) SimpleExpr
e1) SimpleExpr
e1 Int
si SimpleExpr
e0

pop :: FContext -> Word64 -> X86.Operand -> State (Pred,VCS) ()
pop :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
pop FContext
ctxt Word64
i_a Operand
op1 = do
  let si :: Int
si = Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1
  SimpleExpr
e0 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_mem FContext
ctxt (GenericAddress Register -> Int -> Operand
forall storage.
GenericAddress storage -> Int -> GenericOperand storage
Memory (Register -> GenericAddress Register
forall storage. storage -> GenericAddress storage
AddressStorage Register
RSP) Int
si)
  let address :: GenericAddress Register
address = GenericAddress Register
-> GenericAddress Register -> GenericAddress Register
forall storage.
GenericAddress storage
-> GenericAddress storage -> GenericAddress storage
AddressPlus (Register -> GenericAddress Register
forall storage. storage -> GenericAddress storage
AddressStorage Register
RSP) (Word64 -> GenericAddress Register
forall storage. Word64 -> GenericAddress storage
AddressImm (Word64 -> GenericAddress Register)
-> Word64 -> GenericAddress Register
forall a b. (a -> b) -> a -> b
$ Int -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
si)
  SimpleExpr
e1 <- FContext -> GenericAddress Register -> State (Pred, VCS) SimpleExpr
resolve_address FContext
ctxt GenericAddress Register
address
  FContext
-> Word64
-> Register
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_reg FContext
ctxt Word64
i_a Register
RSP SimpleExpr
e1
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 SimpleExpr
e0

lea :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
lea :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
lea FContext
ctxt Word64
i_a Operand
op1 (EffectiveAddress GenericAddress Register
a) = do
  SimpleExpr
e <- FContext -> GenericAddress Register -> State (Pred, VCS) SimpleExpr
resolve_address FContext
ctxt GenericAddress Register
a
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 SimpleExpr
e


leave :: FContext -> Word64 -> State (Pred,VCS) ()
leave :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
leave FContext
ctxt Word64
i_a = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov FContext
ctxt Word64
i_a (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RSP) (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RBP) StateT (Pred, VCS) Identity ()
-> StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
pop FContext
ctxt Word64
i_a (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RBP)


ret :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
ret FContext
ctxt Word64
i_a = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
pop FContext
ctxt Word64
i_a (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RIP)

sysret :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
sysret FContext
ctxt Word64
i_a = do
  SimpleExpr
e0 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RCX)
  FContext
-> Word64
-> Register
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_reg FContext
ctxt Word64
i_a Register
RIP SimpleExpr
e0
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RCX) (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RCX)

jmp :: FContext -> Instruction -> StateT (Pred, VCS) Identity ()
jmp FContext
ctxt Instruction
i =
  if Context -> Instruction -> Bool
instruction_jumps_to_external (FContext -> Context
f_ctxt FContext
ctxt) Instruction
i then
    -- A jump to an external symbol is treated as a function call and implicit RET
    FContext -> Instruction -> StateT (Pred, VCS) Identity ()
call FContext
ctxt Instruction
i StateT (Pred, VCS) Identity ()
-> StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> FContext -> Word64 -> StateT (Pred, VCS) Identity ()
ret FContext
ctxt (Word64 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word64 -> Word64) -> Word64 -> Word64
forall a b. (a -> b) -> a -> b
$ Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i)
  else
    () -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()



write_flags :: (X86.Operand -> X86.Operand -> FlagStatus) -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
write_flags :: (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags Operand -> Operand -> FlagStatus
g Operand
op1 Operand
op2 = do
  (Predicate Map StatePart SimpleExpr
eqs FlagStatus
flg,VCS
vcs) <- StateT (Pred, VCS) Identity (Pred, VCS)
forall s (m :: * -> *). MonadState s m => m s
get
  (Pred, VCS) -> StateT (Pred, VCS) Identity ()
forall s (m :: * -> *). MonadState s m => s -> m ()
put (Map StatePart SimpleExpr -> FlagStatus -> Pred
Predicate Map StatePart SimpleExpr
eqs (Operand -> Operand -> FlagStatus
g Operand
op1 Operand
op2),VCS
vcs)


mov_with_func_op2_to_op1 :: FContext -> Word64 -> (SimpleExpr -> SimpleExpr) -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
mov_with_func_op2_to_op1 :: FContext
-> Word64
-> (SimpleExpr -> SimpleExpr)
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func_op2_to_op1 FContext
ctxt Word64
i_a SimpleExpr -> SimpleExpr
f Operand
op1 Operand
op2 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (SimpleExpr -> SimpleExpr
f SimpleExpr
e1)

mk_bottom :: FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom FContext
ctxt [SimpleExpr]
es = BotTyp -> SimpleExpr
Bottom (BotTyp -> SimpleExpr) -> BotTyp -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ Set BotSrc -> BotTyp
FromSemantics (Set BotSrc -> BotTyp) -> Set BotSrc -> BotTyp
forall a b. (a -> b) -> a -> b
$ [Set BotSrc] -> Set BotSrc
forall (f :: * -> *) a. (Foldable f, Ord a) => f (Set a) -> Set a
S.unions ((SimpleExpr -> Set BotSrc) -> [SimpleExpr] -> [Set BotSrc]
forall a b. (a -> b) -> [a] -> [b]
map (FContext -> SimpleExpr -> Set BotSrc
srcs_of_expr FContext
ctxt) [SimpleExpr]
es)

mov_with_func1 :: FContext -> Word64 -> (FContext -> [SimpleExpr] -> SimpleExpr) -> Bool -> X86.Operand -> State (Pred,VCS) ()
mov_with_func1 :: FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
f Bool
do_write_flags Operand
op1 = do
  SimpleExpr
e0 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (FContext -> [SimpleExpr] -> SimpleExpr
f FContext
ctxt [SimpleExpr
e0])
  Bool
-> StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when Bool
do_write_flags ((Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op1)

mov_with_func :: FContext -> Word64 -> (FContext -> [SimpleExpr] -> SimpleExpr) -> Bool -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
mov_with_func :: FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
f Bool
do_write_flags Operand
op1 Operand
op2 = do
  SimpleExpr
e0 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (FContext -> [SimpleExpr] -> SimpleExpr
f FContext
ctxt [SimpleExpr
e0,SimpleExpr
e1])
  Bool
-> StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when Bool
do_write_flags ((Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2)

mov_with_func3 :: FContext -> Word64 -> (FContext -> [SimpleExpr] -> SimpleExpr) -> Bool -> X86.Operand -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
mov_with_func3 :: FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
f Bool
do_write_flags Operand
op1 Operand
op2 Operand
op3 = do
  SimpleExpr
e0 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op3
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (FContext -> [SimpleExpr] -> SimpleExpr
f FContext
ctxt [SimpleExpr
e0,SimpleExpr
e1,SimpleExpr
e2])
  Bool
-> StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when Bool
do_write_flags ((Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op2 Operand
op3)

nop :: p -> p -> m ()
nop p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

endbr64 :: p -> p -> m ()
endbr64 p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

ud2 :: p -> p -> m ()
ud2 p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

hlt :: p -> p -> m ()
hlt p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

wait :: p -> p -> m ()
wait p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

mfence :: p -> p -> m ()
mfence p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

clflush :: p -> p -> m ()
clflush p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

mov :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov FContext
ctxt Word64
i_a = FContext
-> Word64
-> (SimpleExpr -> SimpleExpr)
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func_op2_to_op1 FContext
ctxt Word64
i_a SimpleExpr -> SimpleExpr
forall a. a -> a
id

movzx :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movzx FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 SimpleExpr
e2

movsx :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movsx FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Int -> Int -> SimpleExpr -> SimpleExpr
SE_SExtend (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op2) (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1) SimpleExpr
e2)

movsxd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movsxd FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Int -> Int -> SimpleExpr -> SimpleExpr
SE_SExtend (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op2) (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1) SimpleExpr
e2)

movsd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
movsd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movsd = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

movss :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
movss :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movss = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

movaps :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
movaps :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movaps = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

movapd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
movapd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movapd = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

movups :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
movups :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movups = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

movupd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
movupd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movupd = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

movabs :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
movabs :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movabs = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

movdqu :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
movdqu :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movdqu = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

movdqa :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
movdqa :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movdqa = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

movlpd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
movlpd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movlpd = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

movlps :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
movlps :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movlps = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

movd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
movd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movd   = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

movq :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
movq :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movq = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

vmovd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
vmovd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vmovd = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

vmovapd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
vmovapd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vmovapd = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov

vmovaps :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
vmovaps :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vmovaps = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov


cmov :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
cmov :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  SimpleExpr
e0 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ [Char] -> FContext -> SimpleExpr -> SimpleExpr -> SimpleExpr
join_expr ([Char]
"cmov") FContext
ctxt SimpleExpr
e0 SimpleExpr
e1

xchg :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
xchg :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xchg FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 SimpleExpr
e2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op2 SimpleExpr
e1


cmp :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
cmp :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmp FContext
ctxt Word64
i_a = (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags ((Operand -> Operand -> FlagStatus)
 -> Operand -> Operand -> StateT (Pred, VCS) Identity ())
-> (Operand -> Operand -> FlagStatus)
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ Maybe Bool -> Operand -> Operand -> FlagStatus
FS_CMP Maybe Bool
forall a. Maybe a
Nothing

add :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
add :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
add FContext
ctxt Word64
i_a Operand
op1 = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a (\FContext
ctxt -> Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Plus (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1))) Bool
True Operand
op1

sub :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
sub :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
sub FContext
ctxt Word64
i_a Operand
op1 = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a (\FContext
ctxt -> Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Minus (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1))) Bool
True Operand
op1

neg :: FContext -> Word64 -> X86.Operand -> State (Pred,VCS) ()
neg :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
neg FContext
ctxt Word64
i_a Operand
op1 = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a (\FContext
ctxt [SimpleExpr]
e -> Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Minus (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) (Word64 -> SimpleExpr
SE_Immediate Word64
0 SimpleExpr -> [SimpleExpr] -> [SimpleExpr]
forall a. a -> [a] -> [a]
: [SimpleExpr]
e) ) Bool
True Operand
op1

test :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
test :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
test FContext
ctxt Word64
i_a = (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) --TODO needed?

ucomisd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
ucomisd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
ucomisd FContext
ctxt Word64
i_a = (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None)

ucomiss :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
ucomiss :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
ucomiss FContext
ctxt Word64
i_a = (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None)

comiss :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
comiss :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
comiss FContext
ctxt Word64
i_a = (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None)

inc :: FContext -> Word64 -> X86.Operand -> State (Pred,VCS) ()
inc :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
inc FContext
ctxt Word64
i_a Operand
op1 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Plus (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,Word64 -> SimpleExpr
SE_Immediate Word64
1])
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op1

dec :: FContext -> Word64 -> X86.Operand -> State (Pred,VCS) ()
dec :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
dec FContext
ctxt Word64
i_a Operand
op1 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Minus (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,Word64 -> SimpleExpr
SE_Immediate Word64
1])
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op1

or' :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
or' :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
or' FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Or (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,SimpleExpr
e2])
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2

and' :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
and' :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
and' FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
And (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,SimpleExpr
e2])
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2


not' :: FContext -> Word64 -> X86.Operand -> State (Pred,VCS) ()
not' :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
not' FContext
ctxt Word64
i_a Operand
op1 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Not (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1])
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op1


xor :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
xor :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xor FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  if Operand
op1 Operand -> Operand -> Bool
forall a. Eq a => a -> a -> Bool
== Operand
op2 then
    FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a (\FContext
ctxt [SimpleExpr]
x -> Word64 -> SimpleExpr
SE_Immediate Word64
0) Bool
True Operand
op1 Operand
op2
  else do
    SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
    SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
    FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Xor (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,SimpleExpr
e2])
    (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2

setxx :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False -- TODO ND 0/1

pxor :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
pxor :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pxor = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xor --TODO flags?

pand :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
pand :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pand FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pandn :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
pandn :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pandn FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

por :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
por :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
por FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

ptest :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
ptest :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
ptest FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True

vpxor :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
vpxor :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vpxor = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xor --TODO flags?

vpand :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
vpand :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vpand FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vpandn :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
vpandn :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vpandn FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vpor :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
vpor :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vpor FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

xorpd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
xorpd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xorpd = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xor --TODO flags?

xorps :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
xorps :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xorps = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xor -- TODO flags?

andpd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
andpd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
andpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

andnpd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
andnpd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
andnpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

orpd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
orpd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
orpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

subpd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
subpd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
subpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

addpd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
addpd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
addpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

subss :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
subss :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
subss FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

addss :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
addss :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
addss FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

mulss :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
mulss :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mulss FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

divss :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
divss :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
divss FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

roundss :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
roundss :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
roundss FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

subsd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
subsd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
subsd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

addsd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
addsd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
addsd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

mulsd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
mulsd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mulsd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

divsd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
divsd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
divsd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

roundsd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
roundsd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
roundsd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

bt :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
bt :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
bt FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2

btc :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
btc :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
btc FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True

btr :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
btr :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
btr FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True

bsr :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
bsr :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
bsr FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Bsr (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e2]
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2

bsf :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
bsf :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
bsf FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True

bts :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
bts :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
bts FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True

paddd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
paddd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
paddd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

paddb :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
paddb :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
paddb FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

paddq :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
paddq :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
paddq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

psubd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
psubd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psubd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

psubb :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
psubb :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psubb FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

psubq :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
psubq :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psubq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

psrld :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
psrld :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psrld FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

psrlw :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
psrlw :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psrlw FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

psrldq :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
psrldq :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psrldq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pslldq :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
pslldq :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pslldq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

psllq :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
psllq :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psllq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

psrlq :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
psrlq :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psrlq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pmulld :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
pmulld :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmulld FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pminud :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
pminud :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pminud FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pminsd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
pminsd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pminsd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pmaxsd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
pmaxsd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmaxsd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pmaxud :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
pmaxud :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmaxud FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pmaxuq :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
pmaxuq :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmaxuq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

psubusb :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
psubusb :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psubusb FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

psubusw :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
psubusw :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psubusw FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

packssdw :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
packssdw :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
packssdw FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

packsswb :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
packsswb :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
packsswb FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

cvtss2sd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
cvtss2sd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvtss2sd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

cvtsd2ss :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
cvtsd2ss :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvtsd2ss FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

cvtsi2sd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
cvtsi2sd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvtsi2sd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

cvtsi2ss :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
cvtsi2ss :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvtsi2ss FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

cvttss2si :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
cvttss2si :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvttss2si FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

cvttsd2si :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
cvttsd2si :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvttsd2si FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

cvttpd2dq :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
cvttpd2dq :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvttpd2dq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

cvtdq2pd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
cvtdq2pd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvtdq2pd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

is_st_reg_operand :: GenericOperand a -> Bool
is_st_reg_operand (Storage a
r) = Int -> [Char] -> [Char]
forall a. Int -> [a] -> [a]
take Int
2 (a -> [Char]
forall a. Show a => a -> [Char]
show a
r) [Char] -> [Char] -> Bool
forall a. Eq a => a -> a -> Bool
== [Char]
"ST"
is_st_reg_operand GenericOperand a
_           = Bool
False

fst' :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
fst' FContext
ctxt Word64
i_a Operand
op1 =
  if Operand -> Bool
forall a. Show a => GenericOperand a -> Bool
is_st_reg_operand Operand
op1 then
    () -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
  else
    FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ BotTyp -> SimpleExpr
Bottom (Set BotSrc -> BotTyp
FromSemantics (Set BotSrc -> BotTyp) -> Set BotSrc -> BotTyp
forall a b. (a -> b) -> a -> b
$ Set BotSrc
forall a. Set a
S.empty)

fstp :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
fstp FContext
ctxt Word64
i_a Operand
op1 =
  if Operand -> Bool
forall a. Show a => GenericOperand a -> Bool
is_st_reg_operand Operand
op1 then
    () -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
  else
    FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ BotTyp -> SimpleExpr
Bottom (Set BotSrc -> BotTyp
FromSemantics (Set BotSrc -> BotTyp) -> Set BotSrc -> BotTyp
forall a b. (a -> b) -> a -> b
$ Set BotSrc
forall a. Set a
S.empty)

fld :: p -> p -> p -> m ()
fld p
ctxt p
i_a p
op1 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fld1 :: p -> p -> m ()
fld1 p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fldz :: p -> p -> m ()
fldz p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fild :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
fild FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

fxch :: p -> p -> m ()
fxch p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fchs :: p -> p -> m ()
fchs p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fucom :: p -> p -> m ()
fucom p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fucomi :: p -> p -> m ()
fucomi p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fucomip :: p -> p -> m ()
fucomip p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fucomp :: p -> p -> m ()
fucomp p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fucompi :: p -> p -> m ()
fucompi p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fucompp :: p -> p -> m ()
fucompp p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

finit' :: p -> p -> m ()
finit' p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fninit :: p -> p -> m ()
fninit p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fnstcw :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
fnstcw FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

fstcw :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
fstcw FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

emms :: p -> p -> m ()
emms p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

-- We do not model state changes to ST(_) registers, hence the following semantics
-- instead of:
--    mov_with_func ctxt i_a mk_bottom False (Reg ST0) op1
fadd1 :: p -> p -> p -> m ()
fadd1 p
ctxt p
i_a p
op1 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fadd2 :: p -> p -> p -> p -> m ()
fadd2 p
ctxt p
i_a p
op1 p
op2 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fmul1 :: p -> p -> p -> m ()
fmul1 p
ctxt p
i_a p
op1 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fmul2 :: p -> p -> p -> p -> m ()
fmul2 p
ctxt p
i_a p
op1 p
op2 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fmulp1 :: p -> p -> p -> m ()
fmulp1 p
ctxt p
i_a p
op1 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fmulp2 :: p -> p -> p -> p -> m ()
fmulp2 p
ctxt p
i_a p
op1 p
op2 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fdivr1 :: p -> p -> p -> m ()
fdivr1 p
ctxt p
i_a p
op1 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fdivr2 :: p -> p -> p -> p -> m ()
fdivr2 p
ctxt p
i_a p
op1 p
op2 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fdivrp1 :: p -> p -> p -> m ()
fdivrp1 p
ctxt p
i_a p
op1 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fdivrp2 :: p -> p -> p -> p -> m ()
fdivrp2 p
ctxt p
i_a p
op1 p
op2 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fisub :: p -> p -> p -> m ()
fisub p
ctxt p
i_a p
op1 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fcmovxx :: p -> p -> m ()
fcmovxx p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

fisttp :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
fisttp FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

idiv :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
idiv FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True

div1 :: FContext -> Word64 -> X86.Operand -> State (Pred,VCS) ()
div1 :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
div1 FContext
ctxt Word64
i_a Operand
op1 = do
  let srcs :: [Register]
srcs = case Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1 of
               Int
8 -> [Register
RDX,Register
RAX]
               Int
4 -> [Register
EDX,Register
EAX]
               Int
2 -> [Register
DX,Register
AX]
               Int
1 -> [Register
AH,Register
AL]
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
src0 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage (Register -> Operand) -> Register -> Operand
forall a b. (a -> b) -> a -> b
$ [Register]
srcs [Register] -> Int -> Register
forall a. [a] -> Int -> a
!! Int
0)
  SimpleExpr
src1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage (Register -> Operand) -> Register -> Operand
forall a b. (a -> b) -> a -> b
$ [Register]
srcs [Register] -> Int -> Register
forall a. [a] -> Int -> a
!! Int
1)

  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage (Register -> Operand) -> Register -> Operand
forall a b. (a -> b) -> a -> b
$ [Register]
srcs [Register] -> Int -> Register
forall a. [a] -> Int -> a
!! Int
0) (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Div_Rem (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
src0,SimpleExpr
src1,SimpleExpr
e1]
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage (Register -> Operand) -> Register -> Operand
forall a b. (a -> b) -> a -> b
$ [Register]
srcs [Register] -> Int -> Register
forall a. [a] -> Int -> a
!! Int
1) (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Div (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
src0,SimpleExpr
src1,SimpleExpr
e1]
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op1


cdq :: FContext -> Word64 -> State (Pred,VCS) ()
cdq :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
cdq FContext
ctxt Word64
i_a = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
EAX)
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
EDX) (FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom FContext
ctxt [SimpleExpr
e1])

cqo :: FContext -> Word64 -> State (Pred,VCS) ()
cqo :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
cqo FContext
ctxt Word64
i_a = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RAX)
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RDX) (FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom FContext
ctxt [SimpleExpr
e1])

cdqe :: FContext -> Word64 -> State (Pred,VCS) ()
cdqe :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
cdqe FContext
ctxt Word64
i_a = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
EAX)
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RAX) (Int -> Int -> SimpleExpr -> SimpleExpr
SE_SExtend Int
32 Int
64 SimpleExpr
e1)

cbw :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
cbw FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
AX)

cwde :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
cwde FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
EAX)





shl :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
shl :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
shl FContext
ctxt Word64
i_a Operand
op1 op2 :: Operand
op2@(Immediate Word64
i) = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Times (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,Word64 -> SimpleExpr
SE_Immediate (Word64 -> SimpleExpr) -> Word64 -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ Word64
2Word64 -> Word64 -> Word64
forall a b. (Num a, Integral b) => a -> b -> a
^Word64
i])
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2
shl FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Shl (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,SimpleExpr
e2])
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2

shr :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
shr :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
shr FContext
ctxt Word64
i_a Operand
op1 op2 :: Operand
op2@(Immediate Word64
i) = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Udiv (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,Word64 -> SimpleExpr
SE_Immediate (Word64 -> SimpleExpr) -> Word64 -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ Word64
2Word64 -> Word64 -> Word64
forall a b. (Num a, Integral b) => a -> b -> a
^Word64
i])
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2
shr FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Shr (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,SimpleExpr
e2])
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2

sar :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
sar FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Sar (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,SimpleExpr
e2])
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2


shld :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
shld FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False -- TODO

shrd :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
shrd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False -- TODO


rol :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
rol :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
rol FContext
ctxt Word64
i_a Operand
op1 op2 :: Operand
op2@(Immediate Word64
i) = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Rol (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,Word64 -> SimpleExpr
SE_Immediate (Word64 -> SimpleExpr) -> Word64 -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ Word64
2Word64 -> Word64 -> Word64
forall a b. (Num a, Integral b) => a -> b -> a
^Word64
i]
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2
rol FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True Operand
op1 Operand
op2

ror :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
ror :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
ror FContext
ctxt Word64
i_a Operand
op1 op2 :: Operand
op2@(Immediate Word64
i) = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Ror (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,Word64 -> SimpleExpr
SE_Immediate (Word64 -> SimpleExpr) -> Word64 -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ Word64
2Word64 -> Word64 -> Word64
forall a b. (Num a, Integral b) => a -> b -> a
^Word64
i]
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2
ror FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True Operand
op1 Operand
op2

{-
adc :: FContext -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
adc ctxt op1 op2 = do
  e1 <- read_operand ctxt op1
  e2 <- read_operand ctxt op2
  write_operand ctxt op1 $ SE_Binop "adc" [e1,e2]
  write_flags (\_ _ -> None) op1 op2

sbb :: FContext -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
sbb ctxt op1 op2 = do
  e1 <- read_operand ctxt op1
  e2 <- read_operand ctxt op2
  write_operand ctxt op1 $ SE_Binop "sbb" [e1,e2]
  write_flags (\_ _ -> None) op1 op2
-}
adc :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
adc FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True

sbb :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
sbb FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True

mul1 :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
mul1 FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True --TODO 

mul2 :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mul2 FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True --TODO 

imul1 :: FContext -> Word64 -> X86.Operand -> State (Pred,VCS) ()
imul1 :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
imul1 FContext
ctxt Word64
i_a Operand
op1 = do
  let srcs :: [Register]
srcs = case Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1 of
               Int
8 -> [Register
RDX,Register
RAX]
               Int
4 -> [Register
EDX,Register
EAX]
               Int
2 -> [Register
DX,Register
AX]
               Int
1 -> [Register
AH,Register
AL]
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
src0 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage (Register -> Operand) -> Register -> Operand
forall a b. (a -> b) -> a -> b
$ [Register]
srcs [Register] -> Int -> Register
forall a. [a] -> Int -> a
!! Int
0)
  SimpleExpr
src1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage (Register -> Operand) -> Register -> Operand
forall a b. (a -> b) -> a -> b
$ [Register]
srcs [Register] -> Int -> Register
forall a. [a] -> Int -> a
!! Int
1)

  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage (Register -> Operand) -> Register -> Operand
forall a b. (a -> b) -> a -> b
$ [Register]
srcs [Register] -> Int -> Register
forall a. [a] -> Int -> a
!! Int
0) (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom FContext
ctxt [SimpleExpr
src1,SimpleExpr
e1] -- high part of multiplication
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage (Register -> Operand) -> Register -> Operand
forall a b. (a -> b) -> a -> b
$ [Register]
srcs [Register] -> Int -> Register
forall a. [a] -> Int -> a
!! Int
1) (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Times (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
src1,SimpleExpr
e1]
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op1

imul2 :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
imul2 :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
imul2 FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Times (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,SimpleExpr
e2])
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2

imul3 :: FContext -> Word64 -> X86.Operand -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
imul3 :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
imul3 FContext
ctxt Word64
i_a Operand
op0 Operand
op1 Operand
op2 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op0 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Times (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op0)) [SimpleExpr
e1,SimpleExpr
e2])
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2



bswap :: FContext -> Word64 -> X86.Operand -> State (Pred,VCS) ()
bswap :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
bswap FContext
ctxt Word64
i_a Operand
op1 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (SimpleExpr -> StateT (Pred, VCS) Identity ())
-> SimpleExpr -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Bswap (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1]
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op1

pextrb :: FContext -> Word64 -> X86.Operand -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
pextrb :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pextrb FContext
ctxt Word64
i_a Operand
op0 Operand
op1 Operand
op2 = do
  SimpleExpr
e0 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op0
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op0 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Pextr Int
8) [SimpleExpr
e0,SimpleExpr
e1,SimpleExpr
e2])

pextrd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
pextrd :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pextrd FContext
ctxt Word64
i_a Operand
op0 Operand
op1 Operand
op2 = do
  SimpleExpr
e0 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op0
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op0 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Pextr Int
32) [SimpleExpr
e0,SimpleExpr
e1,SimpleExpr
e2])

pextrq :: FContext -> Word64 -> X86.Operand -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
pextrq :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pextrq FContext
ctxt Word64
i_a Operand
op0 Operand
op1 Operand
op2 = do
  SimpleExpr
e0 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op0
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op0 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Pextr Int
64) [SimpleExpr
e0,SimpleExpr
e1,SimpleExpr
e2])

haddpd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
haddpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pinsrq :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pinsrq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pinsrd :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pinsrd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pshufb :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pshufb FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pshufd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pshufd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pshufd3 :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pshufd3 FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vpshufb :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vpshufb FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vpshufd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vpshufd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pshuflw :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pshuflw FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pclmulqdq :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pclmulqdq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pcmpeqb :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pcmpeqb FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pcmpeqd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pcmpeqd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pcmpgtb :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pcmpgtb FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pcmpgtd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pcmpgtd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

movmskps :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movmskps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pmovsxdq :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmovsxdq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pmovzxdq :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmovzxdq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pmovsxbd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmovsxbd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

pmovzxbd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmovzxbd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

movmskpd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movmskpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

unpcklps :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
unpcklps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

cmpltsd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmpltsd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

cmpeqsd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmpeqsd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

cmpneqsd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmpneqsd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

cmpnlesd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmpnlesd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

punpcklqdq :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
punpcklqdq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

punpckldq :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
punpckldq FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

punpcklbw :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
punpcklbw FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

blendvpd :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
blendvpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

blendvps :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
blendvps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

extractps :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
extractps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

shufps :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
shufps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

movsd_string :: p -> p -> p -> p -> m ()
movsd_string p
ctxt p
prefix p
op1 p
op2 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return () -- TODO 

movsq :: p -> p -> p -> p -> m ()
movsq p
ctxt p
prefix p
op1 p
op2 = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return () -- TODO 

x86_in :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
x86_in FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

x86_out :: FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
x86_out FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

cli :: p -> p -> m ()
cli p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

clts :: p -> p -> m ()
clts p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

cpuid :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
cpuid FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RAX)

invpcid :: p -> p -> m ()
invpcid p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

lgdt :: p -> p -> m ()
lgdt p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

lidt :: p -> p -> m ()
lidt p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

lldt :: p -> p -> m ()
lldt p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

ltr :: p -> p -> m ()
ltr p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

rdmsr :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
rdmsr FContext
ctxt Word64
i_a = do
  FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RAX)
  FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RDX)

wrmsr :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
wrmsr FContext
ctxt Word64
i_a = do
  FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RAX)
  FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RDX)

rdtsc :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
rdtsc FContext
ctxt Word64
i_a = do
  FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RAX)
  FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
RDX)

swapgs :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
swapgs FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
GS)

xsetbv :: p -> p -> m ()
xsetbv p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

xsaveopt :: p -> p -> m ()
xsaveopt p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

xrstor :: p -> p -> m ()
xrstor p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

wrfsbase :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
wrfsbase FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
FS)

wrgsbase :: FContext -> Word64 -> StateT (Pred, VCS) Identity ()
wrgsbase FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func1 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
GS)

vinsertf128 :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vinsertf128 FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vextractf128 :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vextractf128 FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vextracti128 :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vextracti128 FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vperm2f128 :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vperm2f128 FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vperm2i128 :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vperm2i128 FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vshufpd :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vshufpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vshufps :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vshufps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vaddpd :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vaddpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vaddps :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vaddps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vsubpd :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vsubpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vsubps :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vsubps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vmulpd :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vmulpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vmulps :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vmulps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vxorpd :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vxorpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vxorps :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vxorps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vandpd :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vandpd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vandps :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vandps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vpalignr :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vpalignr FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

palignr :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
palignr FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vmovdqa :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vmovdqa FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vmovdqu :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vmovdqu  FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vmovlhps :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vmovlhps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vzeroupper :: p -> p -> m ()
vzeroupper p
ctxt p
i_a = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

vpunpckhwd :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vpunpckhwd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vpunpcklwd :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vpunpcklwd FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vpcmpeqb :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vpcmpeqb FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vpcmpeqw :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vpcmpeqw FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vpsllw :: FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vpsllw FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func3 FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

movhps :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movhps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

movlhps :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movlhps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

movhlps :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movhlps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False

vmovhps :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vmovhps FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
False


xadd :: FContext -> Word64 -> X86.Operand -> X86.Operand -> State (Pred,VCS) ()
xadd :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xadd FContext
ctxt Word64
i_a Operand
op1 Operand
op2 = do
  SimpleExpr
e1 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op1
  SimpleExpr
e2 <- FContext -> Operand -> State (Pred, VCS) SimpleExpr
read_operand FContext
ctxt Operand
op2
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op1 (Operator -> [SimpleExpr] -> SimpleExpr
SE_Op (Int -> Operator
Plus (Operand -> Int
forall a. HasSize a => a -> Int
sizeof Operand
op1)) [SimpleExpr
e1,SimpleExpr
e2])
  FContext
-> Word64
-> Operand
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_operand FContext
ctxt Word64
i_a Operand
op2 SimpleExpr
e1
  (Operand -> Operand -> FlagStatus)
-> Operand -> Operand -> StateT (Pred, VCS) Identity ()
write_flags (\Operand
_ Operand
_ -> FlagStatus
None) Operand
op1 Operand
op2

cmpxchg :: FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmpxchg FContext
ctxt Word64
i_a = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True

cmps :: FContext
-> Word64
-> p
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
cmps  FContext
ctxt Word64
i_a p
pre = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True

cmpsb :: FContext
-> Word64
-> p
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
cmpsb FContext
ctxt Word64
i_a p
pre = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True

cmpsw :: FContext
-> Word64
-> p
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
cmpsw FContext
ctxt Word64
i_a p
pre = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True

cmpsd :: FContext
-> Word64
-> p
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
cmpsd FContext
ctxt Word64
i_a p
pre = FContext
-> Word64
-> (FContext -> [SimpleExpr] -> SimpleExpr)
-> Bool
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
mov_with_func FContext
ctxt Word64
i_a FContext -> [SimpleExpr] -> SimpleExpr
mk_bottom Bool
True




tau_i :: FContext -> X86.Instruction -> State (Pred,VCS) ()
tau_i :: FContext -> Instruction -> StateT (Pred, VCS) Identity ()
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PUSH     Maybe Operand
_ [Operand
op1]     Maybe Int
_)   = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
push   FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
POP      Maybe Operand
_ [Operand
op1]     Maybe Int
_)   = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
pop    FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
LEA      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)   = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
lea    FContext
ctxt Word64
i_a Operand
op1 Operand
op2

tau_i FContext
ctxt i :: Instruction
i@(Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CALL     Maybe Operand
_ [Operand]
_         Maybe Int
_) = FContext -> Instruction -> StateT (Pred, VCS) Identity ()
call   FContext
ctxt Instruction
i
tau_i FContext
ctxt   (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
RET      Maybe Operand
_ [Operand]
_         Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
ret    FContext
ctxt Word64
i_a
tau_i FContext
ctxt   (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
IRETQ    Maybe Operand
_ [Operand]
_         Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
ret    FContext
ctxt Word64
i_a
tau_i FContext
ctxt   (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SYSRET   Maybe Operand
_ [Operand]
_         Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
sysret FContext
ctxt Word64
i_a
tau_i FContext
ctxt i :: Instruction
i@(Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
JMP      Maybe Operand
_ [Operand
op1]     Maybe Int
_) = FContext -> Instruction -> StateT (Pred, VCS) Identity ()
jmp    FContext
ctxt Instruction
i
tau_i FContext
ctxt   (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
LEAVE    Maybe Operand
_ [Operand]
_         Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
leave  FContext
ctxt Word64
i_a

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOV      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mov    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVZX    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movzx  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVSX    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movsx  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVSXD   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movsxd FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVAPS   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movaps FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVAPD   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movapd FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVABS   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movabs FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVUPD   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movupd FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVUPS   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movups FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVDQU   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movdqu FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVDQA   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movdqa FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVD     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movd   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVQ     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movq   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVLPD   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movlpd FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
MOVLPS   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movlps FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
Nothing Opcode
MOVSD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movsd  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
Nothing Opcode
MOVSS    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movss  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
VMOVD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vmovd  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
VMOVAPD  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vmovapd FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_       Opcode
VMOVAPS  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vmovaps FContext
ctxt Word64
i_a Operand
op1 Operand
op2

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVO    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNO   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVS    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNS   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVE    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVZ    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNE   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNZ   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVB    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNAE  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVC    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNB   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVAE   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNC   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVBE   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNA   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVA    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNBE  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVL    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNGE  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVG    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVGE   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNL   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVLE   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNG   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNLE  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVP    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVPE   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVNP   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMOVPO   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmov   FContext
ctxt Word64
i_a Operand
op1 Operand
op2

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CDQ      Maybe Operand
_ []        Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
cdq    FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CDQE     Maybe Operand
_ []        Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
cdqe   FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CQO      Maybe Operand
_ []        Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
cqo    FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CBW      Maybe Operand
_ []        Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
cbw    FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CWDE     Maybe Operand
_ []        Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
cwde   FContext
ctxt Word64
i_a

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
ADD      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
add    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SUB      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
sub    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
NEG      Maybe Operand
_ [Operand
op1]     Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
neg    FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
INC      Maybe Operand
_ [Operand
op1]     Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
inc    FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
DEC      Maybe Operand
_ [Operand
op1]     Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
dec    FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SHL      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
shl    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SHL      Maybe Operand
_ [Operand
op1]     Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
shl    FContext
ctxt Word64
i_a Operand
op1 (Word64 -> Operand
forall storage. Word64 -> GenericOperand storage
Immediate Word64
1)

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
NOP      Maybe Operand
_ [Operand]
_         Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
nop     FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
ENDBR64  Maybe Operand
_ [Operand]
_         Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
endbr64 FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
UD2      Maybe Operand
_ [Operand]
_         Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
ud2     FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
HLT      Maybe Operand
_ [Operand]
_         Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
hlt     FContext
ctxt Word64
i_a

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
WAIT     Maybe Operand
_ [Operand]
_         Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
wait    FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
MFENCE   Maybe Operand
_ [Operand]
_         Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
mfence  FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CLFLUSH  Maybe Operand
_ [Operand]
_         Maybe Int
_) = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
clflush FContext
ctxt Word64
i_a

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
ADC      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
adc    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SBB      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
sbb    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
ROL      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
rol    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
ROR      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
ror    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SHR      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
shr    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SHR      Maybe Operand
_ [Operand
op1]     Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
shr    FContext
ctxt Word64
i_a Operand
op1 (Word64 -> Operand
forall storage. Word64 -> GenericOperand storage
Immediate Word64
1)
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SAR      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
sar    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SAR      Maybe Operand
_ [Operand
op1]     Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
sar    FContext
ctxt Word64
i_a Operand
op1 (Word64 -> Operand
forall storage. Word64 -> GenericOperand storage
Immediate Word64
1)
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
MUL      Maybe Operand
_ [Operand
op1]     Maybe Int
_)          = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
mul1  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
MUL      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mul2  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
IMUL     Maybe Operand
_ [Operand
op1]     Maybe Int
_)          = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
imul1  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
IMUL     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
imul2  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
IMUL     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)      = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
imul3  FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
IDIV     Maybe Operand
_ [Operand
op1]     Maybe Int
_)          = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
idiv   FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
DIV      Maybe Operand
_ [Operand
op1]     Maybe Int
_)          = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
div1   FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SHLD     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)      = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
shld FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SHRD     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)      = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
shrd FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMP      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmp    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
TEST     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
test   FContext
ctxt Word64
i_a Operand
op1 Operand
op2

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
XOR      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xor    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
OR       Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
or'    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
AND      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
and'   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
NOT      Maybe Operand
_ [Operand
op1]     Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
not'   FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
BT       Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
bt     FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
BTC      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
btc    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
BTR      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
btr    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
BSR      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
bsr    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
BSF      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
bsf    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
BTS      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
bts    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
BSWAP    Maybe Operand
_ [Operand
op1]     Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
bswap  FContext
ctxt Word64
i_a Operand
op1



tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETO     Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNO    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETS     Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNS    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETE     Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETZ     Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNE    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNZ    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETB     Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNAE   Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETC     Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNB    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETAE    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNC    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETBE    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNA    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETA     Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNBE   Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETL     Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNGE   Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETGE    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNL    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETLE    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNG    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETG     Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNLE   Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETP     Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETPE    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETNP    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SETPO    Maybe Operand
_ [Operand
op1] Maybe Int
_) = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
setxx  FContext
ctxt Word64
i_a Operand
op1


tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
XORPS     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)            = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xorps      FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
MOVMSKPS  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)            = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movmskps   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
UNPCKLPS  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)            = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
unpcklps   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
BLENDVPD  Maybe Operand
_ [Operand
op1,Operand
op2]    Maybe Int
_)   = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
blendvpd   FContext
ctxt Word64
i_a Operand
op1 Operand
op2 (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
XMM0)
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
BLENDVPD  Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)   = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
blendvpd   FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
BLENDVPS  Maybe Operand
_ [Operand
op1,Operand
op2]    Maybe Int
_)   = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
blendvps   FContext
ctxt Word64
i_a Operand
op1 Operand
op2 (Register -> Operand
forall storage. storage -> GenericOperand storage
Storage Register
XMM0)
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
BLENDVPS  Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)   = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
blendvps   FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
EXTRACTPS Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)   = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
extractps  FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SHUFPS    Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)   = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
shufps     FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3


tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
XORPD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xorpd    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
ANDPD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
andpd    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
ANDNPD   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
andnpd   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
ORPD     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
orpd     FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SUBPD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
subpd    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
ADDPD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
addpd    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
HADDPD   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
haddpd   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
MOVMSKPD Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movmskpd   FContext
ctxt Word64
i_a Operand
op1 Operand
op2

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
POR        Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
por          FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PAND       Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pand         FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PANDN      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pandn        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PXOR       Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pxor         FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPOR       Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vpor         FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPAND      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vpand        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPANDN     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vpandn       FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPXOR      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vpxor        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PTEST      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
ptest        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PUNPCKLQDQ Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
punpcklqdq   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PUNPCKLBW  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
punpcklbw    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PUNPCKLDQ  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
punpckldq    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PMOVSXDQ   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmovsxdq     FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PMOVZXDQ   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmovzxdq     FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PMOVSXBD   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmovsxbd     FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PMOVZXBD   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmovzxbd     FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSHUFB     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pshufb       FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSHUFD     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pshufd       FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSHUFD     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)      = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pshufd3      FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPSHUFB    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vpshufb      FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPSHUFD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vpshufd      FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PCMPEQB    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pcmpeqb      FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PCMPEQD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pcmpeqd      FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PCMPGTB    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pcmpgtb      FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PCMPGTD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pcmpgtd      FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PADDD      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
paddd        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PADDB      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
paddb        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PADDQ      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
paddq        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSUBD      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psubd        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSUBB      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psubb        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSUBQ      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psubq        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PMULLD     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmulld       FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PMINSD     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pminsd       FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PMAXSD     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmaxsd       FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PMINUD     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pminud       FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PMAXUD     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmaxud       FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PMAXUQ     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pmaxuq       FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSRLD      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psrld        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSRLW      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psrlw        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSRLDQ     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psrldq       FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSLLDQ     Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
pslldq       FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSLLQ      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psllq        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSRLQ      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psrlq        FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSUBUSB    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psubusb      FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSUBUSW    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
psubusw      FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PINSRB     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_) = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pinsrq       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PINSRQ     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_) = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pinsrq       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PINSRD     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_) = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pinsrd       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PEXTRB     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_) = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pextrb       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PEXTRD     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_) = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pextrd       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PEXTRQ     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_) = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pextrq       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PSHUFLW    Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_) = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pshuflw      FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PCLMULQDQ  Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_) = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
pclmulqdq    FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PACKSSDW   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
packssdw     FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PACKSSWB   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)          = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
packsswb     FContext
ctxt Word64
i_a Operand
op1 Operand
op2


tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SUBSS    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
subss    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
ADDSS    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
addss    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
DIVSS    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
divss    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
MULSS    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mulss    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
ROUNDSS  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
roundss  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
UCOMISS  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
ucomiss  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
COMISS   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
comiss   FContext
ctxt Word64
i_a Operand
op1 Operand
op2

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SUBSD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
subsd    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
ADDSD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
addsd    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
DIVSD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
divsd    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
MULSD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
mulsd    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
ROUNDSD  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
roundsd  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
UCOMISD  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
ucomisd  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMPLTSD  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmpltsd  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMPEQSD  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmpeqsd  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMPNEQSD Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmpneqsd FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CMPNLESD Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmpnlesd FContext
ctxt Word64
i_a Operand
op1 Operand
op2



tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CVTSS2SD  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvtss2sd  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CVTSI2SS  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvtsi2ss  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CVTSI2SD  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvtsi2sd  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CVTSD2SS  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvtsd2ss  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CVTTSS2SI Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvttss2si FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CVTTSD2SI Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvttsd2si FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CVTTPD2DQ Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvttpd2dq FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CVTDQ2PD  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cvtdq2pd  FContext
ctxt Word64
i_a Operand
op1 Operand
op2

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FST      Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
fst'     FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FSTP     Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
fstp     FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FINIT    Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
finit'   FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FNINIT   Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fninit   FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FNSTCW   Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
fnstcw   FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FSTCW    Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
fstcw    FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FLD      Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p. Monad m => p -> p -> p -> m ()
fld      FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FLD1     Maybe Operand
_ []         Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fld1     FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FLDZ     Maybe Operand
_ []         Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fldz     FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FILD     Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
fild     FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FUCOM    Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fucom    FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FUCOMI   Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fucomi   FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FUCOMIP  Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fucomip  FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FUCOMP   Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fucomp   FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FUCOMPI  Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fucompi  FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FUCOMPP  Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fucompp  FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FCMOVB   Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fcmovxx  FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FCMOVBE  Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fcmovxx  FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FCMOVE   Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fcmovxx  FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FCMOVNE  Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fcmovxx  FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FCMOVU   Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fcmovxx  FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FCMOVNU  Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fcmovxx  FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FCMOVNBE Maybe Operand
_ [Operand]
_          Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fcmovxx  FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FADD     Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p. Monad m => p -> p -> p -> m ()
fadd1    FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FADD     Maybe Operand
_ [Operand
op1,Operand
op2]  Maybe Int
_)  = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p p. Monad m => p -> p -> p -> p -> m ()
fadd2    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FMUL     Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p. Monad m => p -> p -> p -> m ()
fmul1    FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FMUL     Maybe Operand
_ [Operand
op1,Operand
op2]  Maybe Int
_)  = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p p. Monad m => p -> p -> p -> p -> m ()
fmul2    FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FMULP    Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p. Monad m => p -> p -> p -> m ()
fmulp1   FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FMULP    Maybe Operand
_ [Operand
op1,Operand
op2]  Maybe Int
_)  = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p p. Monad m => p -> p -> p -> p -> m ()
fmulp2   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FDIVR    Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p. Monad m => p -> p -> p -> m ()
fdivr1   FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FDIVR    Maybe Operand
_ [Operand
op1,Operand
op2]  Maybe Int
_)  = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p p. Monad m => p -> p -> p -> p -> m ()
fdivr2   FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FDIVRP   Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p. Monad m => p -> p -> p -> m ()
fdivrp1  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FDIVRP   Maybe Operand
_ [Operand
op1,Operand
op2]  Maybe Int
_)  = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p p. Monad m => p -> p -> p -> p -> m ()
fdivrp2  FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FISUB    Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p. Monad m => p -> p -> p -> m ()
fisub    FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FISTTP   Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
fisttp   FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FXCH     Maybe Operand
_ [Operand
op1]      Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fxch     FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
FCHS     Maybe Operand
_ []         Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
fchs     FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
EMMS     Maybe Operand
_ []         Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
emms     FContext
ctxt Word64
i_a


tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VINSERTF128  Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vinsertf128  FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VEXTRACTI128 Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vextractf128 FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VEXTRACTF128 Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vextracti128 FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPERM2F128   Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vperm2f128   FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPERM2I128   Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vperm2i128   FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPALIGNR     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vpalignr     FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
PALIGNR      Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
palignr      FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VANDPS       Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vandps       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VSHUFPD      Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vshufpd      FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VSHUFPS      Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vshufps      FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VADDPD       Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vaddpd       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VADDPS       Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vaddps       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VSUBPD       Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vsubpd       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VSUBPS       Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vsubps       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VMULPD       Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vmulpd       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VMULPS       Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vmulps       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VXORPD       Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vxorpd       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VXORPS       Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vxorps       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VANDPD       Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vandpd       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VANDPS       Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vandps       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VMOVDQA      Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vmovdqa      FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VMOVDQU      Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vmovdqu      FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VMOVLHPS     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vmovlhps     FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPUNPCKHWD   Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vpunpckhwd   FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPUNPCKLWD   Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vpunpcklwd   FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VZEROUPPER   Maybe Operand
_ []            Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
vzeroupper   FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPCMPEQB     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vpcmpeqb     FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPCMPEQW     Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vpcmpeqw     FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VPSLLW       Maybe Operand
_ [Operand
op1,Operand
op2,Operand
op3] Maybe Int
_)  = FContext
-> Word64
-> Operand
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
vpsllw       FContext
ctxt Word64
i_a Operand
op1 Operand
op2 Operand
op3
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
MOVHPS       Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)      = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movhps       FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
MOVHLPS      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)      = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movhlps      FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
MOVLHPS      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)      = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
movlhps      FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
VMOVHPS      Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_)      = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
vmovhps      FContext
ctxt Word64
i_a Operand
op1 Operand
op2


tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CPUID    Maybe Operand
_ []       Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
cpuid    FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
RDMSR    Maybe Operand
_ []       Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
rdmsr    FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
WRMSR    Maybe Operand
_ []       Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
wrmsr    FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
RDTSC    Maybe Operand
_ []       Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
rdtsc    FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
IN       Maybe Operand
_ [Operand
op1]    Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
x86_in   FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
OUT      Maybe Operand
_ [Operand
op1]    Maybe Int
_)  = FContext -> Word64 -> Operand -> StateT (Pred, VCS) Identity ()
x86_out  FContext
ctxt Word64
i_a Operand
op1
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CLI      Maybe Operand
_ []       Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
cli      FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
CLTS     Maybe Operand
_ []       Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
clts     FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
INVPCID  Maybe Operand
_ [Operand]
_        Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
invpcid  FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
LGDT     Maybe Operand
_ [Operand]
_        Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
lgdt     FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
LIDT     Maybe Operand
_ [Operand]
_        Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
lidt     FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
LLDT     Maybe Operand
_ [Operand]
_        Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
lldt     FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
LTR      Maybe Operand
_ [Operand]
_        Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
ltr      FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
SWAPGS   Maybe Operand
_ [Operand]
_        Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
swapgs   FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
XSETBV   Maybe Operand
_ [Operand]
_        Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
xsetbv   FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
XSAVEOPT Maybe Operand
_ [Operand]
_        Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
xsaveopt FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
XRSTOR   Maybe Operand
_ [Operand]
_        Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p. Monad m => p -> p -> m ()
xrstor   FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
WRFSBASE Maybe Operand
_ [Operand]
_        Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
wrfsbase FContext
ctxt Word64
i_a
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
_ Opcode
WRGSBASE Maybe Operand
_ [Operand]
_        Maybe Int
_)  = FContext -> Word64 -> StateT (Pred, VCS) Identity ()
wrgsbase FContext
ctxt Word64
i_a

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
pre Opcode
CMPS   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64
-> Maybe Prefix
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
forall p.
FContext
-> Word64
-> p
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
cmps      FContext
ctxt Word64
i_a Maybe Prefix
pre Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
pre Opcode
CMPSB  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64
-> Maybe Prefix
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
forall p.
FContext
-> Word64
-> p
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
cmpsb     FContext
ctxt Word64
i_a Maybe Prefix
pre Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
pre Opcode
CMPSW  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64
-> Maybe Prefix
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
forall p.
FContext
-> Word64
-> p
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
cmpsw     FContext
ctxt Word64
i_a Maybe Prefix
pre Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
pre Opcode
CMPSD  Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64
-> Maybe Prefix
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
forall p.
FContext
-> Word64
-> p
-> Operand
-> Operand
-> StateT (Pred, VCS) Identity ()
cmpsw     FContext
ctxt Word64
i_a Maybe Prefix
pre Operand
op1 Operand
op2



tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) Maybe Prefix
Nothing     Opcode
XCHG    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xchg         FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) (Just Prefix
LOCK) Opcode
XADD    Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
xadd         FContext
ctxt Word64
i_a Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) (Just Prefix
LOCK) Opcode
CMPXCHG Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Word64 -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
cmpxchg      FContext
ctxt Word64
i_a Operand
op1 Operand
op2

tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) (Just Prefix
pre)  Opcode
MOVSD   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Prefix -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p p. Monad m => p -> p -> p -> p -> m ()
movsd_string FContext
ctxt Prefix
pre Operand
op1 Operand
op2
tau_i FContext
ctxt (Instruction (AddressWord64 Word64
i_a) (Just Prefix
pre)  Opcode
MOVSQ   Maybe Operand
_ [Operand
op1,Operand
op2] Maybe Int
_) = FContext
-> Prefix -> Operand -> Operand -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) p p p p. Monad m => p -> p -> p -> p -> m ()
movsq        FContext
ctxt Prefix
pre Operand
op1 Operand
op2

tau_i FContext
ctxt Instruction
i
  | Opcode -> Bool
isJump (Instruction -> Opcode
forall label storage prefix opcode annotation.
GenericInstruction label storage prefix opcode annotation -> opcode
Instr.opcode Instruction
i) Bool -> Bool -> Bool
|| Opcode -> Bool
isCondJump (Instruction -> Opcode
forall label storage prefix opcode annotation.
GenericInstruction label storage prefix opcode annotation -> opcode
Instr.opcode Instruction
i) = () -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
  | Context -> Bool
ctxt_continue_on_unknown_instruction (Context -> Bool) -> Context -> Bool
forall a b. (a -> b) -> a -> b
$ FContext -> Context
f_ctxt FContext
ctxt = [Char]
-> StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ()
forall a. [Char] -> a -> a
trace ([Char]
"Unsupported instruction: " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Instruction -> [Char]
forall a. Show a => a -> [Char]
show Instruction
i) (StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ())
-> StateT (Pred, VCS) Identity () -> StateT (Pred, VCS) Identity ()
forall a b. (a -> b) -> a -> b
$ () -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
  | Bool
otherwise = [Char] -> StateT (Pred, VCS) Identity ()
forall a. HasCallStack => [Char] -> a
error ([Char]
"Unsupported instruction: " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Instruction -> [Char]
forall a. Show a => a -> [Char]
show Instruction
i)

-- | Do predicate transformation over a block of instructions.
-- Does not take into account flags, commonly function @`tau_block`@ should be used.
tau_b :: FContext -> [X86.Instruction] -> State (Pred,VCS) ()
tau_b :: FContext -> [Instruction] -> StateT (Pred, VCS) Identity ()
tau_b FContext
ctxt []  = () -> StateT (Pred, VCS) Identity ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
tau_b FContext
ctxt (Instruction
i:[Instruction]
is) = do
  FContext
-> Word64
-> Register
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
write_reg FContext
ctxt (Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i) Register
RIP (Word64 -> SimpleExpr
SE_Immediate (Word64 -> SimpleExpr) -> Word64 -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i Word64 -> Word64 -> Word64
forall a. Num a => a -> a -> a
+ (Int -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word64) -> Int -> Word64
forall a b. (a -> b) -> a -> b
$ Instruction -> Int
forall a. HasSize a => a -> Int
sizeof Instruction
i))
  FContext -> Instruction -> StateT (Pred, VCS) Identity ()
tau_i FContext
ctxt Instruction
i
  FContext -> [Instruction] -> StateT (Pred, VCS) Identity ()
tau_b FContext
ctxt [Instruction]
is



-- TODO JE, other JMP aboves and JUMP lesses
add_jump_to_pred :: X86.Instruction -> X86.Instruction -> FlagStatus -> FlagStatus
add_jump_to_pred :: Instruction -> Instruction -> FlagStatus -> FlagStatus
add_jump_to_pred i0 :: Instruction
i0@(Instruction AddressWord64
_ Maybe Prefix
_ Opcode
JA Maybe Operand
_ [Immediate Word64
trgt] Maybe Int
_) Instruction
i1 FlagStatus
flg =
  case FlagStatus
flg of
    FS_CMP Maybe Bool
b Operand
o1 Operand
o2 -> if Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i1 Word64 -> Word64 -> Bool
forall a. Eq a => a -> a -> Bool
== Word64 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
trgt then Maybe Bool -> Operand -> Operand -> FlagStatus
FS_CMP (Bool -> Maybe Bool
forall a. a -> Maybe a
Just Bool
False) Operand
o1 Operand
o2 else Maybe Bool -> Operand -> Operand -> FlagStatus
FS_CMP (Bool -> Maybe Bool
forall a. a -> Maybe a
Just Bool
True) Operand
o1 Operand
o2
    FlagStatus
_ -> FlagStatus
flg
add_jump_to_pred Instruction
i0 Instruction
i1 FlagStatus
flg = FlagStatus
flg


-- | Do predicate transformation over a basic block in a CFG.
-- Given an edge in the CFG from none block to another, perform predicate transformation.
-- Parameter insts' is needed to set the flags properly. If @Nothing@ is supplied, the flags are overapproximatively set to @`None`@.
tau_block ::
  FContext                    -- ^ The context
  -> [X86.Instruction]        -- ^ The instructions of the basic block
  -> Maybe [X86.Instruction]  -- ^ Optionally, the instructions of the next block if symbolically executing an edge in a CFG.
  -> Pred                     -- ^ The predicate to be transformed
  -> (Pred, VCS)
tau_block :: FContext
-> [Instruction] -> Maybe [Instruction] -> Pred -> (Pred, VCS)
tau_block FContext
ctxt [Instruction]
insts Maybe [Instruction]
insts' p :: Pred
p@(Predicate Map StatePart SimpleExpr
eqs FlagStatus
flg) =
  if [Instruction]
insts [Instruction] -> [Instruction] -> Bool
forall a. Eq a => a -> a -> Bool
== [] then
    (Pred
p, VCS
forall a. Set a
S.empty)
  else let
      addr :: Word64
addr                   = Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof (Instruction -> Word64) -> Instruction -> Word64
forall a b. (a -> b) -> a -> b
$ [Instruction] -> Instruction
forall a. [a] -> a
head [Instruction]
insts
      eqs' :: Map StatePart SimpleExpr
eqs'                   = Word64 -> Map StatePart SimpleExpr -> Map StatePart SimpleExpr
forall a.
Integral a =>
a -> Map StatePart SimpleExpr -> Map StatePart SimpleExpr
write_rip Word64
addr Map StatePart SimpleExpr
eqs
      (Pred
p'',VCS
vcs'')            = StateT (Pred, VCS) Identity () -> (Pred, VCS) -> (Pred, VCS)
forall s a. State s a -> s -> s
execState (FContext -> [Instruction] -> StateT (Pred, VCS) Identity ()
tau_b FContext
ctxt [Instruction]
insts) (Map StatePart SimpleExpr -> FlagStatus -> Pred
Predicate Map StatePart SimpleExpr
eqs' FlagStatus
flg, VCS
forall a. Set a
S.empty)
      Predicate Map StatePart SimpleExpr
eqs'' FlagStatus
flgs'' = Pred
p'' in
    case Maybe [Instruction]
insts' of
      Maybe [Instruction]
Nothing -> (Pred
p'', VCS
vcs'')
      Just (Instruction
i':[Instruction]
_) ->
        let addr' :: Word64
addr'  = Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i' in
          (Map StatePart SimpleExpr -> FlagStatus -> Pred
Predicate (Word64 -> Map StatePart SimpleExpr -> Map StatePart SimpleExpr
forall a.
Integral a =>
a -> Map StatePart SimpleExpr -> Map StatePart SimpleExpr
write_rip Word64
addr' Map StatePart SimpleExpr
eqs'') (Instruction -> Instruction -> FlagStatus -> FlagStatus
add_jump_to_pred ([Instruction] -> Instruction
forall a. [a] -> a
last [Instruction]
insts) Instruction
i' FlagStatus
flgs''), VCS
vcs'')
 where
  write_rip :: a -> Map StatePart SimpleExpr -> Map StatePart SimpleExpr
write_rip a
addr Map StatePart SimpleExpr
eqs = StatePart
-> SimpleExpr
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
forall k a. Ord k => k -> a -> Map k a -> Map k a
M.insert (Register -> StatePart
SP_Reg Register
RIP) (Word64 -> SimpleExpr
SE_Immediate (Word64 -> SimpleExpr) -> Word64 -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ a -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral a
addr) Map StatePart SimpleExpr
eqs






join_expr :: [Char] -> FContext -> SimpleExpr -> SimpleExpr -> SimpleExpr
join_expr [Char]
msg FContext
ctxt SimpleExpr
e0 SimpleExpr
e1 = [Char] -> FContext -> [SimpleExpr] -> SimpleExpr
join_exprs [Char]
msg FContext
ctxt ([SimpleExpr] -> SimpleExpr) -> [SimpleExpr] -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ (SimpleExpr -> SimpleExpr) -> [SimpleExpr] -> [SimpleExpr]
forall a b. (a -> b) -> [a] -> [b]
map SimpleExpr -> SimpleExpr
simp [SimpleExpr
e0,SimpleExpr
e1]
join_expr' :: FContext -> Pred -> p -> SimpleExpr -> SimpleExpr -> SimpleExpr
join_expr' FContext
ctxt Pred
p p
q SimpleExpr
e0 SimpleExpr
e1 = 
  let rip :: SimpleExpr
rip = State (Pred, VCS) SimpleExpr -> (Pred, VCS) -> SimpleExpr
forall s a. State s a -> s -> a
evalState (FContext -> Register -> State (Pred, VCS) SimpleExpr
read_reg FContext
ctxt Register
RIP) (Pred
p,VCS
forall a. Set a
S.empty) in
         [Char] -> FContext -> [SimpleExpr] -> SimpleExpr
join_exprs ([Char]
"join @(" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ SimpleExpr -> [Char]
forall a. Show a => a -> [Char]
show SimpleExpr
rip  [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"):") FContext
ctxt ([SimpleExpr] -> SimpleExpr) -> [SimpleExpr] -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ (SimpleExpr -> SimpleExpr) -> [SimpleExpr] -> [SimpleExpr]
forall a b. (a -> b) -> [a] -> [b]
map SimpleExpr -> SimpleExpr
simp [SimpleExpr
e0,SimpleExpr
e1] -- \n" ++ show p ++ "\n\n" ++ show q $ 


-- the join of two predicates
-- 1.) keep any key-value pair (sp,v) that is in both predicates
-- 2.) for any remaining key-value pair (sp,v) in either of the predicates, join v with reading sp from the other predicate
-- 3.) the flag expression is kept based on strict equality
--
--
-- Assumes any statepart not currently in the state is unwritten to.
join_preds :: FContext -> Pred -> Pred -> Pred
join_preds FContext
ctxt p :: Pred
p@(Predicate Map StatePart SimpleExpr
eqs_p FlagStatus
flg0) p' :: Pred
p'@(Predicate Map StatePart SimpleExpr
eqs_p' FlagStatus
flg1) =
  let (Pred
p0,Map StatePart SimpleExpr
eqs0,Pred
p1,Map StatePart SimpleExpr
eqs1) = if Map StatePart SimpleExpr -> Int
forall k a. Map k a -> Int
M.size Map StatePart SimpleExpr
eqs_p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Map StatePart SimpleExpr -> Int
forall k a. Map k a -> Int
M.size Map StatePart SimpleExpr
eqs_p' then (Pred
p,Map StatePart SimpleExpr
eqs_p,Pred
p',Map StatePart SimpleExpr
eqs_p') else (Pred
p',Map StatePart SimpleExpr
eqs_p',Pred
p,Map StatePart SimpleExpr
eqs_p)
      step0 :: Map StatePart SimpleExpr
step0  = SimpleWhenMissing StatePart SimpleExpr SimpleExpr
-> SimpleWhenMissing StatePart SimpleExpr SimpleExpr
-> SimpleWhenMatched StatePart SimpleExpr SimpleExpr SimpleExpr
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
forall k a c b.
Ord k =>
SimpleWhenMissing k a c
-> SimpleWhenMissing k b c
-> SimpleWhenMatched k a b c
-> Map k a
-> Map k b
-> Map k c
MI.merge ((StatePart -> SimpleExpr -> SimpleExpr)
-> SimpleWhenMissing StatePart SimpleExpr SimpleExpr
forall (f :: * -> *) k x y.
Applicative f =>
(k -> x -> y) -> WhenMissing f k x y
MI.mapMissing ((StatePart -> SimpleExpr -> SimpleExpr)
 -> SimpleWhenMissing StatePart SimpleExpr SimpleExpr)
-> (StatePart -> SimpleExpr -> SimpleExpr)
-> SimpleWhenMissing StatePart SimpleExpr SimpleExpr
forall a b. (a -> b) -> a -> b
$ Pred -> Pred -> StatePart -> SimpleExpr -> SimpleExpr
forall p. p -> Pred -> StatePart -> SimpleExpr -> SimpleExpr
mk_entry Pred
p0 Pred
p1) SimpleWhenMissing StatePart SimpleExpr SimpleExpr
forall (f :: * -> *) k x y. Applicative f => WhenMissing f k x y
MI.dropMissing ((StatePart -> SimpleExpr -> SimpleExpr -> SimpleExpr)
-> SimpleWhenMatched StatePart SimpleExpr SimpleExpr SimpleExpr
forall (f :: * -> *) k x y z.
Applicative f =>
(k -> x -> y -> z) -> WhenMatched f k x y z
MI.zipWithMatched StatePart -> SimpleExpr -> SimpleExpr -> SimpleExpr
forall p. p -> SimpleExpr -> SimpleExpr -> SimpleExpr
do_join) Map StatePart SimpleExpr
eqs0 Map StatePart SimpleExpr
eqs1
      flg' :: FlagStatus
flg'   = if FlagStatus
flg0 FlagStatus -> FlagStatus -> Bool
forall a. Eq a => a -> a -> Bool
== FlagStatus
flg1 then FlagStatus
flg0 else FlagStatus
None
      q :: Pred
q      = Map StatePart SimpleExpr -> FlagStatus -> Pred
Predicate Map StatePart SimpleExpr
step0 FlagStatus
flg'
      diff1 :: Map StatePart SimpleExpr
diff1  = Map StatePart SimpleExpr
-> Map StatePart SimpleExpr -> Map StatePart SimpleExpr
forall k a b. Ord k => Map k a -> Map k b -> Map k a
M.difference Map StatePart SimpleExpr
eqs1 Map StatePart SimpleExpr
eqs0 in
    (Pred, VCS) -> Pred
forall a b. (a, b) -> a
fst ((Pred, VCS) -> Pred) -> (Pred, VCS) -> Pred
forall a b. (a -> b) -> a -> b
$ State (Pred, VCS) (Map StatePart ()) -> (Pred, VCS) -> (Pred, VCS)
forall s a. State s a -> s -> s
execState ((StatePart -> SimpleExpr -> StateT (Pred, VCS) Identity ())
-> Map StatePart SimpleExpr -> State (Pred, VCS) (Map StatePart ())
forall (t :: * -> *) k a b.
Applicative t =>
(k -> a -> t b) -> Map k a -> t (Map k b)
M.traverseWithKey (Pred
-> Pred
-> StatePart
-> SimpleExpr
-> StateT (Pred, VCS) Identity ()
forall p.
Pred
-> p -> StatePart -> SimpleExpr -> StateT (Pred, VCS) Identity ()
mk_entry' Pred
p0 Pred
p1) Map StatePart SimpleExpr
diff1) (Pred
q,VCS
forall a. Set a
S.empty)
 where
  do_join :: p -> SimpleExpr -> SimpleExpr -> SimpleExpr
do_join p
_ SimpleExpr
v SimpleExpr
v'
    | SimpleExpr
v SimpleExpr -> SimpleExpr -> Bool
forall a. Eq a => a -> a -> Bool
== SimpleExpr
v' = SimpleExpr
v
    | Bool
otherwise = FContext -> Pred -> Pred -> SimpleExpr -> SimpleExpr -> SimpleExpr
forall p.
FContext -> Pred -> p -> SimpleExpr -> SimpleExpr -> SimpleExpr
join_expr' FContext
ctxt Pred
p Pred
p' SimpleExpr
v SimpleExpr
v'

  mk_entry :: p -> Pred -> StatePart -> SimpleExpr -> SimpleExpr
mk_entry p
p Pred
p' StatePart
sp SimpleExpr
v
   | StatePart -> SimpleExpr -> Bool
is_initial StatePart
sp SimpleExpr
v = SimpleExpr
v
   | Bool
otherwise = 
       let v' :: SimpleExpr
v' = State (Pred, VCS) SimpleExpr -> (Pred, VCS) -> SimpleExpr
forall s a. State s a -> s -> a
evalState (FContext -> StatePart -> State (Pred, VCS) SimpleExpr
read_sp FContext
ctxt StatePart
sp) (Pred
p',VCS
forall a. Set a
S.empty) in
         SimpleExpr -> SimpleExpr -> StatePart -> SimpleExpr -> SimpleExpr
forall p p p a. p -> p -> p -> a -> a
temp_trace SimpleExpr
v SimpleExpr
v' StatePart
sp (SimpleExpr -> SimpleExpr) -> SimpleExpr -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ StatePart -> SimpleExpr -> SimpleExpr -> SimpleExpr
forall p. p -> SimpleExpr -> SimpleExpr -> SimpleExpr
do_join StatePart
sp SimpleExpr
v SimpleExpr
v'

  mk_entry' :: Pred
-> p -> StatePart -> SimpleExpr -> StateT (Pred, VCS) Identity ()
mk_entry' Pred
p p
p' StatePart
sp' SimpleExpr
v'
    | StatePart -> SimpleExpr -> Bool
is_initial StatePart
sp' SimpleExpr
v' = FContext
-> Word64
-> (Word64 -> StatePart -> MemWriteIdentifier)
-> (StatePart, SimpleExpr)
-> StateT (Pred, VCS) Identity ()
write_sp FContext
ctxt Word64
0 Word64 -> StatePart -> MemWriteIdentifier
mk_mid (StatePart
sp', SimpleExpr
v')
    | Bool
otherwise = do
        let v :: SimpleExpr
v = State (Pred, VCS) SimpleExpr -> (Pred, VCS) -> SimpleExpr
forall s a. State s a -> s -> a
evalState (FContext -> StatePart -> State (Pred, VCS) SimpleExpr
read_sp FContext
ctxt StatePart
sp') (Pred
p,VCS
forall a. Set a
S.empty)
        FContext
-> Word64
-> (Word64 -> StatePart -> MemWriteIdentifier)
-> (StatePart, SimpleExpr)
-> StateT (Pred, VCS) Identity ()
write_sp FContext
ctxt Word64
0 Word64 -> StatePart -> MemWriteIdentifier
mk_mid (StatePart
sp', SimpleExpr -> SimpleExpr -> StatePart -> SimpleExpr -> SimpleExpr
forall p p p a. p -> p -> p -> a -> a
temp_trace SimpleExpr
v SimpleExpr
v' StatePart
sp' (SimpleExpr -> SimpleExpr) -> SimpleExpr -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ StatePart -> SimpleExpr -> SimpleExpr -> SimpleExpr
forall p. p -> SimpleExpr -> SimpleExpr -> SimpleExpr
do_join StatePart
sp' SimpleExpr
v SimpleExpr
v')

  temp_trace :: p -> p -> p -> a -> a
temp_trace p
v p
v' p
sp = a -> a
forall a. a -> a
id -- if S.size (srcs_of_expr v'') == 0 && S.size (srcs_of_expr v) > 0 && S.size (srcs_of_expr v') > 0 then traceShow ("temp_trace",sp,v,v',v'') v'' else v''

  mk_mid :: Word64 -> StatePart -> MemWriteIdentifier
mk_mid = [Char] -> Word64 -> StatePart -> MemWriteIdentifier
MemWriteFunction [Char]
"joining" -- never used





implies_preds :: FContext -> Pred -> Pred -> Bool
implies_preds FContext
ctxt p :: Pred
p@(Predicate Map StatePart SimpleExpr
eqs0 FlagStatus
flg0) q :: Pred
q@(Predicate Map StatePart SimpleExpr
eqs1 FlagStatus
flg1) =
  FlagStatus
flg0 FlagStatus -> [FlagStatus] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [FlagStatus
None,FlagStatus
flg1] Bool -> Bool -> Bool
&& (((StatePart, SimpleExpr) -> Bool)
-> [(StatePart, SimpleExpr)] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
all (StatePart, SimpleExpr) -> Bool
implied_by_eqs0 ([(StatePart, SimpleExpr)] -> Bool)
-> [(StatePart, SimpleExpr)] -> Bool
forall a b. (a -> b) -> a -> b
$ Map StatePart SimpleExpr -> [(StatePart, SimpleExpr)]
forall k a. Map k a -> [(k, a)]
M.toList (Map StatePart SimpleExpr -> [(StatePart, SimpleExpr)])
-> Map StatePart SimpleExpr -> [(StatePart, SimpleExpr)]
forall a b. (a -> b) -> a -> b
$ (SimpleExpr -> SimpleExpr -> Maybe SimpleExpr)
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
forall k a b.
Ord k =>
(a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a
M.differenceWith SimpleExpr -> SimpleExpr -> Maybe SimpleExpr
forall a. Eq a => a -> a -> Maybe a
pick_unequal Map StatePart SimpleExpr
eqs1 Map StatePart SimpleExpr
eqs0)
 where
  pick_unequal :: a -> a -> Maybe a
pick_unequal a
v1 a
v0
    | a
v1 a -> a -> Bool
forall a. Eq a => a -> a -> Bool
/= a
v0 = a -> Maybe a
forall a. a -> Maybe a
Just a
v1
    | Bool
otherwise = Maybe a
forall a. Maybe a
Nothing

  implied_by_eqs0 :: (StatePart, SimpleExpr) -> Bool
implied_by_eqs0 (SP_Reg Register
RIP, SimpleExpr
_) = Bool
True -- technicality 
  implied_by_eqs0 (StatePart
sp1,SimpleExpr
v1) =
    let v0 :: SimpleExpr
v0  = State (Pred, VCS) SimpleExpr -> (Pred, VCS) -> SimpleExpr
forall s a. State s a -> s -> a
evalState (FContext -> StatePart -> State (Pred, VCS) SimpleExpr
read_sp FContext
ctxt StatePart
sp1) (Pred
p,VCS
forall a. Set a
S.empty) in
      -- if v0 `expr_implies` v1  then True else traceShow (sp1,v0,v1) False
      SimpleExpr
v0 SimpleExpr -> SimpleExpr -> Bool
`expr_implies` SimpleExpr
v1 

  (Bottom (FromPointerBases Set PointerBase
bs0)) expr_implies :: SimpleExpr -> SimpleExpr -> Bool
`expr_implies` (Bottom (FromPointerBases Set PointerBase
bs1)) = Set PointerBase
bs1 Set PointerBase -> Set PointerBase -> Bool
forall a. Ord a => Set a -> Set a -> Bool
`S.isSubsetOf` Set PointerBase
bs0
  SimpleExpr
e0  `expr_implies` SimpleExpr
e1 
    | SimpleExpr -> Bool
contains_bot SimpleExpr
e0 Bool -> Bool -> Bool
|| SimpleExpr -> Bool
contains_bot SimpleExpr
e1 =
      let srcs0 :: Set BotSrc
srcs0 = FContext -> SimpleExpr -> Set BotSrc
srcs_of_expr FContext
ctxt SimpleExpr
e0
          srcs1 :: Set BotSrc
srcs1 = FContext -> SimpleExpr -> Set BotSrc
srcs_of_expr FContext
ctxt SimpleExpr
e1 in
        Set BotSrc -> Bool
forall a. Set a -> Bool
S.null Set BotSrc
srcs0 Bool -> Bool -> Bool
|| Set BotSrc
srcs1 Set BotSrc -> Set BotSrc -> Bool
forall a. Ord a => Set a -> Set a -> Bool
`S.isSubsetOf` Set BotSrc
srcs0
    | Bool
otherwise = SimpleExpr
e0 SimpleExpr -> SimpleExpr -> Bool
forall a. Eq a => a -> a -> Bool
== SimpleExpr
e1



-- | The initial predicate.
init_pred ::
  FContext                 -- ^ The current context
  -> Invariants            -- ^ The currently available invariants
  -> S.Set (NodeInfo,Pred) -- ^ The currently known postconditions
  -> S.Set StatePart       -- ^ The currently known stateparts of the function
  -> Pred
init_pred :: FContext
-> Invariants -> Set (NodeInfo, Pred) -> Set StatePart -> Pred
init_pred FContext
ctxt Invariants
curr_invs Set (NodeInfo, Pred)
curr_posts Set StatePart
curr_sps =
  let f :: [Char]
f                    = FContext -> [Char]
f_name FContext
ctxt
      finit :: Map StatePart SimpleExpr
finit                = FContext -> Map StatePart SimpleExpr
f_init FContext
ctxt
      finit' :: Map StatePart SimpleExpr
finit'               = (SimpleExpr -> Bool)
-> Map StatePart SimpleExpr -> Map StatePart SimpleExpr
forall a k. (a -> Bool) -> Map k a -> Map k a
M.filter (Bool -> Bool
not (Bool -> Bool) -> (SimpleExpr -> Bool) -> SimpleExpr -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SimpleExpr -> Bool
contains_bot) Map StatePart SimpleExpr
finit


      rsp0 :: SimpleExpr
rsp0                 = StatePart -> SimpleExpr
SE_Var (StatePart -> SimpleExpr) -> StatePart -> SimpleExpr
forall a b. (a -> b) -> a -> b
$ [Char] -> StatePart
SP_StackPointer [Char]
f
      write_stack_pointer :: Map StatePart SimpleExpr -> Map StatePart SimpleExpr
write_stack_pointer  = StatePart
-> SimpleExpr
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
forall k a. Ord k => k -> a -> Map k a -> Map k a
M.insert (Register -> StatePart
SP_Reg Register
RSP)    (SimpleExpr
 -> Map StatePart SimpleExpr -> Map StatePart SimpleExpr)
-> SimpleExpr
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
forall a b. (a -> b) -> a -> b
$ SimpleExpr
rsp0
      write_return_address :: Map StatePart SimpleExpr -> Map StatePart SimpleExpr
write_return_address = StatePart
-> SimpleExpr
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
forall k a. Ord k => k -> a -> Map k a -> Map k a
M.insert (SimpleExpr -> Int -> StatePart
SP_Mem SimpleExpr
rsp0 Int
8) (SimpleExpr
 -> Map StatePart SimpleExpr -> Map StatePart SimpleExpr)
-> SimpleExpr
-> Map StatePart SimpleExpr
-> Map StatePart SimpleExpr
forall a b. (a -> b) -> a -> b
$ StatePart -> SimpleExpr
SE_Var (SimpleExpr -> Int -> StatePart
SP_Mem SimpleExpr
rsp0 Int
8)
      sps :: Set StatePart
sps  = Set StatePart -> Set StatePart -> Set StatePart
forall a. Ord a => Set a -> Set a -> Set a
S.union Set StatePart
curr_sps (StatePart -> Set StatePart -> Set StatePart
forall a. Ord a => a -> Set a -> Set a
S.delete (Register -> StatePart
SP_Reg Register
RIP) (Set StatePart -> Set StatePart) -> Set StatePart -> Set StatePart
forall a b. (a -> b) -> a -> b
$ Invariants -> Set (NodeInfo, Pred) -> Set StatePart
gather_stateparts Invariants
curr_invs Set (NodeInfo, Pred)
curr_posts)
      eqs :: Map StatePart SimpleExpr
eqs  = Map StatePart SimpleExpr -> Map StatePart SimpleExpr
write_stack_pointer (Map StatePart SimpleExpr -> Map StatePart SimpleExpr)
-> Map StatePart SimpleExpr -> Map StatePart SimpleExpr
forall a b. (a -> b) -> a -> b
$ Map StatePart SimpleExpr -> Map StatePart SimpleExpr
write_return_address (Map StatePart SimpleExpr -> Map StatePart SimpleExpr)
-> Map StatePart SimpleExpr -> Map StatePart SimpleExpr
forall a b. (a -> b) -> a -> b
$ Map StatePart SimpleExpr
-> Map StatePart SimpleExpr -> Map StatePart SimpleExpr
forall k a. Ord k => Map k a -> Map k a -> Map k a
M.union Map StatePart SimpleExpr
finit' (Map StatePart SimpleExpr -> Map StatePart SimpleExpr)
-> Map StatePart SimpleExpr -> Map StatePart SimpleExpr
forall a b. (a -> b) -> a -> b
$ [(StatePart, SimpleExpr)] -> Map StatePart SimpleExpr
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList ((StatePart -> (StatePart, SimpleExpr))
-> [StatePart] -> [(StatePart, SimpleExpr)]
forall a b. (a -> b) -> [a] -> [b]
map (\StatePart
sp -> (StatePart
sp,StatePart -> SimpleExpr
SE_Var StatePart
sp)) ([StatePart] -> [(StatePart, SimpleExpr)])
-> [StatePart] -> [(StatePart, SimpleExpr)]
forall a b. (a -> b) -> a -> b
$ Set StatePart -> [StatePart]
forall a. Set a -> [a]
S.toList Set StatePart
sps) in
    Map StatePart SimpleExpr -> FlagStatus -> Pred
Predicate Map StatePart SimpleExpr
eqs FlagStatus
None



get_stateparts_of_preds :: Set Pred -> Set StatePart
get_stateparts_of_preds Set Pred
ps = [Set StatePart] -> Set StatePart
forall (f :: * -> *) a. (Foldable f, Ord a) => f (Set a) -> Set a
S.unions ([Set StatePart] -> Set StatePart)
-> [Set StatePart] -> Set StatePart
forall a b. (a -> b) -> a -> b
$ (Pred -> Set StatePart) -> [Pred] -> [Set StatePart]
forall a b. (a -> b) -> [a] -> [b]
map Pred -> Set StatePart
get_stateparts_of_pred ([Pred] -> [Set StatePart]) -> [Pred] -> [Set StatePart]
forall a b. (a -> b) -> a -> b
$ Set Pred -> [Pred]
forall a. Set a -> [a]
S.toList (Set Pred -> [Pred]) -> Set Pred -> [Pred]
forall a b. (a -> b) -> a -> b
$ Set Pred
ps

get_stateparts_of_pred :: Pred -> Set StatePart
get_stateparts_of_pred (Predicate Map StatePart SimpleExpr
eqs FlagStatus
_) = (StatePart -> Bool) -> Set StatePart -> Set StatePart
forall a. (a -> Bool) -> Set a -> Set a
S.filter (Bool -> Bool
not (Bool -> Bool) -> (StatePart -> Bool) -> StatePart -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StatePart -> Bool
contains_bot_sp) (Set StatePart -> Set StatePart) -> Set StatePart -> Set StatePart
forall a b. (a -> b) -> a -> b
$ Map StatePart SimpleExpr -> Set StatePart
forall k a. Map k a -> Set k
M.keysSet Map StatePart SimpleExpr
eqs



-- | Given the currently known invariants and postconditions, gather all stateparts occurring in the current function.
gather_stateparts ::
     Invariants            -- ^ The currently available invariants
  -> S.Set (NodeInfo,Pred) -- ^ The currently known postconditions
  -> S.Set StatePart
gather_stateparts :: Invariants -> Set (NodeInfo, Pred) -> Set StatePart
gather_stateparts Invariants
invs Set (NodeInfo, Pred)
posts = [Set StatePart] -> Set StatePart
forall (f :: * -> *) a. (Foldable f, Ord a) => f (Set a) -> Set a
S.unions [(Int -> Pred -> Set StatePart -> Set StatePart)
-> Set StatePart -> Invariants -> Set StatePart
forall a b. (Int -> a -> b -> b) -> b -> IntMap a -> b
IM.foldrWithKey Int -> Pred -> Set StatePart -> Set StatePart
forall p. p -> Pred -> Set StatePart -> Set StatePart
accumulate_stateparts Set StatePart
forall a. Set a
S.empty Invariants
invs, Set Pred -> Set StatePart
get_stateparts_of_preds (((NodeInfo, Pred) -> Pred) -> Set (NodeInfo, Pred) -> Set Pred
forall b a. Ord b => (a -> b) -> Set a -> Set b
S.map (NodeInfo, Pred) -> Pred
forall a b. (a, b) -> b
snd Set (NodeInfo, Pred)
posts)]
 where
  accumulate_stateparts :: p -> Pred -> Set StatePart -> Set StatePart
accumulate_stateparts p
a Pred
p Set StatePart
sps = Set StatePart -> Set StatePart -> Set StatePart
forall a. Ord a => Set a -> Set a -> Set a
S.union Set StatePart
sps (Pred -> Set StatePart
get_stateparts_of_pred Pred
p)








-- | Get the invariant for a given instruction address for a given function entry
get_invariant :: FContext -> Int -> Maybe Pred
get_invariant :: FContext -> Int -> Maybe Pred
get_invariant FContext
fctxt Int
a = do
  let ctxt :: Context
ctxt   = FContext -> Context
f_ctxt FContext
fctxt
  let entry :: Int
entry  = FContext -> Int
f_entry FContext
fctxt
  CFG
g         <- Int -> IntMap CFG -> Maybe CFG
forall a. Int -> IntMap a -> Maybe a
IM.lookup Int
entry (IntMap CFG -> Maybe CFG) -> IntMap CFG -> Maybe CFG
forall a b. (a -> b) -> a -> b
$ Context -> IntMap CFG
ctxt_cfgs   Context
ctxt
  Invariants
invs      <- Int -> IntMap Invariants -> Maybe Invariants
forall a. Int -> IntMap a -> Maybe a
IM.lookup Int
entry (IntMap Invariants -> Maybe Invariants)
-> IntMap Invariants -> Maybe Invariants
forall a b. (a -> b) -> a -> b
$ Context -> IntMap Invariants
ctxt_invs   Context
ctxt
  Int
blockId   <- Int -> IntMap Int -> Maybe Int
forall a. Int -> IntMap a -> Maybe a
IM.lookup Int
a (IntMap Int -> Maybe Int) -> IntMap Int -> Maybe Int
forall a b. (a -> b) -> a -> b
$ CFG -> IntMap Int
cfg_addr_to_blockID CFG
g
  Pred
p         <- Int -> Invariants -> Maybe Pred
forall a. Int -> IntMap a -> Maybe a
IM.lookup Int
blockId Invariants
invs
  [Instruction]
instrs    <- Int -> IntMap [Instruction] -> Maybe [Instruction]
forall a. Int -> IntMap a -> Maybe a
IM.lookup Int
blockId (IntMap [Instruction] -> Maybe [Instruction])
-> IntMap [Instruction] -> Maybe [Instruction]
forall a b. (a -> b) -> a -> b
$ CFG -> IntMap [Instruction]
cfg_instrs CFG
g

  Pred -> Maybe Pred
forall (m :: * -> *) a. Monad m => a -> m a
return (Pred -> Maybe Pred) -> Pred -> Maybe Pred
forall a b. (a -> b) -> a -> b
$ (Pred, VCS) -> Pred
forall a b. (a, b) -> a
fst ((Pred, VCS) -> Pred) -> (Pred, VCS) -> Pred
forall a b. (a -> b) -> a -> b
$ FContext
-> [Instruction] -> Maybe [Instruction] -> Pred -> (Pred, VCS)
tau_block FContext
fctxt ((Instruction -> Bool) -> [Instruction] -> [Instruction]
forall a. (a -> Bool) -> [a] -> [a]
takeWhile (\Instruction
i -> Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Instruction -> Word64
forall a. HasAddress a => a -> Word64
addressof Instruction
i) Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= Int
a) [Instruction]
instrs) Maybe [Instruction]
forall a. Maybe a
Nothing Pred
p








instance Propagator (FContext) Pred where
  tau :: FContext
-> [Instruction] -> Maybe [Instruction] -> Pred -> (Pred, VCS)
tau     = FContext
-> [Instruction] -> Maybe [Instruction] -> Pred -> (Pred, VCS)
tau_block
  join :: FContext -> Pred -> Pred -> Pred
join    = FContext -> Pred -> Pred -> Pred
join_preds
  implies :: FContext -> Pred -> Pred -> Bool
implies = FContext -> Pred -> Pred -> Bool
implies_preds