(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/text/hex#hexes '"0123456789abcdef")
  (define std/text/hex#hex-encode__%
    (lambda (_bytes451_ _start452_ _end453_)
      (let* ((_end458_
              (let ((_$e455_ _end453_))
                (if _$e455_ _$e455_ (u8vector-length _bytes451_))))
             (_len460_ (fx- _end458_ _start452_))
             (_str462_
              (make-string (let () (declare (not safe)) (##fx* '2 _len460_)))))
        (let _lp465_ ((_n467_ '0))
          (if (let () (declare (not safe)) (##fx< _n467_ _len460_))
              (let* ((_ix469_ (let ()
                                (declare (not safe))
                                (##fx+ _n467_ _start452_)))
                     (_b471_ (let ()
                               (declare (not safe))
                               (##u8vector-ref _bytes451_ _ix469_)))
                     (_off473_
                      (let ()
                        (declare (not safe))
                        (##fxarithmetic-shift _n467_ '1))))
                (let ((__tmp4092
                       (let ((__tmp4093
                              (let ()
                                (declare (not safe))
                                (##fxarithmetic-shift _b471_ '-4))))
                         (declare (not safe))
                         (##string-ref std/text/hex#hexes __tmp4093))))
                  (declare (not safe))
                  (##string-set! _str462_ _off473_ __tmp4092))
                (let ((__tmp4096
                       (let () (declare (not safe)) (##fx+ _off473_ '1)))
                      (__tmp4094
                       (let ((__tmp4095
                              (let ()
                                (declare (not safe))
                                (##fxand _b471_ '15))))
                         (declare (not safe))
                         (##string-ref std/text/hex#hexes __tmp4095))))
                  (declare (not safe))
                  (##string-set! _str462_ __tmp4096 __tmp4094))
                (_lp465_ (let () (declare (not safe)) (##fx+ _n467_ '1))))
              _str462_)))))
  (define std/text/hex#hex-encode__0
    (lambda (_bytes479_)
      (let* ((_start481_ '0) (_end483_ '#f))
        (std/text/hex#hex-encode__% _bytes479_ _start481_ _end483_))))
  (define std/text/hex#hex-encode__1
    (lambda (_bytes485_ _start486_)
      (let ((_end488_ '#f))
        (std/text/hex#hex-encode__% _bytes485_ _start486_ _end488_))))
  (define std/text/hex#hex-encode
    (lambda _g4098_
      (let ((_g4097_ (let () (declare (not safe)) (##length _g4098_))))
        (cond ((let () (declare (not safe)) (##fx= _g4097_ 1))
               (apply std/text/hex#hex-encode__0 _g4098_))
              ((let () (declare (not safe)) (##fx= _g4097_ 2))
               (apply std/text/hex#hex-encode__1 _g4098_))
              ((let () (declare (not safe)) (##fx= _g4097_ 3))
               (apply std/text/hex#hex-encode__% _g4098_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/text/hex#hex-encode
                _g4098_))))))
  (define std/text/hex#hex
    (lambda (_u4448_)
      (let () (declare (not safe)) (##string-ref std/text/hex#hexes _u4448_))))
  (define std/text/hex#unhexes-len (char->integer '#\g))
  (define std/text/hex#unhexes (make-u8vector std/text/hex#unhexes-len '255))
  (let _loop442_ ((_i444_ '0))
    (if (<= _i444_ '15)
        (begin
          (let ((_c446_ (std/text/hex#hex _i444_)))
            (let ((__tmp4099 (char->integer _c446_)))
              (declare (not safe))
              (##u8vector-set! std/text/hex#unhexes __tmp4099 _i444_))
            (let ((__tmp4100 (char->integer (char-upcase _c446_))))
              (declare (not safe))
              (##u8vector-set! std/text/hex#unhexes __tmp4100 _i444_)))
          (_loop442_ (+ _i444_ '1)))
        '#!void))
  (define std/text/hex#unhex*
    (lambda (_char436_)
      (letrec* ((_i438_ (char->integer _char436_)))
        (if (let ()
              (declare (not safe))
              (##fx< '-1 _i438_ std/text/hex#unhexes-len))
            (let ((_d440_ (let ()
                            (declare (not safe))
                            (##u8vector-ref std/text/hex#unhexes _i438_))))
              (if (let () (declare (not safe)) (##fx< _d440_ '16)) _d440_ '#f))
            '#f))))
  (define std/text/hex#unhex
    (lambda (_char431_)
      (let ((_$e433_ (std/text/hex#unhex* _char431_)))
        (if _$e433_ _$e433_ (error '"invalid hex char" _char431_)))))
  (define std/text/hex#hex-decode-nibble
    (lambda (_string428_ _pos429_)
      (std/text/hex#unhex
       (let () (declare (not safe)) (##string-ref _string428_ _pos429_)))))
  (define std/text/hex#hex-decode-byte
    (lambda (_string425_ _pos426_)
      (let ((__tmp4102
             (let ((__tmp4103
                    (std/text/hex#hex-decode-nibble _string425_ _pos426_)))
               (declare (not safe))
               (##fxarithmetic-shift __tmp4103 '4)))
            (__tmp4101
             (std/text/hex#hex-decode-nibble
              _string425_
              (let () (declare (not safe)) (##fx+ _pos426_ '1)))))
        (declare (not safe))
        (##fx+ __tmp4102 __tmp4101))))
  (define std/text/hex#hex-decode__%
    (lambda (_str389_ _start390_ _end391_)
      (letrec* ((_len393_
                 (- (let ((_$e404_ _end391_))
                      (if _$e404_ _$e404_ (string-length _str389_)))
                    _start390_))
                (_blen394_
                 (let ((__tmp4104
                        (let () (declare (not safe)) (##fx+ _len393_ '1))))
                   (declare (not safe))
                   (##fxquotient __tmp4104 '2)))
                (_bytes395_ (make-u8vector _blen394_))
                (_hexes-start396_
                 (let ((__tmp4105
                        (let () (declare (not safe)) (##fxand _len393_ '1))))
                   (declare (not safe))
                   (##fx- _start390_ __tmp4105))))
        (let _lp398_ ((_n400_ '0))
          (if (let () (declare (not safe)) (##fx< _n400_ _blen394_))
              (let ((_off402_
                     (let ((__tmp4106
                            (let ()
                              (declare (not safe))
                              (##fxarithmetic-shift _n400_ '1))))
                       (declare (not safe))
                       (##fx+ _hexes-start396_ __tmp4106))))
                (let ((__tmp4107
                       (if (let ()
                             (declare (not safe))
                             (##fx< _off402_ _start390_))
                           (std/text/hex#hex-decode-nibble
                            _str389_
                            (let () (declare (not safe)) (##fx+ _off402_ '1)))
                           (std/text/hex#hex-decode-byte _str389_ _off402_))))
                  (declare (not safe))
                  (##u8vector-set! _bytes395_ _n400_ __tmp4107))
                (_lp398_ (let () (declare (not safe)) (##fx+ _n400_ '1))))
              '#!void))
        _bytes395_)))
  (define std/text/hex#hex-decode__0
    (lambda (_str410_)
      (let* ((_start412_ '0) (_end414_ '#f))
        (std/text/hex#hex-decode__% _str410_ _start412_ _end414_))))
  (define std/text/hex#hex-decode__1
    (lambda (_str416_ _start417_)
      (let ((_end419_ '#f))
        (std/text/hex#hex-decode__% _str416_ _start417_ _end419_))))
  (define std/text/hex#hex-decode
    (lambda _g4109_
      (let ((_g4108_ (let () (declare (not safe)) (##length _g4109_))))
        (cond ((let () (declare (not safe)) (##fx= _g4108_ 1))
               (apply std/text/hex#hex-decode__0 _g4109_))
              ((let () (declare (not safe)) (##fx= _g4108_ 2))
               (apply std/text/hex#hex-decode__1 _g4109_))
              ((let () (declare (not safe)) (##fx= _g4108_ 3))
               (apply std/text/hex#hex-decode__% _g4109_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/text/hex#hex-decode
                _g4109_)))))))
