(command.AndOr
  ops: [Id.Op_DAmp]
  children: [
    (command.ShFunction
      name: _function
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(cur)} {(prev)} {(words)} {(cword)})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(_init_completion)})
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Return val:return span_id:26)
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_GlobDEqual
                              left: {($ Id.VSub_Number '$1')}
                              right: 
                                {
                                  (word_part.ExtGlob
                                    op: (Token id:Id.ExtGlob_At val:'@(' span_id:38)
                                    arms: [{(declare)} {(typeset)}]
                                  )
                                }
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:45)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_GlobDEqual
                                      left: {($ Id.VSub_DollarName '$prev')}
                                      right: {(Id.BoolUnary_f -f)}
                                    )
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:61)
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:COMPREPLY)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (sh_array_literal
                                        left: (Token id:Id.Op_LParen val:'(' span_id:67)
                                        words: [
                                          {
                                            (command_sub
                                              left_token: 
                                                (Token
                                                  id: Id.Left_DollarParen
                                                  val: '$('
                                                  span_id: 69
                                                )
                                              command_list: 
                                                (command.CommandList
                                                  children: [
                                                    (C {(compgen)} {(-A)} {(Id.KW_Function function)} 
                                                      {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                    )
                                                  ]
                                                )
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [66]
                                )
                              ]
                            )
                          ]
                          spids: [50 63]
                        )
                        (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: (Token id:Id.Op_Semi val:';' span_id:102)
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:COMPREPLY)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (sh_array_literal
                                        left: (Token id:Id.Op_LParen val:'(' span_id:108)
                                        words: [
                                          {
                                            (command_sub
                                              left_token: 
                                                (Token
                                                  id: Id.Left_DollarParen
                                                  val: '$('
                                                  span_id: 110
                                                )
                                              command_list: 
                                                (command.CommandList
                                                  children: [
                                                    (C {(compgen)} {(-W)} 
                                                      {
                                                        (SQ 
                                                          (Token
                                                            id: Id.Lit_Chars
                                                            val: '$( _parse_usage "$1" )'
                                                            span_id: 117
                                                          )
                                                        )
                                                      } {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                    )
                                                  ]
                                                )
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [107]
                                )
                              ]
                            )
                          ]
                          spids: [88 104]
                        )
                      ]
                    )
                  ]
                  spids: [30 47]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_eq
                              left: {($ Id.VSub_DollarName '$cword')}
                              right: {(1)}
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:145)
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:COMPREPLY)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (sh_array_literal
                                left: (Token id:Id.Op_LParen val:'(' span_id:151)
                                words: [
                                  {
                                    (command_sub
                                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:153)
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-A)} {(Id.KW_Function function)} {(--)} 
                                              {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [150]
                        )
                      ]
                    )
                  ]
                  spids: [134 147]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:COMPREPLY)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (sh_array_literal
                            left: (Token id:Id.Op_LParen val:'(' span_id:176)
                            words: [
                              {
                                (DQ ('() ') 
                                  (command_sub
                                    left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:180)
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (command.Pipeline
                                            children: [
                                              (C {(type)} {(--)} 
                                                {
                                                  (braced_var_sub
                                                    token: 
                                                      (Token
                                                        id: Id.VSub_Name
                                                        val: words
                                                        span_id: 187
                                                      )
                                                    bracket_op: 
                                                      (bracket_op.ArrayIndex
                                                        expr: 
                                                          (arith_expr.ArithWord
                                                            w: {(Id.Lit_Digits 1)}
                                                          )
                                                      )
                                                  )
                                                }
                                              )
                                              (C {(sed)} {(-e)} {(1) (Id.Lit_Comma ',') (2d)})
                                            ]
                                            negated: F
                                          )
                                        ]
                                      )
                                  )
                                )
                              }
                            ]
                          )
                        }
                      spids: [175]
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (C {(complete)} {(-F)} {(_function)} {(Id.KW_Function function)} {(declare)} {(typeset)})
  ]
)