func whichByte(in uint64, is byte) int { var ( is64 = uint64(is) spread = 0x_01_01_01_01_01_01_01_01 * is64 diff = in ^ spread msb0 = 0x_80_80_80_80_80_80_80_80 &^ diff minus = diff - 0x_01_01_01_01_01_01_01_01 msbTo1 = msb0 & minus ) if msbTo1 == 0 { return -1 } var ( bit = msbTo1 & -msbTo1 >> 7 idx = 0x_00_01_02_03_04_05_06_06 * bit ) return int(idx >> 56) }
To receive a hint, submit unfixed code.