(command.AndOr
  ops: [Op_DAmp]
  children: [
    (command.FuncDef
      name: _modinfo
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair lhs:(lhs_expr.LhsName name:cur) op:Equal)
                (assign_pair lhs:(lhs_expr.LhsName name:prev) op:Equal)
                (assign_pair lhs:(lhs_expr.LhsName name:words) op:Equal)
                (assign_pair lhs:(lhs_expr.LhsName name:cword) op:Equal)
              ]
            )
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (C {(_init_completion)})
                (command.ControlFlow token:<ControlFlow_Return return>)
              ]
            )
            (command.Case
              to_match: {(DQ ($ VSub_DollarName '$prev'))}
              arms: [
                (case_arm
                  pat_list: [{(-F)} {(--field)}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:COMPREPLY)
                          op: Equal
                          rhs: 
                            {
                              (word_part.ArrayLiteralPart
                                words: [
                                  {
                                    (word_part.CommandSubPart
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-W)} 
                                              {
                                                (SQ <'alias author depends description\n'> 
                                                  <
'                filename firmware license parm srcversion staging vermagic\n'
                                                  > <'                version'>
                                                )
                                              } {(--)} 
                                              {
                                                (DQ 
                                                  (word_part.BracedVarSub
                                                    token: <VSub_Name cur>
                                                    suffix_op: 
                                                      (suffix_op.StringUnary
                                                        op_id: VOp1_DComma
                                                        arg_word: (word.EmptyWord)
                                                      )
                                                  )
                                                )
                                              }
                                            )
                                          ]
                                        )
                                      left_token: <Left_CommandSub '$('>
                                    )
                                  }
                                ]
                              )
                            }
                        )
                      ]
                    )
                    (command.ControlFlow token:<ControlFlow_Return return>)
                  ]
                )
                (case_arm
                  pat_list: [{(-k)}]
                  action: [
                    (C {(_kernel_versions)})
                    (command.ControlFlow token:<ControlFlow_Return return>)
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ ($ VSub_DollarName '$cur'))}
                              right: {(-) (Lit_Other '*')}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:COMPREPLY)
                          op: Equal
                          rhs: 
                            {
                              (word_part.ArrayLiteralPart
                                words: [
                                  {
                                    (word_part.CommandSubPart
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-W)} 
                                              {
                                                (SQ <'-V --version -F --field -k -0 --null -a -d\n'> 
                                                  <'            -l -p -n'>
                                                )
                                              } {(--)} {(DQ ($ VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                      left_token: <Left_CommandSub '$('>
                                    )
                                  }
                                ]
                              )
                            }
                        )
                      ]
                    )
                    (command.ControlFlow token:<ControlFlow_Return return>)
                  ]
                )
              ]
            )
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair lhs:(lhs_expr.LhsName name:i) op:Equal)
                (assign_pair
                  lhs: (lhs_expr.LhsName name:version)
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: (command.CommandList children:[(C {(uname)} {(-r)})])
                        left_token: <Left_CommandSub '$('>
                      )
                    }
                )
              ]
            )
            (command.ForExpr
              init: 
                (arith_expr.BinaryAssign
                  op_id: Arith_Equal
                  left: (lhs_expr.LhsName name:i)
                  right: 
                    (arith_expr.ArithBinary
                      op_id: Arith_Minus
                      left: 
                        (arith_expr.ArithWord
                          w: 
                            {
                              (word_part.BracedVarSub
                                token: <VSub_Name words>
                                prefix_op: VSub_Pound
                                bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                              )
                            }
                        )
                      right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                    )
                )
              cond: 
                (arith_expr.ArithBinary
                  op_id: Arith_Great
                  left: (arith_expr.ArithVarRef token:<Lit_ArithVarLike i>)
                  right: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                )
              update: (arith_expr.UnaryAssign op_id:Node_PostDMinus child:(lhs_expr.LhsName name:i))
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.BoolBinary
                                      op_id: BoolBinary_GlobDEqual
                                      left: 
                                        {
                                          (word_part.BracedVarSub
                                            token: <VSub_Name words>
                                            bracket_op: 
                                              (bracket_op.ArrayIndex
                                                expr: 
                                                  (arith_expr.ArithVarRef
                                                    token: <Lit_ArithVarLike i>
                                                  )
                                              )
                                          )
                                        }
                                      right: {(-k)}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:version)
                                  op: Equal
                                  rhs: 
                                    {
                                      (word_part.BracedVarSub
                                        token: <VSub_Name words>
                                        bracket_op: 
                                          (bracket_op.ArrayIndex
                                            expr: 
                                              (arith_expr.ArithBinary
                                                op_id: Arith_Plus
                                                left: 
                                                  (arith_expr.ArithVarRef
                                                    token: <Lit_ArithVarLike i>
                                                  )
                                                right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                              )
                                          )
                                      )
                                    }
                                )
                              ]
                            )
                            (command.ControlFlow
                              token: <ControlFlow_Break break>
                            )
                          ]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ ($ VSub_DollarName '$cur'))}
                              right: 
                                {
                                  (word_part.ExtGlobPart
                                    op: <ExtGlob_At '@('>
                                    arms: [{(Lit_Other '*') (/)} {('[.~]')}]
                                  ) (Lit_Other '*')
                                }
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(_filedir)} {(SQ <'@(?(k)o?(.gz))'>)})]
                )
              ]
              else_action: [(C {(_modules)} {($ VSub_DollarName '$version')})]
            )
          ]
        )
    )
    (C {(complete)} {(-F)} {(_modinfo)} {(modinfo)})
  ]
)