root->cost_hi = newp->cost_hi; root->cost_lo = newp->cost_lo; root->module_name = newp->module_name;
newp->left = root->left; newp->right = root->right; newp->same = root->same; *rootp = newp;  free (root);
insert_module (struct gconv_module *newp, int tobefreed){  struct gconv_module **rootp = &__gconv_modules_db;  while (*rootp != NULL)    {      struct gconv_module *root = *rootp;      int cmpres;      cmpres = strcmp (newp->from_string, root->from_string);      if (cmpres == 0)	{	  /* Both strings are identical.  Insert the string at the	     end of the `same' list if it is not already there.  */	  while (strcmp (newp->from_string, root->from_string) != 0		 || strcmp (newp->to_string, root->to_string) != 0)	    {	      rootp = &root->same;	      root = *rootp;	      if (root == NULL)		break;	    }	  if (root != NULL)	    {	      /* This is a no new conversion.  But maybe the cost is		 better.  */	      if (newp->cost_hi < root->cost_hi		  || (newp->cost_hi == root->cost_hi		      && newp->cost_lo < root->cost_lo))		{		  root->cost_hi = newp->cost_hi;		  root->cost_lo = newp->cost_lo;		  root->module_name = newp->module_name;		}	      if (tobefreed)		free (newp);	      return;	    }	  break;	}      else if (cmpres < 0)	rootp = &root->left;      else	rootp = &root->right;    }  /* Plug in the new node here.  */  *rootp = newp;}