getReg :: Name -> CG IR.Reg
getReg name = do
  regMap <- gets _sRegisterMap
  case Map.lookup name regMap of
    Nothing   -> error $ "unknown variable " ++ unpackName name
    Just reg  -> pure reg
getReg :: Name -> CG IR.Reg
getReg name = do
  regMap <- gets _sRegisterMap
  case Map.lookup name regMap of
    Nothing   -> error $ "unknown variable " ++ unpackName name
    Just reg  -> pure reg
getReg name = do
  regMap <- gets _sRegisterMap
  case Map.lookup name regMap of
    Nothing   -> error $ "unknown variable " ++ unpackName name
    Just reg  -> pure reg