appendInt64(high32, low32) {
    if (!Number.isInteger(high32) || !Number.isInteger(low32)) {
      throw new RangeError("value is not an integer")
    }
    if (
      high32 < -0x80000000 ||
      high32 > 0x7fffffff ||
      low32 < -0x80000000 ||
      low32 > 0xffffffff
    ) {
      throw new RangeError("number out of range")
    }
    low32 >>>= 0 // interpret as unsigned
    if (high32 === 0 && low32 <= 0x7fffffff) return this.appendInt32(low32)
    if (high32 === -1 && low32 >= 0x80000000)
      return this.appendInt32(low32 - 0x100000000)

    const numBytes = Math.ceil(
      (65 - Math.clz32(high32 >= 0 ? high32 : -high32 - 1)) / 7,
    )
    if (this.offset + numBytes > this.buf.byteLength) this.grow()
    for (let i = 0; i < 4; i++) {
      this.buf[this.offset + i] = (low32 & 0x7f) | 0x80
      low32 >>>= 7 // zero-filling right shift
    }
    this.buf[this.offset + 4] =
      (low32 & 0x0f) | ((high32 & 0x07) << 4) | (numBytes === 5 ? 0x00 : 0x80)
    high32 >>= 3 // sign-propagating right shift
    for (let i = 5; i < numBytes; i++) {
      this.buf[this.offset + i] =
        (high32 & 0x7f) | (i === numBytes - 1 ? 0x00 : 0x80)
      high32 >>= 7
    }
    this.offset += numBytes
    return numBytes
  }
Encodes a 64-bit signed integer in a variable number of bytes using the
LEB128 encoding scheme, and appends it to the buffer. The number is given
as two 32-bit halves since JavaScript cannot accurately represent integers
with more than 53 bits in a single variable. The sign of the 64-bit
number is determined by the sign of the `high32` half; the sign of the
`low32` half is ignored.