     }
     let p = pow(mulmod(x, x, m), n >> 1, m)
     return n & 1 == 1 ? mulmod(x, p, m) : p
-}
-
-@_inlineable
-public func pow(_ x: UInt, _ n: UInt) -> UInt {
-    return pow(x, n, UInt.max)
-}
-@_inlineable
-public func pow(_ x: UInt64, _ n: UInt64) -> UInt64 {
-    return pow(x, n, UInt64.max)
-}
-@_inlineable
-public func pow(_ x: UInt32, _ n: UInt32) -> UInt32 {
-    return pow(x, n, UInt32.max)
-}
-@_inlineable
-public func pow(_ x: UInt16, _ n: UInt16) -> UInt16 {
-    return pow(x, n, UInt16.max)
-}
-@_inlineable
-public func pow(_ x: UInt8, _ n: UInt8) -> UInt8 {
-    return pow(x, n, UInt8.max)
 }
 
 @_inlineable


import Foundation

extension UInt8 {
    
    @_inlineable
    public var reverse: UInt8 {
        var x = self
        x = ((x & 0x55) << 1) | ((x & 0xAA) >> 1)
        x = ((x & 0x33) << 2) | ((x & 0xCC) >> 2)
        x = ((x & 0x0F) << 4) | ((x & 0xF0) >> 4)
        return x
    }
}
extension FixedWidthInteger {
    
    @_inlineable
    public var reverse: Self {
        var r = self
        var x: Self = 0
        for _ in 0..<bitWidth >> 3 {
            x = (x << 8) | Self(UInt8(extendingOrTruncating: r).reverse)
            r >>= 8
        }
        return x
    }
}


}

@_inlineable
public func pow<T: FixedWidthInteger & UnsignedInteger>(_ x: T, _ n: T, _ m: T = T.max) -> T {
    assert(m != 0, "divide by zero")
    let x = x % m
    if x == 0 || m == 1 {
