(command.AndOr
  ops: [Id.Op_DAmp]
  children: [
    (command.ShFunction
      name: _iscsiadm
      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: (Token id:Id.ControlFlow_Return val:return span_id:30)
                )
              ]
            )
            (command.Case
              to_match: {($ Id.VSub_DollarName '$prev')}
              arms: [
                (case_arm
                  pat_list: [{(-m)} {(--mode)}]
                  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:48)
                                words: [
                                  {
                                    (command_sub
                                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:50)
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-W)} 
                                              {
                                                (SQ 
                                                  (Token
                                                    id: Id.Lit_Chars
                                                    val: 'discovery node session iface fw host'
                                                    span_id: 57
                                                  )
                                                )
                                              } {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [47]
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:73)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [41 44 78 -1]
                )
                (case_arm
                  pat_list: [{(-o)} {(--op)}]
                  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:88)
                                words: [
                                  {
                                    (command_sub
                                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:90)
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-W)} 
                                              {
                                                (SQ 
                                                  (Token
                                                    id: Id.Lit_Chars
                                                    val: 'new delete update show'
                                                    span_id: 97
                                                  )
                                                )
                                              } {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [87]
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:111)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [81 84 116 -1]
                )
                (case_arm
                  pat_list: [{(-t)} {(--type)}]
                  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:126)
                                words: [
                                  {
                                    (command_sub
                                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:128)
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-W)} 
                                              {
                                                (SQ 
                                                  (Token
                                                    id: Id.Lit_Chars
                                                    val: 'sendtargets st slp isns fw'
                                                    span_id: 135
                                                  )
                                                )
                                              } {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [125]
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:149)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [119 122 154 -1]
                )
                (case_arm
                  pat_list: [{(-L)} {(-U)} {(--loginall)} {(--logoutall)}]
                  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:168)
                                words: [
                                  {
                                    (command_sub
                                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:170)
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-W)} 
                                              {
                                                (SQ 
                                                  (Token
                                                    id: Id.Lit_Chars
                                                    val: 'all manual automatic'
                                                    span_id: 177
                                                  )
                                                )
                                              } {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [167]
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:191)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [157 164 196 -1]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {($ Id.VSub_DollarName '$split')})
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Return val:return span_id:207)
                  arg_word: {(0)}
                )
              ]
            )
            (C {(local)} {(options)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_gt
                              left: {($ Id.VSub_DollarName '$cword')}
                              right: {(1)}
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:230)
                    )
                  ]
                  action: [
                    (command.Case
                      to_match: 
                        {
                          (braced_var_sub
                            token: (Token id:Id.VSub_Name val:words span_id:239)
                            bracket_op: 
                              (bracket_op.ArrayIndex
                                expr: (arith_expr.ArithWord w:{(Id.Lit_Digits 2)})
                              )
                          )
                        }
                      arms: [
                        (case_arm
                          pat_list: [{(discovery)}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:options)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (SQ 
                                        (Token
                                          id: Id.Lit_Chars
                                          val: 
'--help --version --debug --print --interface --type \\\n'
                                          span_id: 254
                                        ) (Token id:Id.Lit_Chars val:'                    --portal --login --op --name --value' span_id:255)
                                      )
                                    }
                                  spids: [252]
                                )
                              ]
                            )
                          ]
                          spids: [248 249 259 -1]
                        )
                        (case_arm
                          pat_list: [{(node)}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:options)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (SQ 
                                        (Token
                                          id: Id.Lit_Chars
                                          val: '--help --version --debug --print --loginall \\\n'
                                          span_id: 268
                                        ) 
                                        (Token
                                          id: Id.Lit_Chars
                                          val: 
'                    --logoutall--show  -T --portal --interface --login \\\n'
                                          span_id: 269
                                        ) 
                                        (Token
                                          id: Id.Lit_Chars
                                          val: 
'                    --logout --rescan --stats --op --name --value'
                                          span_id: 270
                                        )
                                      )
                                    }
                                  spids: [266]
                                )
                              ]
                            )
                          ]
                          spids: [262 263 274 -1]
                        )
                        (case_arm
                          pat_list: [{(session)}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:options)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (SQ 
                                        (Token
                                          id: Id.Lit_Chars
                                          val: 
'--help --version --debug --print --sid --logout \\\n'
                                          span_id: 283
                                        ) (Token id:Id.Lit_Chars val:'                    --rescan --stats' span_id:284)
                                      )
                                    }
                                  spids: [281]
                                )
                              ]
                            )
                          ]
                          spids: [277 278 288 -1]
                        )
                        (case_arm
                          pat_list: [{(iface)}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:options)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (SQ 
                                        (Token
                                          id: Id.Lit_Chars
                                          val: 
'--help --version --debug --print --interface --op \\\n'
                                          span_id: 297
                                        ) (Token id:Id.Lit_Chars val:'                    --name --value' span_id:298)
                                      )
                                    }
                                  spids: [295]
                                )
                              ]
                            )
                          ]
                          spids: [291 292 302 -1]
                        )
                        (case_arm
                          pat_list: [{(fw)}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:options)
                                  op: assign_op.Equal
                                  rhs: {(SQ (Token id:Id.Lit_Chars val:--login span_id:311))}
                                  spids: [309]
                                )
                              ]
                            )
                          ]
                          spids: [305 306 315 -1]
                        )
                        (case_arm
                          pat_list: [{(host)}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:options)
                                  op: assign_op.Equal
                                  rhs: {(SQ (Token id:Id.Lit_Chars val:'--print -H' span_id:324))}
                                  spids: [322]
                                )
                              ]
                            )
                          ]
                          spids: [318 319 328 -1]
                        )
                      ]
                    )
                  ]
                  spids: [218 232]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:options)
                      op: assign_op.Equal
                      rhs: {(SQ (Token id:Id.Lit_Chars val:--mode span_id:339))}
                      spids: [337]
                    )
                  ]
                )
              ]
            )
            (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:348)
                        words: [
                          {
                            (command_sub
                              left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:350)
                              command_list: 
                                (command.CommandList
                                  children: [
                                    (C {(compgen)} {(-W)} {(DQ ($ Id.VSub_DollarName '$options'))} {(--)} 
                                      {(DQ ($ Id.VSub_DollarName '$cur'))}
                                    )
                                  ]
                                )
                            )
                          }
                        ]
                      )
                    }
                  spids: [347]
                )
              ]
            )
          ]
        )
    )
    (C {(complete)} {(-F)} {(_iscsiadm)} {(iscsiadm)})
  ]
)