(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define scheme/process-context-impl#get-environment-variable
    (lambda (_var8043_) (getenv _var8043_ '#f)))
  (c-declare
   "#include <unistd.h>\nextern char **environ;\nstatic int ffi_count_envvars ()\n{\n int x;\n char **env;\n for (env = environ;\n      *env;\n      ++env) ++x;\n return x;\n}\n\nstatic char *ffi_get_envvar (int x)\n{\n return environ[x];\n}")
  (define-macro (define-c-lambda id args ret #!optional (name #f))
    (let ((name (or name (##symbol->string id))))
      `(define ,id (c-lambda ,args ,ret ,name))))
  (define-c-lambda
   scheme/process-context-impl#count-envvars
   ()
   int
   "ffi_count_envvars")
  (define-c-lambda
   scheme/process-context-impl#get-envvar
   (int)
   char-string
   "ffi_get_envvar")
  (define-c-lambda scheme/process-context-impl#_exit (int) void "_exit")
  (define scheme/process-context-impl#get-environment-variables
    (lambda ()
      (letrec ((_envvar8030_
                (lambda (_str8039_)
                  (let ((_ix8041_ (string-index _str8039_ '#\=)))
                    (cons (substring _str8039_ '0 _ix8041_)
                          (substring
                           _str8039_
                           (fx+ _ix8041_ '1)
                           (string-length _str8039_)))))))
        (let ((_count8032_ (scheme/process-context-impl#count-envvars)))
          (let _lp8034_ ((_x8036_ '0) (_vars8037_ '()))
            (if (fx< _x8036_ _count8032_)
                (_lp8034_
                 (fx+ _x8036_ '1)
                 (cons (_envvar8030_
                        (scheme/process-context-impl#get-envvar _x8036_))
                       _vars8037_))
                (reverse _vars8037_)))))))
  (define scheme/process-context-impl#r7rs-exit__%
    (lambda (_normally?8019_) (exit (if _normally?8019_ '0 '1))))
  (define scheme/process-context-impl#r7rs-exit__0
    (lambda ()
      (let ((_normally?8025_ '#t))
        (scheme/process-context-impl#r7rs-exit__% _normally?8025_))))
  (define scheme/process-context-impl#r7rs-exit
    (lambda _g8045_
      (let ((_g8044_ (length _g8045_)))
        (cond ((##fx= _g8044_ 0)
               (apply scheme/process-context-impl#r7rs-exit__0 _g8045_))
              ((##fx= _g8044_ 1)
               (apply scheme/process-context-impl#r7rs-exit__% _g8045_))
              (else
               (##raise-wrong-number-of-arguments-exception
                scheme/process-context-impl#r7rs-exit
                _g8045_)))))))
