 import TestsUtils
 
 // a naive O(n) implementation of byteswap.
+@inline(never)
 func byteswap_n(_ a: UInt64) -> UInt64 {
 #if swift(>=4)
   return ((a & 0x00000000000000FF) &<< 56) |


@inline(never)
public func run_ByteSwap(_ N: Int) {
  for _ in 1...100*N {
    // Check some results.
    CheckResults(byteswap_logn(byteswap_n(2457)) == 2457)
    CheckResults(byteswap_logn(byteswap_n(9129)) == 9129)
    CheckResults(byteswap_logn(byteswap_n(3333)) == 3333)
  }
}

}

// a O(logn) implementation of byteswap.
@inline(never)
func byteswap_logn(_ a: UInt64) -> UInt64 {
  var a = a
  a = (a & 0x00000000FFFFFFFF) << 32 | (a & 0xFFFFFFFF00000000) >> 32
