reprimTrivial :: Core.Prim -> Maybe X64.Prim
reprimTrivial = \case
    -- Trivial cases
    Core.Neg ->
      Just X64.Neg
    Core.Not ->
      Just X64.Not

    Core.Add ->
      Just X64.Add
    Core.Sub ->
      Just X64.Sub

    Core.And ->
      Just X64.And
    Core.Xor ->
      Just X64.Xor
    Core.Or ->
      Just X64.Or

    Core.Shl ->
      Just X64.Sal
    Core.Shr ->
      Just X64.Sar

    -- Complex cases, must be handled by reprimComplex.
    Core.Mul ->
      Nothing
    Core.Div ->
      Nothing
    Core.Mod ->
      Nothing

    Core.Eq ->
      Nothing
    Core.Ne ->
      Nothing
    Core.Lt ->
      Nothing
    Core.Le ->
      Nothing
    Core.Gt ->
      Nothing
    Core.Ge ->
      Nothing
reprimTrivial :: Core.Prim -> Maybe X64.Prim
reprimTrivial = \case
    -- Trivial cases
    Core.Neg ->
      Just X64.Neg
    Core.Not ->
      Just X64.Not

    Core.Add ->
      Just X64.Add
    Core.Sub ->
      Just X64.Sub

    Core.And ->
      Just X64.And
    Core.Xor ->
      Just X64.Xor
    Core.Or ->
      Just X64.Or

    Core.Shl ->
      Just X64.Sal
    Core.Shr ->
      Just X64.Sar

    -- Complex cases, must be handled by reprimComplex.
    Core.Mul ->
      Nothing
    Core.Div ->
      Nothing
    Core.Mod ->
      Nothing

    Core.Eq ->
      Nothing
    Core.Ne ->
      Nothing
    Core.Lt ->
      Nothing
    Core.Le ->
      Nothing
    Core.Gt ->
      Nothing
    Core.Ge ->
      Nothing
reprimTrivial = \case
    -- Trivial cases
    Core.Neg ->
      Just X64.Neg
    Core.Not ->
      Just X64.Not

    Core.Add ->
      Just X64.Add
    Core.Sub ->
      Just X64.Sub

    Core.And ->
      Just X64.And
    Core.Xor ->
      Just X64.Xor
    Core.Or ->
      Just X64.Or

    Core.Shl ->
      Just X64.Sal
    Core.Shr ->
      Just X64.Sar

    -- Complex cases, must be handled by reprimComplex.
    Core.Mul ->
      Nothing
    Core.Div ->
      Nothing
    Core.Mod ->
      Nothing

    Core.Eq ->
      Nothing
    Core.Ne ->
      Nothing
    Core.Lt ->
      Nothing
    Core.Le ->
      Nothing
    Core.Gt ->
      Nothing
    Core.Ge ->
      Nothing