(command.If
  if_kw: <Id.KW_If if>
  arms: [
    (IfArm
      keyword: <Id.KW_If if>
      cond: 
        (condition.Shell
          commands: [
            (command.Sentence
              child: 
                (command.DBracket
                  left: <Id.KW_DLeftBracket '[['>
                  expr: 
                    (bool_expr.Unary
                      op_id: Id.BoolUnary_z
                      child: {($ Id.VSub_DollarName _Dbg_requires)}
                    )
                  right: <Id.Lit_DRightBracket ']]'>
                  redirects: []
                )
              terminator: <Id.Op_Semi _>
            )
          ]
        )
      then_kw: <Id.KW_Then then>
      action: [
        (command.ShFunction
          keyword: <Id.KW_Function function>
          name_tok: <_Dbg_expand_filename>
          name: _Dbg_expand_filename
          body: 
            (BraceGroup
              left: <Id.Lit_LBrace '{'>
              children: [
                (command.Simple
                  blame_tok: <typeset>
                  more_env: []
                  words: [{<typeset>} {<-r>} {<Id.Lit_VarLike 'filename='> (DQ ($ Id.VSub_Number 1))}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <typeset>
                  more_env: []
                  words: [
                    {<typeset>}
                    {<Id.Lit_VarLike 'basename='> 
                      (DQ 
                        (BracedVarSub
                          left: <Id.Left_DollarBrace '${'>
                          token: <Id.VSub_Name filename>
                          var_name: filename
                          suffix_op: 
                            (suffix_op.Unary
                              op: <Id.VOp1_DPound '##'>
                              arg_word: {<Id.Lit_Other '*'> <Id.Lit_Slash '/'>}
                            )
                          right: <Id.Right_DollarBrace '}'>
                        )
                      )
                    }
                  ]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <typeset>
                  more_env: []
                  words: [
                    {<typeset>}
                    {<-x>}
                    {<Id.Lit_VarLike 'dirname='> 
                      (DQ 
                        (BracedVarSub
                          left: <Id.Left_DollarBrace '${'>
                          token: <Id.VSub_Name filename>
                          var_name: filename
                          suffix_op: 
                            (suffix_op.Unary
                              op: <Id.VOp1_Percent '%'>
                              arg_word: {<Id.Lit_Slash '/'> <Id.Lit_Other '*'>}
                            )
                          right: <Id.Right_DollarBrace '}'>
                        )
                      )
                    }
                  ]
                  redirects: []
                  do_fork: T
                )
                (command.AndOr
                  children: [
                    (command.DBracket
                      left: <Id.KW_DLeftBracket '[['>
                      expr: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_GlobDEqual
                          left: {($ Id.VSub_DollarName dirname)}
                          right: {($ Id.VSub_DollarName basename)}
                        )
                      right: <Id.Lit_DRightBracket ']]'>
                      redirects: []
                    )
                    (command.DBracket
                      left: <Id.KW_DLeftBracket '[['>
                      expr: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_GlobNEqual
                          left: {($ Id.VSub_DollarName filename)}
                          right: {(SQ <'/'>)}
                        )
                      right: <Id.Lit_DRightBracket ']]'>
                      redirects: []
                    )
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'dirname='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'dirname='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'dirname='> name:dirname)
                          op: assign_op.Equal
                          rhs: {(SQ <.>)}
                        )
                      ]
                      redirects: []
                    )
                  ]
                  ops: [<Id.Op_DAmp _> <Id.Op_DAmp _>]
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'dirname='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'dirname='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'dirname='> name:dirname)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (BracedVarSub
                            left: <Id.Left_DollarBrace '${'>
                            token: <Id.VSub_Name dirname>
                            var_name: dirname
                            suffix_op: 
                              (suffix_op.Unary
                                op: <Id.VTest_ColonHyphen _>
                                arg_word: {<Id.Lit_Slash '/'>}
                              )
                            right: <Id.Right_DollarBrace '}'>
                          )
                        }
                    )
                  ]
                  redirects: []
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'dirname='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'dirname='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'dirname='> name:dirname)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (CommandSub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (command.Simple
                                blame_tok: <echo>
                                more_env: []
                                words: [{<echo>} {($ Id.VSub_DollarName dirname)}]
                                redirects: []
                                do_fork: T
                              )
                            right: <Id.Eof_RParen _>
                          )
                        }
                    )
                  ]
                  redirects: []
                )
                (command.Simple
                  blame_tok: <typeset>
                  more_env: []
                  words: [{<typeset>} {<long_path>}]
                  redirects: []
                  do_fork: T
                )
                (command.If
                  if_kw: <Id.KW_If if>
                  arms: [
                    (IfArm
                      keyword: <Id.KW_If if>
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Sentence
                              child: 
                                (command.ShAssignment
                                  left: <Id.Lit_VarLike 'long_path='>
                                  pairs: [
                                    (AssignPair
                                      left: <Id.Lit_VarLike 'long_path='>
                                      lhs: 
                                        (sh_lhs_expr.Name
                                          left: <Id.Lit_VarLike 'long_path='>
                                          name: long_path
                                        )
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (CommandSub
                                            left_token: <Id.Left_DollarParen '$('>
                                            child: 
                                              (command.Subshell
                                                left: <Id.Op_LParen _>
                                                child: 
                                                  (command.CommandList
                                                    children: [
                                                      (command.Sentence
                                                        child: 
                                                          (command.Simple
                                                            blame_tok: <cd>
                                                            more_env: []
                                                            words: [
                                                              {<cd>}
                                                              {(DQ ($ Id.VSub_DollarName dirname))}
                                                            ]
                                                            redirects: []
                                                            do_fork: T
                                                          )
                                                        terminator: <Id.Op_Semi _>
                                                      )
                                                      (command.Simple
                                                        blame_tok: <pwd>
                                                        more_env: []
                                                        words: [{<pwd>}]
                                                        redirects: []
                                                        do_fork: T
                                                      )
                                                    ]
                                                  )
                                                right: <Id.Right_Subshell _>
                                                redirects: [
                                                  (Redir
                                                    op: <Id.Redir_Great '2>'>
                                                    loc: (redir_loc.Fd fd:2)
                                                    arg: {<'/dev/null'>}
                                                  )
                                                ]
                                              )
                                            right: <Id.Eof_RParen _>
                                          )
                                        }
                                    )
                                  ]
                                  redirects: []
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      then_kw: <Id.KW_Then then>
                      action: [
                        (command.If
                          if_kw: <Id.KW_If if>
                          arms: [
                            (IfArm
                              keyword: <Id.KW_If if>
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (command.Sentence
                                      child: 
                                        (command.DBracket
                                          left: <Id.KW_DLeftBracket '[['>
                                          expr: 
                                            (bool_expr.Binary
                                              op_id: Id.BoolBinary_GlobDEqual
                                              left: {(DQ ($ Id.VSub_DollarName long_path))}
                                              right: {(SQ <'/'>)}
                                            )
                                          right: <Id.Lit_DRightBracket ']]'>
                                          redirects: []
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                  ]
                                )
                              then_kw: <Id.KW_Then then>
                              action: [
                                (command.Simple
                                  blame_tok: <echo>
                                  more_env: []
                                  words: [{<echo>} {(DQ <'/'> ($ Id.VSub_DollarName basename))}]
                                  redirects: []
                                  do_fork: T
                                )
                              ]
                              spids: [210 228]
                            )
                          ]
                          else_kw: <Id.KW_Else else>
                          else_action: [
                            (command.Simple
                              blame_tok: <echo>
                              more_env: []
                              words: [
                                {<echo>}
                                {
                                  (DQ ($ Id.VSub_DollarName long_path) <'/'> 
                                    ($ Id.VSub_DollarName basename)
                                  )
                                }
                              ]
                              redirects: []
                              do_fork: T
                            )
                          ]
                          fi_kw: <Id.KW_Fi fi>
                          redirects: []
                        )
                        (command.ControlFlow
                          keyword: <Id.ControlFlow_Return return>
                          arg_word: {<0>}
                        )
                      ]
                      spids: [183 207]
                    )
                  ]
                  else_kw: <Id.KW_Else else>
                  else_action: [
                    (command.Simple
                      blame_tok: <echo>
                      more_env: []
                      words: [{<echo>} {($ Id.VSub_DollarName filename)}]
                      redirects: []
                      do_fork: T
                    )
                    (command.ControlFlow
                      keyword: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  fi_kw: <Id.KW_Fi fi>
                  redirects: []
                )
              ]
              redirects: []
              right: <Id.Lit_RBrace '}'>
            )
        )
        (command.Simple
          blame_tok: <typeset>
          more_env: []
          words: [{<typeset>} {<-A>} {<_Dbg_requires>}]
          redirects: []
          do_fork: T
        )
        (command.ShFunction
          name_tok: <require>
          name: require
          body: 
            (BraceGroup
              left: <Id.Lit_LBrace '{'>
              children: [
                (command.Simple
                  blame_tok: <typeset>
                  more_env: []
                  words: [{<typeset>} {<file>}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <typeset>
                  more_env: []
                  words: [{<typeset>} {<expanded_file>}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <typeset>
                  more_env: []
                  words: [{<typeset>} {<source_dir>}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <typeset>
                  more_env: []
                  words: [{<typeset>} {<orig_dir>}]
                  redirects: []
                  do_fork: T
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'orig_dir='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'orig_dir='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'orig_dir='> name:orig_dir)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (CommandSub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (command.Simple
                                blame_tok: <pwd>
                                more_env: []
                                words: [{<pwd>}]
                                redirects: []
                                do_fork: T
                              )
                            right: <Id.Eof_RParen _>
                          )
                        }
                    )
                  ]
                  redirects: []
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'source_dir='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'source_dir='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'source_dir='> name:source_dir)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (BracedVarSub
                            left: <Id.Left_DollarBrace '${'>
                            token: <Id.VSub_Name BASH_SOURCE>
                            var_name: BASH_SOURCE
                            bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 1>})
                            suffix_op: 
                              (suffix_op.Unary
                                op: <Id.VOp1_Percent '%'>
                                arg_word: {<Id.Lit_Slash '/'> <Id.Lit_Other '*'>}
                              )
                            right: <Id.Right_DollarBrace '}'>
                          )
                        }
                    )
                  ]
                  redirects: []
                )
                (command.If
                  if_kw: <Id.KW_If if>
                  arms: [
                    (IfArm
                      keyword: <Id.KW_If if>
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  left: <Id.KW_DLeftBracket '[['>
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_GlobNEqual
                                      left: {($ Id.VSub_DollarName source_dir)}
                                      right: 
                                        {
                                          (BracedVarSub
                                            left: <Id.Left_DollarBrace '${'>
                                            token: <Id.VSub_Name BASH_SOURCE>
                                            var_name: BASH_SOURCE
                                            bracket_op: 
                                              (bracket_op.ArrayIndex
                                                expr: {<Id.Lit_Digits 1>}
                                              )
                                            right: <Id.Right_DollarBrace '}'>
                                          )
                                        }
                                    )
                                  right: <Id.Lit_DRightBracket ']]'>
                                  redirects: []
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      then_kw: <Id.KW_Then then>
                      action: [
                        (command.Simple
                          blame_tok: <builtin>
                          more_env: []
                          words: [{<builtin>} {<cd>} {($ Id.VSub_DollarName source_dir)}]
                          redirects: []
                          do_fork: T
                        )
                      ]
                      spids: [331 350]
                    )
                  ]
                  else_action: []
                  fi_kw: <Id.KW_Fi fi>
                  redirects: []
                )
                (command.ForEach
                  keyword: <Id.KW_For for>
                  iter_names: [file]
                  iterable: (for_iter.Words words:[{(DQ ($ Id.VSub_At '@'))}])
                  semi_tok: <Id.Op_Semi _>
                  body: 
                    (command.DoGroup
                      left: <Id.KW_Do do>
                      children: [
                        (command.ShAssignment
                          left: <Id.Lit_VarLike 'expanded_file='>
                          pairs: [
                            (AssignPair
                              left: <Id.Lit_VarLike 'expanded_file='>
                              lhs: 
                                (sh_lhs_expr.Name
                                  left: <Id.Lit_VarLike 'expanded_file='>
                                  name: expanded_file
                                )
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (CommandSub
                                    left_token: <Id.Left_DollarParen '$('>
                                    child: 
                                      (command.Simple
                                        blame_tok: <_Dbg_expand_filename>
                                        more_env: []
                                        words: [
                                          {<_Dbg_expand_filename>}
                                          {(DQ ($ Id.VSub_DollarName file))}
                                        ]
                                        redirects: []
                                        do_fork: T
                                      )
                                    right: <Id.Eof_RParen _>
                                  )
                                }
                            )
                          ]
                          redirects: []
                        )
                        (command.If
                          if_kw: <Id.KW_If if>
                          arms: [
                            (IfArm
                              keyword: <Id.KW_If if>
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (command.Sentence
                                      child: 
                                        (command.DBracket
                                          left: <Id.KW_DLeftBracket '[['>
                                          expr: 
                                            (bool_expr.LogicalAnd
                                              left: 
                                                (bool_expr.Unary
                                                  op_id: Id.BoolUnary_z
                                                  child: 
                                                    {
                                                      (BracedVarSub
                                                        left: <Id.Left_DollarBrace '${'>
                                                        token: <Id.VSub_Name _Dbg_requires>
                                                        var_name: _Dbg_requires
                                                        bracket_op: 
                                                          (bracket_op.ArrayIndex
                                                            expr: {($ Id.VSub_DollarName file)}
                                                          )
                                                        right: <Id.Right_DollarBrace '}'>
                                                      )
                                                    }
                                                )
                                              right: 
                                                (bool_expr.Unary
                                                  op_id: Id.BoolUnary_z
                                                  child: 
                                                    {
                                                      (BracedVarSub
                                                        left: <Id.Left_DollarBrace '${'>
                                                        token: <Id.VSub_Name _Dbg_requires>
                                                        var_name: _Dbg_requires
                                                        bracket_op: 
                                                          (bracket_op.ArrayIndex
                                                            expr: 
                                                              {($ Id.VSub_DollarName expanded_file)}
                                                          )
                                                        right: <Id.Right_DollarBrace '}'>
                                                      )
                                                    }
                                                )
                                            )
                                          right: <Id.Lit_DRightBracket ']]'>
                                          redirects: []
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                  ]
                                )
                              then_kw: <Id.KW_Then then>
                              action: [
                                (command.Simple
                                  blame_tok: <source>
                                  more_env: []
                                  words: [{<source>} {($ Id.VSub_DollarName expanded_file)}]
                                  redirects: []
                                  do_fork: T
                                )
                                (command.ShAssignment
                                  left: <Id.Lit_ArrayLhsOpen '_Dbg_requires['>
                                  pairs: [
                                    (AssignPair
                                      left: <Id.Lit_ArrayLhsOpen '_Dbg_requires['>
                                      lhs: 
                                        (sh_lhs_expr.IndexedName
                                          left: <Id.Lit_ArrayLhsOpen '_Dbg_requires['>
                                          name: _Dbg_requires
                                          index: {($ Id.VSub_DollarName file)}
                                        )
                                      op: assign_op.Equal
                                      rhs: {($ Id.VSub_DollarName expanded_file)}
                                    )
                                  ]
                                  redirects: []
                                )
                                (command.ShAssignment
                                  left: <Id.Lit_ArrayLhsOpen '_Dbg_requires['>
                                  pairs: [
                                    (AssignPair
                                      left: <Id.Lit_ArrayLhsOpen '_Dbg_requires['>
                                      lhs: 
                                        (sh_lhs_expr.IndexedName
                                          left: <Id.Lit_ArrayLhsOpen '_Dbg_requires['>
                                          name: _Dbg_requires
                                          index: {($ Id.VSub_DollarName expanded_file)}
                                        )
                                      op: assign_op.Equal
                                      rhs: {($ Id.VSub_DollarName expanded_file)}
                                    )
                                  ]
                                  redirects: []
                                )
                              ]
                              spids: [388 418]
                            )
                          ]
                          else_action: []
                          fi_kw: <Id.KW_Fi fi>
                          redirects: []
                        )
                      ]
                      right: <Id.KW_Done done>
                    )
                  redirects: []
                )
                (command.AndOr
                  children: [
                    (command.DBracket
                      left: <Id.KW_DLeftBracket '[['>
                      expr: 
                        (bool_expr.Unary
                          op_id: Id.BoolUnary_n
                          child: {($ Id.VSub_DollarName orig_dir)}
                        )
                      right: <Id.Lit_DRightBracket ']]'>
                      redirects: []
                    )
                    (command.Simple
                      blame_tok: <builtin>
                      more_env: []
                      words: [{<builtin>} {<cd>} {($ Id.VSub_DollarName orig_dir)}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  ops: [<Id.Op_DAmp _>]
                )
              ]
              redirects: []
              right: <Id.Lit_RBrace '}'>
            )
        )
      ]
      spids: [48 60]
    )
  ]
  else_action: []
  fi_kw: <Id.KW_Fi fi>
  redirects: []
)