(command.CommandList
  children: [
    (C {<unset>} {<CDPATH>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'PROG='> name:PROG)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_Backtick '`'>
                child: (C {<basename>} {($ Id.VSub_Number 0)})
                right: <Id.Backtick_Right '`'>
              )
            }
          spids: [102]
        )
      ]
      redirects: []
    )
    (command.Simple
      words: [{<export>} {<PATH>}]
      redirects: []
      more_env: [
        (env_pair
          name: PATH
          val: {<'/opt/onbld/bin'> <Id.Lit_Colon ':'> ($ Id.VSub_DollarName PATH)}
          spids: [111]
        )
      ]
      do_fork: T
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ ($ Id.VSub_DollarName BUILD_TOOLS))} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.Simple
              words: [{<export>} {<PATH>}]
              redirects: []
              more_env: [
                (env_pair
                  name: PATH
                  val: 
                    {($ Id.VSub_DollarName BUILD_TOOLS) <'/onbld/bin'> <Id.Lit_Colon ':'> 
                      ($ Id.VSub_DollarName PATH)
                    }
                  spids: [136]
                )
              ]
              do_fork: T
            )
          ]
          spids: [120 133]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'CONF='> name:CONF)
          op: assign_op.Equal
          rhs: {<'tools/scripts/build_cscope.conf'>}
          spids: [149]
        )
      ]
      redirects: []
    )
    (command.ShFunction
      name: fail
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              words: [{<echo>} {($ Id.VSub_DollarName PROG) <Id.Lit_Colon ':'>} {($ Id.VSub_At '@')}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'/dev/stderr'>})]
              more_env: []
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<-ne>} {<1>} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<echo>} {(DQ <'Usage: '> ($ Id.VSub_DollarName PROG) <' <env_file>'>)})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [188 201]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-f>} {(DQ ($ Id.VSub_Number 1))} {<Id.Lit_RBracket ']'>})
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_GlobEqual
                                  left: {($ Id.VSub_Number 1)}
                                  right: {<Id.Lit_Other '*'> <'/'> <Id.Lit_Other '*'>}
                                )
                              redirects: []
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<.>} {($ Id.VSub_Number 1)})]
                  spids: [245 260]
                )
              ]
              else_action: [(C {<.>} {<'./'> ($ Id.VSub_Number 1)})]
              redirects: []
            )
          ]
          spids: [229 242]
        )
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-f>} {(DQ <'/opt/onbld/env/'> ($ Id.VSub_Number 1))} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<.>} {(DQ <'/opt/onbld/env/'> ($ Id.VSub_Number 1))})]
          spids: [279 293]
        )
      ]
      else_action: [
        (C {<fail>} 
          {
            (DQ <'cannot find env file as '> ($ Id.VSub_Number 1) <' or /opt/onbld/env/'> 
              ($ Id.VSub_Number 1)
            )
          }
        )
      ]
      redirects: []
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName SRC))} {<Id.Lit_RBracket ']'>})
        (C {<fail>} 
          {(DQ (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'> ch:'$') <'SRC is not set'>)}
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-d>} {(DQ ($ Id.VSub_DollarName SRC))} 
          {<Id.Lit_RBracket ']'>}
        )
        (C {<fail>} 
          {
            (DQ (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'> ch:'$') <'SRC ('> 
              ($ Id.VSub_DollarName SRC) <') is not a directory'>
            )
          }
        )
      ]
    )
    (C {<cd>} {($ Id.VSub_DollarName SRC)})
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (command.Sentence
              child: (C {<read>} {<name>} {<flags>} {<dirs>})
              terminator: <Id.Op_Semi _>
            )
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName name))} {<Id.Lit_Equals '='>} {(DQ )} 
                  {<-o>} {(DQ ($ Id.VSub_DollarName name))} {<Id.Lit_Equals '='>} {(DQ <'#'>)} {<Id.Lit_RBracket ']'>}
                )
                (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName flags))} {<Id.Lit_Equals '='>} 
                  {
                    (DQ (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') 
                      (word_part.EscapedLiteral
                        token: <Id.Lit_EscapedChar '\\"'>
                        ch: '"'
                      )
                    )
                  } {<Id.Lit_RBracket ']'>}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'flags='> name:flags)
                      op: assign_op.Equal
                      rhs: (rhs_word.Empty)
                      spids: [438]
                    )
                  ]
                  redirects: []
                )
              ]
            )
            (C {<xref>} {<-c>} {($ Id.VSub_DollarName dirs)})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<xref>} {($ Id.VSub_DollarName flags)} {($ Id.VSub_DollarName dirs)})
                (C {<fail>} {(DQ <'cannot build '> ($ Id.VSub_DollarName name) <' cross-reference'>)})
              ]
            )
          ]
        )
      redirects: [
        (redir
          op: <Id.Redir_Less '<'>
          loc: (redir_loc.Fd fd:0)
          arg: {($ Id.VSub_DollarName CONF)}
        )
      ]
    )
  ]
)