(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/debug/threads#dump-thread-stack-trace!__%
    (lambda (_thread524_ _port525_)
      (let ((_cont527_
             (let ()
               (declare (not safe))
               (##thread-continuation-capture _thread524_))))
        (display-continuation-backtrace _cont527_ _port525_ '#t '#f))))
  (define std/debug/threads#dump-thread-stack-trace!__0
    (lambda (_thread532_)
      (let ((_port534_ (current-error-port)))
        (std/debug/threads#dump-thread-stack-trace!__%
         _thread532_
         _port534_))))
  (define std/debug/threads#dump-thread-stack-trace!
    (lambda _g4138_
      (let ((_g4137_ (let () (declare (not safe)) (##length _g4138_))))
        (cond ((let () (declare (not safe)) (##fx= _g4137_ 1))
               (apply std/debug/threads#dump-thread-stack-trace!__0 _g4138_))
              ((let () (declare (not safe)) (##fx= _g4137_ 2))
               (apply std/debug/threads#dump-thread-stack-trace!__% _g4138_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/debug/threads#dump-thread-stack-trace!
                _g4138_))))))
  (define std/debug/threads#dump-thread!__%
    (lambda (_thread508_ _port509_)
      (if (eq? _thread508_ (current-thread))
          '#!void
          (begin
            (display '"thread: " _port509_)
            (display _thread508_ _port509_)
            (let ((_qlen511_
                   (std/debug/threads#thread-queue-length _thread508_)))
              (display '" (" _port509_)
              (display _qlen511_ _port509_)
              (display '")" _port509_))
            (newline _port509_)
            (std/debug/threads#dump-thread-stack-trace!__%
             _thread508_
             _port509_)))))
  (define std/debug/threads#dump-thread!__0
    (lambda (_thread516_)
      (let ((_port518_ (current-error-port)))
        (std/debug/threads#dump-thread!__% _thread516_ _port518_))))
  (define std/debug/threads#dump-thread!
    (lambda _g4140_
      (let ((_g4139_ (let () (declare (not safe)) (##length _g4140_))))
        (cond ((let () (declare (not safe)) (##fx= _g4139_ 1))
               (apply std/debug/threads#dump-thread!__0 _g4140_))
              ((let () (declare (not safe)) (##fx= _g4139_ 2))
               (apply std/debug/threads#dump-thread!__% _g4140_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/debug/threads#dump-thread!
                _g4140_))))))
  (define std/debug/threads#dump-thread-group!__%
    (lambda (_tg476_ _port477_ _filter478_)
      (for-each
       (lambda (_thread480_)
         (if (_filter478_ _thread480_)
             (std/debug/threads#dump-thread!__% _thread480_ _port477_)
             '#!void))
       (thread-group->thread-list _tg476_))))
  (define std/debug/threads#dump-thread-group!__0
    (lambda ()
      (let* ((_tg486_ (gerbil/gambit/threads#current-thread-group))
             (_port488_ (current-error-port))
             (_filter490_ true))
        (std/debug/threads#dump-thread-group!__%
         _tg486_
         _port488_
         _filter490_))))
  (define std/debug/threads#dump-thread-group!__1
    (lambda (_tg492_)
      (let* ((_port494_ (current-error-port)) (_filter496_ true))
        (std/debug/threads#dump-thread-group!__%
         _tg492_
         _port494_
         _filter496_))))
  (define std/debug/threads#dump-thread-group!__2
    (lambda (_tg498_ _port499_)
      (let ((_filter501_ true))
        (std/debug/threads#dump-thread-group!__%
         _tg498_
         _port499_
         _filter501_))))
  (define std/debug/threads#dump-thread-group!
    (lambda _g4142_
      (let ((_g4141_ (let () (declare (not safe)) (##length _g4142_))))
        (cond ((let () (declare (not safe)) (##fx= _g4141_ 0))
               (apply std/debug/threads#dump-thread-group!__0 _g4142_))
              ((let () (declare (not safe)) (##fx= _g4141_ 1))
               (apply std/debug/threads#dump-thread-group!__1 _g4142_))
              ((let () (declare (not safe)) (##fx= _g4141_ 2))
               (apply std/debug/threads#dump-thread-group!__2 _g4142_))
              ((let () (declare (not safe)) (##fx= _g4141_ 3))
               (apply std/debug/threads#dump-thread-group!__% _g4142_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/debug/threads#dump-thread-group!
                _g4142_))))))
  (define std/debug/threads#dump-thread-group!*__%
    (lambda (_tg442_ _port443_ _filter444_)
      (std/debug/threads#dump-thread-group!__% _tg442_ _port443_ _filter444_)
      (for-each
       (lambda (_g445447_)
         (std/debug/threads#dump-thread-group!*__%
          _g445447_
          _port443_
          _filter444_))
       (thread-group->thread-group-list _tg442_))))
  (define std/debug/threads#dump-thread-group!*__0
    (lambda ()
      (let* ((_tg454_ (gerbil/gambit/threads#current-thread-group))
             (_port456_ (current-error-port))
             (_filter458_ true))
        (std/debug/threads#dump-thread-group!*__%
         _tg454_
         _port456_
         _filter458_))))
  (define std/debug/threads#dump-thread-group!*__1
    (lambda (_tg460_)
      (let* ((_port462_ (current-error-port)) (_filter464_ true))
        (std/debug/threads#dump-thread-group!*__%
         _tg460_
         _port462_
         _filter464_))))
  (define std/debug/threads#dump-thread-group!*__2
    (lambda (_tg466_ _port467_)
      (let ((_filter469_ true))
        (std/debug/threads#dump-thread-group!*__%
         _tg466_
         _port467_
         _filter469_))))
  (define std/debug/threads#dump-thread-group!*
    (lambda _g4144_
      (let ((_g4143_ (let () (declare (not safe)) (##length _g4144_))))
        (cond ((let () (declare (not safe)) (##fx= _g4143_ 0))
               (apply std/debug/threads#dump-thread-group!*__0 _g4144_))
              ((let () (declare (not safe)) (##fx= _g4143_ 1))
               (apply std/debug/threads#dump-thread-group!*__1 _g4144_))
              ((let () (declare (not safe)) (##fx= _g4143_ 2))
               (apply std/debug/threads#dump-thread-group!*__2 _g4144_))
              ((let () (declare (not safe)) (##fx= _g4143_ 3))
               (apply std/debug/threads#dump-thread-group!*__% _g4144_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/debug/threads#dump-thread-group!*
                _g4144_))))))
  (define std/debug/threads#dump-all-threads!__%
    (lambda (_port423_ _filter424_)
      (std/debug/threads#dump-thread-group!*__%
       (std/misc/threads#primordial-thread-group)
       _port423_
       _filter424_)))
  (define std/debug/threads#dump-all-threads!__0
    (lambda ()
      (let* ((_port430_ (current-error-port)) (_filter432_ true))
        (std/debug/threads#dump-all-threads!__% _port430_ _filter432_))))
  (define std/debug/threads#dump-all-threads!__1
    (lambda (_port434_)
      (let ((_filter436_ true))
        (std/debug/threads#dump-all-threads!__% _port434_ _filter436_))))
  (define std/debug/threads#dump-all-threads!
    (lambda _g4146_
      (let ((_g4145_ (let () (declare (not safe)) (##length _g4146_))))
        (cond ((let () (declare (not safe)) (##fx= _g4145_ 0))
               (apply std/debug/threads#dump-all-threads!__0 _g4146_))
              ((let () (declare (not safe)) (##fx= _g4145_ 1))
               (apply std/debug/threads#dump-all-threads!__1 _g4146_))
              ((let () (declare (not safe)) (##fx= _g4145_ 2))
               (apply std/debug/threads#dump-all-threads!__% _g4146_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/debug/threads#dump-all-threads!
                _g4146_))))))
  (define std/debug/threads#dump-all-threads/queue!__%
    (lambda (_port409_)
      (std/debug/threads#dump-all-threads!__%
       _port409_
       (lambda (_$obj411_)
         (not (std/debug/threads#thread-queue-empty? _$obj411_))))))
  (define std/debug/threads#dump-all-threads/queue!__0
    (lambda ()
      (let ((_port418_ (current-error-port)))
        (std/debug/threads#dump-all-threads/queue!__% _port418_))))
  (define std/debug/threads#dump-all-threads/queue!
    (lambda _g4148_
      (let ((_g4147_ (let () (declare (not safe)) (##length _g4148_))))
        (cond ((let () (declare (not safe)) (##fx= _g4147_ 0))
               (apply std/debug/threads#dump-all-threads/queue!__0 _g4148_))
              ((let () (declare (not safe)) (##fx= _g4147_ 1))
               (apply std/debug/threads#dump-all-threads/queue!__% _g4148_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/debug/threads#dump-all-threads/queue!
                _g4148_))))))
  (define std/debug/threads#thread-queue-length
    (lambda (_thread399_)
      (let ((_$e401_ (macro-thread-mailbox _thread399_)))
        (if _$e401_
            ((lambda (_mb404_)
               (let ((_fifo406_ (macro-mailbox-fifo _mb404_)))
                 (length (cdr _fifo406_))))
             _$e401_)
            '0))))
  (define std/debug/threads#thread-queue-empty?
    (lambda (_thread390_)
      (let ((_$e392_ (macro-thread-mailbox _thread390_)))
        (if _$e392_
            ((lambda (_mb395_)
               (let ((_fifo397_ (macro-mailbox-fifo _mb395_)))
                 (null? (cdr _fifo397_))))
             _$e392_)
            '#t)))))
