(command.AndOr
  ops: [Op_DAmp Op_DAmp]
  children: [
    (C {(_have)} {(pkgrm)})
    (command.FuncDef
      name: _pkgrm
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:cur spids:[26])
                  op: Equal
                  spids: [26]
                )
                (assign_pair
                  lhs: (lhs_expr.LhsName name:prev spids:[28])
                  op: Equal
                  spids: [28]
                )
                (assign_pair
                  lhs: (lhs_expr.LhsName name:words spids:[30])
                  op: Equal
                  spids: [30]
                )
                (assign_pair
                  lhs: (lhs_expr.LhsName name:cword spids:[32])
                  op: Equal
                  spids: [32]
                )
              ]
              spids: [24]
            )
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (C {(_init_completion)})
                (command.ControlFlow token:<ControlFlow_Return return>)
              ]
            )
            (command.Sentence
              child: 
                (command.Assignment
                  keyword: Assign_Local
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:spool spids:[58])
                      op: Equal
                      rhs: {(/var/sadm/pkg)}
                      spids: [58]
                    )
                  ]
                  spids: [56]
                )
              terminator: <Op_Semi ';'>
            )
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:i spids:[65])
                  op: Equal
                  rhs: {($ VSub_DollarName '$cword')}
                  spids: [65]
                )
              ]
              spids: [63]
            )
            (command.Sentence
              child: 
                (command.WhileUntil
                  keyword: <KW_While while>
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.BoolBinary
                              op_id: BoolBinary_gt
                              left: 
                                {
                                  (word_part.ArithSubPart
                                    anode: 
                                      (arith_expr.UnaryAssign
                                        op_id: Node_PostDMinus
                                        child: (lhs_expr.LhsName name:i spids:[74])
                                      )
                                    spids: [73 77]
                                  )
                                }
                              right: {(0)}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  body: 
                    (command.DoGroup
                      children: [
                        (command.Sentence
                          child: 
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:i spids:[89])
                                  op: Equal
                                  rhs: 
                                    {
                                      (word_part.ArithSubPart
                                        anode: 
                                          (arith_expr.ArithBinary
                                            op_id: Arith_Minus
                                            left: (arith_expr.ArithVarRef token:<Lit_ArithVarLike i>)
                                            right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                          )
                                        spids: [90 95]
                                      )
                                    }
                                  spids: [89]
                                )
                              ]
                              spids: [89]
                            )
                          terminator: <Op_Semi ';'>
                        )
                        (command.Sentence
                          child: 
                            (command.Case
                              to_match: 
                                {
                                  (DQ 
                                    (word_part.BracedVarSub
                                      token: <VSub_Name words>
                                      bracket_op: 
                                        (bracket_op.ArrayIndex
                                          expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$i')})
                                        )
                                      spids: [102 107]
                                    )
                                  )
                                }
                              arms: [
                                (case_arm
                                  pat_list: [{(-s)}]
                                  action: [
                                    (command.Sentence
                                      child: 
                                        (command.Assignment
                                          keyword: Assign_None
                                          pairs: [
                                            (assign_pair
                                              lhs: (lhs_expr.LhsName name:spool spids:[117])
                                              op: Equal
                                              rhs: 
                                                {
                                                  (DQ 
                                                    (word_part.BracedVarSub
                                                      token: <VSub_Name words>
                                                      bracket_op: 
                                                        (bracket_op.ArrayIndex
                                                          expr: 
                                                            (arith_expr.ArithWord
                                                              w: 
                                                                {
                                                                  (word_part.ArithSubPart
                                                                    anode: 
                                                                      (arith_expr.ArithBinary
                                                                        op_id: Arith_Plus
                                                                        left: 
                                                                          (arith_expr.ArithVarRef
                                                                            token: 
                                                                              <Lit_ArithVarLike i>
                                                                          )
                                                                        right: 
                                                                          (arith_expr.ArithWord
                                                                            w: {(Lit_Digits 1)}
                                                                          )
                                                                      )
                                                                    spids: [122 127]
                                                                  )
                                                                }
                                                            )
                                                        )
                                                      spids: [119 129]
                                                    )
                                                  )
                                                }
                                              spids: [117]
                                            )
                                          ]
                                          spids: [117]
                                        )
                                      terminator: <Op_Semi ';'>
                                    )
                                    (command.ControlFlow
                                      token: <ControlFlow_Break break>
                                    )
                                  ]
                                  spids: [113 114 137 16777215]
                                )
                              ]
                              spids: [99 110 140]
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      spids: [86 144]
                    )
                )
              terminator: <Op_Semi ';'>
            )
            (command.Case
              to_match: {($ VSub_DollarName '$prev')}
              arms: [
                (case_arm
                  pat_list: [{(-a)} {(-V)}]
                  action: [(C {(_filedir)})]
                  spids: [156 161 167 16777215]
                )
                (case_arm
                  pat_list: [{(-s)} {(-R)}]
                  action: [(C {(_filedir)} {(-d)})]
                  spids: [170 175 183 16777215]
                )
                (case_arm pat_list:[{(-Y)}] spids:[186 187 190 16777215])
                (case_arm
                  pat_list: [{(Lit_Other '*')}]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.BoolBinary
                                      op_id: BoolBinary_GlobDEqual
                                      left: {(${ VSub_Name cur)}
                                      right: {(-) (Lit_Other '*')}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.Sentence
                              child: 
                                (command.Assignment
                                  keyword: Assign_Local
                                  pairs: [
                                    (assign_pair
                                      lhs: (lhs_expr.LhsName name:opts spids:[218])
                                      op: Equal
                                      rhs: {(DQ ('-a -A -n -M -R -s -v -V -Y'))}
                                      spids: [218]
                                    )
                                  ]
                                  spids: [216]
                                )
                              terminator: <Op_Semi ';'>
                            )
                            (command.Sentence
                              child: 
                                (command.Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (lhs_expr.LhsName name:COMPREPLY spids:[225])
                                      op: Equal
                                      rhs: 
                                        {
                                          (word_part.ArrayLiteralPart
                                            words: [
                                              {
                                                (word_part.CommandSubPart
                                                  command_list: 
                                                    (command.CommandList
                                                      children: [
                                                        (C {(compgen)} {(-W)} {(DQ (${ VSub_Name opts))} 
                                                          {(--)} {(${ VSub_Name cur)}
                                                        )
                                                      ]
                                                    )
                                                  left_token: <Left_CommandSub '$('>
                                                  spids: [227 243]
                                                )
                                              }
                                            ]
                                          )
                                        }
                                      spids: [225]
                                    )
                                  ]
                                  spids: [225]
                                )
                              terminator: <Op_Semi ';'>
                            )
                            (command.Sentence
                              child: 
                                (command.ControlFlow
                                  token: <ControlFlow_Return return>
                                  arg_word: {(0)}
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          spids: [16777215 213]
                        )
                      ]
                      else_action: [
                        (command.Sentence
                          child: 
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:COMPREPLY spids:[257])
                                  op: Equal
                                  rhs: 
                                    {
                                      (word_part.ArrayLiteralPart
                                        words: [
                                          {
                                            (word_part.CommandSubPart
                                              command_list: 
                                                (command.CommandList
                                                  children: [
                                                    (C {(compgen)} {(-W)} 
                                                      {
                                                        (DQ 
                                                          (word_part.CommandSubPart
                                                            command_list: 
                                                              (command.CommandList
                                                                children: [
                                                                  (C {(/bin/ls)} {(-1)} 
                                                                    {($ VSub_DollarName '$spool')}
                                                                  )
                                                                ]
                                                              )
                                                            left_token: <Left_CommandSub '$('>
                                                            spids: [265 271]
                                                          )
                                                        )
                                                      } {(--)} {(${ VSub_Name cur)}
                                                    )
                                                  ]
                                                )
                                              left_token: <Left_CommandSub '$('>
                                              spids: [259 279]
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [257]
                                )
                              ]
                              spids: [257]
                            )
                          terminator: <Op_Semi ';'>
                        )
                        (command.Sentence
                          child: (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      spids: [254 290]
                    )
                  ]
                  spids: [193 194 293 16777215]
                )
              ]
              spids: [149 153 296]
            )
          ]
          spids: [21]
        )
      spids: [16 20]
    )
    (C {(complete)} {(-F)} {(_pkgrm)} {(pkgrm)})
  ]
)