(command.CommandList
  children: [
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName TMPDIR))} 
                  {<Id.Lit_RBracket ']'>}
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'TDIR='> name:TDIR)
                  op: assign_op.Equal
                  rhs: {(DQ <'/tmp'>)}
                  spids: [103]
                )
              ]
              redirects: []
            )
          ]
          spids: [88 100]
        )
      ]
      else_action: [
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'TDIR='> name:TDIR)
              op: assign_op.Equal
              rhs: {($ Id.VSub_DollarName TMPDIR)}
              spids: [111]
            )
          ]
          redirects: []
        )
      ]
      redirects: []
    )
    (C {<trap>} 
      {
        (DQ <'rm -f '> ($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <'symdef '> 
          ($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <'symref '> ($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') 
          <'tmp; exit'>
        )
      } {<1>} {<2>} {<13>} {<15>}
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'PFX='> name:PFX)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [142]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'WHERE='> name:WHERE)
          op: assign_op.Equal
          rhs: {<'/usr/bin'>}
          spids: [144]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'USAGE='> name:USAGE)
          op: assign_op.Equal
          rhs: {(DQ <'Usage: '> (${ Id.VSub_Name PFX) <'lorder file ...'>)}
          spids: [148]
        )
      ]
      redirects: []
    )
    (command.ForEach
      iter_names: [i]
      iterable: (for_iter.Words words:[{(DQ ($ Id.VSub_At '@'))}])
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName i))}
              arms: [
                (case_arm
                  pat_list: [{<-> <Id.Lit_Star '*'>}]
                  action: [
                    (command.Sentence
                      child: (C {<echo>} {(DQ ($ Id.VSub_DollarName USAGE))})
                      terminator: <Id.Op_Semi _>
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<2>}
                    )
                  ]
                  spids: [179 181 194 -1]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-r>} 
                          {(DQ ($ Id.VSub_DollarName i))} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {
                        (DQ (${ Id.VSub_Name PFX) <'lorder: '> ($ Id.VSub_DollarName i) 
                          <': cannot open'>
                        )
                      }
                    )
                    (command.Sentence
                      child: (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<2>})
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  spids: [201 216]
                )
              ]
              else_action: []
              redirects: []
            )
          ]
        )
      redirects: []
    )
    (command.Case
      to_match: {($ Id.VSub_Pound '#')}
      arms: [
        (case_arm
          pat_list: [{<0>}]
          action: [
            (C {<echo>} {(DQ ($ Id.VSub_DollarName USAGE))})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<2>})
          ]
          spids: [248 249 261 -1]
        )
        (case_arm
          pat_list: [{<1>}]
          action: [
            (command.Case
              to_match: {($ Id.VSub_Number 1)}
              arms: [
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'> <.o>}]
                  action: [(C {<set>} {($ Id.VSub_Number 1)} {($ Id.VSub_Number 1)})]
                  spids: [273 275 -1 284]
                )
              ]
              redirects: []
            )
          ]
          spids: [263 264 -1 286]
        )
      ]
      redirects: []
    )
    (command.Pipeline
      children: [
        (command.Simple
          words: [
            {(${ Id.VSub_Name WHERE) <'/'> (${ Id.VSub_Name PFX) <nm>}
            {<-p>}
            {($ Id.VSub_Star '*')}
          ]
          redirects: [
            (redir
              op: <Id.Redir_Great '2>'>
              loc: (redir_loc.Fd fd:2)
              arg: {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <tmp>}
            )
          ]
          more_env: []
          do_fork: T
        )
        (C {<sed>} {<-e>} {(SQ <'/^[ \t]*$/d'>)} {<-e>} 
          {
            (SQ <'\n'> <'\t/^[0-9]* R $/d\n'> <'\t/ [a-zFLS] /d\n'> <'\t/[^]]:$/{\n'> <'\t\ts/://\n'> 
              <'\t\th\n'> <'\t\ts/.*/& &/\n'> <'\t\tp\n'> <'\t\td\n'> <'\t}\n'> <'\t/]:$/{\n'> <'\t\ts/]://\n'> <'\t\ts/^.*\\[//\n'> 
              <'\t\th\n'> <'\t\ts/.*/& &/\n'> <'\t\tp\n'> <'\t\td\n'> <'\t}\n'> <'\t/ [TDBNCAR] /{\n'> <'\t\ts/^.* [TDBNCAR] //\n'> 
              <'\t\tG\n'> <'\t\ts/\\n/ /\n'> <'\t\tw '>
            ) ($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <symdef> 
            (SQ <'\n'> <'\t\td\n'> <'\t}\n'> <'\t/ U /{\n'> <'\t\ts/^.* U //\n'> <'\t\tG\n'> 
              <'\t\ts/\\n/ /\n'> <'\t\tw '>
            ) ($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <symref> (SQ <'\n'> <'\t\td\n'> <'\t}\n'>)
          }
        )
      ]
      negated: F
      stderr_indices: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (C {<Id.Lit_LBracket '['>} {<-s>} 
                  {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <tmp>} {<Id.Lit_RBracket ']'>}
                )
              ]
            )
          action: [
            (command.Simple
              words: [
                {<sed>}
                {<-e>}
                {(DQ <'s/^'> (${ Id.VSub_Name PFX) <'nm:/'> (${ Id.VSub_Name PFX) <'lorder:/'>)}
              ]
              redirects: [
                (redir
                  op: <Id.Redir_Less '<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <tmp>}
                )
                (redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})
              ]
              more_env: []
              do_fork: T
            )
            (C {<rm>} {<-f>} {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <symdef>} 
              {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <symref>} {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <tmp>}
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [441 454]
        )
      ]
      else_action: []
      redirects: []
    )
    (C {<sort>} {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <symdef>} {<-o>} 
      {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <symdef>}
    )
    (C {<sort>} {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <symref>} {<-o>} 
      {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <symref>}
    )
    (command.Pipeline
      children: [
        (C {<join>} {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <symref>} 
          {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <symdef>}
        )
        (C {<sed>} {(SQ <'s/[^ ]* *//'>)})
      ]
      negated: F
      stderr_indices: []
    )
    (C {<rm>} {<-f>} {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <symdef>} 
      {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <symref>} {($ Id.VSub_DollarName TDIR) <'/'> ($ Id.VSub_Dollar '$') <tmp>}
    )
  ]
)