(command.CommandList
  children: [
    (C {<typeset>} {<-r>} 
      {<Id.Lit_VarLike 'ARGV0='> 
        (command_sub
          left_token: <Id.Left_DollarParen '$('>
          child: (C {<basename>} {($ Id.VSub_Number 0)})
          right: <Id.Eof_RParen _>
        )
      }
    )
    (C {<typeset>} {<-r>} {<Id.Lit_VarLike 'NWS_START_DIR='> <'/usr/cluster/lib/dscfg/start'>})
    (C {<typeset>} {<-r>} {<Id.Lit_VarLike 'NWS_STOP_DIR='> <'/usr/cluster/lib/dscfg/stop'>})
    (C {<typeset>} {<-r>} {<Id.Lit_VarLike 'SYSLOG_FACILITY='> <daemon>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'PATH='> name:PATH)
          op: assign_op.Equal
          rhs: 
            {($ Id.VSub_DollarName PATH) <Id.Lit_Colon ':'> <'/usr/cluster/bin'> <Id.Lit_Colon ':'> 
              <'/etc'>
            }
          spids: [272]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'retry_num='> name:retry_num)
          op: assign_op.Equal
          rhs: {<12>}
          spids: [283]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'retry_interval='> name:retry_interval)
          op: assign_op.Equal
          rhs: {<10>}
          spids: [286]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rgname='> name:rgname)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [289]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rgstat='> name:rgstat)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [291]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'skip_resource='> name:skip_resource)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [293]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: 
            (sh_lhs_expr.Name
              left: <Id.Lit_VarLike 'count_LogicalHostname='>
              name: count_LogicalHostname
            )
          op: assign_op.Equal
          rhs: {<0>}
          spids: [296]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: 
            (sh_lhs_expr.Name
              left: <Id.Lit_VarLike 'count_HAStoragePlus='>
              name: count_HAStoragePlus
            )
          op: assign_op.Equal
          rhs: {<0>}
          spids: [299]
        )
      ]
      redirects: []
    )
    (command.ShFunction
      name: kill_scswitch
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'dg='> name:dg)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                  spids: [332]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<-f>} 
                          {<'/var/run/scnws/'> ($ Id.VSub_DollarName dg) <.pid>} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (command.ForEach
                      iter_names: [i]
                      iterable: 
                        (for_iter.Words
                          words: [
                            {
                              (command_sub
                                left_token: <Id.Left_Backtick '`'>
                                child: 
                                  (C {<cat>} {<'/var/run/scnws/'> ($ Id.VSub_DollarName dg) <.pid>})
                                right: <Id.Backtick_Right '`'>
                              )
                            }
                          ]
                        )
                      body: 
                        (command.DoGroup
                          children: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'pid='> name:pid)
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_DollarName i)}
                                  spids: [372]
                                )
                              ]
                              redirects: []
                            )
                            (C {<kill>} {<-9>} {($ Id.VSub_DollarName pid)})
                          ]
                        )
                      redirects: []
                    )
                    (C {<rm>} {<-f>} {<'/var/run/scnws/'> ($ Id.VSub_DollarName dg) <.pid>})
                  ]
                  spids: [336 349]
                )
              ]
              else_action: []
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: get_rgstat
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rg='> name:rg)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                  spids: [417]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rgstat='> name:rgstat)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: 
                          (C {<scha_resourcegroup_get>} {<-O>} {<RG_STATE>} {<-G>} 
                            {($ Id.VSub_DollarName rg)}
                          )
                        right: <Id.Backtick_Right '`'>
                      )
                    }
                  spids: [421]
                )
              ]
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: switchfunc
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rg='> name:rg)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                  spids: [477]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'dg='> name:dg)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 2)}
                  spids: [481]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'how_many='> name:how_many)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [485]
                )
              ]
              redirects: []
            )
            (C {<sleep>} {<2>})
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName how_many)} 
                      {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {($ Id.VSub_DollarName retry_num)} {<Id.Lit_RBracket ']'>}
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  children: [
                    (C {<get_rgstat>} {($ Id.VSub_DollarName rg)})
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName rgstat))}
                      arms: [
                        (case_arm
                          pat_list: [{(DQ <ONLINE>)}]
                          action: [
                            (C {<rm>} {<-f>} {<'/var/run/scnws/'> ($ Id.VSub_DollarName dg) <.pid>})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<0>}
                            )
                          ]
                          spids: [525 528 545 -1]
                        )
                        (case_arm
                          pat_list: [{(DQ <OFFLINE>)}]
                          action: [
                            (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
                              {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} 
                              {
                                (command_sub
                                  left_token: <Id.Left_Backtick '`'>
                                  child: (C {<gettext>} {(DQ <'scswitch of resource group'>)})
                                  right: <Id.Backtick_Right '`'>
                                )
                              } {(DQ ($ Id.VSub_DollarName rg))}
                            )
                            (C {<scswitch>} {<-z>} {<-g>} {($ Id.VSub_DollarName rg)} {<-h>} 
                              {
                                (command_sub
                                  left_token: <Id.Left_DollarParen '$('>
                                  child: (C {<hostname>})
                                  right: <Id.Eof_RParen _>
                                )
                              }
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'retval='> name:retval)
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_QMark '?')}
                                  spids: [605]
                                )
                              ]
                              redirects: []
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName retval)} 
                                          {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<0>} {<Id.Lit_RBracket ']'>}
                                        )
                                      ]
                                    )
                                  action: [
                                    (C {<sleep>} {($ Id.VSub_DollarName retry_interval)})
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: 
                                            (sh_lhs_expr.Name
                                              left: <Id.Lit_VarLike 'how_many='>
                                              name: how_many
                                            )
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (word_part.ArithSub
                                                anode: 
                                                  (arith_expr.Binary
                                                    op_id: Id.Arith_Plus
                                                    left: {($ Id.VSub_DollarName how_many)}
                                                    right: {<Id.Lit_Digits 1>}
                                                  )
                                              )
                                            }
                                          spids: [631]
                                        )
                                      ]
                                      redirects: []
                                    )
                                  ]
                                  spids: [609 623]
                                )
                              ]
                              else_action: []
                              redirects: []
                            )
                          ]
                          spids: [549 552 645 -1]
                        )
                        (case_arm
                          pat_list: [{(DQ <PENDING_ONLINE>)}]
                          action: [
                            (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
                              {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} 
                              {
                                (command_sub
                                  left_token: <Id.Left_Backtick '`'>
                                  child: (C {<gettext>} {(DQ <'pending online of resource group'>)})
                                  right: <Id.Backtick_Right '`'>
                                )
                              } {(DQ ($ Id.VSub_DollarName rg))}
                            )
                            (C {<sleep>} {($ Id.VSub_DollarName retry_interval)})
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.Name
                                      left: <Id.Lit_VarLike 'how_many='>
                                      name: how_many
                                    )
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (word_part.ArithSub
                                        anode: 
                                          (arith_expr.Binary
                                            op_id: Id.Arith_Plus
                                            left: {($ Id.VSub_DollarName how_many)}
                                            right: {<Id.Lit_Digits 1>}
                                          )
                                      )
                                    }
                                  spids: [694]
                                )
                              ]
                              redirects: []
                            )
                          ]
                          spids: [649 652 705 -1]
                        )
                        (case_arm
                          pat_list: [{<Id.Lit_Star '*'>}]
                          action: [
                            (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
                              {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} 
                              {
                                (command_sub
                                  left_token: <Id.Left_Backtick '`'>
                                  child: 
                                    (C {<gettext>} 
                                      {(DQ <'Improper resource group status for Remote Mirror'>)}
                                    )
                                  right: <Id.Backtick_Right '`'>
                                )
                              } {(DQ ($ Id.VSub_DollarName rgstat))}
                            )
                            (C {<rm>} {<-f>} {<'/var/run/scnws/'> ($ Id.VSub_DollarName dg) <.pid>})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [709 710 761 -1]
                        )
                      ]
                      redirects: []
                    )
                  ]
                )
              redirects: []
            )
            (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.err>} {<-t>} 
              {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} {(DQ <'Did not switch resource group for Remote Mirror. System Administrator intervention required'>)}
            )
            (C {<rm>} {<-f>} {<'/var/run/scnws/'> ($ Id.VSub_DollarName dg) <.pid>})
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<1>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: do_scswitch
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'dg='> name:dg)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                  spids: [922]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-x>} 
                          {<'/usr/cluster/bin/scha_resource_get'>} {<-o>} {<Id.KW_Bang '!'>} {<-x>} {<'/usr/cluster/bin/scha_resourcegroup_get'>} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<1>})]
                  spids: [927 950]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rgname='> name:rgname)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName dg) <-stor-rg>)}
                  spids: [965]
                )
              ]
              redirects: []
            )
            (command.Simple
              words: [
                {<scha_resourcegroup_get>}
                {<-O>}
                {<rg_description>}
                {<-G>}
                {($ Id.VSub_DollarName rgname)}
              ]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'/dev/null'>})]
              more_env: []
              do_fork: T
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '?')} 
                          {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<0>} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<1>})]
                  spids: [987 1001]
                )
              ]
              else_action: []
              redirects: []
            )
            (C {<get_rgstat>} {($ Id.VSub_DollarName rgname)})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName rgstat))} {<-o>} 
                          {(DQ ($ Id.VSub_DollarName rgstat))} {<Id.Lit_Equals '='>} {(DQ <UNMANAGED>)} {<-o>} {(DQ ($ Id.VSub_DollarName rgstat))} {<Id.Lit_Equals '='>} 
                          {(DQ <ERROR_STOP_FAILED>)} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
                      {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} 
                      {
                        (command_sub
                          left_token: <Id.Left_Backtick '`'>
                          child: (C {<gettext>} {(DQ <'Improper Remote Mirror resource group state'>)})
                          right: <Id.Backtick_Right '`'>
                        )
                      } {(DQ ($ Id.VSub_DollarName rgstat))}
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<2>}
                    )
                  ]
                  spids: [1025 1064]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rs_list='> name:rs_list)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: 
                          (C {<scha_resourcegroup_get>} {<-O>} {<resource_list>} {<-G>} 
                            {($ Id.VSub_DollarName rgname)}
                          )
                        right: <Id.Backtick_Right '`'>
                      )
                    }
                  spids: [1117]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName rs_list))} 
                          {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
                      {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} 
                      {
                        (command_sub
                          left_token: <Id.Left_Backtick '`'>
                          child: 
                            (C {<gettext>} 
                              {
                                (DQ <'No resources in Remote Mirror resource group <'> 
                                  ($ Id.VSub_DollarName rgname) <'>'>
                                )
                              }
                            )
                          right: <Id.Backtick_Right '`'>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<2>}
                    )
                  ]
                  spids: [1133 1146]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.ForEach
              iter_names: [rs]
              iterable: (for_iter.Words words:[{($ Id.VSub_DollarName rs_list)}])
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rs_type='> name:rs_type)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_Backtick '`'>
                                child: 
                                  (command.Pipeline
                                    children: [
                                      (C {<scha_resource_get>} {<-O>} {<type>} {<-R>} 
                                        {($ Id.VSub_DollarName rs)} {<-G>} {($ Id.VSub_DollarName rgname)}
                                      )
                                      (C {<cut>} {<-d> (SQ <':'>)} {<-f1>})
                                    ]
                                    negated: F
                                    stderr_indices: []
                                  )
                                right: <Id.Backtick_Right '`'>
                              )
                            }
                          spids: [1204]
                        )
                      ]
                      redirects: []
                    )
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName rs_type))}
                      arms: [
                        (case_arm
                          pat_list: [{<SUNW.LogicalHostname>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rs_enb='> name:rs_enb)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: <Id.Left_Backtick '`'>
                                        child: 
                                          (C {<scha_resource_get>} {<-O>} {<ON_OFF_SWITCH>} {<-R>} 
                                            {($ Id.VSub_DollarName rs)} {<-G>} {($ Id.VSub_DollarName rgname)}
                                          )
                                        right: <Id.Backtick_Right '`'>
                                      )
                                    }
                                  spids: [1248]
                                )
                              ]
                              redirects: []
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName rs_enb))} 
                                          {<Id.Lit_Equals '='>} {(DQ <ENABLED>)} {<Id.Lit_RBracket ']'>}
                                        )
                                      ]
                                    )
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: 
                                            (sh_lhs_expr.Name
                                              left: <Id.Lit_VarLike 'count_LogicalHostname='>
                                              name: count_LogicalHostname
                                            )
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (word_part.ArithSub
                                                anode: 
                                                  (arith_expr.Binary
                                                    op_id: Id.Arith_Plus
                                                    left: 
                                                      {($ Id.VSub_DollarName count_LogicalHostname)}
                                                    right: {<Id.Lit_Digits 1>}
                                                  )
                                              )
                                            }
                                          spids: [1288]
                                        )
                                      ]
                                      redirects: []
                                    )
                                  ]
                                  spids: [1268 1285]
                                )
                              ]
                              else_action: []
                              redirects: []
                            )
                          ]
                          spids: [1244 1245 1302 -1]
                        )
                        (case_arm
                          pat_list: [{<SUNW.HAStoragePlus>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rs_enb='> name:rs_enb)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: <Id.Left_Backtick '`'>
                                        child: 
                                          (C {<scha_resource_get>} {<-O>} {<ON_OFF_SWITCH>} {<-R>} 
                                            {($ Id.VSub_DollarName rs)} {<-G>} {($ Id.VSub_DollarName rgname)}
                                          )
                                        right: <Id.Backtick_Right '`'>
                                      )
                                    }
                                  spids: [1309]
                                )
                              ]
                              redirects: []
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName rs_enb))} 
                                          {<Id.Lit_Equals '='>} {(DQ <ENABLED>)} {<Id.Lit_RBracket ']'>}
                                        )
                                      ]
                                    )
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: 
                                            (sh_lhs_expr.Name
                                              left: <Id.Lit_VarLike 'count_HAStoragePlus='>
                                              name: count_HAStoragePlus
                                            )
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (word_part.ArithSub
                                                anode: 
                                                  (arith_expr.Binary
                                                    op_id: Id.Arith_Plus
                                                    left: {($ Id.VSub_DollarName count_HAStoragePlus)}
                                                    right: {<Id.Lit_Digits 1>}
                                                  )
                                              )
                                            }
                                          spids: [1349]
                                        )
                                      ]
                                      redirects: []
                                    )
                                  ]
                                  spids: [1329 1346]
                                )
                              ]
                              else_action: []
                              redirects: []
                            )
                          ]
                          spids: [1305 1306 1363 -1]
                        )
                      ]
                      redirects: []
                    )
                  ]
                )
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName count_LogicalHostname)} 
                          {<-lt>} {<1>} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
                      {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} 
                      {
                        (command_sub
                          left_token: <Id.Left_Backtick '`'>
                          child: 
                            (C {<gettext>} 
                              {
                                (DQ <'Missing Enabled Logical Host in resource group <'> 
                                  ($ Id.VSub_DollarName rgname) <'> for Remote Mirror'>
                                )
                              }
                            )
                          right: <Id.Backtick_Right '`'>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<2>}
                    )
                  ]
                  spids: [1372 1385]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName count_LogicalHostname)} 
                          {<-gt>} {<1>} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
                      {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} 
                      {
                        (command_sub
                          left_token: <Id.Left_Backtick '`'>
                          child: 
                            (C {<gettext>} 
                              {
                                (DQ <'Too Many Enabled Logical Host in resource group <'> 
                                  ($ Id.VSub_DollarName rgname) <'> for Remote Mirror'>
                                )
                              }
                            )
                          right: <Id.Backtick_Right '`'>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<2>}
                    )
                  ]
                  spids: [1425 1438]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName count_HAStoragePlus)} {<-lt>} 
                          {<1>} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
                      {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} 
                      {
                        (command_sub
                          left_token: <Id.Left_Backtick '`'>
                          child: 
                            (C {<gettext>} 
                              {
                                (DQ <'Missing Enabled HAStoragePlus in resource group <'> 
                                  ($ Id.VSub_DollarName rgname) <'> for Remote Mirror'>
                                )
                              }
                            )
                          right: <Id.Backtick_Right '`'>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<2>}
                    )
                  ]
                  spids: [1482 1495]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName count_HAStoragePlus)} {<-gt>} 
                          {<1>} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
                      {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} 
                      {
                        (command_sub
                          left_token: <Id.Left_Backtick '`'>
                          child: 
                            (C {<gettext>} 
                              {
                                (DQ <'Too Many Enabled HAStoragePlus in resource group <'> 
                                  ($ Id.VSub_DollarName rgname) <'> for Remote Mirror'>
                                )
                              }
                            )
                          right: <Id.Backtick_Right '`'>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<2>}
                    )
                  ]
                  spids: [1535 1548]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.Sentence
              child: (C {<switchfunc>} {($ Id.VSub_DollarName rgname)} {($ Id.VSub_DollarName dg)})
              terminator: <Id.Op_Amp _>
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'pid='> name:pid)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Bang '!')}
                  spids: [1605]
                )
              ]
              redirects: []
            )
            (C {<mkdir>} {<-p>} {<'/var/run/scnws/'>})
            (C {<rm>} {<-f>} {<'/var/run/scnws/'> ($ Id.VSub_DollarName dg) <.pid>})
            (command.Simple
              words: [{<echo>} {($ Id.VSub_DollarName pid)}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<'/var/run/scnws/'> ($ Id.VSub_DollarName dg) <.pid>}
                )
              ]
              more_env: []
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: usage
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.err>} {<-t>} 
              {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} {(DQ <'usage: '> ($ Id.VSub_DollarName ARGV0) <' { start | stop } diskgroup'>)}
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: process_dir
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<typeset>} {<Id.Lit_VarLike 'dir='> ($ Id.VSub_Number 1)})
            (C {<typeset>} {<Id.Lit_VarLike 'arg1='> ($ Id.VSub_Number 2)})
            (C {<typeset>} {<Id.Lit_VarLike 'dg='> ($ Id.VSub_Number 3)})
            (C {<typeset>} {<Id.Lit_VarLike 'arg2='> ($ Id.VSub_Number 4)})
            (C {<typeset>} {<Id.Lit_VarLike 'RDC='> ($ Id.VSub_DollarName dir) <'/10rdc'>})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.DBracket
                          expr: 
                            (bool_expr.Unary
                              op_id: Id.BoolUnary_d
                              child: {($ Id.VSub_DollarName dir)}
                            )
                          redirects: []
                        )
                      ]
                    )
                  action: [
                    (command.ForEach
                      iter_names: [f]
                      iterable: 
                        (for_iter.Words
                          words: [{($ Id.VSub_DollarName dir) <'/'> <Id.Lit_Star '*'>}]
                        )
                      body: 
                        (command.DoGroup
                          children: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (command.AndOr
                                          ops: [Id.Op_DAmp]
                                          children: [
                                            (C {<Id.Lit_LBracket '['>} {<-s>} {($ Id.VSub_DollarName f)} 
                                              {<Id.Lit_RBracket ']'>}
                                            )
                                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName arg2)} 
                                              {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <sndr_dis>)} {<Id.Lit_RBracket ']'>}
                                            )
                                          ]
                                        )
                                      ]
                                    )
                                  action: [
                                    (command.Pipeline
                                      children: [
                                        (command.Simple
                                          words: [
                                            {<'/usr/bin/ksh'>}
                                            {($ Id.VSub_DollarName f)}
                                            {($ Id.VSub_DollarName arg1)}
                                            {($ Id.VSub_DollarName dg)}
                                          ]
                                          redirects: [
                                            (redir
                                              op: <Id.Redir_GreatAnd '2>&'>
                                              loc: (redir_loc.Fd fd:2)
                                              arg: {<1>}
                                            )
                                          ]
                                          more_env: []
                                          do_fork: T
                                        )
                                        (C {<logger>} {<-p>} 
                                          {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
                                          {
                                            (DQ <'NWS.['> (${ Id.VSub_Name ARGV0) <':'> 
                                              (command_sub
                                                left_token: <Id.Left_DollarParen '$('>
                                                child: (C {<basename>} {($ Id.VSub_DollarName f)})
                                                right: <Id.Eof_RParen _>
                                              ) <']'>
                                            )
                                          }
                                        )
                                      ]
                                      negated: F
                                      stderr_indices: []
                                    )
                                  ]
                                  spids: [1788 1815]
                                )
                              ]
                              else_action: [
                                (command.If
                                  arms: [
                                    (if_arm
                                      cond: 
                                        (condition.Shell
                                          commands: [
                                            (command.AndOr
                                              ops: [Id.Op_DAmp]
                                              children: [
                                                (C {<Id.Lit_LBracket '['>} {<-s>} 
                                                  {($ Id.VSub_DollarName f)} {<Id.Lit_RBracket ']'>}
                                                )
                                                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName f)} 
                                                  {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {($ Id.VSub_DollarName RDC)} {<Id.Lit_RBracket ']'>}
                                                )
                                              ]
                                            )
                                          ]
                                        )
                                      action: [
                                        (command.Pipeline
                                          children: [
                                            (command.Simple
                                              words: [
                                                {<'/usr/bin/ksh'>}
                                                {($ Id.VSub_DollarName f)}
                                                {($ Id.VSub_DollarName arg1)}
                                                {($ Id.VSub_DollarName dg)}
                                              ]
                                              redirects: [
                                                (redir
                                                  op: <Id.Redir_GreatAnd '2>&'>
                                                  loc: (redir_loc.Fd fd:2)
                                                  arg: {<1>}
                                                )
                                              ]
                                              more_env: []
                                              do_fork: T
                                            )
                                            (C {<logger>} {<-p>} 
                                              {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
                                              {
                                                (DQ <'NWS.['> (${ Id.VSub_Name ARGV0) <':'> 
                                                  (command_sub
                                                    left_token: <Id.Left_DollarParen '$('>
                                                    child: (C {<basename>} {($ Id.VSub_DollarName f)})
                                                    right: <Id.Eof_RParen _>
                                                  ) <']'>
                                                )
                                              }
                                            )
                                          ]
                                          negated: F
                                          stderr_indices: []
                                        )
                                      ]
                                      spids: [1876 1901]
                                    )
                                  ]
                                  else_action: []
                                  redirects: []
                                )
                              ]
                              redirects: []
                            )
                          ]
                        )
                      redirects: []
                    )
                  ]
                  spids: [1751 1762]
                )
              ]
              else_action: [
                (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.err>} {<-t>} 
                  {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} {(DQ <'no directory: '> ($ Id.VSub_DollarName dir))}
                )
              ]
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<-ne>} {<2>} {<Id.Lit_RBracket ']'>})
              ]
            )
          action: [(C {<usage>})]
          spids: [2007 2019]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.Case
      to_match: {(DQ ($ Id.VSub_Number 1))}
      arms: [
        (case_arm
          pat_list: [{<start>}]
          action: [
            (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
              {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} {(DQ <'starting: '> ($ Id.VSub_DollarName ARGV0) <' '> ($ Id.VSub_Star '*'))}
            )
            (C {<do_scswitch>} {($ Id.VSub_Number 2)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'retval='> name:retval)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '?')}
                  spids: [2074]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName retval)} 
                          {<Id.Lit_Equals '='> <Id.Lit_Equals '='>} {<2>} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.err>} {<-t>} 
                      {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} 
                      {
                        (DQ 
                          <
'**FATAL ERROR** Remote Mirror is mis-configured and DISABLED for devicegroup <'
                          >
                        ) ($ Id.VSub_Number 2) (DQ <'> '>)
                      }
                    )
                    (C {<process_dir>} {($ Id.VSub_DollarName NWS_START_DIR)} {<start>} 
                      {(DQ ($ Id.VSub_Number 2))} {<sndr_dis>}
                    )
                  ]
                  spids: [2078 2092]
                )
              ]
              else_action: [
                (C {<process_dir>} {($ Id.VSub_DollarName NWS_START_DIR)} {<start>} 
                  {(DQ ($ Id.VSub_Number 2))} {<sndr_ena>}
                )
              ]
              redirects: []
            )
          ]
          spids: [2040 2041 2160 -1]
        )
        (case_arm
          pat_list: [{<stop>}]
          action: [
            (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
              {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} {(DQ <'stopping: '> ($ Id.VSub_DollarName ARGV0) <' '> ($ Id.VSub_Star '*'))}
            )
            (C {<process_dir>} {($ Id.VSub_DollarName NWS_STOP_DIR)} {<stop>} {(DQ ($ Id.VSub_Number 2))} 
              {<sndr_ena>}
            )
            (C {<kill_scswitch>} {($ Id.VSub_Number 2)})
          ]
          spids: [2162 2163 2209 -1]
        )
        (case_arm
          pat_list: [{<Id.Lit_Star '*'>}]
          action: [(C {<usage>})]
          spids: [2212 2213 2223 -1]
        )
      ]
      redirects: []
    )
    (C {<logger>} {<-p>} {(${ Id.VSub_Name SYSLOG_FACILITY) <.notice>} {<-t>} 
      {(DQ <'NWS.['> ($ Id.VSub_DollarName ARGV0) <']'>)} {(DQ <'completed: '> ($ Id.VSub_DollarName ARGV0) <' '> ($ Id.VSub_Star '*'))}
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
  ]
)