(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/srfi/117#make-list
    (lambda (_n88852_ . _o88853_)
      (let ((_default88855_ (if (pair? _o88853_) (car _o88853_) '#!void)))
        (let _lp88857_ ((_n88859_ _n88852_) (_res88860_ '()))
          (if (<= _n88859_ '0)
              _res88860_
              (_lp88857_ (- _n88859_ '1) (cons _default88855_ _res88860_)))))))
  (define std/srfi/117#list-copy
    (lambda (_ls88845_)
      (let _lp88847_ ((_ls88849_ _ls88845_) (_res88850_ '()))
        (if (pair? _ls88849_)
            (_lp88847_ (cdr _ls88849_) (cons (car _ls88849_) _res88850_))
            (append (reverse _res88850_) _ls88849_)))))
  (define std/srfi/117#list-set!
    (lambda (_ls88841_ _k88842_ _x88843_)
      (if (null? _ls88841_)
          (error '"invalid list index")
          (if (zero? _k88842_)
              (set-car! _ls88841_ _x88843_)
              (std/srfi/117#list-set!
               (cdr _ls88841_)
               (- _k88842_ '1)
               _x88843_)))))
  (define std/srfi/117#last-pair
    (lambda (_ls88839_)
      (if (null? (cdr _ls88839_))
          _ls88839_
          (std/srfi/117#last-pair (cdr _ls88839_)))))
  (define std/srfi/117#map!
    (lambda (_f88832_ _lis88833_)
      (let _lp88835_ ((_lis88837_ _lis88833_))
        (if (pair? _lis88837_)
            (begin
              (set-car! _lis88837_ (_f88832_ (car _lis88837_)))
              (_lp88835_ (cdr _lis88837_)))
            '#!void))))
  (define std/srfi/117#<list-queue>
    (make-struct-type
     'std/srfi/117#<list-queue>
     '#f
     '2
     '<list-queue>
     '((fields: first last))
     '#f))
  (define std/srfi/117#list-queue?
    (make-struct-predicate std/srfi/117#<list-queue>))
  (define std/srfi/117#get-first
    (make-struct-field-accessor std/srfi/117#<list-queue> '0))
  (define std/srfi/117#get-last
    (make-struct-field-accessor std/srfi/117#<list-queue> '1))
  (define std/srfi/117#set-first!
    (make-struct-field-mutator std/srfi/117#<list-queue> '0))
  (define std/srfi/117#set-last!
    (make-struct-field-mutator std/srfi/117#<list-queue> '1))
  (define std/srfi/117#raw-make-list-queue
    (lambda (_first88829_ _last88830_)
      (make-struct-instance
       std/srfi/117#<list-queue>
       _first88829_
       _last88830_)))
  (define std/srfi/117#make-list-queue__0
    (lambda (_list88824_)
      (if (null? _list88824_)
          (##structure std/srfi/117#<list-queue> '() '())
          (##structure
           std/srfi/117#<list-queue>
           _list88824_
           (std/srfi/117#last-pair _list88824_)))))
  (define std/srfi/117#make-list-queue
    (lambda _g88862_
      (let ((_g88861_ (length _g88862_)))
        (cond ((##fx= _g88861_ 1)
               (apply std/srfi/117#make-list-queue__0 _g88862_))
              ((##fx= _g88861_ 2)
               (apply (lambda (_list88826_ _last88827_)
                        (##structure
                         std/srfi/117#<list-queue>
                         _list88826_
                         _last88827_))
                      _g88862_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/117#make-list-queue
                _g88862_))))))
  (define std/srfi/117#list-queue
    (lambda _objs88822_ (std/srfi/117#make-list-queue__0 _objs88822_)))
  (define std/srfi/117#list-queue-copy
    (lambda (_list-queue88820_)
      (std/srfi/117#make-list-queue__0
       (std/srfi/117#list-copy
        (##structure-ref
         _list-queue88820_
         '1
         std/srfi/117#<list-queue>
         '#f)))))
  (define std/srfi/117#list-queue-empty?
    (lambda (_list-queue88818_)
      (null? (##structure-ref
              _list-queue88818_
              '1
              std/srfi/117#<list-queue>
              '#f))))
  (define std/srfi/117#list-queue-front
    (lambda (_list-queue88816_)
      (if (std/srfi/117#list-queue-empty? _list-queue88816_)
          (error '"Empty list-queue")
          (car (##structure-ref
                _list-queue88816_
                '1
                std/srfi/117#<list-queue>
                '#f)))))
  (define std/srfi/117#list-queue-back
    (lambda (_list-queue88814_)
      (if (std/srfi/117#list-queue-empty? _list-queue88814_)
          (error '"Empty list-queue")
          (car (##structure-ref
                _list-queue88814_
                '2
                std/srfi/117#<list-queue>
                '#f)))))
  (define std/srfi/117#list-queue-add-front!
    (lambda (_list-queue88809_ _elem88810_)
      (let ((_new-first88812_
             (cons _elem88810_
                   (##structure-ref
                    _list-queue88809_
                    '1
                    std/srfi/117#<list-queue>
                    '#f))))
        (if (std/srfi/117#list-queue-empty? _list-queue88809_)
            (##structure-set!
             _list-queue88809_
             _new-first88812_
             '2
             std/srfi/117#<list-queue>
             '#f)
            '#!void)
        (##structure-set!
         _list-queue88809_
         _new-first88812_
         '1
         std/srfi/117#<list-queue>
         '#f))))
  (define std/srfi/117#list-queue-add-back!
    (lambda (_list-queue88804_ _elem88805_)
      (let ((_new-last88807_ (list _elem88805_)))
        (if (std/srfi/117#list-queue-empty? _list-queue88804_)
            (##structure-set!
             _list-queue88804_
             _new-last88807_
             '1
             std/srfi/117#<list-queue>
             '#f)
            (set-cdr!
             (##structure-ref
              _list-queue88804_
              '2
              std/srfi/117#<list-queue>
              '#f)
             _new-last88807_))
        (##structure-set!
         _list-queue88804_
         _new-last88807_
         '2
         std/srfi/117#<list-queue>
         '#f))))
  (define std/srfi/117#list-queue-remove-front!
    (lambda (_list-queue88795_)
      (if (std/srfi/117#list-queue-empty? _list-queue88795_)
          (error '"Empty list-queue")
          '#!void)
      (let* ((_old-first88797_
              (##structure-ref
               _list-queue88795_
               '1
               std/srfi/117#<list-queue>
               '#f))
             (_elem88799_ (car _old-first88797_))
             (_new-first88801_ (cdr _old-first88797_)))
        (if (null? _new-first88801_)
            (##structure-set!
             _list-queue88795_
             '()
             '2
             std/srfi/117#<list-queue>
             '#f)
            '#!void)
        (##structure-set!
         _list-queue88795_
         _new-first88801_
         '1
         std/srfi/117#<list-queue>
         '#f)
        _elem88799_)))
  (define std/srfi/117#list-queue-remove-back!
    (lambda (_list-queue88786_)
      (if (std/srfi/117#list-queue-empty? _list-queue88786_)
          (error '"Empty list-queue")
          '#!void)
      (let* ((_old-last88788_
              (##structure-ref
               _list-queue88786_
               '2
               std/srfi/117#<list-queue>
               '#f))
             (_elem88790_ (car _old-last88788_))
             (_new-last88792_
              (std/srfi/117#penult-pair
               (##structure-ref
                _list-queue88786_
                '1
                std/srfi/117#<list-queue>
                '#f))))
        (if (null? _new-last88792_)
            (##structure-set!
             _list-queue88786_
             '()
             '1
             std/srfi/117#<list-queue>
             '#f)
            (set-cdr! _new-last88792_ '()))
        (##structure-set!
         _list-queue88786_
         _new-last88792_
         '2
         std/srfi/117#<list-queue>
         '#f)
        _elem88790_)))
  (define std/srfi/117#list-queue-remove-all!
    (lambda (_list-queue88782_)
      (let ((_result88784_
             (##structure-ref
              _list-queue88782_
              '1
              std/srfi/117#<list-queue>
              '#f)))
        (##structure-set!
         _list-queue88782_
         '()
         '1
         std/srfi/117#<list-queue>
         '#f)
        (##structure-set!
         _list-queue88782_
         '()
         '2
         std/srfi/117#<list-queue>
         '#f)
        _result88784_)))
  (define std/srfi/117#penult-pair
    (lambda (_lis88776_)
      (let _lp88778_ ((_lis88780_ _lis88776_))
        (if (null? (cdr _lis88780_))
            '()
            (if (null? (cddr _lis88780_))
                _lis88780_
                (_lp88778_ (cdr _lis88780_)))))))
  (define std/srfi/117#list-queue-append
    (lambda _list-queues88774_
      (std/srfi/117#list-queue-concatenate _list-queues88774_)))
  (define std/srfi/117#list-queue-concatenate
    (lambda (_list-queues88766_)
      (let ((_result88768_ (std/srfi/117#list-queue)))
        (for-each
         (lambda (_list-queue88770_)
           (for-each
            (lambda (_elem88772_)
              (std/srfi/117#list-queue-add-back! _result88768_ _elem88772_))
            (##structure-ref
             _list-queue88770_
             '1
             std/srfi/117#<list-queue>
             '#f)))
         _list-queues88766_)
        _result88768_)))
  (define std/srfi/117#list-queue-append!__1
    (lambda (_queue88760_) _queue88760_))
  (define std/srfi/117#list-queue-append!__2
    (lambda _queues88762_
      (for-each
       (lambda (_queue88764_)
         (std/srfi/117#list-queue-join! (car _queues88762_) _queue88764_))
       (cdr _queues88762_))
      (car _queues88762_)))
  (define std/srfi/117#list-queue-append!
    (lambda _g88864_
      (let ((_g88863_ (length _g88864_)))
        (cond ((##fx= _g88863_ 0) (apply std/srfi/117#list-queue _g88864_))
              ((##fx= _g88863_ 1)
               (apply std/srfi/117#list-queue-append!__1 _g88864_))
              (#t (apply std/srfi/117#list-queue-append!__2 _g88864_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/117#list-queue-append!
                _g88864_))))))
  (define std/srfi/117#list-queue-join!
    (lambda (_queue188756_ _queue288757_)
      (set-cdr!
       (##structure-ref _queue188756_ '2 std/srfi/117#<list-queue> '#f)
       (##structure-ref _queue288757_ '1 std/srfi/117#<list-queue> '#f))))
  (define std/srfi/117#list-queue-map
    (lambda (_proc88753_ _list-queue88754_)
      (std/srfi/117#make-list-queue__0
       (map _proc88753_
            (##structure-ref
             _list-queue88754_
             '1
             std/srfi/117#<list-queue>
             '#f)))))
  (define std/srfi/117#list-queue-unfold__1
    (lambda (_stop?88748_ _mapper88749_ _successor88750_ _seed88751_)
      (std/srfi/117#list-queue-unfold*
       _stop?88748_
       _mapper88749_
       _successor88750_
       _seed88751_
       (std/srfi/117#list-queue))))
  (define std/srfi/117#list-queue-unfold
    (lambda _g88866_
      (let ((_g88865_ (length _g88866_)))
        (cond ((##fx= _g88865_ 5)
               (apply std/srfi/117#list-queue-unfold* _g88866_))
              ((##fx= _g88865_ 4)
               (apply std/srfi/117#list-queue-unfold__1 _g88866_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/117#list-queue-unfold
                _g88866_))))))
  (define std/srfi/117#list-queue-unfold*
    (lambda (_stop?88732_
             _mapper88733_
             _successor88734_
             _seed88735_
             _queue88736_)
      (let _loop88738_ ((_seed88740_ _seed88735_))
        (if (not (_stop?88732_ _seed88740_))
            (std/srfi/117#list-queue-add-front!
             (_loop88738_ (_successor88734_ _seed88740_))
             (_mapper88733_ _seed88740_))
            '#!void)
        _queue88736_)))
  (define std/srfi/117#list-queue-unfold-right__1
    (lambda (_stop?88727_ _mapper88728_ _successor88729_ _seed88730_)
      (std/srfi/117#list-queue-unfold-right*
       _stop?88727_
       _mapper88728_
       _successor88729_
       _seed88730_
       (std/srfi/117#list-queue))))
  (define std/srfi/117#list-queue-unfold-right
    (lambda _g88868_
      (let ((_g88867_ (length _g88868_)))
        (cond ((##fx= _g88867_ 5)
               (apply std/srfi/117#list-queue-unfold-right* _g88868_))
              ((##fx= _g88867_ 4)
               (apply std/srfi/117#list-queue-unfold-right__1 _g88868_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/117#list-queue-unfold-right
                _g88868_))))))
  (define std/srfi/117#list-queue-unfold-right*
    (lambda (_stop?88711_
             _mapper88712_
             _successor88713_
             _seed88714_
             _queue88715_)
      (let _loop88717_ ((_seed88719_ _seed88714_))
        (if (not (_stop?88711_ _seed88719_))
            (std/srfi/117#list-queue-add-back!
             (_loop88717_ (_successor88713_ _seed88719_))
             (_mapper88712_ _seed88719_))
            '#!void)
        _queue88715_)))
  (define std/srfi/117#list-queue-map!
    (lambda (_proc88708_ _list-queue88709_)
      (std/srfi/117#map!
       _proc88708_
       (##structure-ref _list-queue88709_ '1 std/srfi/117#<list-queue> '#f))))
  (define std/srfi/117#list-queue-for-each
    (lambda (_proc88705_ _list-queue88706_)
      (for-each
       _proc88705_
       (##structure-ref _list-queue88706_ '1 std/srfi/117#<list-queue> '#f))))
  (define std/srfi/117#list-queue-list
    (lambda (_list-queue88703_)
      (##structure-ref _list-queue88703_ '1 std/srfi/117#<list-queue> '#f)))
  (define std/srfi/117#list-queue-first-last
    (lambda (_list-queue88701_)
      (values (##structure-ref
               _list-queue88701_
               '1
               std/srfi/117#<list-queue>
               '#f)
              (##structure-ref
               _list-queue88701_
               '2
               std/srfi/117#<list-queue>
               '#f))))
  (define std/srfi/117#list-queue-set-list!__0
    (lambda (_list-queue88694_ _first88695_)
      (##structure-set!
       _list-queue88694_
       _first88695_
       '1
       std/srfi/117#<list-queue>
       '#f)
      (if (null? _first88695_)
          (##structure-set!
           _list-queue88694_
           '()
           '2
           std/srfi/117#<list-queue>
           '#f)
          (##structure-set!
           _list-queue88694_
           (std/srfi/117#last-pair _first88695_)
           '2
           std/srfi/117#<list-queue>
           '#f))))
  (define std/srfi/117#list-queue-set-list!__1
    (lambda (_list-queue88697_ _first88698_ _last88699_)
      (##structure-set!
       _list-queue88697_
       _first88698_
       '1
       std/srfi/117#<list-queue>
       '#f)
      (##structure-set!
       _list-queue88697_
       _last88699_
       '2
       std/srfi/117#<list-queue>
       '#f)))
  (define std/srfi/117#list-queue-set-list!
    (lambda _g88870_
      (let ((_g88869_ (length _g88870_)))
        (cond ((##fx= _g88869_ 2)
               (apply std/srfi/117#list-queue-set-list!__0 _g88870_))
              ((##fx= _g88869_ 3)
               (apply std/srfi/117#list-queue-set-list!__1 _g88870_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/srfi/117#list-queue-set-list!
                _g88870_)))))))
