(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/srfi/159/string#make-char-predicate
    (lambda (_x455_)
      (if (procedure? _x455_)
          _x455_
          (if (char? _x455_)
              (lambda (_ch457_) (eq? _ch457_ _x455_))
              (if (let ()
                    (declare (not safe))
                    (##structure-instance-of? _x455_ 'std/srfi/14#:char-set))
                  (lambda (_ch459_)
                    (std/srfi/14#char-set-contains? _x455_ _ch459_))
                  (error '"invalid character predicate" _x455_))))))
  (define std/srfi/159/string#string-find
    (lambda (_str444_ _check445_ . _o446_)
      (let ((_pred448_ (std/srfi/159/string#make-char-predicate _check445_))
            (_end449_
             (if (and (pair? _o446_) (pair? (cdr _o446_)))
                 (cadr _o446_)
                 (string-length _str444_))))
        (let _lp451_ ((_i453_ (if (pair? _o446_)
                                  (car _o446_)
                                  (std/srfi/130#string-cursor-start
                                   _str444_))))
          (if (>= _i453_ _end449_)
              _end449_
              (if (_pred448_
                   (std/srfi/159/string#string-cursor-ref _str444_ _i453_))
                  _i453_
                  (_lp451_ (std/srfi/130#string-cursor-next
                            _str444_
                            _i453_))))))))
  (define std/srfi/159/string#string-find-right
    (lambda (_str431_ _check432_ . _o433_)
      (let ((_pred435_ (std/srfi/159/string#make-char-predicate _check432_))
            (_start436_
             (if (pair? _o433_)
                 (car _o433_)
                 (std/srfi/130#string-cursor-start _str431_))))
        (let _lp438_ ((_i440_ (if (and (pair? _o433_) (pair? (cdr _o433_)))
                                  (cadr _o433_)
                                  (string-length _str431_))))
          (let ((_i2442_ (std/srfi/130#string-cursor-prev _str431_ _i440_)))
            (if (< _i2442_ _start436_)
                _start436_
                (if (_pred435_
                     (std/srfi/159/string#string-cursor-ref _str431_ _i2442_))
                    _i440_
                    (_lp438_ _i2442_))))))))
  (define std/srfi/159/string#string-cursor-ref string-ref)
  (define std/srfi/159/string#substring-cursor__%
    (lambda (_str415_ _start416_ _end417_)
      (substring _str415_ _start416_ _end417_)))
  (define std/srfi/159/string#substring-cursor__0
    (lambda (_str422_ _start423_)
      (let ((_end425_ (string-length _str422_)))
        (substring _str422_ _start423_ _end425_))))
  (define std/srfi/159/string#substring-cursor
    (lambda _g4060_
      (let ((_g4059_ (let () (declare (not safe)) (##length _g4060_))))
        (cond ((let () (declare (not safe)) (##fx= _g4059_ 2))
               (apply std/srfi/159/string#substring-cursor__0 _g4060_))
              ((let () (declare (not safe)) (##fx= _g4059_ 3))
               (apply substring _g4060_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/159/string#substring-cursor
                _g4060_))))))
  (define std/srfi/159/string#substring*__%
    (lambda (_str398_ _start399_ _end400_)
      (substring _str398_ _start399_ _end400_)))
  (define std/srfi/159/string#substring*__0
    (lambda (_str405_ _start406_)
      (let ((_end408_ (string-length _str405_)))
        (substring _str405_ _start406_ _end408_))))
  (define std/srfi/159/string#substring*
    (lambda _g4062_
      (let ((_g4061_ (let () (declare (not safe)) (##length _g4062_))))
        (cond ((let () (declare (not safe)) (##fx= _g4061_ 2))
               (apply std/srfi/159/string#substring*__0 _g4062_))
              ((let () (declare (not safe)) (##fx= _g4061_ 3))
               (apply substring _g4062_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/159/string#substring*
                _g4062_)))))))
