(command.AndOr
  ops: [Op_DAmp]
  children: [
    (command.FuncDef
      name: _portupgrade
      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.AndOr
              ops: [Op_DAmp]
              children: [
                (command.DBracket
                  expr: 
                    (bool_expr.LogicalOr
                      left: 
                        (bool_expr.BoolBinary
                          op_id: BoolBinary_GlobDEqual
                          left: {(DQ ($ VSub_DollarName '$prev'))}
                          right: {(-l)}
                        )
                      right: 
                        (bool_expr.LogicalOr
                          left: 
                            (bool_expr.BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ ($ VSub_DollarName '$prev'))}
                              right: {(BoolUnary_L -L)}
                            )
                          right: 
                            (bool_expr.BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ ($ VSub_DollarName '$prev'))}
                              right: {(BoolUnary_o -o)}
                            )
                        )
                    )
                )
                (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
              ]
            )
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:pkgdir spids:[72])
                  op: Equal
                  rhs: 
                    {
                      (word_part.BracedVarSub
                        token: <VSub_Name PKG_DBDIR>
                        suffix_op: 
                          (suffix_op.StringUnary
                            op_id: VTest_ColonHyphen
                            arg_word: {(Lit_Slash /) (var) (Lit_Slash /) (db) (Lit_Slash /) (pkg)}
                          )
                        spids: [73 82]
                      ) (/)
                    }
                  spids: [72]
                )
              ]
              spids: [70]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:COMPREPLY spids:[87])
                  op: Equal
                  rhs: 
                    {
                      (word_part.ArrayLiteralPart
                        words: [
                          {
                            (word_part.CommandSubPart
                              command_list: 
                                (command.CommandList
                                  children: [
                                    (C {(compgen)} {(-d)} {(--)} 
                                      {(DQ ($ VSub_DollarName '$pkgdir') ($ VSub_DollarName '$cur'))}
                                    )
                                  ]
                                )
                              left_token: <Left_CommandSub '$('>
                              spids: [90 103]
                            )
                          }
                        ]
                      )
                    }
                  spids: [87]
                )
              ]
              spids: [87]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:COMPREPLY spids:[108])
                  op: Equal
                  rhs: 
                    {
                      (word_part.ArrayLiteralPart
                        words: [
                          {
                            (word_part.BracedVarSub
                              token: <VSub_Name COMPREPLY>
                              bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                              suffix_op: 
                                (suffix_op.StringUnary
                                  op_id: VOp1_Pound
                                  arg_word: {($ VSub_DollarName '$pkgdir')}
                                )
                              spids: [111 118]
                            )
                          }
                        ]
                      )
                    }
                  spids: [108]
                )
              ]
              spids: [108]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:COMPREPLY spids:[123])
                  op: Equal
                  rhs: 
                    {
                      (word_part.ArrayLiteralPart
                        words: [
                          {
                            (word_part.BracedVarSub
                              token: <VSub_Name COMPREPLY>
                              bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                              suffix_op: (suffix_op.StringUnary op_id:VOp1_Percent arg_word:{('-*')})
                              spids: [126 133]
                            )
                          }
                        ]
                      )
                    }
                  spids: [123]
                )
              ]
              spids: [123]
            )
            (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
          ]
          spids: [8]
        )
      spids: [4 7]
    )
    (C {(complete)} {(-F)} {(_portupgrade)} {(-o)} {(dirnames)} {(portupgrade)})
  ]
)