'Assign *srcvar* to *destvar*. Return either *srcvar* or a possible
simplified assignment source (earlier assigned to *srcvar*).'

def assign(self, srcvar, destvar):

    srcname = srcvar.name
    destname = destvar.name
    if (destname in self.src_invalidate):
        for d in self.src_invalidate.pop(destname):
            self.dest_to_src.pop(d)
    if (srcname in self.dest_to_src):
        srcvar = self.dest_to_src[srcname]
    if destvar.is_temp:
        self.dest_to_src[destname] = srcvar
        self.src_invalidate[srcname].append(destname)
        self.unused_dests.add(destname)
    return srcvar
