docs: function splitFreeBlock(
    state: BlockMapType,
    addr: number,
    blockSize: number,
    splitAddr: number,
    splitSize: number
  ): BlockMapType {
    var bottomGap = splitAddr - addr;
    var topGap = endAddr(addr, blockSize) - endAddr(splitAddr, splitSize);
    if (bottomGap > 0 && topGap === 0) {
      return resizeFreeBlock(state, addr, blockSize, addr, bottomGap);
    }
    if (topGap > 0 && bottomGap === 0) {
      return resizeFreeBlock(
        state,
        addr,
        blockSize,
        endAddr(addr, blockSize) - topGap,
        topGap
      );
    }
    if (topGap > 0 && bottomGap > 0) {
      state = popFreeBlock(state, addr, blockSize);
      state = pushFreeBlock(state, addr, bottomGap);
      state = pushFreeBlock(state, endAddr(addr, blockSize) - topGap, topGap);
      return state;
    }
    return state;
  }