    {-# LANGUAGE CPP #-}
    {-# LANGUAGE MagicHash #-}
    {-# LANGUAGE StrictData #-}
    #if MIN_VERSION_base(4,17,0)
    {-# LANGUAGE UnboxedTuples #-}
    #endif

    -- | This module exists to centralize compatibility shims for GHC 9.4.
    module Data.WideWord.Compat
      ( plusWord2#
      , timesWord2#
      , int2Word#
      , minusWord#
      , subWordC#
      , not#
      , or#
      , and#
      , xor#
      , timesWord#
      , plusWord#
      , word2Int#
      , quotRemWord2#
      , compatWordLiteral#
      , compatIntLiteral#
      , compatCaseOnWordLiteral#
      , compatCaseOnIntLiteral#
      ) where

    #if MIN_VERSION_base(4,17,0)
    import qualified GHC.Base
    import GHC.Exts (Word64#, wordToWord64#, word64ToWord#, Int64#)
    #else
    import GHC.Base (Int#, Word#, quotRemWord2#, int2Word#, subWordC#, plusWord2#, or#, minusWord#,
            timesWord2#, word2Int#, xor#, and#, not#, plusWord#, timesWord#)
    #endif

    #if MIN_VERSION_base(4,17,0)
    plusWord2# :: Word64# -> Word64# -> (# Word64#, Word64# #)
    plusWord2# :: Word64# -> Word64# -> (# Word64#, Word64# #)
    plusWord2# Word64#
    a Word64#
    b =
     case Word# -> Word# -> (# Word#, Word# #)
    GHC.Base.plusWord2# (Word64# -> Word#
    word64ToWord# Word64#
    a) (Word64# -> Word#
    word64ToWord# Word64#
    b) of
       (# Word#
    a', Word#
    b' #) ->
         (# Word# -> Word64#
    wordToWord64# Word#
    a', Word# -> Word64#
    wordToWord64# Word#
    b' #)

    timesWord2# :: Word64# -> Word64# -> (# Word64#, Word64# #)
    timesWord2# :: Word64# -> Word64# -> (# Word64#, Word64# #)
    timesWord2# Word64#
    a Word64#
    b =
      case Word# -> Word# -> (# Word#, Word# #)
    GHC.Base.timesWord2# (Word64# -> Word#
    word64ToWord# Word64#
    a) (Word64# -> Word#
    word64ToWord# Word64#
    b) of
        (# Word#
    a', Word#
    b' #) ->
         (# Word# -> Word64#
    wordToWord64# Word#
    a', Word# -> Word64#
    wordToWord64# Word#
    b' #)

    int2Word# :: Int64# -> Word64#
    int2Word# :: Int64# -> Word64#
    int2Word# = Int64# -> Word64#
    GHC.Base.int64ToWord64#

    minusWord# :: Word64# -> Word64# -> Word64#
    minusWord# :: Word64# -> Word64# -> Word64#
    minusWord# Word64#
    a Word64#
    b =
      Word# -> Word64#
    wordToWord64# (Word# -> Word# -> Word#
    GHC.Base.minusWord# (Word64# -> Word#
    word64ToWord# Word64#
    a) (Word64# -> Word#
    word64ToWord# Word64#
    b))

    subWordC# :: Word64# -> Word64# -> (# Word64#, Int64# #)
    subWordC# :: Word64# -> Word64# -> (# Word64#, Int64# #)
    subWordC# Word64#
    a Word64#
    b =
      case Word# -> Word# -> (# Word#, Int# #)
    GHC.Base.subWordC# (Word64# -> Word#
    word64ToWord# Word64#
    a) (Word64# -> Word#
    word64ToWord# Word64#
    b) of
        (# Word#
    a', Int#
    b' #) ->
         (# Word# -> Word64#
    wordToWord64# Word#
    a', Int# -> Int64#
    GHC.Base.intToInt64# Int#
    b' #)

    not# :: Word64# -> Word64#
    not# :: Word64# -> Word64#
    not# = Word64# -> Word64#
    GHC.Base.not64#

    or# :: Word64# -> Word64# -> Word64#
    or# :: Word64# -> Word64# -> Word64#
    or# = Word64# -> Word64# -> Word64#
    GHC.Base.or64#

    xor# :: Word64# -> Word64# -> Word64#
    xor# :: Word64# -> Word64# -> Word64#
    xor# = Word64# -> Word64# -> Word64#
    GHC.Base.xor64#

    and# :: Word64# -> Word64# -> Word64#
    and# :: Word64# -> Word64# -> Word64#
    and# = Word64# -> Word64# -> Word64#
    GHC.Base.and64#

    timesWord# :: Word64# -> Word64# -> Word64#
    timesWord# :: Word64# -> Word64# -> Word64#
    timesWord# = Word64# -> Word64# -> Word64#
    GHC.Base.timesWord64#

    plusWord# :: Word64# -> Word64# -> Word64#
    plusWord# :: Word64# -> Word64# -> Word64#
    plusWord# = Word64# -> Word64# -> Word64#
    GHC.Base.plusWord64#

    word2Int# :: Word64# -> Int64#
    word2Int# :: Word64# -> Int64#
    word2Int# = Word64# -> Int64#
    GHC.Base.word64ToInt64#

    quotRemWord2# :: Word64# -> Word64# -> Word64# -> (# Word64#, Word64# #)
    quotRemWord2# :: Word64# -> Word64# -> Word64# -> (# Word64#, Word64# #)
    quotRemWord2# Word64#
    a Word64#
    b Word64#
    c =
      case Word# -> Word# -> Word# -> (# Word#, Word# #)
    GHC.Base.quotRemWord2# (Word64# -> Word#
    word64ToWord# Word64#
    a) (Word64# -> Word#
    word64ToWord# Word64#
    b) (Word64# -> Word#
    word64ToWord# Word64#
    c) of
        (# Word#
    x, Word#
    y #) -> (# Word# -> Word64#
    wordToWord64# Word#
    x, Word# -> Word64#
    wordToWord64# Word#
    y #)
    #endif

    compatWordLiteral#
    #if MIN_VERSION_base(4,17,0)
      :: GHC.Base.Word# -> Word64#
    compatWordLiteral# :: Word# -> Word64#
    compatWordLiteral# = Word# -> Word64#
    wordToWord64#
    #else
      :: Word# -> Word#
    compatWordLiteral# a = a
    #endif

    compatIntLiteral#
    #if MIN_VERSION_base(4,17,0)
        :: GHC.Base.Int# -> Int64#
    compatIntLiteral# :: Int# -> Int64#
    compatIntLiteral# = Int# -> Int64#
    GHC.Base.intToInt64#
    #else
        :: Int# -> Int#
    compatIntLiteral# a = a
    #endif

    compatCaseOnWordLiteral#
    #if MIN_VERSION_base(4,17,0)
        :: Word64# -> GHC.Base.Word#
    compatCaseOnWordLiteral# :: Word64# -> Word#
    compatCaseOnWordLiteral# = Word64# -> Word#
    word64ToWord#
    #else
        :: Word# -> Word#
    compatCaseOnWordLiteral# a = a
    #endif

    compatCaseOnIntLiteral#
    #if MIN_VERSION_base(4,17,0)
        :: Int64# -> GHC.Base.Int#
    compatCaseOnIntLiteral# :: Int64# -> Int#
    compatCaseOnIntLiteral# = Int64# -> Int#
    GHC.Base.int64ToInt#
    #else
        :: Int# -> Int#
    compatCaseOnIntLiteral# a = a
    #endif