code: def _classify_move_register(self, regs_init, regs_fini, mem_fini, written_regs, read_regs):
          
          matches = []
  
          regs_init_inv = self._invert_dictionary(regs_init)
  
          # Check for "dst_reg <- src_reg" pattern.
          for dst_reg, dst_val in regs_fini.items():
              # Make sure the *dst* register was written.
              if dst_reg not in written_regs:
                  continue
  
              for src_reg in regs_init_inv.get(dst_val, []):
                  # Make sure the *src* register was read.
                  if src_reg not in read_regs:
                      continue
  
                  # Check restrictions...
                  if self._arch_regs_size[src_reg] != self._arch_regs_size[dst_reg]:
                      continue
  
                  if src_reg == dst_reg:
                      continue
  
                  if regs_init[dst_reg] == regs_init[src_reg]:
                      continue
  
                  src_reg_ir = ReilRegisterOperand(src_reg, self._arch_regs_size[src_reg])
                  dst_reg_ir = ReilRegisterOperand(dst_reg, self._arch_regs_size[dst_reg])
  
                  matches.append({
                      "src": [src_reg_ir],
                      "dst": [dst_reg_ir]
                  })
  
          return matches
docs: Classify move-register gadgets.