--- fano.h.orig	2024-05-03 11:33:34.184362683 -0400
+++ fano.h	2024-05-03 11:34:08.284362876 -0400
@@ -26,7 +26,7 @@
  * goes into the 1-bit.
  */
 #define	ENCODE(sym,encstate){\
-unsigned long _tmp;\
+unsigned int _tmp;\
 \
 _tmp = (encstate) & POLY1;\
 _tmp ^= _tmp >> 16;\
--- fano.c.orig	2024-05-03 11:33:21.324362610 -0400
+++ fano.c	2024-05-03 11:42:19.254365656 -0400
@@ -17,7 +17,7 @@
 #include "fano.h"
 
 struct node {
-  unsigned long encstate;	// Encoder state of next node
+  unsigned int encstate;        // Encoder state of next node
   long gamma;		        // Cumulative metric to this node
   int metrics[4];		// Metrics indexed by all possible tx syms
   int tm[2];		        // Sorted metrics for current hypotheses
@@ -64,7 +64,7 @@
 	   unsigned char *data,		// Input buffer, nbytes
 	   unsigned int nbytes)		// Number of bytes in data
 {
-  unsigned long encstate;
+  unsigned int encstate;
   int sym;
   int i;
 
@@ -127,17 +127,15 @@
   np->encstate = 0;
 
 // Compute and sort branch metrics from root node */
-  ENCODE(lsym,np->encstate);	// 0-branch (LSB is 0)
-  m0 = np->metrics[lsym];
+  m0 = np->metrics[0]; // don't bother to ENCODE, encstate=0 will always yield 0
 
-/* Now do the 1-branch. To save another ENCODE call here and
- * inside the loop, we assume that both polynomials are odd,
- * providing complementary pairs of branch symbols.
+/* Now do the 1-branch. Here and inside the loop we assume that both polynomials
+ * are odd, providing complementary pairs of branch symbols.
 
  * This code should be modified if a systematic code were used.
  */
 
-  m1 = np->metrics[3^lsym];
+  m1 = np->metrics[3]; // 3^0 will always yield 3
   if(m0 > m1) {
     np->tm[0] = m0;                             // 0-branch has better metric
     np->tm[1] = m1;
@@ -180,6 +178,7 @@
        * zero branch
        */
       ENCODE(lsym,np->encstate);
+
       if(np >= tail) {
 	/* The tail must be all zeroes, so don't 
 	 * bother computing the 1-branches here.
