fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char) {
  var ch: Char? = nextChar(/* <this> = <this> */)
  while (when {
    EQEQ(arg0 = ch, arg1 = null).not() -> EQEQ(arg0 = ch, arg1 = quote).not()
    else -> false
  }) { // BLOCK
    when {
      EQEQ(arg0 = ch, arg1 = '\\') -> { // BLOCK
        val tmp_0: Char? = nextChar(/* <this> = <this> */)
        when {
          EQEQ(arg0 = tmp_0, arg1 = null) -> null
          else -> let<Char, @FlexibleNullability StringBuilder?>(/* <this> = tmp_0 /*as Char */, */ block = local fun <anonymous>(it: Char): @FlexibleNullability StringBuilder? {
            return sb.append(p0 = it)
          }
)
        }
      }
      else -> sb.append(p0 = ch /*as Char */)
    } /*~> Unit */
    ch = nextChar(/* <this> = <this> */)
  }
}

private fun Reader.nextChar(): Char? {
  return { // BLOCK
    val tmp_1: Int? = takeUnless<Int>(/* <this> = <this>.read(), */ predicate = local fun <anonymous>(it: Int): Boolean {
      return EQEQ(arg0 = it, arg1 = -1)
    }
)
    when {
      EQEQ(arg0 = tmp_1, arg1 = null) -> null
      else -> tmp_1 /*as Int */.toChar()
    }
  }
}

private const val BACKSLASH: Char
  field = '\\'
  private get

