ntRest) <&> head
  frame.intVars %= ((var, reg) :)
  frame.intRest %= tail
  return $ reg

definePtr ptr@(Var v) = do
  defd <- alreadyDefinedPtr ptr
  when defd (error $ "already defined ptr: " ++ v)
  reg <- 
lookupPtr :: Var -> State CompileState PReg
lookupPtr ptr@(Var s) = do
  vars <- use (frame.ptrVars)
  case lookup ptr vars of
    Nothing -> error $ "undefined pointer variable: " ++ s
    Just pr -> return pr
lookupPtr ptr@(Var s) = do
  vars <- use (frame.ptrVars)
  case lookup ptr vars of
    Nothing -> error $ "undefined pointer variable: " ++ s
    Just pr -> return pr