old_contents: import simuvex
  
  ######################################
  # fread
  ######################################
  
  class fread(simuvex.SimProcedure):
      #pylint:disable=arguments-differ
  
      def run(self, dst, size, nm, file_ptr):
          # TODO handle errors
  
          _ = self.state.posix.pos(file_ptr)
          data = self.state.posix.read(file_ptr, size * nm)
          self.state.memory.store(dst, data)
          return size #TODO: handle reading less than nm items somewhere
  
new_contents: import simuvex
  
  ######################################
  # fread
  ######################################
  
  class fread(simuvex.SimProcedure):
      #pylint:disable=arguments-differ
  
      def run(self, dst, size, nm, file_ptr):
          # TODO handle errors
  
          ret = self.state.posix.read(file_ptr, dst, size * nm)
          return ret #TODO: handle reading less than nm items somewhere
  
subject: Update fread to use the new read calling convention