public static int handAto5LoEval(long hand) {

		// each of the following extracts a 13-bit field from hand and
		// rotates it left to position the ace in the least significant bit
		final int c = (((int)hand & 0x0FFF) << 1)  + (((int)hand & 0x1000) >> 12);
		final int d = (((int)hand >> 15) & 0x1FFE) + (((int)hand & (0x1000 << 16)) >> 28);
		final int h = ((int)(hand >> 31) & 0x1FFE) + (int)((hand & (0x1000L << 32)) >> 44);
		final int s = ((int)(hand >> 47) & 0x1FFE) + (int)((hand & (0x1000L << 48)) >> 60);

		final int ranks = c | d | h | s;
		int i;

		switch (nbrOfRanks[ranks]) {

	        case 2: /* quads or full house */
	                i = c & d;				/* any two suits */
	                if ((i & h & s) == 0) { /* no bit common to all suits */
	                    i = c ^ d ^ h ^ s;  /* trips bit */
	                    return FULL_HOUSE | (hiRank[i] << RANK_SHIFT_4) | (hiRank[i ^ ranks] << RANK_SHIFT_3); }
	                else
	                    /* the quads bit must be present in each suit mask,
	                       but the kicker bit in no more than one; so we need
	                       only AND any two suit masks to get the quad bit: */
	                    return FOUR_OF_A_KIND | (hiRank[i] << RANK_SHIFT_4) | (hiRank[i ^ ranks] << RANK_SHIFT_3);

	        case 3: /* trips and two kickers,
	                   or two pair and kicker */
	                if ((i = c ^ d ^ h ^ s) == ranks) {
	                    /* trips and two kickers */
	                    if ((i = c & d) == 0)
	                    	if ((i = c & h) == 0)
	                    		i = d & h;
	                    return THREE_OF_A_KIND | (hiRank[i] << RANK_SHIFT_4) 
	                        | (hiUpTo5Ranks[i ^ ranks] << RANK_SHIFT_2); }
	                /* two pair and kicker; i has kicker bit */
	                return TWO_PAIR | (hiUpTo5Ranks[i ^ ranks] << RANK_SHIFT_3) | (hiRank[i] << RANK_SHIFT_2);

	        case 4: /* pair and three kickers */
	                i = c ^ d ^ h ^ s; /* kicker bits */
	                return PAIR | (hiRank[ranks ^ i] << RANK_SHIFT_4) | (hiUpTo5Ranks[i] << RANK_SHIFT_1);

	        case 5: /* no pair */
					return hiUpTo5Ranks[ranks];
		}

	    return 0; /* never reached, but avoids compiler warning */
	}