(command.CommandList
  children: [
    (command.ShFunction
      name: _installed_alternatives
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(admindir)})
            (command.ForEach
              iter_name: i
              iter_words: [{(alternatives)} {(dpkg/alternatives)} {(rpm/alternatives)}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.AndOr
                      ops: [Id.Op_DAmp Id.Op_DAmp]
                      children: [
                        (command.DBracket
                          expr: 
                            (bool_expr.Unary
                              op_id: Id.BoolUnary_d
                              child: {(/var/lib/) ($ Id.VSub_DollarName '$i')}
                            )
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:admindir)
                              op: assign_op.Equal
                              rhs: {(/var/lib/) ($ Id.VSub_DollarName '$i')}
                              spids: [47]
                            )
                          ]
                        )
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Break val:break span_id:53)
                        )
                      ]
                    )
                  ]
                )
            )
            (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 1)})
                )
              cond: 
                (arith_expr.Binary
                  op_id: Id.Arith_Less
                  left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:68))
                  right: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:cword span_id:72))
                )
              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: 
                                        {
                                          (DQ 
                                            (braced_var_sub
                                              token: (Token id:Id.VSub_Name val:words span_id:91)
                                              bracket_op: 
                                                (bracket_op.ArrayIndex
                                                  expr: 
                                                    (arith_expr.VarRef
                                                      token: 
                                                        (Token
                                                          id: Id.Lit_ArithVarLike
                                                          val: i
                                                          span_id: 93
                                                        )
                                                    )
                                                )
                                            )
                                          )
                                        }
                                      right: {(--admindir)}
                                    )
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:103)
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:admindir)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: (Token id:Id.VSub_Name val:words span_id:110)
                                        bracket_op: 
                                          (bracket_op.ArrayIndex
                                            expr: 
                                              (arith_expr.Binary
                                                op_id: Id.Arith_Plus
                                                left: 
                                                  (arith_expr.VarRef
                                                    token: 
                                                      (Token
                                                        id: Id.Lit_ArithVarLike
                                                        val: i
                                                        span_id: 112
                                                      )
                                                  )
                                                right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                                              )
                                          )
                                      )
                                    }
                                  spids: [108]
                                )
                              ]
                            )
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Break val:break span_id:119)
                            )
                          ]
                          spids: [85 105]
                        )
                      ]
                    )
                  ]
                )
            )
            (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:129)
                        words: [
                          {
                            (command_sub
                              left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:131)
                              command_list: 
                                (command.CommandList
                                  children: [
                                    (C {(compgen)} {(-W)} 
                                      {
                                        (SQ 
                                          (Token
                                            id: Id.Lit_Chars
                                            val: '$( command ls $admindir )'
                                            span_id: 138
                                          )
                                        )
                                      } {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                    )
                                  ]
                                )
                            )
                          }
                        ]
                      )
                    }
                  spids: [128]
                )
              ]
            )
          ]
        )
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (command.ShFunction
          name: _update_alternatives
          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:176)
                    )
                  ]
                )
                (command.Case
                  to_match: {($ Id.VSub_DollarName '$prev')}
                  arms: [
                    (case_arm
                      pat_list: [{(--altdir)} {(--admindir)}]
                      action: [
                        (C {(_filedir)} {(-d)})
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Return val:return span_id:198)
                          arg_word: {(0)}
                        )
                      ]
                      spids: [187 190 203 -1]
                    )
                    (case_arm
                      pat_list: [{(--help)} {(--usage)} {(--version)}]
                      action: [
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Return val:return span_id:214)
                          arg_word: {(0)}
                        )
                      ]
                      spids: [206 211 219 -1]
                    )
                  ]
                )
                (C {(local)} {(mode)} {(args)} {(i)})
                (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 1)})
                    )
                  cond: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Less
                      left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:249))
                      right: 
                        (arith_expr.VarRef
                          token: (Token id:Id.Lit_ArithVarLike val:cword span_id:253)
                        )
                    )
                  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: 
                                            {
                                              (DQ 
                                                (braced_var_sub
                                                  token: 
                                                    (Token
                                                      id: Id.VSub_Name
                                                      val: words
                                                      span_id: 272
                                                    )
                                                  bracket_op: 
                                                    (bracket_op.ArrayIndex
                                                      expr: 
                                                        (arith_expr.VarRef
                                                          token: 
                                                            (Token
                                                              id: Id.Lit_ArithVarLike
                                                              val: i
                                                              span_id: 274
                                                            )
                                                        )
                                                    )
                                                )
                                              )
                                            }
                                          right: 
                                            {(--) 
                                              (word_part.ExtGlob
                                                op: (Token id:Id.ExtGlob_At val:'@(' span_id:282)
                                                arms: [
                                                  {(install)}
                                                  {(remove)}
                                                  {(auto)}
                                                  {(display)}
                                                  {(config)}
                                                  {(remove-all)}
                                                  {(set)}
                                                ]
                                              )
                                            }
                                        )
                                    )
                                  terminator: (Token id:Id.Op_Semi val:';' span_id:299)
                                )
                              ]
                              action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:mode)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (braced_var_sub
                                            token: (Token id:Id.VSub_Name val:words span_id:306)
                                            bracket_op: 
                                              (bracket_op.ArrayIndex
                                                expr: 
                                                  (arith_expr.VarRef
                                                    token: 
                                                      (Token
                                                        id: Id.Lit_ArithVarLike
                                                        val: i
                                                        span_id: 308
                                                      )
                                                  )
                                              )
                                          )
                                        }
                                      spids: [304]
                                    )
                                  ]
                                )
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:args)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (word_part.ArithSub
                                            anode: 
                                              (arith_expr.Binary
                                                op_id: Id.Arith_Minus
                                                left: 
                                                  (arith_expr.ArithWord
                                                    w: {($ Id.VSub_DollarName '$cword')}
                                                  )
                                                right: 
                                                  (arith_expr.VarRef
                                                    token: 
                                                      (Token
                                                        id: Id.Lit_ArithVarLike
                                                        val: i
                                                        span_id: 319
                                                      )
                                                  )
                                              )
                                          )
                                        }
                                      spids: [313]
                                    )
                                  ]
                                )
                                (command.ControlFlow
                                  token: (Token id:Id.ControlFlow_Break val:break span_id:324)
                                )
                              ]
                              spids: [266 301]
                            )
                          ]
                        )
                      ]
                    )
                )
                (command.Case
                  to_match: {($ Id.VSub_DollarName '$mode')}
                  arms: [
                    (case_arm
                      pat_list: [{(--install)}]
                      action: [
                        (command.Case
                          to_match: {($ Id.VSub_DollarName '$args')}
                          arms: [
                            (case_arm
                              pat_list: [{(1)} {(3)}]
                              action: [(C {(_filedir)})]
                              spids: [352 355 361 -1]
                            )
                            (case_arm
                              pat_list: [{(2)}]
                              action: [(C {(_installed_alternatives)})]
                              spids: [364 365 371 -1]
                            )
                            (case_arm
                              pat_list: [{(4)}]
                              spids: [374 375 382 -1]
                            )
                            (case_arm
                              pat_list: [{(Id.Lit_Star '*')}]
                              action: [
                                (command.Case
                                  to_match: 
                                    {
                                      (word_part.ArithSub
                                        anode: 
                                          (arith_expr.Binary
                                            op_id: Id.Arith_Percent
                                            left: 
                                              (arith_expr.VarRef
                                                token: 
                                                  (Token
                                                    id: Id.Lit_ArithVarLike
                                                    val: args
                                                    span_id: 392
                                                  )
                                              )
                                            right: (arith_expr.ArithWord w:{(Id.Lit_Digits 4)})
                                          )
                                      )
                                    }
                                  arms: [
                                    (case_arm
                                      pat_list: [{(0)} {(2)}]
                                      action: [(C {(_filedir)})]
                                      spids: [403 406 412 -1]
                                    )
                                    (case_arm
                                      pat_list: [{(1)}]
                                      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:420)
                                                    words: [
                                                      {
                                                        (command_sub
                                                          left_token: 
                                                            (Token
                                                              id: Id.Left_DollarParen
                                                              val: '$('
                                                              span_id: 422
                                                            )
                                                          command_list: 
                                                            (command.CommandList
                                                              children: [
                                                                (C {(compgen)} {(-W)} 
                                                                  {
                                                                    (SQ 
                                                                      (Token
                                                                        id: Id.Lit_Chars
                                                                        val: --slave
                                                                        span_id: 429
                                                                      )
                                                                    )
                                                                  } {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                                )
                                                              ]
                                                            )
                                                        )
                                                      }
                                                    ]
                                                  )
                                                }
                                              spids: [419]
                                            )
                                          ]
                                        )
                                      ]
                                      spids: [415 416 443 -1]
                                    )
                                    (case_arm
                                      pat_list: [{(3)}]
                                      action: [(C {(_installed_alternatives)})]
                                      spids: [446 447 453 -1]
                                    )
                                  ]
                                )
                              ]
                              spids: [385 386 -1 459]
                            )
                          ]
                        )
                      ]
                      spids: [341 342 462 -1]
                    )
                    (case_arm
                      pat_list: [{(--remove)} {(--set)}]
                      action: [
                        (command.Case
                          to_match: {($ Id.VSub_DollarName '$args')}
                          arms: [
                            (case_arm
                              pat_list: [{(1)}]
                              action: [(C {(_installed_alternatives)})]
                              spids: [478 479 485 -1]
                            )
                            (case_arm
                              pat_list: [{(2)}]
                              action: [(C {(_filedir)})]
                              spids: [488 489 495 -1]
                            )
                          ]
                        )
                      ]
                      spids: [465 468 501 -1]
                    )
                    (case_arm
                      pat_list: [{(--auto)} {(--remove-all)} {(--display)} {(--config)}]
                      action: [(C {(_installed_alternatives)})]
                      spids: [504 511 517 -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:525)
                                    words: [
                                      {
                                        (command_sub
                                          left_token: 
                                            (Token
                                              id: Id.Left_DollarParen
                                              val: '$('
                                              span_id: 527
                                            )
                                          command_list: 
                                            (command.CommandList
                                              children: [
                                                (C {(compgen)} {(-W)} 
                                                  {
                                                    (SQ 
                                                      (Token
                                                        id: Id.Lit_Chars
                                                        val: '--verbose --quiet --help --version\n'
                                                        span_id: 534
                                                      ) 
                                                      (Token
                                                        id: Id.Lit_Chars
                                                        val: 
'                --altdir --admindir --install --remove --auto --display\n'
                                                        span_id: 535
                                                      ) (Token id:Id.Lit_Chars val:'                --config --set' span_id:536)
                                                    )
                                                  } {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                )
                                              ]
                                            )
                                        )
                                      }
                                    ]
                                  )
                                }
                              spids: [524]
                            )
                          ]
                        )
                      ]
                      spids: [520 521 -1 550]
                    )
                  ]
                )
              ]
            )
        )
        (C {(complete)} {(-F)} {(_update_alternatives)} {(update-alternatives)} {(alternatives)})
      ]
    )
  ]
)