(command.CommandList
  children: [
    (C {<export>} {<Id.Lit_VarLike 'PATH='> <'/bin'> <Id.Lit_Colon ':'> <'/usr/bin'>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LC_ALL)
          op: assign_op.Equal
          rhs: {<C>}
          spids: [90]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:FS)
          op: assign_op.Equal
          rhs: {(SQ <': '>)}
          spids: [96]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LIBDEPENDS)
          op: assign_op.Equal
          rhs: {<'./_libdeps'>}
          spids: [104]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:USRSRC)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: <Id.VSub_Number 1>
                suffix_op: 
                  (suffix_op.Unary
                    tok: <Id.VTest_ColonHyphen ':-'>
                    arg_word: {<Id.Lit_Slash '/'> <usr> <Id.Lit_Slash '/'> <src>}
                  )
              )
            }
          spids: [110]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LIBS)
          op: assign_op.Equal
          rhs: 
            {
              (DQ <'\n'> <'\tlib\n'> <'\tgnu/lib\n'> <'\tkerberos5/lib\n'> <'\tsecure/lib\n'> 
                <'\tusr.bin/lex/lib\n'> <'\tcddl/lib\n'>
              )
            }
          spids: [123]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SED_FILTER)
          op: assign_op.Equal
          rhs: 
            {
              (DQ <'\n'> <'sed -E\n'> <'    -e\'s; ;! ;g\'\n'> <'    -e\'s;'> <Id.Lit_Dollar '$'> 
                <';!;\'\n'> <'    -e\'s;-lbsdxml!;lib/libexpat;g\'\n'> <'    -e\'s;-lpthread!;lib/libthr;g\'\n'> 
                <'    -e\'s;-lm!;lib/msun;g\'\n'> <'    -e\'s;-l(ncurses|termcap)!;lib/ncurses/ncurses;g\'\n'> <'    -e\'s;-l(gcc)!;gnu/lib/lib'> 
                <Id.Lit_BadBackslash '\\'> <'1;g\'\n'> <'    -e\'s;-lssp_nonshared!;gnu/lib/libssp/libssp_nonshared;g\'\n'> 
                <
'    -e\'s;-l(asn1|hdb|kdc|heimbase|heimntlm|heimsqlite|hx509|krb5|roken|wind)!;kerberos5/lib/lib'
                > <Id.Lit_BadBackslash '\\'> <'1;g\'\n'> <'    -e\'s;-l(crypto|ssh|ssl)!;secure/lib/lib'> 
                <Id.Lit_BadBackslash '\\'> <'1;g\'\n'> <'    -e\'s;-l([^!]+)!;lib/lib'> <Id.Lit_BadBackslash '\\'> <'1;g\'\n'>
              )
            }
          spids: [144]
        )
      ]
    )
    (command.ShFunction
      name: genlibdepends
      body: 
        (BraceGroup
          children: [
            (command.Subshell
              child: 
                (command.CommandList
                  children: [
                    (C {<cd>} {(${ Id.VSub_Name USRSRC)})
                    (command.Pipeline
                      children: [
                        (C {<find>} {<-s>} {(${ Id.VSub_Name LIBS)} {<-mindepth>} {<1>} {<-name>} 
                          {<Makefile>}
                        )
                        (C {<xargs>} {<grep>} {<-l>} {(SQ <'bsd\\.lib\\.mk'>)})
                        (command.WhileUntil
                          keyword: <Id.KW_While while>
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: (C {<read>} {<makefile>})
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          body: 
                            (command.DoGroup
                              children: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:libdir)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (command_sub
                                            left_token: <Id.Left_DollarParen '$('>
                                            child: (C {<dirname>} {(${ Id.VSub_Name makefile)})
                                          )
                                        }
                                      spids: [237]
                                    )
                                  ]
                                )
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:deps)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (command_sub
                                            left_token: <Id.Left_DollarParen '$('>
                                            child: 
                                              (command.CommandList
                                                children: [
                                                  (C {<cd>} {(${ Id.VSub_Name libdir)})
                                                  (C {<make>} {<-m>} 
                                                    {(${ Id.VSub_Name USRSRC) <'/share/mk'>} {<-V>} {<LDADD>}
                                                  )
                                                ]
                                              )
                                          )
                                        }
                                      spids: [247]
                                    )
                                  ]
                                )
                                (command.If
                                  arms: [
                                    (if_arm
                                      cond: 
                                        (condition.Shell
                                          commands: [
                                            (command.Sentence
                                              child: 
                                                (C {<Id.Lit_LBracket '['>} {(DQ (${ Id.VSub_Name deps))} 
                                                  {<Id.Lit_RBracket ']'>}
                                                )
                                              terminator: <Id.Op_Semi _>
                                            )
                                          ]
                                        )
                                      action: [
                                        (C {<echo>} 
                                          {(${ Id.VSub_Name libdir) (DQ (${ Id.VSub_Name FS)) 
                                            (command_sub
                                              left_token: <Id.Left_DollarParen '$('>
                                              child: 
                                                (command.Pipeline
                                                  children: [
                                                    (C {<echo>} {(${ Id.VSub_Name deps)})
                                                    (C {<eval>} {(${ Id.VSub_Name SED_FILTER)})
                                                  ]
                                                  negated: F
                                                )
                                            )
                                          }
                                        )
                                      ]
                                      spids: [275 288]
                                    )
                                  ]
                                )
                              ]
                            )
                        )
                      ]
                      negated: F
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: main
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-f>} 
                              {(${ Id.VSub_Name LIBDEPENDS)} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.Simple
                      words: [{<genlibdepends>}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {(${ Id.VSub_Name LIBDEPENDS)}
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  spids: [341 356]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:prebuild_libs)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<awk>} {<-F> (DQ (${ Id.VSub_Name FS))} {(SQ <'{ print $2 }'>)} 
                                {(${ Id.VSub_Name LIBDEPENDS)}
                              )
                              (C {<tr>} {(SQ <' '>)} {(SQ <'\\n'>)})
                              (C {<sort>} {<-u>})
                            ]
                            negated: F
                          )
                      )
                    }
                  spids: [371]
                )
              ]
            )
            (C {<echo>} {(DQ <'Libraries with dependents:'>)})
            (C {<echo>})
            (command.Pipeline
              children: [
                (C {<echo>} {(${ Id.VSub_Name prebuild_libs)})
                (C {<tr>} {(SQ <' '>)} {(SQ <'\\n'>)})
              ]
              negated: F
            )
            (C {<echo>})
            (C {<echo>} {(DQ <'List of interdependencies:'>)})
            (C {<echo>})
            (command.Pipeline
              children: [
                (command.ForEach
                  iter_name: lib
                  iter_words: [{(${ Id.VSub_Name prebuild_libs)}]
                  do_arg_iter: F
                  body: 
                    (command.DoGroup
                      children: [
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {<grep>} {(DQ <'^'> (${ Id.VSub_Name lib) (${ Id.VSub_Name FS))} 
                              {(${ Id.VSub_Name LIBDEPENDS)}
                            )
                            (C {<true>})
                          ]
                        )
                      ]
                    )
                )
                (C {<awk>} {<-F> (DQ (${ Id.VSub_Name FS))} 
                  {
                    (SQ <'{\n'> <'\t\tif ($2 in dependents)\n'> 
                      <'\t\t\tdependents[$2]=dependents[$2]" "$1\n'> <'\t\telse\n'> <'\t\t\tdependents[$2]=$1\n'> <'\t}\n'> <'\tEND {\n'> <'\t\tfor (lib in dependents)\n'> 
                      <'\t\t\tprint dependents[lib]": " lib\n'> <'\t}'>
                    )
                  }
                )
                (C {<sort>})
              ]
              negated: F
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
          ]
        )
    )
    (C {<main>})
  ]
)