(command.CommandList
  children: [
    (command.ShFunction
      name: usage
      body: 
        (BraceGroup
          children: [
            (C {<echo>} {<Usage> <Id.Lit_Colon ':'>} 
              {
                (command_sub
                  left_token: <Id.Left_Backtick '`'>
                  child: (C {<basename>} {($ Id.VSub_Number '$0')})
                )
              } {(DQ <'[-h] [-D] [-C ca_name]'>)} {(DQ <'[-P ca_port] [-t(imeout) timeout_ms]'>)}
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<2>})
          ]
        )
    )
    (command.ShFunction
      name: dump_by_lid
      body: 
        (BraceGroup
          children: [
            (command.ForEach
              iter_name: sw_lid
              iter_words: [
                {
                  (command_sub
                    left_token: <Id.Left_Backtick '`'>
                    child: 
                      (command.Pipeline
                        children: [
                          (C {<ibswitches>} {($ Id.VSub_DollarName '$ca_info')})
                          (C {<sed>} {<-ne>} {(SQ <'s/^.* lid \\([0-9a-f]*\\) .*$/\\1/p'>)})
                        ]
                        negated: F
                      )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {<ibroute>} {($ Id.VSub_DollarName '$ca_info')} {<-M>} 
                      {($ Id.VSub_DollarName '$sw_lid')}
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: dump_by_dr_path
      body: 
        (BraceGroup
          children: [
            (command.ForEach
              iter_name: sw_dr
              iter_words: [
                {
                  (command_sub
                    left_token: <Id.Left_Backtick '`'>
                    child: 
                      (command.Pipeline
                        children: [
                          (C {<ibnetdiscover>} {($ Id.VSub_DollarName '$ca_info')} {<-v>})
                          (C {<sed>} {<-ne>} 
                            {(SQ <'/^DR path .* switch /s/^DR path \\[\\(.*\\)\\].*$/\\1/p'>)}
                          )
                          (C {<sed>} {<-e>} {(SQ <'s/\\]\\[/,/g'>)})
                          (C {<sort>} {<-u>})
                        ]
                        negated: F
                      )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {<ibroute>} {($ Id.VSub_DollarName '$ca_info')} {<-M>} {<-D>} 
                      {(${ Id.VSub_Name sw_dr)}
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:use_d)
          op: assign_op.Equal
          rhs: {(DQ )}
          spids: [218]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:ca_info)
          op: assign_op.Equal
          rhs: {(DQ )}
          spids: [222]
        )
      ]
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: [
        (command.Sentence
          child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_RBracket ']'>})
          terminator: <Id.Op_Semi _>
        )
      ]
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {($ Id.VSub_Number '$1')}
              arms: [
                (case_arm
                  pat_list: [{<-D>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:use_d)
                          op: assign_op.Equal
                          rhs: {(DQ <-D>)}
                          spids: [252]
                        )
                      ]
                    )
                  ]
                  spids: [248 249 258 -1]
                )
                (case_arm
                  pat_list: [{<-h>}]
                  action: [(C {<usage>})]
                  spids: [261 262 268 -1]
                )
                (case_arm
                  pat_list: [{<-P>} {<-C>} {<-t>} {<-timeout>}]
                  action: [
                    (command.Case
                      to_match: {($ Id.VSub_Number '$2')}
                      arms: [
                        (case_arm
                          pat_list: [{<-> <Id.Lit_Star '*'>}]
                          action: [(C {<usage>})]
                          spids: [294 296 302 -1]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} {<x> ($ Id.VSub_Number '$2')} 
                                  {<Id.Lit_Equals '='>} {<x>} {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [(C {<usage>})]
                          spids: [308 323]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:ca_info)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName '$ca_info') <' '> ($ Id.VSub_Number '$1') <' '> 
                                ($ Id.VSub_Number '$2')
                              )
                            }
                          spids: [332]
                        )
                      ]
                    )
                    (C {<shift>})
                  ]
                  spids: [271 284 345 -1]
                )
                (case_arm
                  pat_list: [{<-> <Id.Lit_Star '*'>}]
                  action: [(C {<usage>})]
                  spids: [348 350 356 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [(C {<usage>})]
                  spids: [359 360 366 -1]
                )
              ]
            )
            (C {<shift>})
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$use_d'))} {<Id.Lit_Equals '='>} 
                  {(DQ <-D>)} {<Id.Lit_RBracket ']'>}
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [(C {<dump_by_dr_path>})]
          spids: [377 395]
        )
      ]
      else_action: [(C {<dump_by_lid>})]
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
  ]
)