(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:wwwoosh_port) op:Equal rhs:{(DQ (8080))} spids:[4])]
      spids: [4]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:wwwoosh_http_version)
          op: Equal
          rhs: {(DQ (HTTP/1.1))}
          spids: [9]
        )
      ]
      spids: [9]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:wwwoosh_fifo)
          op: Equal
          rhs: {(DQ (/tmp/wwwoosh_fifo))}
          spids: [15]
        )
      ]
      spids: [15]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:wwwoosh_debug_enabled) op:Equal rhs:{(DQ )} spids:[20])]
      spids: [20]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:CR)
          op: Equal
          rhs: {(SingleQuotedPart left:<Left_DollarSingleQuote "$'"> tokens:[<Char_OneChar '\\r'>])}
          spids: [25]
        )
      ]
      spids: [25]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:LF)
          op: Equal
          rhs: {(SingleQuotedPart left:<Left_DollarSingleQuote "$'"> tokens:[<Char_OneChar '\\n'>])}
          spids: [30]
        )
      ]
      spids: [30]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:CRLF)
          op: Equal
          rhs: {(DQ ($ VSub_Name '$CR') ($ VSub_Name '$LF'))}
          spids: [35]
        )
      ]
      spids: [35]
    )
    (FuncDef
      name: wwwoosh
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:app)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [52]
                )
              ]
              spids: [50]
            )
            (C {(rm)} {(-f)} {(DQ ($ VSub_Name '$wwwoosh_fifo'))})
            (C {(mkfifo)} {(DQ ($ VSub_Name '$wwwoosh_fifo'))})
            (AndOr
              ops: [Op_DAmp]
              children: [
                (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-gt)} {(1)} {(Lit_Other ']')})
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:wwwoosh_port)
                      op: Equal
                      rhs: {(DQ ($ VSub_Number '$2'))}
                      spids: [92]
                    )
                  ]
                  spids: [92]
                )
              ]
            )
            (AndOr
              ops: [Op_DAmp]
              children: [
                (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-gt)} {(2)} {(Lit_Other ']')})
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:wwwoosh_debug_enabled)
                      op: Equal
                      rhs: {(DQ ($ VSub_Number '$3'))}
                      spids: [110]
                    )
                  ]
                  spids: [110]
                )
              ]
            )
            (C {(echo)} {(DQ ('Starting Wwwoosh on port ') ($ VSub_Name '$wwwoosh_port') (...))})
            (While
              cond: [(Sentence child:(C {(true)}) terminator:<Op_Semi ';'>)]
              body: 
                (DoGroup
                  children: [
                    (Pipeline
                      children: [
                        (SimpleCommand
                          words: [{(wwwoosh_listen)} {($ VSub_Name '$wwwoosh_port')}]
                          redirects: [
                            (Redir
                              op_id: Redir_Less
                              fd: 16777215
                              arg_word: {(DQ ($ VSub_Name '$wwwoosh_fifo'))}
                              spids: [139]
                            )
                          ]
                        )
                        (C {(wwwoosh_debug)})
                        (C {(wwwoosh_handle_request)} {(DQ ($ VSub_Name '$app'))})
                        (C {(wwwoosh_debug)})
                        (SimpleCommand
                          words: [{(wwwoosh_handle_response)}]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(DQ ($ VSub_Name '$wwwoosh_fifo'))}
                              spids: [169]
                            )
                          ]
                        )
                      ]
                      negated: F
                    )
                  ]
                  spids: [132 176]
                )
            )
          ]
          spids: [47]
        )
      spids: [42 46]
    )
    (FuncDef
      name: wwwoosh_debug
      body: 
        (BraceGroup
          children: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {($ VSub_Name '$wwwoosh_debug_enabled')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(tee)} {(/dev/stderr)})]
                  spids: [16777215 198]
                )
              ]
              else_action: [(C {(cat)})]
              spids: [206 212]
            )
          ]
          spids: [186]
        )
      spids: [181 185]
    )
    (FuncDef
      name: wwwoosh_handle_request
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:app)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [227]
                )
              ]
              spids: [225]
            )
            (C {(read)} {(request_line)})
            (While
              cond: [
                (Sentence
                  child: 
                    (AndOr
                      ops: [Op_DAmp]
                      children: [
                        (C {(read)} {(header)})
                        (C {(Lit_Other '[')} {(KW_Bang '!')} {(DQ ($ VSub_Name '$header'))} 
                          {(Lit_Other '=')} {(SingleQuotedPart left:<Left_DollarSingleQuote "$'"> tokens:[<Char_OneChar '\\r'>])} {(Lit_Other ']')}
                        )
                      ]
                    )
                  terminator: <Op_Semi ';'>
                )
              ]
              body: 
                (DoGroup
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:header_name)
                          op: Equal
                          rhs: 
                            {
                              (DQ (HTTP_) 
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [
                                        (Pipeline
                                          children: [
                                            (C {(echo)} {($ VSub_Name '$header')})
                                            (C {(cut)} {(-d)} {(SQ <':'>)} {(-f)} {(1)})
                                            (C {(tr)} {(SQ <a-z->)} {(SQ <A-Z_>)})
                                          ]
                                          negated: F
                                        )
                                      ]
                                    )
                                  left_token: <Left_CommandSub '$('>
                                  spids: [283 313]
                                )
                              )
                            }
                          spids: [280]
                        )
                      ]
                      spids: [280]
                    )
                    (C {(export)} 
                      {($ VSub_Name '$header_name') (Lit_Other '=') 
                        (DQ 
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [
                                  (Pipeline
                                    children: [
                                      (C {(echo)} {($ VSub_Name '$header')})
                                      (C {(cut)} {(-d)} {(SQ <':'>)} {(-f)} {(2)})
                                      (C {(sed)} {(SQ <'s/^ //'>)})
                                    ]
                                    negated: F
                                  )
                                ]
                              )
                            left_token: <Left_CommandSub '$('>
                            spids: [322 348]
                          )
                        )
                      }
                    )
                  ]
                  spids: [273 352]
                )
            )
            (C {(export)} 
              {(Lit_VarLike 'REQUEST_METHOD=') 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [
                        (Pipeline
                          children: [
                            (C {(echo)} {($ VSub_Name '$request_line')})
                            (C {(cut)} {(-d)} {(SQ <' '>)} {(-f)} {(1)})
                          ]
                          negated: F
                        )
                      ]
                    )
                  left_token: <Left_CommandSub '$('>
                  spids: [363 381]
                )
              }
            )
            (C {(export)} 
              {(Lit_VarLike 'wwwoosh_http_version=') 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [
                        (Pipeline
                          children: [
                            (C {(echo)} {($ VSub_Name '$request_line')})
                            (C {(cut)} {(-d)} {(SQ <' '>)} {(-f)} {(3)})
                            (C {(tr)} {(-d)} 
                              {
                                (SingleQuotedPart
                                  left: <Left_DollarSingleQuote "$'">
                                  tokens: [<Char_OneChar '\\r'>]
                                )
                              }
                            )
                          ]
                          negated: F
                        )
                      ]
                    )
                  left_token: <Left_CommandSub '$('>
                  spids: [387 415]
                )
              }
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:request_path)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(echo)} {($ VSub_Name '$request_line')})
                                  (C {(cut)} {(-d)} {(SQ <' '>)} {(-f)} {(2)})
                                ]
                                negated: F
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [424 442]
                      )
                    }
                  spids: [423]
                )
              ]
              spids: [423]
            )
            (C {(export)} 
              {(Lit_VarLike 'PATH_INFO=') 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [
                        (Pipeline
                          children: [
                            (C {(echo)} {($ VSub_Name '$request_path')})
                            (C {(cut)} {(-d)} {(SQ <'?'>)} {(-f)} {(1)})
                          ]
                          negated: F
                        )
                      ]
                    )
                  left_token: <Left_CommandSub '$('>
                  spids: [448 466]
                )
              }
            )
            (C {(export)} 
              {(Lit_VarLike 'QUERY_STRING=') 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [
                        (Pipeline
                          children: [
                            (C {(echo)} {($ VSub_Name '$request_path')})
                            (C {(cut)} {(-d)} {(SQ <'?'>)} {(-f)} {(2)})
                          ]
                          negated: F
                        )
                      ]
                    )
                  left_token: <Left_CommandSub '$('>
                  spids: [472 490]
                )
              }
            )
            (C {(export)} {(Lit_VarLike 'SCRIPT_NAME=') (DQ )})
            (C {(export)} {(Lit_VarLike 'SERVER_NAME=') (DQ (localhost))})
            (C {(export)} {(Lit_VarLike 'SERVER_PORT=') (DQ ($ VSub_Name '$port'))})
            (C {(DQ ($ VSub_Name '$app'))})
          ]
          spids: [222]
        )
      spids: [217 221]
    )
    (FuncDef
      name: wwwoosh_handle_response
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:response_status)
                  op: Equal
                  rhs: {(DQ ('200 OK'))}
                  spids: [535]
                )
              ]
              spids: [533]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:response_headers)
                  op: Equal
                  rhs: {(DQ )}
                  spids: [543]
                )
              ]
              spids: [541]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:content_length)
                  op: Equal
                  rhs: {(DQ (-))}
                  spids: [551]
                )
              ]
              spids: [549]
            )
            (FuncDef
              name: add_header
              body: 
                (BraceGroup
                  children: [
                    (Assignment
                      keyword: Assign_Local
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:header)
                          op: Equal
                          rhs: {(DQ ($ VSub_Number '$1'))}
                          spids: [568]
                        )
                      ]
                      spids: [566]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$response_headers'))} 
                                  {(Lit_Other ']')}
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:response_headers)
                                  op: Equal
                                  rhs: 
                                    {
                                      (DQ ($ VSub_Name '$response_headers') ($ VSub_Name '$CRLF') 
                                        ($ VSub_Name '$header')
                                      )
                                    }
                                  spids: [588]
                                )
                              ]
                              spids: [588]
                            )
                          ]
                          spids: [16777215 585]
                        )
                      ]
                      else_action: [
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:response_headers)
                              op: Equal
                              rhs: {(DQ ($ VSub_Name '$header'))}
                              spids: [599]
                            )
                          ]
                          spids: [599]
                        )
                      ]
                      spids: [596 605]
                    )
                  ]
                  spids: [563]
                )
              spids: [558 562]
            )
            (While
              cond: [
                (Sentence
                  child: 
                    (AndOr
                      ops: [Op_DAmp]
                      children: [
                        (C {(read)} {(header)})
                        (C {(Lit_Other '[')} {(KW_Bang '!')} {(DQ ($ VSub_Name '$header'))} 
                          {(Lit_Other '=')} {(DQ )} {(Lit_Other ']')}
                        )
                      ]
                    )
                  terminator: <Op_Semi ';'>
                )
              ]
              body: 
                (DoGroup
                  children: [
                    (Assignment
                      keyword: Assign_Local
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:header_name)
                          op: Equal
                          rhs: 
                            {
                              (DQ 
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [
                                        (Pipeline
                                          children: [
                                            (C {(echo)} {($ VSub_Name '$header')})
                                            (C {(cut)} {(-d)} {(SQ <':'>)} {(-f)} {(1)})
                                            (C {(tr)} {(SQ <A-Z>)} {(SQ <a-z>)})
                                          ]
                                          negated: F
                                        )
                                      ]
                                    )
                                  left_token: <Left_CommandSub '$('>
                                  spids: [643 673]
                                )
                              )
                            }
                          spids: [641]
                        )
                      ]
                      spids: [639]
                    )
                    (Assignment
                      keyword: Assign_Local
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:header_value)
                          op: Equal
                          rhs: 
                            {
                              (DQ 
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [
                                        (Pipeline
                                          children: [
                                            (C {(echo)} {($ VSub_Name '$header')})
                                            (C {(cut)} {(-d)} {(SQ <':'>)} {(-f)} {(2)})
                                          ]
                                          negated: F
                                        )
                                      ]
                                    )
                                  left_token: <Left_CommandSub '$('>
                                  spids: [681 699]
                                )
                              )
                            }
                          spids: [679]
                        )
                      ]
                      spids: [677]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$header_name'))} 
                                  {(Lit_Other '=')} {(DQ (status))} {(Lit_Other ']')}
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:response_status)
                                  op: Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (CommandSubPart
                                          command_list: 
                                            (CommandList
                                              children: [
                                                (Pipeline
                                                  children: [
                                                    (C {(echo)} {($ VSub_Name '$header')})
                                                    (C {(cut)} {(-d)} {(SQ <':'>)} {(-f)} {(2)})
                                                    (C {(sed)} {(SQ <'s/^ //'>)})
                                                  ]
                                                  negated: F
                                                )
                                              ]
                                            )
                                          left_token: <Left_CommandSub '$('>
                                          spids: [725 751]
                                        )
                                      )
                                    }
                                  spids: [723]
                                )
                              ]
                              spids: [723]
                            )
                          ]
                          spids: [16777215 720]
                        )
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$header_name'))} 
                                  {(Lit_Other '=')} {(DQ (content-length))} {(Lit_Other ']')}
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:content_length)
                                  op: Equal
                                  rhs: {(DQ ($ VSub_Name '$header_value'))}
                                  spids: [775]
                                )
                              ]
                              spids: [775]
                            )
                            (C {(add_header)} {(DQ ($ VSub_Name '$header'))})
                          ]
                          spids: [755 772]
                        )
                      ]
                      else_action: [(C {(add_header)} {(DQ ($ VSub_Name '$header'))})]
                      spids: [788 798]
                    )
                  ]
                  spids: [636 801]
                )
            )
            (C {(add_header)} {(DQ ('Connection: close'))})
            (C {(add_header)} 
              {
                (DQ ('Date: ') 
                  (CommandSubPart
                    command_list: 
                      (CommandList
                        children: [(C {(date)} {(-u)} {(SQ <'+%a, %d %b %Y %R:%S GMT'>)})]
                      )
                    left_token: <Left_CommandSub '$('>
                    spids: [816 824]
                  )
                )
              }
            )
            (C {(echo)} 
              {
                (DQ ($ VSub_Name '$wwwoosh_http_version') (' ') ($ VSub_Name '$response_status') 
                  ($ VSub_Name '$CRLF') ($ VSub_Name '$response_headers') ($ VSub_Name '$CRLF') ($ VSub_Name '$CR')
                )
              }
            )
            (C {(cat)})
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:log_remote_host)
                  op: Equal
                  rhs: {(DQ (-))}
                  spids: [850]
                )
              ]
              spids: [850]
            )
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:log_user) op:Equal rhs:{(DQ (-))} spids:[856])]
              spids: [856]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:log_date)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [(C {(date)} {(-u)} {(SQ <'+%d/%b/%Y:%H:%M:%S'>)})]
                            )
                          left_token: <Left_CommandSub '$('>
                          spids: [864 872]
                        )
                      )
                    }
                  spids: [862]
                )
              ]
              spids: [862]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:log_header)
                  op: Equal
                  rhs: 
                    {
                      (DQ ($ VSub_Name '$REQUEST_METHOD') (' ') ($ VSub_Name '$PATH_INFO') (' ') 
                        ($ VSub_Name '$wwwoosh_http_version')
                      )
                    }
                  spids: [876]
                )
              ]
              spids: [876]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:log_status)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [
                                (Pipeline
                                  children: [
                                    (C {(echo)} {(DQ ($ VSub_Name '$response_status'))})
                                    (C {(cut)} {(-d)} {(DQ (' '))} {(-f1)})
                                  ]
                                  negated: F
                                )
                              ]
                            )
                          left_token: <Left_CommandSub '$('>
                          spids: [891 909]
                        )
                      )
                    }
                  spids: [889]
                )
              ]
              spids: [889]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:log_size)
                  op: Equal
                  rhs: {(DQ ($ VSub_Name '$content_length'))}
                  spids: [913]
                )
              ]
              spids: [913]
            )
            (SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ ($ VSub_Name '$log_remote_host') (' - ') ($ VSub_Name '$log_user') (' [') 
                    ($ VSub_Name '$log_date') ('] ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_Name '$log_header') 
                    (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' ') ($ VSub_Name '$log_status') (' ') ($ VSub_Name '$log_size')
                  )
                }
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[938])]
            )
          ]
          spids: [530]
        )
      spids: [525 529]
    )
    (FuncDef
      name: wwwoosh_listen
      body: 
        (BraceGroup
          children: [
            (AndOr
              ops: [Op_DPipe]
              children: [
                (SimpleCommand
                  words: [{(nc)} {(-l)} {(-p)} {($ VSub_Number '$1')}]
                  redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[964])]
                )
                (C {(nc)} {(-l)} {($ VSub_Number '$1')})
              ]
            )
          ]
          spids: [949]
        )
      spids: [944 948]
    )
    (Case
      to_match: {(DQ ($ VSub_Number '$0'))}
      arms: [
        (case_arm
          pat_list: [{(Lit_Other '*') (wwwoosh.sh)}]
          action: [(C {(wwwoosh)} {($ VSub_At '$@')})]
          spids: [988 990 996 16777215]
        )
      ]
      spids: [979 985 998]
    )
  ]
)