code: DecodeAux make_decode_tree(){
      int top=0;
      DecodeAux t=new DecodeAux();
      int[] ptr0=t.ptr0=new int[entries*2];
      int[] ptr1=t.ptr1=new int[entries*2];
      int[] codelist=make_words(c.lengthlist, c.entries);
  
      if(codelist==null)
        return (null);
      
      //t.aux=entries*2;
  
      for(int i=0; i<entries; i++){
        if(c.lengthlist[i]>0){
          int ptr=0;
          int j;
          for(j=0; j<c.lengthlist[i]-1; j++){
            int bit=(codelist[i]>>>j)&1;
            if(bit==0){
              if(ptr0[ptr]==0){
                ptr0[ptr]=++top;
              }
              ptr=ptr0[ptr];
            }
            else{
              if(ptr1[ptr]==0){
                ptr1[ptr]=++top;
              }
              ptr=ptr1[ptr];
            }
          }
  
          if(((codelist[i]>>>j)&1)==0){
            ptr0[ptr]=-i;
          }
          else{
            ptr1[ptr]=-i;
          }
  
        }
      }
  
      t.tabn=Util.ilog(entries)-4;
  
      if(t.tabn<5)
        t.tabn=5;
      int n=1<<t.tabn;
      t.tab=new int[n];
      t.tabl=new int[n];
      for(int i=0; i<n; i++){
        int p=0;
        int j=0;
        for(j=0; j<t.tabn&&(p>0||j==0); j++){
          if((i&(1<<j))!=0){
            p=ptr1[p];
          }
          else{
            p=ptr0[p];
          }
        }
        t.tab[i]=p; // -code
        t.tabl[i]=j; // length 
      }
  
      return (t);
    }
docs: build the decode helper tree from the codewords