(AndOr
  ops: [Op_DAmp Op_DAmp Op_DAmp]
  children: [
    (C {(_have)} {(pkg-get)})
    (FuncDef
      name: _pkg-get_get_catalog_file
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:url)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [26]
                )
              ]
              spids: [24]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair lhs:(LhsName name:catalog_file) op:Equal spids:[34])
                (assign_pair lhs:(LhsName name:i) op:Equal spids:[36])
                (assign_pair lhs:(LhsName name:conffile) op:Equal spids:[38])
              ]
              spids: [32]
            )
            (ForEach
              iter_name: file
              iter_words: [
                {(/etc/opt/csw/pkg-get.conf)}
                {(/opt/csw/etc/pkg-get.conf)}
                {(/etc/pkg-get.conf)}
              ]
              do_arg_iter: F
              body: 
                (DoGroup
                  children: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: (BoolUnary op_id:BoolUnary_f child:{($ VSub_Name '$file')})
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:conffile)
                                  op: Equal
                                  rhs: {(DQ ($ VSub_Name '$file'))}
                                  spids: [72]
                                )
                              ]
                              spids: [72]
                            )
                            (ControlFlow token:<ControlFlow_Break break>)
                          ]
                          spids: [16777215 69]
                        )
                      ]
                      spids: [16777215 81]
                    )
                  ]
                  spids: [55 84]
                )
              spids: [47 53]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:conffile)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name conffile>
                          suffix_op: 
                            (StringUnary
                              op_id: VTest_ColonHyphen
                              arg_word: 
                                {(Lit_Slash /) (opt) (Lit_Slash /) (csw) (Lit_Slash /) (etc) 
                                  (Lit_Slash /) (pkg-get.conf)
                                }
                            )
                          spids: [89 100]
                        )
                      )
                    }
                  spids: [87]
                )
              ]
              spids: [87]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolUnary op_id:BoolUnary_z child:{(DQ ($ VSub_Name '$url'))})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:url)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (C {(awk)} {(-F) (Lit_Other '=')} 
                                        {(SQ <' $1=="url" { print $2 }'>)} {($ VSub_Name '$conffile')}
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [122 133]
                              )
                            }
                          spids: [121]
                        )
                      ]
                      spids: [121]
                    )
                  ]
                  spids: [16777215 118]
                )
              ]
              spids: [16777215 136]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:catalog_file)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name url>
                          suffix_op: 
                            (StringUnary
                              op_id: VOp1_DPound
                              arg_word: {('*') (Lit_Slash /) (Lit_Slash /)}
                            )
                          spids: [142 148]
                        )
                      )
                    }
                  spids: [140]
                )
              ]
              spids: [140]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:catalog_file)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name catalog_file>
                          suffix_op: (StringUnary op_id:VOp1_DPercent arg_word:{(Lit_Slash /) ('*')})
                          spids: [154 159]
                        )
                      )
                    }
                  spids: [152]
                )
              ]
              spids: [152]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:catalog_file)
                  op: Equal
                  rhs: {(DQ (/var/pkg-get/catalog-) ($ VSub_Name '$catalog_file'))}
                  spids: [163]
                )
              ]
              spids: [163]
            )
            (C {(echo)} {(DQ ($ VSub_Name '$catalog_file'))})
          ]
          spids: [21]
        )
      spids: [17 20]
    )
    (FuncDef
      name: _pkg-get
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair lhs:(LhsName name:cur) op:Equal spids:[190])
                (assign_pair lhs:(LhsName name:prev) op:Equal spids:[192])
                (assign_pair lhs:(LhsName name:file) op:Equal spids:[194])
                (assign_pair lhs:(LhsName name:catalog_file) op:Equal spids:[196])
                (assign_pair lhs:(LhsName name:url) op:Equal spids:[198])
                (assign_pair lhs:(LhsName name:command) op:Equal spids:[200])
              ]
              spids: [188]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:COMPREPLY)
                  op: Equal
                  rhs: {(ArrayLiteralPart)}
                  spids: [203]
                )
              ]
              spids: [203]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:cur)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name COMP_WORDS>
                          bracket_op: (ArrayIndex expr:(ArithVarRef name:COMP_CWORD))
                          spids: [210 215]
                        )
                      )
                    }
                  spids: [208]
                )
              ]
              spids: [208]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:prev)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name COMP_WORDS>
                          bracket_op: 
                            (ArrayIndex
                              expr: 
                                (ArithBinary
                                  op_id: Arith_Minus
                                  left: (ArithVarRef name:COMP_CWORD)
                                  right: (ArithWord w:{(Lit_Digits 1)})
                                )
                            )
                          spids: [221 228]
                        )
                      )
                    }
                  spids: [219]
                )
              ]
              spids: [219]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ (${ VSub_Name prev))}
                              right: {(DQ (-s))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})]
                  spids: [16777215 252]
                )
              ]
              spids: [16777215 260]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:i)
                  op: Equal
                  rhs: 
                    {
                      (BracedVarSub
                        token: <VSub_Name COMP_WORDS>
                        prefix_op: VSub_Pound
                        bracket_op: (WholeArray op_id:Arith_Star)
                        spids: [265 271]
                      )
                    }
                  spids: [264]
                )
              ]
              spids: [264]
            )
            (WhileUntil
              keyword: <KW_While while>
              cond: [
                (Sentence
                  child: 
                    (DBracket
                      expr: (BoolBinary op_id:BoolBinary_gt left:{($ VSub_Name '$i')} right:{(0)})
                    )
                  terminator: <Op_Semi ';'>
                )
              ]
              body: 
                (DoGroup
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:i)
                          op: Equal
                          rhs: 
                            {
                              (ArithSubPart
                                anode: 
                                  (ArithBinary
                                    op_id: Arith_Minus
                                    left: (ArithVarRef name:i)
                                    right: (ArithWord w:{(Lit_Digits 1)})
                                  )
                                spids: [292 297]
                              )
                            }
                          spids: [291]
                        )
                      ]
                      spids: [291]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolBinary
                                      op_id: BoolBinary_GlobDEqual
                                      left: 
                                        {
                                          (DQ 
                                            (BracedVarSub
                                              token: <VSub_Name COMP_WORDS>
                                              bracket_op: 
                                                (ArrayIndex
                                                  expr: (ArithWord w:{($ VSub_Name '$i')})
                                                )
                                              spids: [305 310]
                                            )
                                          )
                                        }
                                      right: {(BoolUnary_s -s)}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:url)
                                  op: Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (BracedVarSub
                                          token: <VSub_Name COMP_WORDS>
                                          bracket_op: 
                                            (ArrayIndex
                                              expr: 
                                                (ArithWord
                                                  w: 
                                                    {
                                                      (ArithSubPart
                                                        anode: 
                                                          (ArithBinary
                                                            op_id: Arith_Plus
                                                            left: (ArithVarRef name:i)
                                                            right: (ArithWord w:{(Lit_Digits 1)})
                                                          )
                                                        spids: [328 333]
                                                      )
                                                    }
                                                )
                                            )
                                          spids: [325 335]
                                        )
                                      )
                                    }
                                  spids: [323]
                                )
                              ]
                              spids: [323]
                            )
                          ]
                          spids: [16777215 320]
                        )
                      ]
                      spids: [16777215 339]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolBinary
                                      op_id: BoolBinary_GlobDEqual
                                      left: 
                                        {
                                          (DQ 
                                            (BracedVarSub
                                              token: <VSub_Name COMP_WORDS>
                                              bracket_op: 
                                                (ArrayIndex
                                                  expr: (ArithWord w:{($ VSub_Name '$i')})
                                                )
                                              spids: [347 352]
                                            )
                                          )
                                        }
                                      right: {(ExtGlobPart op:<ExtGlob_At '@('> spids:[357 373])}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:command)
                                  op: Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (BracedVarSub
                                          token: <VSub_Name COMP_WORDS>
                                          bracket_op: 
                                            (ArrayIndex
                                              expr: (ArithWord w:{($ VSub_Name '$i')})
                                            )
                                          spids: [383 388]
                                        )
                                      )
                                    }
                                  spids: [381]
                                )
                              ]
                              spids: [381]
                            )
                          ]
                          spids: [16777215 378]
                        )
                      ]
                      spids: [16777215 392]
                    )
                  ]
                  spids: [288 395]
                )
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolUnary op_id:BoolUnary_n child:{(DQ ($ VSub_Name '$command'))})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolBinary
                                      op_id: BoolBinary_GlobDEqual
                                      left: {(DQ ($ VSub_Name '$command'))}
                                      right: {(ExtGlobPart op:<ExtGlob_At '@('> spids:[425 433])}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:catalog_file)
                                  op: Equal
                                  rhs: 
                                    {
                                      (CommandSubPart
                                        command_list: 
                                          (CommandList
                                            children: [
                                              (C {(_pkg-get_get_catalog_file)} 
                                                {(DQ ($ VSub_Name '$url'))}
                                              )
                                            ]
                                          )
                                        left_token: <Left_CommandSub '$('>
                                        spids: [442 448]
                                      )
                                    }
                                  spids: [441]
                                )
                              ]
                              spids: [441]
                            )
                            (If
                              arms: [
                                (if_arm
                                  cond: [
                                    (Sentence
                                      child: 
                                        (DBracket
                                          expr: 
                                            (BoolUnary
                                              op_id: BoolUnary_f
                                              child: {($ VSub_Name '$catalog_file')}
                                            )
                                        )
                                      terminator: <Op_Semi ';'>
                                    )
                                  ]
                                  action: [
                                    (Assignment
                                      keyword: Assign_Local
                                      pairs: [
                                        (assign_pair
                                          lhs: (LhsName name:packages_list)
                                          op: Equal
                                          rhs: 
                                            {
                                              (CommandSubPart
                                                command_list: 
                                                  (CommandList
                                                    children: [
                                                      (C {(awk)} 
                                                        {
                                                          (SQ 
                                                            <
' $0 ~ /BEGIN PGP SIGNATURE/ { exit } $1 ~ /^Hash:/ || $1 ~ /^ *(-|#|$)/ { next } { print $1 }'
                                                            >
                                                          )
                                                        } {($ VSub_Name '$catalog_file')}
                                                      )
                                                    ]
                                                  )
                                                left_token: <Left_CommandSub '$('>
                                                spids: [468 476]
                                              )
                                            }
                                          spids: [467]
                                        )
                                      ]
                                      spids: [465]
                                    )
                                    (Assignment
                                      keyword: Assign_None
                                      pairs: [
                                        (assign_pair
                                          lhs: (LhsName name:COMPREPLY)
                                          op: Equal
                                          rhs: 
                                            {
                                              (ArrayLiteralPart
                                                words: [
                                                  {
                                                    (CommandSubPart
                                                      command_list: 
                                                        (CommandList
                                                          children: [
                                                            (C {(compgen)} {(-W)} 
                                                              {(DQ (${ VSub_Name packages_list))} {(--)} {(${ VSub_Name cur)}
                                                            )
                                                          ]
                                                        )
                                                      left_token: <Left_CommandSub '$('>
                                                      spids: [482 498]
                                                    )
                                                  }
                                                ]
                                              )
                                            }
                                          spids: [479]
                                        )
                                      ]
                                      spids: [479]
                                    )
                                  ]
                                  spids: [16777215 462]
                                )
                              ]
                              spids: [16777215 503]
                            )
                          ]
                          spids: [16777215 438]
                        )
                      ]
                      spids: [16777215 506]
                    )
                    (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
                  ]
                  spids: [16777215 412]
                )
              ]
              spids: [16777215 514]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(${ VSub_Name cur)}
                              right: {(-) (Lit_Other '*')}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_Local
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:opts)
                          op: Equal
                          rhs: {(DQ ('-c -d -D -f -i -l -s -S -u -U -v'))}
                          spids: [540]
                        )
                      ]
                      spids: [538]
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:COMPREPLY)
                          op: Equal
                          rhs: 
                            {
                              (ArrayLiteralPart
                                words: [
                                  {
                                    (CommandSubPart
                                      command_list: 
                                        (CommandList
                                          children: [
                                            (C {(compgen)} {(-W)} {(DQ (${ VSub_Name opts))} {(--)} 
                                              {(${ VSub_Name cur)}
                                            )
                                          ]
                                        )
                                      left_token: <Left_CommandSub '$('>
                                      spids: [549 565]
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [546]
                        )
                      ]
                      spids: [546]
                    )
                    (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
                  ]
                  spids: [16777215 535]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_Local
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:commands)
                      op: Equal
                      rhs: 
                        {
                          (DQ ('available describe download install list ') 
                            ('            updatecatalog upgrade')
                          )
                        }
                      spids: [580]
                    )
                  ]
                  spids: [578]
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:COMPREPLY)
                      op: Equal
                      rhs: 
                        {
                          (ArrayLiteralPart
                            words: [
                              {
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [
                                        (C {(compgen)} {(-W)} {(DQ (${ VSub_Name commands))} {(--)} 
                                          {(${ VSub_Name cur)}
                                        )
                                      ]
                                    )
                                  left_token: <Left_CommandSub '$('>
                                  spids: [591 607]
                                )
                              }
                            ]
                          )
                        }
                      spids: [588]
                    )
                  ]
                  spids: [588]
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
              ]
              spids: [575 617]
            )
          ]
          spids: [185]
        )
      spids: [181 184]
    )
    (C {(complete)} {(-F)} {(_pkg-get)} {(pkg-get)})
  ]
)