e (frame.ptrRest) <&> head
  frame.ptrVars %= ((ptr, reg) :)
  frame.ptrRest %= tail
  return $ reg

-- releaseVar var@(Var v) = do
--  frame.intVars %= filter ((v ==) . fst)
  
ge
alreadyDefinedVar :: Var -> State CompileState Bool
alreadyDefinedVar v = do
  vars <- use (frame.intVars)
  return $ case lookup v vars of
    Nothing -> False
    Just _  -> True
alreadyDefinedVar v = do
  vars <- use (frame.intVars)
  return $ case lookup v vars of
    Nothing -> False
    Just _  -> True