(command.AndOr
  ops: [Id.Op_DAmp]
  children: [
    (command.ShFunction
      name: _iptables
      body: 
        (command.BraceGroup
          children: [
            (C {<local>} {<cur>} {<prev>} {<words>} {<cword>} {<split>})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<_init_completion>} {<-s>})
                (command.ControlFlow token:<Id.ControlFlow_Return return>)
              ]
            )
            (C {<local>} {<table>} 
              {<Id.Lit_VarLike 'chain='> (SQ <'s/^Chain \\([^ ]\\{1,\\}\\).*$/\\1/p'>)}
            )
            (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.WholeArray op_id:Id.Lit_At)
                                  )
                                }
                              right: 
                                {<Id.Lit_Other '*'> <Id.BoolUnary_t -t> 
                                  (word_part.EscapedLiteral
                                    token: <Id.Lit_EscapedChar '\\ '>
                                  ) <Id.Lit_Other '*'> <filter> <Id.Lit_Other '*'>
                                }
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:table)
                          op: assign_op.Equal
                          rhs: {(DQ <'-t filter'>)}
                          spids: [71]
                        )
                      ]
                    )
                  ]
                  spids: [45 68]
                )
                (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.WholeArray op_id:Id.Lit_At)
                                  )
                                }
                              right: 
                                {<Id.Lit_Other '*'> <Id.BoolUnary_t -t> 
                                  (word_part.EscapedLiteral
                                    token: <Id.Lit_EscapedChar '\\ '>
                                  ) <Id.Lit_Other '*'> <nat> <Id.Lit_Other '*'>
                                }
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:table)
                          op: assign_op.Equal
                          rhs: {(DQ <'-t nat'>)}
                          spids: [103]
                        )
                      ]
                    )
                  ]
                  spids: [77 100]
                )
                (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.WholeArray op_id:Id.Lit_At)
                                  )
                                }
                              right: 
                                {<Id.Lit_Other '*'> <Id.BoolUnary_t -t> 
                                  (word_part.EscapedLiteral
                                    token: <Id.Lit_EscapedChar '\\ '>
                                  ) <Id.Lit_Other '*'> <mangle> <Id.Lit_Other '*'>
                                }
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:table)
                          op: assign_op.Equal
                          rhs: {(DQ <'-t mangle'>)}
                          spids: [135]
                        )
                      ]
                    )
                  ]
                  spids: [109 132]
                )
              ]
            )
            (command.Case
              to_match: {($ Id.VSub_DollarName '$prev')}
              arms: [
                (case_arm
                  pat_list: [
                    {<-> <Id.Lit_Star '*'> <Id.Lit_LBracket '['> <AIDRPFXLZ> <Id.Lit_RBracket ']'>}
                  ]
                  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 <'`iptables $table -nL | \\\n'> 
                                                  <
'                sed -ne "s/^Chain \\([^ ]\\{1,\\}\\).*$/\\1/p"`'
                                                  >
                                                )
                                              } {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [160]
                        )
                      ]
                    )
                  ]
                  spids: [152 157 185 -1]
                )
                (case_arm
                  pat_list: [{<-> <Id.Lit_Star '*'> <t>}]
                  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 <'nat filter mangle'>)} {<-->} 
                                              {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [194]
                        )
                      ]
                    )
                  ]
                  spids: [188 191 218 -1]
                )
                (case_arm
                  pat_list: [{<-j>}]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.LogicalOr
                                      left: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_GlobDEqual
                                          left: {(DQ ($ Id.VSub_DollarName '$table'))}
                                          right: {(DQ <'-t filter'>)}
                                        )
                                      right: 
                                        (bool_expr.Unary
                                          op_id: Id.BoolUnary_z
                                          child: {(DQ ($ Id.VSub_DollarName '$table'))}
                                        )
                                    )
                                )
                              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 <'ACCEPT DROP LOG ULOG REJECT\n'> 
                                                          <
'                `iptables $table -nL | sed -ne "$chain" \\\n'
                                                          > <'                -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`'>
                                                        )
                                                      } {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                    )
                                                  ]
                                                )
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [253]
                                )
                              ]
                            )
                          ]
                          spids: [225 250]
                        )
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_GlobDEqual
                                      left: {($ Id.VSub_DollarName '$table')}
                                      right: {(DQ <'-t nat'>)}
                                    )
                                )
                              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 
                                                          <
'ACCEPT DROP LOG ULOG REJECT MIRROR SNAT\n'
                                                          > <'                DNAT MASQUERADE `iptables $table -nL | \\\n'> 
                                                          <
'                sed -ne "$chain" -e "s/OUTPUT|PREROUTING|POSTROUTING//"`'
                                                          >
                                                        )
                                                      } {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                    )
                                                  ]
                                                )
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [299]
                                )
                              ]
                            )
                          ]
                          spids: [281 296]
                        )
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_GlobDEqual
                                      left: {($ Id.VSub_DollarName '$table')}
                                      right: {(DQ <'-t mangle'>)}
                                    )
                                )
                              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 
                                                          <'ACCEPT DROP LOG ULOG REJECT MARK TOS\n'> <'                `iptables $table -nL | sed -ne "$chain" \\\n'> 
                                                          <
'                -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`'
                                                          >
                                                        )
                                                      } {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                    )
                                                  ]
                                                )
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [345]
                                )
                              ]
                            )
                          ]
                          spids: [327 342]
                        )
                      ]
                    )
                  ]
                  spids: [221 222 376 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (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 
                                                          <
'--in-interface --out-interface --source\n'
                                                          > <'                --destination --protocol --fragment --match --append --delete\n'> 
                                                          <
'                --insert --replace --list --flush --zero --new --delete-chain\n'
                                                          > <'                --policy --rename-chain --proto --source --destination\n'> 
                                                          <
'                --in-interface --jump --match --numeric --out-interface --table\n'
                                                          > <'                --verbose --line-numbers --exact --fragment --modprobe\n'> 
                                                          <
'                --set-counters --version'
                                                          >
                                                        )
                                                      } {<-->} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                                    )
                                                  ]
                                                )
                                            )
                                          }
                                        ]
                                      )
                                    }
                                  spids: [402]
                                )
                              ]
                            )
                          ]
                          spids: [383 399]
                        )
                      ]
                    )
                  ]
                  spids: [379 380 435 -1]
                )
              ]
            )
          ]
        )
    )
    (C {<complete>} {<-F>} {<_iptables>} {<iptables>})
  ]
)