(command.AndOr
  ops: [Id.Op_DAmp]
  children: [
    (command.ShFunction
      name: _modinfo
      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>)
              ]
            )
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$prev'))}
              arms: [
                (case_arm
                  pat_list: [{<-F>} {<--field>}]
                  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 <'alias author depends description\n'> 
                                                  <
'                filename firmware license parm srcversion staging vermagic\n'
                                                  > <'                version'>
                                                )
                                              } {<-->} {(DQ (braced_var_sub token:<Id.VSub_Name cur> suffix_op:(suffix_op.Unary op_id:Id.VOp1_DComma arg_word:(word.Empty))))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [45]
                        )
                      ]
                    )
                    (command.ControlFlow token:<Id.ControlFlow_Return return>)
                  ]
                  spids: [39 42 77 -1]
                )
                (case_arm
                  pat_list: [{<-k>}]
                  action: [
                    (C {<_kernel_versions>})
                    (command.ControlFlow token:<Id.ControlFlow_Return return>)
                  ]
                  spids: [80 81 90 -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 <'-V --version -F --field -k -0 --null -a -d\n'> 
                                                  <'            -l -p -n'>
                                                )
                                              } {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [116]
                        )
                      ]
                    )
                    (command.ControlFlow token:<Id.ControlFlow_Return return>)
                  ]
                  spids: [97 113]
                )
              ]
            )
            (C {<local>} {<i>} 
              {<Id.Lit_VarLike 'version='> 
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  command_list: (command.CommandList children:[(C {<uname>} {<-r>})])
                )
              }
            )
            (command.ForExpr
              init: 
                (arith_expr.BinaryAssign
                  op_id: Id.Arith_Equal
                  left: (sh_lhs_expr.Name name: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>})
                    )
                )
              cond: 
                (arith_expr.Binary
                  op_id: Id.Arith_Great
                  left: (arith_expr.VarRef token:<Id.Lit_ArithVarLike i>)
                  right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                )
              update: 
                (arith_expr.UnaryAssign
                  op_id: Id.Node_PostDMinus
                  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: {<-k>}
                                    )
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:version)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: <Id.VSub_Name words>
                                        bracket_op: 
                                          (bracket_op.ArrayIndex
                                            expr: 
                                              (arith_expr.Binary
                                                op_id: Id.Arith_Plus
                                                left: 
                                                  (arith_expr.VarRef
                                                    token: <Id.Lit_ArithVarLike i>
                                                  )
                                                right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                                              )
                                          )
                                      )
                                    }
                                  spids: [213]
                                )
                              ]
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Break break>
                            )
                          ]
                          spids: [192 210]
                        )
                      ]
                    )
                  ]
                )
            )
            (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: 
                                {
                                  (word_part.ExtGlob
                                    op: <Id.ExtGlob_At '@('>
                                    arms: [{<Id.Lit_Other '*'> </>} {<'[.~]'>}]
                                  ) <Id.Lit_Other '*'>
                                }
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [(C {<_filedir>} {(SQ <'@(?(k)o?(.gz))'>)})]
                  spids: [238 259]
                )
              ]
              else_action: [(C {<_modules>} {($ Id.VSub_DollarName '$version')})]
            )
          ]
        )
    )
    (C {<complete>} {<-F>} {<_modinfo>} {<modinfo>})
  ]
)