(command.AndOr
  ops: [Op_DAmp]
  children: [
    (command.FuncDef
      name: _chgrp
      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]
                )
                (assign_pair
                  lhs: (lhs_expr.LhsName name:split spids:[21])
                  op: Equal
                  spids: [21]
                )
              ]
              spids: [11]
            )
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (C {(_init_completion)} {(-s)})
                (command.ControlFlow token:<ControlFlow_Return return>)
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:cur spids:[34])
                  op: Equal
                  rhs: 
                    {
                      (word_part.BracedVarSub
                        token: <VSub_Name cur>
                        suffix_op: 
                          (suffix_op.PatSub
                            pat: 
                              {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) 
                                (word_part.EscapedLiteralPart
                                  token: <Lit_EscapedChar '\\\\'>
                                )
                              }
                            replace: {}
                            replace_mode: Lit_Slash
                            spids: [37]
                          )
                        spids: [35 42]
                      )
                    }
                  spids: [34]
                )
              ]
              spids: [34]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ ($ VSub_DollarName '$prev'))}
                              right: {(--reference)}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(_filedir)})
                    (command.ControlFlow
                      token: <ControlFlow_Return return>
                      arg_word: {(0)}
                    )
                  ]
                  spids: [16777215 61]
                )
              ]
              spids: [16777215 72]
            )
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (C {($ VSub_DollarName '$split')})
                (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
              ]
            )
            (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_Local
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:w spids:[111])
                          op: Equal
                          spids: [111]
                        )
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:opts spids:[113])
                          op: Equal
                          spids: [113]
                        )
                      ]
                      spids: [109]
                    )
                    (command.ForEach
                      iter_name: w
                      iter_words: [
                        {
                          (DQ 
                            (word_part.BracedVarSub
                              token: <VSub_Name words>
                              bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                              spids: [123 128]
                            )
                          )
                        }
                      ]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.AndOr
                              ops: [Op_DAmp Op_DAmp]
                              children: [
                                (command.DBracket
                                  expr: 
                                    (bool_expr.BoolBinary
                                      op_id: BoolBinary_GlobDEqual
                                      left: {(DQ ($ VSub_DollarName '$w'))}
                                      right: 
                                        {(-) 
                                          (word_part.ExtGlobPart
                                            op: <ExtGlob_At '@('>
                                            arms: [{(R)} {(-recursive)}]
                                            spids: [145 149]
                                          )
                                        }
                                    )
                                )
                                (command.Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (lhs_expr.LhsName name:opts spids:[155])
                                      op: Equal
                                      rhs: {(DQ ('-H -L -P'))}
                                      spids: [155]
                                    )
                                  ]
                                  spids: [155]
                                )
                                (command.ControlFlow
                                  token: <ControlFlow_Break break>
                                )
                              ]
                            )
                          ]
                          spids: [133 165]
                        )
                      spids: [121 131]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:COMPREPLY spids:[168])
                          op: Equal
                          rhs: 
                            {
                              (word_part.ArrayLiteralPart
                                words: [
                                  {
                                    (word_part.CommandSubPart
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-W)} 
                                              {
                                                (SQ <'-c -h -f -R -v --changes --dereference\n'> 
                                                  <
'            --no-dereference --silent --quiet --reference --recursive --verbose\n'
                                                  > <'            --help --version $opts'>
                                                )
                                              } {(--)} {(DQ ($ VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                      left_token: <Left_CommandSub '$('>
                                      spids: [171 189]
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [168]
                        )
                      ]
                      spids: [168]
                    )
                    (command.ControlFlow
                      token: <ControlFlow_Return return>
                      arg_word: {(0)}
                    )
                  ]
                  spids: [16777215 106]
                )
              ]
              spids: [16777215 199]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.LogicalOr
                              left: 
                                (bool_expr.LogicalAnd
                                  left: 
                                    (bool_expr.BoolBinary
                                      op_id: BoolBinary_eq
                                      left: {($ VSub_DollarName '$cword')}
                                      right: {(1)}
                                    )
                                  right: 
                                    (bool_expr.BoolBinary
                                      op_id: BoolBinary_GlobNEqual
                                      left: {(DQ ($ VSub_DollarName '$cur'))}
                                      right: {(-) (Lit_Other '*')}
                                    )
                                )
                              right: 
                                (bool_expr.BoolBinary
                                  op_id: BoolBinary_GlobDEqual
                                  left: {(DQ ($ VSub_DollarName '$prev'))}
                                  right: {(-) (Lit_Other '*')}
                                )
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(_allowed_groups)} {(DQ ($ VSub_DollarName '$cur'))})]
                  spids: [16777215 242]
                )
              ]
              else_action: [
                (command.AndOr
                  ops: [Op_DPipe]
                  children: [
                    (C {(_filedir)})
                    (command.ControlFlow
                      token: <ControlFlow_Return return>
                      arg_word: {(0)}
                    )
                  ]
                )
              ]
              spids: [252 264]
            )
            (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
          ]
          spids: [8]
        )
      spids: [4 7]
    )
    (C {(complete)} {(-F)} {(_chgrp)} {(chgrp)})
  ]
)