(command.CommandList
  children: [
    (command.ShFunction
      name: _apt_cache_packages
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [{<apt-cache>} {<--no-generate>} {<pkgnames>} {(DQ ($ Id.VSub_DollarName '$cur'))}]
              redirects: [(redir.Redir op:<Id.Redir_Great '2>'> fd:2 arg_word:{</dev/null>})]
            )
          ]
        )
    )
    (command.ShFunction
      name: _apt_cache_sources
      body: 
        (command.BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {<apt-cache>} {<dumpavail>})
                (C {<command>} {<grep>} {(DQ <'^Source: '> ($ Id.VSub_Number '$1'))})
                (C {<cut>} {<-f2>} {<-d> (DQ <' '>)})
                (C {<sort>} {<-u>})
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: _apt_cache_src_packages
      body: 
        (command.BraceGroup
          children: [
            (C {<compgen>} {<-W>} {(SQ <'$( _apt_cache_sources "$cur" )'>)} {<-->} 
              {(DQ ($ Id.VSub_DollarName '$cur'))}
            )
          ]
        )
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (command.ShFunction
          name: _apt_cache
          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>)
                  ]
                )
                (C {<local>} {<special>} {<i>})
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_GlobNEqual
                                  left: {($ Id.VSub_DollarName '$cur')}
                                  right: {<show>}
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      action: [
                        (command.ForExpr
                          init: 
                            (arith_expr.BinaryAssign
                              op_id: Id.Arith_Equal
                              left: (sh_lhs_expr.Name name:i)
                              right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                            )
                          cond: 
                            (arith_expr.Binary
                              op_id: Id.Arith_Less
                              left: (arith_expr.VarRef token:<Id.Lit_ArithVarLike i>)
                              right: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_Minus
                                  left: 
                                    (arith_expr.ArithWord
                                      w: 
                                        {
                                          (braced_var_sub
                                            token: <Id.VSub_Name words>
                                            prefix_op: (Id.VSub_Pound)
                                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                          )
                                        }
                                    )
                                  right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                                )
                            )
                          update: 
                            (arith_expr.UnaryAssign
                              op_id: Id.Node_PostDPlus
                              child: (sh_lhs_expr.Name name:i)
                            )
                          body: 
                            (command.DoGroup
                              children: [
                                (command.If
                                  arms: [
                                    (if_arm
                                      cond: [
                                        (command.Sentence
                                          child: 
                                            (command.DBracket
                                              expr: 
                                                (bool_expr.Binary
                                                  op_id: Id.BoolBinary_GlobDEqual
                                                  left: 
                                                    {
                                                      (braced_var_sub
                                                        token: <Id.VSub_Name words>
                                                        bracket_op: 
                                                          (bracket_op.ArrayIndex
                                                            expr: 
                                                              (arith_expr.VarRef
                                                                token: <Id.Lit_ArithVarLike i>
                                                              )
                                                          )
                                                      )
                                                    }
                                                  right: 
                                                    {
                                                      (word_part.ExtGlob
                                                        op: <Id.ExtGlob_At '@('>
                                                        arms: [
                                                          {<add>}
                                                          {<depends>}
                                                          {<dotty>}
                                                          {<madison>}
                                                          {<policy>}
                                                          {<rdepends>}
                                                          {<show> 
                                                            (word_part.ExtGlob
                                                              op: <Id.ExtGlob_QMark '?('>
                                                              arms: [{<pkg>} {<src>} {}]
                                                            )
                                                          }
                                                        ]
                                                      )
                                                    }
                                                )
                                            )
                                          terminator: <Id.Op_Semi _>
                                        )
                                      ]
                                      action: [
                                        (command.ShAssignment
                                          pairs: [
                                            (assign_pair
                                              lhs: (sh_lhs_expr.Name name:special)
                                              op: assign_op.Equal
                                              rhs: 
                                                {
                                                  (braced_var_sub
                                                    token: <Id.VSub_Name words>
                                                    bracket_op: 
                                                      (bracket_op.ArrayIndex
                                                        expr: 
                                                          (arith_expr.VarRef
                                                            token: <Id.Lit_ArithVarLike i>
                                                          )
                                                      )
                                                  )
                                                }
                                              spids: [227]
                                            )
                                          ]
                                        )
                                      ]
                                      spids: [186 224]
                                    )
                                  ]
                                )
                              ]
                            )
                        )
                      ]
                      spids: [136 149]
                    )
                  ]
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.Unary
                                  op_id: Id.BoolUnary_n
                                  child: {($ Id.VSub_DollarName '$special')}
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      action: [
                        (command.Case
                          to_match: {($ Id.VSub_DollarName '$special')}
                          arms: [
                            (case_arm
                              pat_list: [{<add>}]
                              action: [
                                (C {<_filedir>})
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Return return>
                                  arg_word: {<0>}
                                )
                              ]
                              spids: [268 269 280 -1]
                            )
                            (case_arm
                              pat_list: [{<showsrc>}]
                              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 {<_apt_cache_sources>} 
                                                          {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                        )
                                                      ]
                                                    )
                                                )
                                              }
                                            ]
                                          )
                                        }
                                      spids: [288]
                                    )
                                  ]
                                )
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Return return>
                                  arg_word: {<0>}
                                )
                              ]
                              spids: [284 285 309 -1]
                            )
                            (case_arm
                              pat_list: [{<Id.Lit_Star '*'>}]
                              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 {<_apt_cache_packages>})]
                                                    )
                                                )
                                              }
                                            ]
                                          )
                                        }
                                      spids: [317]
                                    )
                                  ]
                                )
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Return return>
                                  arg_word: {<0>}
                                )
                              ]
                              spids: [313 314 334 -1]
                            )
                          ]
                        )
                      ]
                      spids: [247 258]
                    )
                  ]
                )
                (command.Case
                  to_match: {($ Id.VSub_DollarName '$prev')}
                  arms: [
                    (case_arm
                      pat_list: [{<-c>} {<-p>} {<-s>} {<--config-file>} {<--pkg-cache>} {<--src-cache>}]
                      action: [
                        (C {<_filedir>})
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                          arg_word: {<0>}
                        )
                      ]
                      spids: [353 364 375 -1]
                    )
                    (case_arm
                      pat_list: [{<search>}]
                      action: [
                        (command.If
                          arms: [
                            (if_arm
                              cond: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_GlobNEqual
                                          left: {(DQ ($ Id.VSub_DollarName '$cur'))}
                                          right: {<-> <Id.Lit_Other '*'>}
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                              action: [
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Return return>
                                  arg_word: {<0>}
                                )
                              ]
                              spids: [382 398]
                            )
                          ]
                        )
                      ]
                      spids: [378 379 409 -1]
                    )
                  ]
                )
                (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 <'-h -v -p -s -q -i -f -a -g -c -o --help\n'> 
                                                      <
'                --version --pkg-cache --src-cache --quiet --important --full\n'
                                                      > <'                --all-versions --no-all-versions --generate --no-generate\n'> 
                                                      <
'                --names-only --all-names --recurse --config-file --option\n'
                                                      > <'                --installed'>
                                                    )
                                                  } {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                )
                                              ]
                                            )
                                        )
                                      }
                                    ]
                                  )
                                }
                              spids: [436]
                            )
                          ]
                        )
                      ]
                      spids: [416 432]
                    )
                  ]
                  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 '$('>
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {<compgen>} {<-W>} 
                                              {
                                                (SQ <'add gencaches show showpkg showsrc stats\n'> 
                                                  <
'                dump dumpavail unmet search search depends rdepends pkgnames\n'
                                                  > <'                dotty xvcg policy madison'>
                                                )
                                              } {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [468]
                        )
                      ]
                    )
                  ]
                )
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {<0>}
                )
              ]
            )
        )
        (C {<complete>} {<-F>} {<_apt_cache>} {<apt-cache>})
      ]
    )
  ]
)