(command.AndOr
  ops: [Id.Op_DAmp]
  children: [
    (command.ShFunction
      name: _pkg_config
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<cur>} {<prev>} {<words>} {<cword>} {<split>})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<_init_completion>} {<-s>})
                (command.ControlFlow token:<Id.ControlFlow_Return return>)
              ]
            )
            (command.Case
              to_match: {($ Id.VSub_DollarName '$prev')}
              arms: [
                (case_arm
                  pat_list: [
                    {<--define-variable>}
                    {<--atleast-version>}
                    {<--atleast-pkgconfig-version>}
                    {<--exact-version>}
                    {<--max-version>}
                  ]
                  action: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})]
                  spids: [41 53 65 -1]
                )
                (case_arm
                  pat_list: [{<--variable>}]
                  action: [
                    (C {<local>} {<i>})
                    (command.ForExpr
                      init: 
                        (arith_expr.BinaryAssign
                          op_id: Id.Arith_Equal
                          left: <Id.Lit_ArithVarLike i>
                          right: {<Id.Lit_Digits 1>}
                        )
                      cond: 
                        (arith_expr.Binary
                          op_id: Id.Arith_Less
                          left: <Id.Lit_ArithVarLike i>
                          right: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name words>
                                prefix_op: (Id.VSub_Pound)
                                bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                              )
                            }
                        )
                      update: 
                        (arith_expr.UnaryAssign
                          op_id: Id.Node_PostDPlus
                          child: <Id.Lit_ArithVarLike i>
                        )
                      body: 
                        (command.DoGroup
                          children: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (command.Sentence
                                          child: 
                                            (command.DBracket
                                              expr: 
                                                (bool_expr.Binary
                                                  op_id: Id.BoolBinary_GlobNEqual
                                                  left: 
                                                    {
                                                      (braced_var_sub
                                                        token: <Id.VSub_Name words>
                                                        bracket_op: 
                                                          (bracket_op.ArrayIndex
                                                            expr: <Id.Lit_ArithVarLike i>
                                                          )
                                                      )
                                                    }
                                                  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 '$('>
                                                      child: 
                                                        (C {<compgen>} {<-W>} 
                                                          {
                                                            (SQ 
                                                              <
'$( "$1" ${words[i]} --print-variables 2>/dev/null )'
                                                              >
                                                            )
                                                          } {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                        )
                                                    )
                                                  }
                                                ]
                                              )
                                            }
                                          spids: [131]
                                        )
                                      ]
                                    )
                                    (command.ControlFlow
                                      token: <Id.ControlFlow_Break break>
                                    )
                                  ]
                                  spids: [109 128]
                                )
                              ]
                            )
                          ]
                        )
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<0>}
                    )
                  ]
                  spids: [68 69 173 -1]
                )
                (case_arm
                  pat_list: [
                    {<-> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\?'>)}
                    {<--help>}
                    {<--version>}
                    {<--usage>}
                  ]
                  action: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})]
                  spids: [176 184 196 -1]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {($ Id.VSub_DollarName '$split')})
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {<0>}
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (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 '$('>
                                      child: 
                                        (C {<compgen>} {<-W>} {(SQ <'$( _parse_help "$1" )'>)} {<-->} 
                                          {(DQ ($ Id.VSub_DollarName '$cur'))}
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [232]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_GlobDEqual
                              left: {($ Id.VSub_DollarName '$COMPREPLY')}
                              right: {<Id.Lit_Other '*'> <Id.BoolBinary_GlobEqual '='>}
                            )
                        )
                        (C {<compopt>} {<-o>} {<nospace>})
                      ]
                    )
                  ]
                  spids: [213 229]
                )
              ]
              else_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 '$('>
                                  child: 
                                    (C {<compgen>} {<-W>} 
                                      {
                                        (DQ 
                                          (command_sub
                                            left_token: <Id.Left_DollarParen '$('>
                                            child: 
                                              (command.Pipeline
                                                children: [
                                                  (command.Simple
                                                    words: [{($ Id.VSub_Number '$1')} {<--list-all>}]
                                                    redirects: [
                                                      (redir
                                                        op: <Id.Redir_Great '2>'>
                                                        loc: (redir_loc.Fd fd:2)
                                                        arg: {<'/dev/null'>}
                                                      )
                                                    ]
                                                    do_fork: T
                                                  )
                                                  (C {<awk>} {(SQ <'{print $1}'>)})
                                                ]
                                                negated: F
                                              )
                                          )
                                        )
                                      } {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                    )
                                )
                              }
                            ]
                          )
                        }
                      spids: [279]
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (C {<complete>} {<-F>} {<_pkg_config>} {<pkg-config>})
  ]
)