(AndOr
  ops: [Op_DAmp]
  children: [
    (FuncDef
      name: _apt_build
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair lhs:(LhsName name:cur) op:Equal spids:[13])
                (assign_pair lhs:(LhsName name:prev) op:Equal spids:[15])
                (assign_pair lhs:(LhsName name:words) op:Equal spids:[17])
                (assign_pair lhs:(LhsName name:cword) op:Equal spids:[19])
              ]
              spids: [11]
            )
            (AndOr
              ops: [Op_DPipe]
              children: [(C {(_init_completion)}) (ControlFlow token:<ControlFlow_Return return>)]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair lhs:(LhsName name:special) op:Equal spids:[32])
                (assign_pair lhs:(LhsName name:i) op:Equal spids:[34])
              ]
              spids: [30]
            )
            (ForExpr
              init: 
                (BinaryAssign
                  op_id: Arith_Equal
                  left: (LhsName name:i)
                  right: (ArithWord w:{(Lit_Digits 0)})
                )
              cond: 
                (ArithBinary
                  op_id: Arith_Less
                  left: (ArithVarRef name:i)
                  right: 
                    (ArithBinary
                      op_id: Arith_Minus
                      left: 
                        (ArithWord
                          w: 
                            {
                              (BracedVarSub
                                token: <VSub_Name words>
                                prefix_op: VSub_Pound
                                bracket_op: (WholeArray op_id:Lit_At)
                                spids: [50 56]
                              )
                            }
                        )
                      right: (ArithWord w:{(Lit_Digits 1)})
                    )
                )
              update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i))
              body: 
                (DoGroup
                  children: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolBinary
                                      op_id: BoolBinary_GlobDEqual
                                      left: 
                                        {
                                          (BracedVarSub
                                            token: <VSub_Name words>
                                            bracket_op: (ArrayIndex expr:(ArithVarRef name:i))
                                            spids: [75 80]
                                          )
                                        }
                                      right: {(ExtGlobPart op:<ExtGlob_At '@('> spids:[84 94])}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:special)
                                  op: Equal
                                  rhs: 
                                    {
                                      (BracedVarSub
                                        token: <VSub_Name words>
                                        bracket_op: (ArrayIndex expr:(ArithVarRef name:i))
                                        spids: [103 108]
                                      )
                                    }
                                  spids: [102]
                                )
                              ]
                              spids: [102]
                            )
                          ]
                          spids: [16777215 99]
                        )
                      ]
                      spids: [16777215 111]
                    )
                  ]
                  spids: [68 114]
                )
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolUnary op_id:BoolUnary_n child:{($ VSub_Name '$special')})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Case
                      to_match: {($ VSub_Name '$special')}
                      arms: [
                        (case_arm
                          pat_list: [{(install)} {(source)} {(info)}]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:COMPREPLY)
                                  op: Equal
                                  rhs: 
                                    {
                                      (ArrayLiteralPart
                                        words: [
                                          {
                                            (CommandSubPart
                                              command_list: 
                                                (CommandList
                                                  children: [
                                                    (SimpleCommand
                                                      words: [
                                                        {(apt-cache)}
                                                        {(pkgnames)}
                                                        {(DQ ($ VSub_Name '$cur'))}
                                                      ]
                                                      redirects: [
                                                        (Redir
                                                          op: <Redir_Great '2>'>
                                                          fd: 2
                                                          arg_word: {(/dev/null)}
                                                        )
                                                      ]
                                                    )
                                                  ]
                                                )
                                              left_token: <Left_CommandSub '$('>
                                              spids: [150 164]
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [147]
                                )
                              ]
                              spids: [147]
                            )
                            (ControlFlow
                              token: <ControlFlow_Return return>
                              arg_word: {(0)}
                            )
                          ]
                          spids: [139 144 174 16777215]
                        )
                        (case_arm
                          pat_list: [{(remove)}]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:COMPREPLY)
                                  op: Equal
                                  rhs: 
                                    {
                                      (ArrayLiteralPart
                                        words: [
                                          {
                                            (CommandSubPart
                                              command_list: 
                                                (CommandList
                                                  children: [
                                                    (C {(_xfunc)} {(dpkg)} 
                                                      {(_comp_dpkg_installed_packages)} {(DQ ($ VSub_Name '$cur'))}
                                                    )
                                                  ]
                                                )
                                              left_token: <Left_CommandSub '$('>
                                              spids: [186 198]
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [181]
                                )
                              ]
                              spids: [181]
                            )
                            (ControlFlow
                              token: <ControlFlow_Return return>
                              arg_word: {(0)}
                            )
                          ]
                          spids: [177 178 208 16777215]
                        )
                        (case_arm
                          pat_list: [{(Lit_Other '*')}]
                          action: [(ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})]
                          spids: [211 212 220 16777215]
                        )
                      ]
                      spids: [132 136 223]
                    )
                  ]
                  spids: [16777215 129]
                )
              ]
              spids: [16777215 226]
            )
            (Case
              to_match: {($ VSub_Name '$prev')}
              arms: [
                (case_arm
                  pat_list: [{(--patch)} {(--build-dir)} {(--repository-dir)}]
                  action: [
                    (C {(_filedir)})
                    (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
                  ]
                  spids: [237 242 253 16777215]
                )
                (case_arm
                  pat_list: [{(-h)} {(--help)}]
                  action: [(ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})]
                  spids: [256 259 267 16777215]
                )
              ]
              spids: [230 234 270]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ ($ VSub_Name '$cur'))}
                              right: {(-) (Lit_Other '*')}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:COMPREPLY)
                          op: Equal
                          rhs: 
                            {
                              (ArrayLiteralPart
                                words: [
                                  {
                                    (CommandSubPart
                                      command_list: 
                                        (CommandList
                                          children: [
                                            (C {(compgen)} {(-W)} 
                                              {
                                                (SQ <'--help --show-upgraded -u --build-dir\n'> 
                                                  <
'            --repository-dir --build-only --build-command --reinstall --rebuild\n'
                                                  > <'            --remove-builddep --no-wrapper --purge --patch --patch-strip -p\n'> 
                                                  <'            --yes -y --version -v --no-source'>
                                                )
                                              } {(--)} {(DQ ($ VSub_Name '$cur'))}
                                            )
                                          ]
                                        )
                                      left_token: <Left_CommandSub '$('>
                                      spids: [296 315]
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [293]
                        )
                      ]
                      spids: [293]
                    )
                  ]
                  spids: [16777215 290]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:COMPREPLY)
                      op: Equal
                      rhs: 
                        {
                          (ArrayLiteralPart
                            words: [
                              {
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [
                                        (C {(compgen)} {(-W)} 
                                          {
                                            (SQ <'update upgrade install remove source\n'> 
                                              <
'            dist-upgrade world clean info clean-build update-repository'
                                              >
                                            )
                                          } {(--)} {(DQ ($ VSub_Name '$cur'))}
                                        )
                                      ]
                                    )
                                  left_token: <Left_CommandSub '$('>
                                  spids: [327 346]
                                )
                              }
                            ]
                          )
                        }
                      spids: [324]
                    )
                  ]
                  spids: [324]
                )
              ]
              spids: [321 351]
            )
            (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
          ]
          spids: [8]
        )
      spids: [4 7]
    )
    (C {(complete)} {(-F)} {(_apt_build)} {(apt-build)})
  ]
)