setTreeObserver(tm, &tob);
setTreeObserverTM(tm, &tob);
int main(int argc, char **argv){  int next_option;  const char *const short_options = "ROTFo:";  static struct option long_options[] = {      { "rooted", 0, NULL, 'R' },      { "unordered", 0, NULL, 'u' },      { "text", 0, NULL, 'T' },      { "outfile", 1, NULL, 'o' },      { NULL, 0, NULL, 0 },  };#if GSL_RDY  double score;  struct DoubleA *res;  struct TreeBlaster *tb;  struct TreeHolder *th;  struct TreeMaster *tm;  struct CLNodeSet *clns = NULL;  struct TreeAdaptor *ub;  int j;  int isRooted = 0;  int isOrdered = 1;  int isEnablingMaxFailCount = 0;  int isText = 0;  double s;  char *fname = NULL;  struct MakeTreeConfig *maketreecfg;  cur = loadMakeTreeEnvironment();  maketreecfg = (struct MakeTreeConfig *) cur->vptr;  while (1) {    next_option = complearn_getopt_long(argc, argv, short_options, long_options, NULL, cur);    if (next_option == -1) /* options done */      break;    switch (next_option) {      case 'R':        isRooted = 1;        setKeyValEM(cur->em, "isRooted", "1");        break;      case 'F':        isEnablingMaxFailCount = 1;        setKeyValEM(cur->em, "selfAgreementTermination", "0");        break;      case 'u':        isOrdered = 0;        setKeyValEM(cur->em, "isOrdered", "0");        break;      case 'T':        isText = 1;        break;      case 'o':        gfreeifpresent(maketreecfg->output_tree_fname);        maketreecfg->output_tree_fname = gstrdup(optarg);        break;    }  }  if (optind < argc) {    while (optind < argc)       fname = argv[optind++];  }  srand(time(NULL));  if (!fname) {    printf("Usage: %s <distmatrix.clb>\n", argv[0]);    exit(1);  }  if (isText) {    dm = get_dm_from_txt(fname);    labels = get_labels_from_txt(fname);  } else {    struct EnvMap *em = get_clem_from_clb(fname);    struct StringStack *ss = get_clcmds_from_clb(fname);    char *cmd = NULL;    assert(ss);    if (cur->cmdKeeper) {      cmd = shiftSS(cur->cmdKeeper);      freeSS(cur->cmdKeeper);      cur->cmdKeeper = NULL;    }    cur->cmdKeeper = ss;    if (cmd)      pushSS(cur->cmdKeeper, cmd);    mergeEM(cur->em, em);    dm = get_cldm_from_clb(fname);    labels = get_labels_from_clb(fname);    freeEM(em);    gfreeandclear(cmd);  }  printf("The matrix is %d by %d\n", dm->size1, dm->size2);  tm = newTreeMasterEx(dm, isRooted, cur->em);  globtm = tm;  setTreeObserver(tm, &tob);  th = findTree(tm);  ub = getCurTree(th);  s = getCurScore(th);  j = totalTreesExamined(tm);  printf("Examined %d trees total\n", j);  if (isOrdered) {    printf("Proceeding with ordering phase...\n");    tb = newTreeBlaster(dm, ub);    printf("tb is %p\n", tb);    setTreeOrderObserver(tb, &too);    clns = findTreeOrder(tb, &score);    printf("Got score %f\n", score);    printf("And flipped node set:\n ");    printCLNodeSet(clns);  }  printf("\nNode ordering:\n");  res = simpleWalkTree(ub, clns);  printNodeList(res);  printf("\nLeaf ordering:\n");  for (j = 0; j < getSize(res); j += 1) {    int nodenum = getValueAt(res, j).i;    if (treeIsQuartettable(ub, nodenum))      printf("%d ", nodenum);  }  printf("\nLeaf labels, in %s order:\n", isOrdered ? "best" : "arbitrary");  for (j = 0; j < getSize(res); j += 1) {    int nodenum = getValueAt(res, j).i;    struct LabelPerm *lph = treegetlabelpermTRA(ub);    if (!treeIsQuartettable(ub, nodenum))      continue;    int indnum = getColumnIndexForNodeIDLP(lph, nodenum);    printf("%s\n", readAtSS(labels, indnum));  }  printf("Done.\n");  freeDoubleDoubler(res);  freedotth(dotth);  freeTreeMaster(tm);  freeGSLMatrix(dm);  if (labels) {    freeSS(labels);  }  return 0;#else	printf("no gsl support; maketree impossible\n");	exit(1);	return 1;#endif}