- BlackBox:
    name: GHC.Base.remInt
    kind: Declaration
    type: 'remInt :: Int ->
      Int -> Int'
    template: |-
      ~RESULT <= ~ARG[0] rem ~ARG[1]
          -- pragma translate_off
          when (~ARG[1] /= 0) else (others => 'X')
          -- pragma translate_on
          ;
- BlackBox:
    name: GHC.Base.divInt
    kind: Declaration
    type: 'divInt :: Int ->
      Int -> Int'
    template: |-
      -- divInt begin
      ~GENSYM[divInt][0] : block
        signal ~GENSYM[resultPos][1] : boolean;
        signal ~GENSYM[dividerNeg][2] : boolean;
        signal ~GENSYM[dividend2][3] : signed(~SIZE[~TYPO] downto 0);
        signal ~GENSYM[quot_res][4] : signed(~SIZE[~TYPO] downto 0);
      begin
        ~SYM[1] <= ~VAR[dividend][0](~VAR[dividend][0]'high) = ~VAR[divider][1](~VAR[divider][1]'high);
        ~SYM[2] <= ~VAR[divider][1](~VAR[divider][1]'high) = '1';
        ~SYM[3] <= resize(~VAR[dividend][0],~SIZE[~TYPO]+1)   when ~SYM[1] else
                   (resize(~VAR[dividend][0],~SIZE[~TYPO]+1) - resize(~VAR[divider][1],~SIZE[~TYPO]+1) - 1)   when ~SYM[2] else
                   (resize(~VAR[dividend][0],~SIZE[~TYPO]+1) - resize(~VAR[divider][1],~SIZE[~TYPO]+1) + 1);
        ~SYM[4] <= ~SYM[3] / ~VAR[divider][1]
            -- pragma translate_off
            when (~VAR[divider][1] /= 0) else (others => 'X')
            -- pragma translate_on
            ;
        ~RESULT <= signed(~SYM[4](~SIZE[~TYPO]-1 downto 0));
      end block;
      -- divInt end
- BlackBox:
    name: GHC.Base.modInt
    kind: Declaration
    type: 'modInt :: Int ->
      Int -> Int'
    template: |-
      ~RESULT <= ~ARG[0] mod ~ARG[1]
          -- pragma translate_off
          when (~ARG[1] /= 0) else (others => 'X')
          -- pragma translate_on
          ;
- BlackBox:
    name: GHC.Base.quotInt
    kind: Declaration
    type: 'quotInt :: Int
      -> Int -> Int'
    template: |-
      ~RESULT <= ~ARG[0] / ~ARG[1]
          -- pragma translate_off
          when (~ARG[1] /= 0) else (others => 'X')
          -- pragma translate_on
          ;
