(CommandList
  children: [
    (FuncDef
      name: warn
      body: 
        (BraceGroup
          children: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(echo)} {(DQ ('WARNING: ') ($ VSub_At '$@'))}]
                  redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
                )
              terminator: <Op_Semi ';'>
            )
          ]
          spids: [29]
        )
      spids: [25 28]
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(Lit_Other '[')} {(-r)} {(bashttpd.conf)} {(Lit_Other ']')})
        (BraceGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(bashttpd.conf)})
                (HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(SQ <EOF>)}
                  here_end_span_id: 156
                  stdin_parts: [
                    ('#\n')
                    ('# bashttpd.conf - configuration for bashttpd\n')
                    ('#\n')
                    ('# The behavior of bashttpd is dictated by the evaluation\n')
                    ('# of rules specified in this configuration file.  Each rule\n')
                    ('# is evaluated until one is matched.  If no rule is matched,\n')
                    ('# bashttpd will serve a 500 Internal Server Error.\n')
                    ('#\n')
                    ('# The format of the rules are:\n')
                    ('#    on_uri_match REGEX command [args]\n')
                    ('#    unconditionally command [args]\n')
                    ('#\n')
                    ('# on_uri_match:\n')
                    ('#   On an incoming request, the URI is checked against the specified\n')
                    (
'#   (bash-supported extended) regular expression, and if encounters a match the\n'
                    )
                    ('#   specified command is executed with the specified arguments.\n')
                    ('#\n')
                    (
'#   For additional flexibility, on_uri_match will also pass the results of the\n'
                    )
                    (
'#   regular expression match, ${BASH_REMATCH[@]} as additional arguments to the\n'
                    )
                    ('#   command.\n')
                    ('#\n')
                    ('# unconditionally:\n')
                    ('#   Always serve via the specified command.  Useful for catchall rules.\n')
                    ('#\n')
                    ('# The following commands are available for use:\n')
                    ('#\n')
                    ('#   serve_file FILE\n')
                    ('#     Statically serves a single file.\n')
                    ('#\n')
                    ('#   serve_dir_with_tree DIRECTORY\n')
                    ("#     Statically serves the specified directory using 'tree'.  It must be\n")
                    ('#     installed and in the PATH.\n')
                    ('#\n')
                    ('#   serve_dir_with_ls DIRECTORY\n')
                    ("#     Statically serves the specified directory using 'ls -al'.\n")
                    ('#\n')
                    ('#   serve_dir  DIRECTORY\n')
                    (
"#     Statically serves a single directory listing.  Will use 'tree' if it is\n"
                    )
                    ("#     installed and in the PATH, otherwise, 'ls -al'\n")
                    ('#\n')
                    ('#   serve_dir_or_file_from DIRECTORY\n')
                    (
'#     Serves either a directory listing (using serve_dir) or a file (using\n'
                    )
                    ('#     serve_file).  Constructs local path by appending the specified root\n')
                    ('#     directory, and the URI portion of the client request.\n')
                    ('#\n')
                    ('#   serve_static_string STRING\n')
                    ('#     Serves the specified static string with Content-Type text/plain.\n')
                    ('#\n')
                    ('# Examples of rules:\n')
                    ('#\n')
                    ('# on_uri_match \'^/issue$\' serve_file "/etc/issue"\n')
                    ('#\n')
                    (
"#   When a client's requested URI matches the string '/issue', serve them the\n"
                    )
                    ('#   contents of /etc/issue\n')
                    ('#\n')
                    ("# on_uri_match 'root' serve_dir /\n")
                    ('#\n')
                    ("#   When a client's requested URI has the word 'root' in it, serve up\n")
                    ('#   a directory listing of /\n')
                    ('#\n')
                    ('# DOCROOT=/var/www/html\n')
                    ('# on_uri_match \'/(.*)\' serve_dir_or_file_from "$DOCROOT"\n')
                    ('#   When any URI request is made, attempt to serve a directory listing\n')
                    ("#   or file content based on the request URI, by mapping URI's to local\n")
                    ('#   paths relative to the specified "$DOCROOT"\n')
                    ('#\n')
                    ('\n')
                    (
"unconditionally serve_static_string 'Hello, world!  You can configure bashttpd by modifying bashttpd.conf.'\n"
                    )
                    ('\n')
                    ('# More about commands:\n')
                    ('#\n')
                    ('# It is possible to somewhat easily write your own commands.  An example\n')
                    ('# may help.  The following example will serve "Hello, $x!" whenever\n')
                    ('# a client sends a request with the URI /say_hello_to/$x:\n')
                    ('#\n')
                    ('# serve_hello() {\n')
                    ('#    add_response_header "Content-Type" "text/plain"\n')
                    ('#    send_response_ok_exit <<< "Hello, $2!"\n')
                    ('# }\n')
                    ("# on_uri_match '^/say_hello_to/(.*)$' serve_hello\n")
                    ('#\n')
                    ('# Like mentioned before, the contents of ${BASH_REMATCH[@]} are passed\n')
                    ('# to your command, so its possible to use regular expression groups\n')
                    ('# to pull out info.\n')
                    ('#\n')
                    (
'# With this example, when the requested URI is /say_hello_to/Josh, serve_hello\n'
                    )
                    ("# is invoked with the arguments '/say_hello_to/Josh' 'Josh',\n")
                    ('# (${BASH_REMATCH[0]} is always the full match)\n')
                  ]
                )
              ]
            )
            (C {(warn)} 
              {
                (DQ 
                  (
'Created bashttpd.conf using defaults.  Please review it/configure before running bashttpd again.'
                  )
                )
              }
            )
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [55]
        )
      ]
    )
    (FuncDef
      name: recv
      body: 
        (BraceGroup
          children: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(echo)} {(DQ ('< ') ($ VSub_At '$@'))}]
                  redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
                )
              terminator: <Op_Semi ';'>
            )
          ]
          spids: [176]
        )
      spids: [172 175]
    )
    (FuncDef
      name: send
      body: 
        (BraceGroup
          children: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(echo)} {(DQ ('> ') ($ VSub_At '$@'))}]
                  redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
                )
              terminator: <Op_Semi ';'>
            )
            (Sentence
              child: (C {(printf)} {(SQ <'%s\\r\\n'>)} {(DQ ($ VSub_Star '$*'))})
              terminator: <Op_Semi ';'>
            )
          ]
          spids: [195]
        )
      spids: [191 194]
    )
    (AndOr
      ops: [Op_DAmp]
      children: [
        (DBracket
          expr: (BoolBinary op_id:BoolBinary_GlobEqual left:{($ VSub_Name '$UID')} right:{(0)})
        )
        (C {(warn)} {(DQ ('It is not recommended to run bashttpd as root.'))})
      ]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:DATE)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [(C {(date)} {(Lit_Other '+') (DQ ('%a, %d %b %Y %H:%M:%S %Z'))})]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [243 250]
              )
            }
          spids: [242]
        )
      ]
      spids: [242]
    )
    (Assignment
      keyword: Assign_Declare
      flags: [-a]
      pairs: [
        (assign_pair
          lhs: (LhsName name:RESPONSE_HEADERS)
          op: Equal
          rhs: 
            {
              (ArrayLiteralPart
                words: [
                  {(DQ ('Date: ') ($ VSub_Name '$DATE'))}
                  {(DQ ('Expires: ') ($ VSub_Name '$DATE'))}
                  {(DQ ('Server: Slash Bin Slash Bash'))}
                ]
              )
            }
          spids: [256]
        )
      ]
      spids: [252]
    )
    (FuncDef
      name: add_response_header
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:RESPONSE_HEADERS)
                  op: PlusEqual
                  rhs: 
                    {
                      (ArrayLiteralPart
                        words: [{(DQ ($ VSub_Number '$1') (': ') ($ VSub_Number '$2'))}]
                      )
                    }
                  spids: [286]
                )
              ]
              spids: [286]
            )
          ]
          spids: [283]
        )
      spids: [279 282]
    )
    (Assignment
      keyword: Assign_Declare
      flags: [-a]
      pairs: [
        (assign_pair
          lhs: (LhsName name:HTTP_RESPONSE)
          op: Equal
          rhs: 
            {
              (ArrayLiteralPart
                words: [
                  {(Lit_Other '[') (200) (Lit_Other ']') (Lit_Other '=') (DQ (OK))}
                  {(Lit_Other '[') (400) (Lit_Other ']') (Lit_Other '=') (DQ ('Bad Request'))}
                  {(Lit_Other '[') (403) (Lit_Other ']') (Lit_Other '=') (DQ (Forbidden))}
                  {(Lit_Other '[') (404) (Lit_Other ']') (Lit_Other '=') (DQ ('Not Found'))}
                  {(Lit_Other '[') (405) (Lit_Other ']') (Lit_Other '=') (DQ ('Method Not Allowed'))}
                  {(Lit_Other '[') (500) (Lit_Other ']') (Lit_Other '=') (DQ ('Internal Server Error'))}
                ]
              )
            }
          spids: [302]
        )
      ]
      spids: [298]
    )
    (FuncDef
      name: send_response
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:code)
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                  spids: [371]
                )
              ]
              spids: [369]
            )
            (C {(send)} 
              {
                (DQ ('HTTP/1.0 ') ($ VSub_Number '$1') (' ') 
                  (BracedVarSub
                    token: <VSub_Name HTTP_RESPONSE>
                    bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Number '$1')}))
                    spids: [381 386]
                  )
                )
              }
            )
            (ForEach
              iter_name: i
              iter_words: [
                {
                  (DQ 
                    (BracedVarSub
                      token: <VSub_Name RESPONSE_HEADERS>
                      bracket_op: (WholeArray op_id:Lit_At)
                      spids: [397 402]
                    )
                  )
                }
              ]
              do_arg_iter: F
              body: (DoGroup children:[(C {(send)} {(DQ ($ VSub_Name '$i'))})] spids:[406 416])
              spids: [395 404]
            )
            (C {(send)})
            (WhileUntil
              keyword: <KW_While while>
              cond: [(Sentence child:(C {(read)} {(-r)} {(line)}) terminator:<Op_Semi ';'>)]
              body: (DoGroup children:[(C {(send)} {(DQ ($ VSub_Name '$line'))})] spids:[431 441])
            )
          ]
          spids: [366]
        )
      spids: [362 365]
    )
    (FuncDef
      name: send_response_ok_exit
      body: 
        (BraceGroup
          children: [
            (Sentence child:(C {(send_response)} {(200)}) terminator:<Op_Semi ';'>)
            (Sentence
              child: (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})
              terminator: <Op_Semi ';'>
            )
          ]
          spids: [450]
        )
      spids: [446 449]
    )
    (FuncDef
      name: fail_with
      body: 
        (BraceGroup
          children: [
            (SimpleCommand
              words: [{(send_response)} {(DQ ($ VSub_Number '$1'))}]
              redirects: [
                (Redir
                  op: <Redir_TLess '<<<'>
                  fd: 16777215
                  arg_word: 
                    {
                      (DQ ($ VSub_Number '$1') (' ') 
                        (BracedVarSub
                          token: <VSub_Name HTTP_RESPONSE>
                          bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Number '$1')}))
                          spids: [483 488]
                        )
                      )
                    }
                )
              ]
            )
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [469]
        )
      spids: [465 468]
    )
    (FuncDef
      name: serve_file
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:file)
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                  spids: [508]
                )
              ]
              spids: [506]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:CONTENT_TYPE)
                  op: Equal
                  rhs: {(EmptyPart)}
                  spids: [513]
                )
              ]
              spids: [513]
            )
            (Case
              to_match: {(DQ ($ VSub_Name '$file'))}
              arms: [
                (case_arm
                  pat_list: [
                    {(Lit_Other '*') (EscapedLiteralPart token:<Lit_EscapedChar '\\.'>) (css)}
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:CONTENT_TYPE)
                          op: Equal
                          rhs: {(DQ (text/css))}
                          spids: [531]
                        )
                      ]
                      spids: [531]
                    )
                  ]
                  spids: [525 528 537 16777215]
                )
                (case_arm
                  pat_list: [{(Lit_Other '*') (EscapedLiteralPart token:<Lit_EscapedChar '\\.'>) (js)}]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:CONTENT_TYPE)
                          op: Equal
                          rhs: {(DQ (text/javascript))}
                          spids: [546]
                        )
                      ]
                      spids: [546]
                    )
                  ]
                  spids: [540 543 552 16777215]
                )
                (case_arm
                  pat_list: [{(Lit_Other '*')}]
                  action: [
                    (SimpleCommand
                      words: [{(read)} {(-r)} {(CONTENT_TYPE)}]
                      redirects: [
                        (Redir
                          op: <Redir_Less '<'>
                          fd: 16777215
                          arg_word: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (C {(file)} {(-b)} {(--mime-type)} {(DQ ($ VSub_Name '$file'))})
                                    ]
                                  )
                                left_token: <Left_ProcSubIn '<('>
                                spids: [567 577]
                              )
                            }
                        )
                      ]
                    )
                  ]
                  spids: [555 556 580 16777215]
                )
              ]
              spids: [516 522 583]
            )
            (Sentence
              child: 
                (C {(add_response_header)} {(DQ (Content-Type))} {(DQ ($ VSub_Name '$CONTENT_TYPE'))})
              terminator: <Op_Semi ';'>
            )
            (AndOr
              ops: [Op_DAmp]
              children: [
                (SimpleCommand
                  words: [{(read)} {(-r)} {(CONTENT_LENGTH)}]
                  redirects: [
                    (Redir
                      op: <Redir_Less '<'>
                      fd: 16777215
                      arg_word: 
                        {
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [(C {(stat)} {(-c) (SQ <'%s'>)} {(DQ ($ VSub_Name '$file'))})]
                              )
                            left_token: <Left_ProcSubIn '<('>
                            spids: [608 619]
                          )
                        }
                    )
                  ]
                )
                (C {(add_response_header)} {(DQ (Content-Length))} {(DQ ($ VSub_Name '$CONTENT_LENGTH'))})
              ]
            )
            (SimpleCommand
              words: [{(send_response_ok_exit)}]
              redirects: [(Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(DQ ($ VSub_Name '$file'))})]
            )
          ]
          spids: [503]
        )
      spids: [499 502]
    )
    (FuncDef
      name: serve_dir_with_tree
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:dir)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [657]
                )
                (assign_pair lhs:(LhsName name:tree_vers) op:Equal spids:[662])
                (assign_pair lhs:(LhsName name:tree_opts) op:Equal spids:[664])
                (assign_pair lhs:(LhsName name:basehref) op:Equal spids:[666])
                (assign_pair lhs:(LhsName name:x) op:Equal spids:[668])
              ]
              spids: [655]
            )
            (C {(add_response_header)} {(DQ (Content-Type))} {(DQ (text/html))})
            (SimpleCommand
              words: [{(read)} {(x)} {(tree_vers)} {(x)}]
              redirects: [
                (Redir
                  op: <Redir_Less '<'>
                  fd: 16777215
                  arg_word: 
                    {
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(tree)} {(--version)})])
                        left_token: <Left_ProcSubIn '<('>
                        spids: [698 702]
                      )
                    }
                )
              ]
            )
            (AndOr
              ops: [Op_DAmp]
              children: [
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: {($ VSub_Name '$tree_vers')}
                      right: {(v1.6) (Lit_Other '*')}
                    )
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:tree_opts)
                      op: Equal
                      rhs: {(DQ (--du))}
                      spids: [718]
                    )
                  ]
                  spids: [718]
                )
              ]
            )
            (SimpleCommand
              words: [{(send_response_ok_exit)}]
              redirects: [
                (Redir
                  op: <Redir_Less '<'>
                  fd: 16777215
                  arg_word: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (C {(tree)} {(-H)} {(DQ ($ VSub_Number '$2'))} {(-L)} {(1)} 
                                {(DQ ($ VSub_Name '$tree_opts'))} {(-D)} {(DQ ($ VSub_Name '$dir'))}
                              )
                            ]
                          )
                        left_token: <Left_ProcSubIn '<('>
                        spids: [731 753]
                      )
                    }
                )
              ]
            )
          ]
          spids: [652]
        )
      spids: [648 651]
    )
    (FuncDef
      name: serve_dir_with_ls
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:dir)
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                  spids: [767]
                )
              ]
              spids: [765]
            )
            (C {(add_response_header)} {(DQ (Content-Type))} {(DQ (text/plain))})
            (SimpleCommand
              words: [{(send_response_ok_exit)}]
              redirects: [
                (Redir
                  op: <Redir_Less '<'>
                  fd: 16777215
                  arg_word: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [(C {(ls)} {(-la)} {(DQ ($ VSub_Name '$dir'))})]
                          )
                        left_token: <Left_ProcSubIn '<('>
                        spids: [790 798]
                      )
                    }
                )
              ]
            )
          ]
          spids: [762]
        )
      spids: [758 761]
    )
    (FuncDef
      name: serve_dir
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:dir)
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                  spids: [812]
                )
              ]
              spids: [810]
            )
            (AndOr
              ops: [Op_DAmp]
              children: [
                (SimpleCommand
                  words: [{(which)} {(tree)}]
                  redirects: [(Redir op:<Redir_AndGreat '&>'> fd:16777215 arg_word:{(/dev/null)})]
                )
                (C {(serve_dir_with_tree)} {(DQ ($ VSub_At '$@'))})
              ]
            )
            (C {(serve_dir_with_ls)} {(DQ ($ VSub_At '$@'))})
            (C {(fail_with)} {(500)})
          ]
          spids: [807]
        )
      spids: [803 806]
    )
    (FuncDef
      name: serve_dir_or_file_from
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:URL_PATH)
                  op: Equal
                  rhs: {($ VSub_Number '$1') (/) ($ VSub_Number '$3')}
                  spids: [864]
                )
              ]
              spids: [862]
            )
            (C {(shift)})
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:URL_PATH)
                  op: Equal
                  rhs: 
                    {
                      (BracedVarSub
                        token: <VSub_Name URL_PATH>
                        suffix_op: 
                          (PatSub
                            pat: 
                              {('[^a-zA-Z0-9_~') (EscapedLiteralPart token:<Lit_EscapedChar '\\-'>) 
                                (EscapedLiteralPart
                                  token: <Lit_EscapedChar '\\.'>
                                ) (EscapedLiteralPart token:<Lit_EscapedChar '\\/'>) (']')
                              }
                            replace: {}
                            do_all: T
                            do_prefix: F
                            do_suffix: F
                          )
                        spids: [879 889]
                      )
                    }
                  spids: [878]
                )
              ]
              spids: [878]
            )
            (AndOr
              ops: [Op_DAmp]
              children: [
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: {($ VSub_Name '$URL_PATH')}
                      right: {(Lit_Other '*') (..) (Lit_Other '*')}
                    )
                )
                (C {(fail_with)} {(400)})
              ]
            )
            (AndOr
              ops: [Op_DAmp]
              children: [
                (DBracket
                  expr: 
                    (LogicalAnd
                      left: (BoolUnary op_id:BoolUnary_d child:{($ VSub_Name '$URL_PATH')})
                      right: 
                        (LogicalAnd
                          left: 
                            (BoolUnary
                              op_id: BoolUnary_f
                              child: {($ VSub_Name '$URL_PATH') (/index.html)}
                            )
                          right: 
                            (BoolUnary
                              op_id: BoolUnary_r
                              child: {($ VSub_Name '$URL_PATH') (/index.html)}
                            )
                        )
                    )
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:URL_PATH)
                      op: Equal
                      rhs: {(DQ ($ VSub_Name '$URL_PATH') (/index.html))}
                      spids: [942]
                    )
                  ]
                  spids: [942]
                )
              ]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolUnary op_id:BoolUnary_f child:{($ VSub_Name '$URL_PATH')})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (AndOr
                      ops: [Op_DAmp Op_DPipe]
                      children: [
                        (DBracket
                          expr: (BoolUnary op_id:BoolUnary_r child:{($ VSub_Name '$URL_PATH')})
                        )
                        (C {(serve_file)} {(DQ ($ VSub_Name '$URL_PATH'))} {(DQ ($ VSub_At '$@'))})
                        (C {(fail_with)} {(403)})
                      ]
                    )
                  ]
                  spids: [16777215 961]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolUnary op_id:BoolUnary_d child:{($ VSub_Name '$URL_PATH')})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (AndOr
                      ops: [Op_DAmp Op_DPipe]
                      children: [
                        (DBracket
                          expr: (BoolUnary op_id:BoolUnary_x child:{($ VSub_Name '$URL_PATH')})
                        )
                        (C {(serve_dir)} {(DQ ($ VSub_Name '$URL_PATH'))} {(DQ ($ VSub_At '$@'))})
                        (C {(fail_with)} {(403)})
                      ]
                    )
                  ]
                  spids: [993 1004]
                )
              ]
              spids: [16777215 1036]
            )
            (C {(fail_with)} {(404)})
          ]
          spids: [859]
        )
      spids: [855 858]
    )
    (FuncDef
      name: serve_static_string
      body: 
        (BraceGroup
          children: [
            (C {(add_response_header)} {(DQ (Content-Type))} {(DQ (text/plain))})
            (SimpleCommand
              words: [{(send_response_ok_exit)}]
              redirects: [
                (Redir
                  op: <Redir_TLess '<<<'>
                  fd: 16777215
                  arg_word: {(DQ ($ VSub_Number '$1'))}
                )
              ]
            )
          ]
          spids: [1051]
        )
      spids: [1047 1050]
    )
    (FuncDef
      name: on_uri_match
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:regex)
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                  spids: [1085]
                )
              ]
              spids: [1083]
            )
            (C {(shift)})
            (AndOr
              ops: [Op_DAmp]
              children: [
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_EqualTilde
                      left: {($ VSub_Name '$REQUEST_URI')}
                      right: {($ VSub_Name '$regex')}
                    )
                )
                (C {(DQ ($ VSub_At '$@'))} 
                  {
                    (DQ 
                      (BracedVarSub
                        token: <VSub_Name BASH_REMATCH>
                        bracket_op: (WholeArray op_id:Lit_At)
                        spids: [1112 1117]
                      )
                    )
                  }
                )
              ]
            )
          ]
          spids: [1080]
        )
      spids: [1076 1079]
    )
    (FuncDef
      name: unconditionally
      body: 
        (BraceGroup
          children: [(C {(DQ ($ VSub_At '$@'))} {(DQ ($ VSub_Name '$REQUEST_URI'))})]
          spids: [1127]
        )
      spids: [1123 1126]
    )
    (AndOr ops:[Op_DPipe] children:[(C {(read)} {(-r)} {(line)}) (C {(fail_with)} {(400)})])
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:line)
          op: Equal
          rhs: 
            {
              (BracedVarSub
                token: <VSub_Name line>
                suffix_op: 
                  (StringUnary
                    op_id: VOp1_DPercent
                    arg_word: 
                      {
                        (SingleQuotedPart
                          left: <Left_DollarSingleQuote "$'">
                          tokens: [<Char_OneChar '\\r'>]
                          spids: [1164 1166]
                        )
                      }
                  )
                spids: [1161 1167]
              )
            }
          spids: [1160]
        )
      ]
      spids: [1160]
    )
    (C {(recv)} {(DQ ($ VSub_Name '$line'))})
    (SimpleCommand
      words: [{(read)} {(-r)} {(REQUEST_METHOD)} {(REQUEST_URI)} {(REQUEST_HTTP_VERSION)}]
      redirects: [(Redir op:<Redir_TLess '<<<'> fd:16777215 arg_word:{(DQ ($ VSub_Name '$line'))})]
    )
    (AndOr
      ops: [Op_DAmp Op_DAmp Op_DPipe]
      children: [
        (C {(Lit_Other '[')} {(-n)} {(DQ ($ VSub_Name '$REQUEST_METHOD'))} {(Lit_Other ']')})
        (C {(Lit_Other '[')} {(-n)} {(DQ ($ VSub_Name '$REQUEST_URI'))} {(Lit_Other ']')})
        (C {(Lit_Other '[')} {(-n)} {(DQ ($ VSub_Name '$REQUEST_HTTP_VERSION'))} {(Lit_Other ']')})
        (C {(fail_with)} {(400)})
      ]
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$REQUEST_METHOD'))} {(Lit_Other '=')} {(DQ (GET))} 
          {(Lit_Other ']')}
        )
        (C {(fail_with)} {(405)})
      ]
    )
    (Assignment
      keyword: Assign_Declare
      flags: [-a]
      pairs: [(assign_pair lhs:(LhsName name:REQUEST_HEADERS) op:Equal spids:[1265])]
      spids: [1261]
    )
    (WhileUntil
      keyword: <KW_While while>
      cond: [(Sentence child:(C {(read)} {(-r)} {(line)}) terminator:<Op_Semi ';'>)]
      body: 
        (DoGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:line)
                  op: Equal
                  rhs: 
                    {
                      (BracedVarSub
                        token: <VSub_Name line>
                        suffix_op: 
                          (StringUnary
                            op_id: VOp1_DPercent
                            arg_word: 
                              {
                                (SingleQuotedPart
                                  left: <Left_DollarSingleQuote "$'">
                                  tokens: [<Char_OneChar '\\r'>]
                                  spids: [1284 1286]
                                )
                              }
                          )
                        spids: [1281 1287]
                      )
                    }
                  spids: [1280]
                )
              ]
              spids: [1280]
            )
            (C {(recv)} {(DQ ($ VSub_Name '$line'))})
            (AndOr
              ops: [Op_DAmp]
              children: [
                (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Name '$line'))} {(Lit_Other ']')})
                (ControlFlow token:<ControlFlow_Break break>)
              ]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:REQUEST_HEADERS)
                  op: PlusEqual
                  rhs: {(ArrayLiteralPart words:[{(DQ ($ VSub_Name '$line'))}])}
                  spids: [1318]
                )
              ]
              spids: [1318]
            )
          ]
          spids: [1277 1325]
        )
    )
    (C {(source)} 
      {
        (DQ 
          (BracedVarSub
            token: <VSub_Name BASH_SOURCE>
            bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
            suffix_op: (StringUnary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ('*')})
            spids: [1331 1339]
          )
        ) (/bashttpd.conf)
      }
    )
    (C {(fail_with)} {(500)})
  ]
)