(command.AndOr
  ops: [Id.Op_DAmp]
  children: [
    (command.ShFunction
      name: _p4
      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>)
              ]
            )
            (C {<local>} {<p4commands>} {<p4filetypes>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:p4commands)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          command_list: 
                            (command.CommandList
                              children: [
                                (command.Pipeline
                                  children: [
                                    (command.Simple
                                      words: [{<p4>} {<help>} {<commands>}]
                                      redirects: [
                                        (redir.Redir
                                          op: <Id.Redir_Great '2>'>
                                          fd: 2
                                          arg_word: {</dev/null>}
                                        )
                                      ]
                                    )
                                    (C {<awk>} {(SQ <'NF>3 {print $1}'>)})
                                  ]
                                  negated: F
                                )
                              ]
                            )
                        )
                      )
                    }
                  spids: [45]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:p4filetypes)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ <'ctext cxtext ktext kxtext ltext tempobj ubinary '> 
                        <'        uresource uxbinary xbinary xltext xtempobj xtext '> <'        text binary resource'>
                      )
                    }
                  spids: [70]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_eq
                              left: {($ Id.VSub_DollarName '$cword')}
                              right: {<1>}
                            )
                        )
                      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>} 
                                              {(DQ ($ Id.VSub_DollarName '$p4commands'))} {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [97]
                        )
                      ]
                    )
                  ]
                  spids: [81 94]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_eq
                              left: {($ Id.VSub_DollarName '$cword')}
                              right: {<2>}
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Case
                      to_match: {($ Id.VSub_DollarName '$prev')}
                      arms: [
                        (case_arm
                          pat_list: [{<help>}]
                          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>} 
                                                      {
                                                        (DQ <'simple commands environment\n'> 
                                                          <
'                    filetypes jobview revisions usage views '
                                                          > ($ Id.VSub_DollarName '$p4commands')
                                                        )
                                                      } {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                    )
                                                  ]
                                                )
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [148]
                                )
                              ]
                            )
                          ]
                          spids: [144 145 176 -1]
                        )
                        (case_arm
                          pat_list: [{<admin>}]
                          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>} {(DQ <'checkpoint stop'>)} 
                                                      {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                    )
                                                  ]
                                                )
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [183]
                                )
                              ]
                            )
                          ]
                          spids: [179 180 207 -1]
                        )
                        (case_arm
                          pat_list: [{<Id.Lit_Star '*'>}]
                          spids: [210 211 214 -1]
                        )
                      ]
                    )
                  ]
                  spids: [121 134]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_gt
                              left: {($ Id.VSub_DollarName '$cword')}
                              right: {<2>}
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Case
                      to_match: {($ Id.VSub_DollarName '$prev')}
                      arms: [
                        (case_arm
                          pat_list: [{<-t>}]
                          action: [
                            (command.Case
                              to_match: 
                                {
                                  (braced_var_sub
                                    token: <Id.VSub_Name words>
                                    bracket_op: 
                                      (bracket_op.ArrayIndex
                                        expr: 
                                          (arith_expr.Binary
                                            op_id: Id.Arith_Minus
                                            left: 
                                              (arith_expr.ArithWord
                                                w: {($ Id.VSub_DollarName '$cword')}
                                              )
                                            right: (arith_expr.ArithWord w:{<Id.Lit_Digits 2>})
                                          )
                                      )
                                  )
                                }
                              arms: [
                                (case_arm
                                  pat_list: [{<add>} {<edit>} {<reopen>}]
                                  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>} 
                                                              {
                                                                (DQ 
                                                                  ($ Id.VSub_DollarName 
'$p4filetypes'
                                                                  )
                                                                )
                                                              } {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                            )
                                                          ]
                                                        )
                                                    )
                                                  }
                                                ]
                                              )
                                            }
                                          spids: [269]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [261 266 293 -1]
                                )
                                (case_arm
                                  pat_list: [{<Id.Lit_Star '*'>}]
                                  spids: [296 297 300 -1]
                                )
                              ]
                            )
                          ]
                          spids: [243 244 306 -1]
                        )
                        (case_arm
                          pat_list: [{<Id.Lit_Star '*'>}]
                          spids: [309 310 313 -1]
                        )
                      ]
                    )
                  ]
                  spids: [220 233]
                )
              ]
            )
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
        )
    )
    (C {<complete>} {<-F>} {<_p4>} {<-o>} {<default>} {<p4>} {<g4>})
  ]
)