(command.AndOr
  ops: [Id.Op_DAmp]
  children: [
    (command.ShFunction
      name: _upgradepkg
      body: 
        (command.BraceGroup
          children: [
            (C {<local>} {<cur>} {<prev>} {<words>} {<cword>})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<_init_completion>})
                (command.ControlFlow token:<Id.ControlFlow_Return return>)
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_GlobDEqual
                              left: {(DQ ($ Id.VSub_DollarName '$cur'))}
                              right: {<-> <Id.Lit_Other '*'>}
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:COMPREPLY)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (sh_array_literal
                                left: <Id.Op_LParen _>
                                words: [
                                  {
                                    (command_sub
                                      left_token: <Id.Left_DollarParen '$('>
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {<compgen>} {<-W>} 
                                              {
                                                (SQ <'--dry-run --install-new --reinstall\n'> 
                                                  <'            --verbose'>
                                                )
                                              } {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [49]
                        )
                      ]
                    )
                    (command.ControlFlow token:<Id.ControlFlow_Return return>)
                  ]
                  spids: [30 46]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_GlobDEqual
                              left: {(DQ ($ Id.VSub_DollarName '$cur'))}
                              right: 
                                {<Id.Lit_Other '?'> <Id.Lit_Other '*'> <Id.Lit_Other '%'> 
                                  <Id.Lit_Other '*'>
                                }
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:prev)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ 
                                (braced_var_sub
                                  token: <Id.VSub_Name cur>
                                  suffix_op: 
                                    (suffix_op.Unary
                                      op_id: Id.VOp1_DPercent
                                      arg_word: 
                                        {<'?('> 
                                          (word_part.EscapedLiteral
                                            token: <Id.Lit_EscapedChar '\\\\'>
                                          ) <')'> <Id.Lit_Percent '%'> <'*'>
                                        }
                                    )
                                )
                              )
                            }
                          spids: [102]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:cur)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ 
                                (braced_var_sub
                                  token: <Id.VSub_Name cur>
                                  suffix_op: 
                                    (suffix_op.Unary
                                      op_id: Id.VOp1_Pound
                                      arg_word: {<'*'> <Id.Lit_Percent '%'>}
                                    )
                                )
                              )
                            }
                          spids: [116]
                        )
                      ]
                    )
                    (C {<local>} {<nofiles>} 
                      {<Id.Lit_VarLike 'IFS='> 
                        (single_quoted
                          left: <Id.Left_SingleQuoteC "$'">
                          tokens: [<Id.Char_OneChar '\\n'>]
                        )
                      }
                    )
                    (C {<compopt>} {<-o>} {<filenames>})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:COMPREPLY)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (sh_array_literal
                                left: <Id.Op_LParen _>
                                words: [
                                  {
                                    (command_sub
                                      left_token: <Id.Left_DollarParen '$('>
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {<compgen>} {<-P>} 
                                              {(DQ ($ Id.VSub_DollarName '$prev') <'%'>)} {<-f>} {<-X>} {(DQ <'!*.@(t[bgxl]z)'>)} {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [144]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (command.DBracket
                          expr: (bool_expr.WordTest w:{($ Id.VSub_DollarName '$COMPREPLY')})
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:nofiles)
                              op: assign_op.Equal
                              rhs: {<1>}
                              spids: [185]
                            )
                          ]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:COMPREPLY)
                          op: assign_op.PlusEqual
                          rhs: 
                            {
                              (sh_array_literal
                                left: <Id.Op_LParen _>
                                words: [
                                  {
                                    (command_sub
                                      left_token: <Id.Left_DollarParen '$('>
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {<compgen>} {<-P>} 
                                              {(DQ ($ Id.VSub_DollarName '$prev') <'%'>)} {<-S>} {(SQ </>)} {<-d>} {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [189]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (command.DBracket
                          expr: (bool_expr.WordTest w:{($ Id.VSub_DollarName '$nofiles')})
                        )
                        (C {<compopt>} {<-o>} {<nospace>})
                      ]
                    )
                    (command.ControlFlow token:<Id.ControlFlow_Return return>)
                  ]
                  spids: [81 99]
                )
              ]
            )
            (C {<_filedir>} {(SQ <'t[bglx]z'>)})
          ]
        )
    )
    (C {<complete>} {<-F>} {<_upgradepkg>} {<upgradepkg>})
  ]
)