(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: (Token id:Id.Redir_Great val:'2>' span_id:24)
                  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 (Token id:Id.Lit_Chars val:'$( _apt_cache_sources "$cur" )' span_id:91))} {(--)} {(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: (Token id:Id.ControlFlow_Return val:return span_id:125)
                    )
                  ]
                )
                (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: (Token id:Id.Op_Semi val:';' span_id:147)
                        )
                      ]
                      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: (Token id:Id.Lit_ArithVarLike val:i span_id:161)
                                )
                              right: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_Minus
                                  left: 
                                    (arith_expr.ArithWord
                                      w: 
                                        {
                                          (braced_var_sub
                                            token: (Token id:Id.VSub_Name val:words span_id:167)
                                            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: 
                                                          (Token
                                                            id: Id.VSub_Name
                                                            val: words
                                                            span_id: 191
                                                          )
                                                        bracket_op: 
                                                          (bracket_op.ArrayIndex
                                                            expr: 
                                                              (arith_expr.VarRef
                                                                token: 
                                                                  (Token
                                                                    id: Id.Lit_ArithVarLike
                                                                    val: i
                                                                    span_id: 193
                                                                  )
                                                              )
                                                          )
                                                      )
                                                    }
                                                  right: 
                                                    {
                                                      (word_part.ExtGlob
                                                        op: 
                                                          (Token
                                                            id: Id.ExtGlob_At
                                                            val: '@('
                                                            span_id: 199
                                                          )
                                                        arms: [
                                                          {(add)}
                                                          {(depends)}
                                                          {(dotty)}
                                                          {(madison)}
                                                          {(policy)}
                                                          {(rdepends)}
                                                          {(show) 
                                                            (word_part.ExtGlob
                                                              op: 
                                                                (Token
                                                                  id: Id.ExtGlob_QMark
                                                                  val: '?('
                                                                  span_id: 213
                                                                )
                                                              arms: [{(pkg)} {(src)} {}]
                                                            )
                                                          }
                                                        ]
                                                      )
                                                    }
                                                )
                                            )
                                          terminator: (Token id:Id.Op_Semi val:';' span_id:222)
                                        )
                                      ]
                                      action: [
                                        (command.ShAssignment
                                          pairs: [
                                            (assign_pair
                                              lhs: (sh_lhs_expr.Name name:special)
                                              op: assign_op.Equal
                                              rhs: 
                                                {
                                                  (braced_var_sub
                                                    token: 
                                                      (Token
                                                        id: Id.VSub_Name
                                                        val: words
                                                        span_id: 229
                                                      )
                                                    bracket_op: 
                                                      (bracket_op.ArrayIndex
                                                        expr: 
                                                          (arith_expr.VarRef
                                                            token: 
                                                              (Token
                                                                id: Id.Lit_ArithVarLike
                                                                val: i
                                                                span_id: 231
                                                              )
                                                          )
                                                      )
                                                  )
                                                }
                                              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: (Token id:Id.Op_Semi val:';' span_id:256)
                        )
                      ]
                      action: [
                        (command.Case
                          to_match: {($ Id.VSub_DollarName '$special')}
                          arms: [
                            (case_arm
                              pat_list: [{(add)}]
                              action: [
                                (C {(_filedir)})
                                (command.ControlFlow
                                  token: (Token id:Id.ControlFlow_Return val:return span_id:275)
                                  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: (Token id:Id.Op_LParen val:'(' span_id:289)
                                            words: [
                                              {
                                                (command_sub
                                                  left_token: 
                                                    (Token
                                                      id: Id.Left_DollarParen
                                                      val: '$('
                                                      span_id: 291
                                                    )
                                                  command_list: 
                                                    (command.CommandList
                                                      children: [
                                                        (C {(_apt_cache_sources)} 
                                                          {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                        )
                                                      ]
                                                    )
                                                )
                                              }
                                            ]
                                          )
                                        }
                                      spids: [288]
                                    )
                                  ]
                                )
                                (command.ControlFlow
                                  token: (Token id:Id.ControlFlow_Return val:return span_id:304)
                                  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: (Token id:Id.Op_LParen val:'(' span_id:318)
                                            words: [
                                              {
                                                (command_sub
                                                  left_token: 
                                                    (Token
                                                      id: Id.Left_DollarParen
                                                      val: '$('
                                                      span_id: 320
                                                    )
                                                  command_list: 
                                                    (command.CommandList
                                                      children: [(C {(_apt_cache_packages)})]
                                                    )
                                                )
                                              }
                                            ]
                                          )
                                        }
                                      spids: [317]
                                    )
                                  ]
                                )
                                (command.ControlFlow
                                  token: (Token id:Id.ControlFlow_Return val:return span_id:329)
                                  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: (Token id:Id.ControlFlow_Return val:return span_id:370)
                          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: (Token id:Id.Op_Semi val:';' span_id:396)
                                )
                              ]
                              action: [
                                (command.ControlFlow
                                  token: (Token id:Id.ControlFlow_Return val:return span_id:401)
                                  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: (Token id:Id.Op_Semi val:';' span_id:430)
                        )
                      ]
                      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:437)
                                    words: [
                                      {
                                        (command_sub
                                          left_token: 
                                            (Token
                                              id: Id.Left_DollarParen
                                              val: '$('
                                              span_id: 439
                                            )
                                          command_list: 
                                            (command.CommandList
                                              children: [
                                                (C {(compgen)} {(-W)} 
                                                  {
                                                    (SQ 
                                                      (Token
                                                        id: Id.Lit_Chars
                                                        val: 
'-h -v -p -s -q -i -f -a -g -c -o --help\n'
                                                        span_id: 446
                                                      ) 
                                                      (Token
                                                        id: Id.Lit_Chars
                                                        val: 
'                --version --pkg-cache --src-cache --quiet --important --full\n'
                                                        span_id: 447
                                                      ) 
                                                      (Token
                                                        id: Id.Lit_Chars
                                                        val: 
'                --all-versions --no-all-versions --generate --no-generate\n'
                                                        span_id: 448
                                                      ) 
                                                      (Token
                                                        id: Id.Lit_Chars
                                                        val: 
'                --names-only --all-names --recurse --config-file --option\n'
                                                        span_id: 449
                                                      ) (Token id:Id.Lit_Chars val:'                --installed' span_id:450)
                                                    )
                                                  } {(--)} {(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: (Token id:Id.Op_LParen val:'(' span_id:469)
                                words: [
                                  {
                                    (command_sub
                                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:471)
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-W)} 
                                              {
                                                (SQ 
                                                  (Token
                                                    id: Id.Lit_Chars
                                                    val: 
'add gencaches show showpkg showsrc stats\n'
                                                    span_id: 478
                                                  ) 
                                                  (Token
                                                    id: Id.Lit_Chars
                                                    val: 
'                dump dumpavail unmet search search depends rdepends pkgnames\n'
                                                    span_id: 479
                                                  ) (Token id:Id.Lit_Chars val:'                dotty xvcg policy madison' span_id:480)
                                                )
                                              } {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [468]
                        )
                      ]
                    )
                  ]
                )
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Return val:return span_id:500)
                  arg_word: {(0)}
                )
              ]
            )
        )
        (C {(complete)} {(-F)} {(_apt_cache)} {(apt-cache)})
      ]
    )
  ]
)