(command.AndOr
  ops: [Op_DAmp]
  children: [
    (command.FuncDef
      name: _upgradepkg
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:cur spids:[13])
                  op: Equal
                  spids: [13]
                )
                (assign_pair
                  lhs: (lhs_expr.LhsName name:prev spids:[15])
                  op: Equal
                  spids: [15]
                )
                (assign_pair
                  lhs: (lhs_expr.LhsName name:words spids:[17])
                  op: Equal
                  spids: [17]
                )
                (assign_pair
                  lhs: (lhs_expr.LhsName name:cword spids:[19])
                  op: Equal
                  spids: [19]
                )
              ]
              spids: [11]
            )
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (C {(_init_completion)})
                (command.ControlFlow token:<ControlFlow_Return return>)
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ ($ VSub_DollarName '$cur'))}
                              right: {(-) (Lit_Other '*')}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:COMPREPLY spids:[49])
                          op: Equal
                          rhs: 
                            {
                              (word_part.ArrayLiteralPart
                                words: [
                                  {
                                    (word_part.CommandSubPart
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-W)} 
                                              {
                                                (SQ <'--dry-run --install-new --reinstall\n'> 
                                                  <'            --verbose'>
                                                )
                                              } {(--)} {(DQ ($ VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                      left_token: <Left_CommandSub '$('>
                                      spids: [52 69]
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [49]
                        )
                      ]
                      spids: [49]
                    )
                    (command.ControlFlow token:<ControlFlow_Return return>)
                  ]
                  spids: [16777215 46]
                )
              ]
              spids: [16777215 77]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ ($ VSub_DollarName '$cur'))}
                              right: {(Lit_Other '?') (Lit_Other '*') (Lit_Other '%') (Lit_Other '*')}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:prev spids:[102])
                          op: Equal
                          rhs: 
                            {
                              (DQ 
                                (word_part.BracedVarSub
                                  token: <VSub_Name cur>
                                  suffix_op: 
                                    (suffix_op.StringUnary
                                      op_id: VOp1_DPercent
                                      arg_word: 
                                        {('?(') 
                                          (word_part.EscapedLiteralPart
                                            token: <Lit_EscapedChar '\\\\'>
                                          ) (')') (Lit_Percent '%') ('*')
                                        }
                                    )
                                  spids: [104 112]
                                )
                              )
                            }
                          spids: [102]
                        )
                      ]
                      spids: [102]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:cur spids:[116])
                          op: Equal
                          rhs: 
                            {
                              (DQ 
                                (word_part.BracedVarSub
                                  token: <VSub_Name cur>
                                  suffix_op: 
                                    (suffix_op.StringUnary
                                      op_id: VOp1_Pound
                                      arg_word: {('*') (Lit_Percent '%')}
                                    )
                                  spids: [118 123]
                                )
                              )
                            }
                          spids: [116]
                        )
                      ]
                      spids: [116]
                    )
                    (command.Assignment
                      keyword: Assign_Local
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:nofiles spids:[129])
                          op: Equal
                          spids: [129]
                        )
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:IFS spids:[131])
                          op: Equal
                          rhs: 
                            {
                              (word_part.SingleQuotedPart
                                left: <Left_DollarSingleQuote "$'">
                                tokens: [<Char_OneChar '\\n'>]
                                spids: [132 134]
                              )
                            }
                          spids: [131]
                        )
                      ]
                      spids: [127]
                    )
                    (C {(compopt)} {(-o)} {(filenames)})
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:COMPREPLY spids:[144])
                          op: Equal
                          rhs: 
                            {
                              (word_part.ArrayLiteralPart
                                words: [
                                  {
                                    (word_part.CommandSubPart
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-P)} 
                                              {(DQ ($ VSub_DollarName '$prev') ('%'))} {(-f)} {(-X)} {(DQ ('!*.@(t[bgxl]z)'))} {(--)} {(DQ ($ VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                      left_token: <Left_CommandSub '$('>
                                      spids: [147 172]
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [144]
                        )
                      ]
                      spids: [144]
                    )
                    (command.AndOr
                      ops: [Op_DPipe]
                      children: [
                        (command.DBracket
                          expr: (bool_expr.WordTest w:{($ VSub_DollarName '$COMPREPLY')})
                        )
                        (command.Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (lhs_expr.LhsName name:nofiles spids:[185])
                              op: Equal
                              rhs: {(1)}
                              spids: [185]
                            )
                          ]
                          spids: [185]
                        )
                      ]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:COMPREPLY spids:[189])
                          op: PlusEqual
                          rhs: 
                            {
                              (word_part.ArrayLiteralPart
                                words: [
                                  {
                                    (word_part.CommandSubPart
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-P)} 
                                              {(DQ ($ VSub_DollarName '$prev') ('%'))} {(-S)} {(SQ </>)} {(-d)} {(--)} {(DQ ($ VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                      left_token: <Left_CommandSub '$('>
                                      spids: [192 217]
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [189]
                        )
                      ]
                      spids: [189]
                    )
                    (command.AndOr
                      ops: [Op_DAmp]
                      children: [
                        (command.DBracket
                          expr: (bool_expr.WordTest w:{($ VSub_DollarName '$nofiles')})
                        )
                        (C {(compopt)} {(-o)} {(nospace)})
                      ]
                    )
                    (command.ControlFlow token:<ControlFlow_Return return>)
                  ]
                  spids: [16777215 99]
                )
              ]
              spids: [16777215 240]
            )
            (C {(_filedir)} {(SQ <'t[bglx]z'>)})
          ]
          spids: [8]
        )
      spids: [4 7]
    )
    (C {(complete)} {(-F)} {(_upgradepkg)} {(upgradepkg)})
  ]
)