(command.CommandList
  children: [
    (command.ShFunction
      name_tok: <sort_list>
      name: sort_list
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.AndOr
              children: [
                (command.DParen
                  left: <Id.Op_DLeftParen _>
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_NEqual
                      left: {($ Id.VSub_Pound '#')}
                      right: {<Id.Lit_Digits 2>}
                    )
                  right: <Id.Op_DRightParen _>
                  redirects: []
                )
                (command.ControlFlow
                  keyword: <Id.ControlFlow_Return return>
                  arg_word: {<1>}
                )
              ]
              ops: [<Id.Op_DAmp _>]
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<-i>} {<Id.Lit_VarLike 'left='> ($ Id.VSub_Number 1)}]
              redirects: []
              do_fork: T
            )
            (command.AndOr
              children: [
                (command.DParen
                  left: <Id.Op_DLeftParen _>
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Less
                      left: ($ Id.Lit_ArithVarLike left)
                      right: {<Id.Lit_Digits 0>}
                    )
                  right: <Id.Op_DRightParen _>
                  redirects: []
                )
                (command.DParen
                  left: <Id.Op_DLeftParen _>
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_DEqual
                      left: {<Id.Lit_Digits 0>}
                      right: 
                        {
                          (BracedVarSub
                            left: <Id.Left_DollarBrace '${'>
                            token: <Id.VSub_Name list>
                            var_name: list
                            prefix_op: <Id.VSub_Pound '#'>
                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                            right: <Id.Right_DollarBrace '}'>
                          )
                        }
                    )
                  right: <Id.Op_DRightParen _>
                  redirects: []
                )
                (command.ControlFlow
                  keyword: <Id.ControlFlow_Return return>
                  arg_word: {<2>}
                )
              ]
              ops: [<Id.Op_DPipe _> <Id.Op_DAmp _>]
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<-i>} {<Id.Lit_VarLike 'right='> ($ Id.VSub_Number 2)}]
              redirects: []
              do_fork: T
            )
            (command.AndOr
              children: [
                (command.DParen
                  left: <Id.Op_DLeftParen _>
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_GreatEqual
                      left: ($ Id.Lit_ArithVarLike right)
                      right: 
                        {
                          (BracedVarSub
                            left: <Id.Left_DollarBrace '${'>
                            token: <Id.VSub_Name list>
                            var_name: list
                            prefix_op: <Id.VSub_Pound '#'>
                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                            right: <Id.Right_DollarBrace '}'>
                          )
                        }
                    )
                  right: <Id.Op_DRightParen _>
                  redirects: []
                )
                (command.ControlFlow
                  keyword: <Id.ControlFlow_Return return>
                  arg_word: {<3>}
                )
              ]
              ops: [<Id.Op_DAmp _>]
            )
            (command.Sentence
              child: 
                (command.Simple
                  blame_tok: <typeset>
                  more_env: []
                  words: [{<typeset>} {<-i>} {<Id.Lit_VarLike 'i='> ($ Id.VSub_DollarName left)}]
                  redirects: []
                  do_fork: T
                )
              terminator: <Id.Op_Semi _>
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<-i>} {<Id.Lit_VarLike 'j='> ($ Id.VSub_DollarName right)}]
              redirects: []
              do_fork: T
            )
            (command.Sentence
              child: 
                (command.Simple
                  blame_tok: <typeset>
                  more_env: []
                  words: [{<typeset>} {<-i>} {<mid>}]
                  redirects: []
                  do_fork: T
                )
              terminator: <Id.Op_Semi _>
            )
            (command.DParen
              left: <Id.Op_DLeftParen _>
              child: 
                (arith_expr.BinaryAssign
                  op_id: Id.Arith_Equal
                  left: ($ Id.Lit_ArithVarLike mid)
                  right: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Slash
                      left: 
                        (arith_expr.Binary
                          op_id: Id.Arith_Plus
                          left: ($ Id.Lit_ArithVarLike left)
                          right: ($ Id.Lit_ArithVarLike right)
                        )
                      right: {<Id.Lit_Digits 2>}
                    )
                )
              right: <Id.Op_DRightParen _>
              redirects: []
            )
            (command.Sentence
              child: 
                (command.Simple
                  blame_tok: <typeset>
                  more_env: []
                  words: [{<typeset>} {<partition_item>}]
                  redirects: []
                  do_fork: T
                )
              terminator: <Id.Op_Semi _>
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'partition_item='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'partition_item='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'partition_item='> name:partition_item)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          left: <Id.Left_DollarBrace '${'>
                          token: <Id.VSub_Name list>
                          var_name: list
                          bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName mid)})
                          right: <Id.Right_DollarBrace '}'>
                        )
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<temp>}]
              redirects: []
              do_fork: T
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          left: <Id.Op_DLeftParen _>
                          child: 
                            (arith_expr.Binary
                              op_id: Id.Arith_Great
                              left: ($ Id.Lit_ArithVarLike j)
                              right: ($ Id.Lit_ArithVarLike i)
                            )
                          right: <Id.Op_DRightParen _>
                          redirects: []
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  left: <Id.KW_Do do>
                  children: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'item='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'item='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'item='> name:item)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (BracedVarSub
                                left: <Id.Left_DollarBrace '${'>
                                token: <Id.VSub_Name list>
                                var_name: list
                                bracket_op: (bracket_op.ArrayIndex expr:($ Id.Lit_ArithVarLike i))
                                right: <Id.Right_DollarBrace '}'>
                              )
                            }
                        )
                      ]
                      redirects: []
                    )
                    (command.WhileUntil
                      keyword: <Id.KW_While while>
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  left: <Id.KW_DLeftBracket '[['>
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.Op_Less
                                      left: 
                                        {
                                          (DQ 
                                            (BracedVarSub
                                              left: <Id.Left_DollarBrace '${'>
                                              token: <Id.VSub_Name list>
                                              var_name: list
                                              bracket_op: 
                                                (bracket_op.ArrayIndex
                                                  expr: {($ Id.VSub_DollarName i)}
                                                )
                                              right: <Id.Right_DollarBrace '}'>
                                            )
                                          )
                                        }
                                      right: {(DQ ($ Id.VSub_DollarName partition_item))}
                                    )
                                  right: <Id.Lit_DRightBracket ']]'>
                                  redirects: []
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      body: 
                        (command.DoGroup
                          left: <Id.KW_Do do>
                          children: [
                            (command.DParen
                              left: <Id.Op_DLeftParen _>
                              child: 
                                (arith_expr.UnaryAssign
                                  op_id: Id.Node_PostDPlus
                                  child: ($ Id.Lit_ArithVarLike i)
                                )
                              right: <Id.Op_DRightParen _>
                              redirects: []
                            )
                          ]
                          right: <Id.KW_Done done>
                        )
                      redirects: []
                    )
                    (command.WhileUntil
                      keyword: <Id.KW_While while>
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  left: <Id.KW_DLeftBracket '[['>
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.Op_Great
                                      left: 
                                        {
                                          (DQ 
                                            (BracedVarSub
                                              left: <Id.Left_DollarBrace '${'>
                                              token: <Id.VSub_Name list>
                                              var_name: list
                                              bracket_op: 
                                                (bracket_op.ArrayIndex
                                                  expr: {($ Id.VSub_DollarName j)}
                                                )
                                              right: <Id.Right_DollarBrace '}'>
                                            )
                                          )
                                        }
                                      right: {(DQ ($ Id.VSub_DollarName partition_item))}
                                    )
                                  right: <Id.Lit_DRightBracket ']]'>
                                  redirects: []
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      body: 
                        (command.DoGroup
                          left: <Id.KW_Do do>
                          children: [
                            (command.DParen
                              left: <Id.Op_DLeftParen _>
                              child: 
                                (arith_expr.UnaryAssign
                                  op_id: Id.Node_PostDMinus
                                  child: ($ Id.Lit_ArithVarLike j)
                                )
                              right: <Id.Op_DRightParen _>
                              redirects: []
                            )
                          ]
                          right: <Id.KW_Done done>
                        )
                      redirects: []
                    )
                    (command.If
                      if_kw: <Id.KW_If if>
                      arms: [
                        (IfArm
                          keyword: <Id.KW_If if>
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DParen
                                      left: <Id.Op_DLeftParen _>
                                      child: 
                                        (arith_expr.Binary
                                          op_id: Id.Arith_LessEqual
                                          left: ($ Id.Lit_ArithVarLike i)
                                          right: ($ Id.Lit_ArithVarLike j)
                                        )
                                      right: <Id.Op_DRightParen _>
                                      redirects: []
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          then_kw: <Id.KW_Then then>
                          action: [
                            (command.Sentence
                              child: 
                                (command.ShAssignment
                                  left: <Id.Lit_VarLike 'temp='>
                                  pairs: [
                                    (AssignPair
                                      left: <Id.Lit_VarLike 'temp='>
                                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'temp='> name:temp)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (DQ 
                                            (BracedVarSub
                                              left: <Id.Left_DollarBrace '${'>
                                              token: <Id.VSub_Name list>
                                              var_name: list
                                              bracket_op: 
                                                (bracket_op.ArrayIndex
                                                  expr: {($ Id.VSub_DollarName i)}
                                                )
                                              right: <Id.Right_DollarBrace '}'>
                                            )
                                          )
                                        }
                                    )
                                  ]
                                  redirects: []
                                )
                              terminator: <Id.Op_Semi _>
                            )
                            (command.Sentence
                              child: 
                                (command.ShAssignment
                                  left: <Id.Lit_ArrayLhsOpen 'list['>
                                  pairs: [
                                    (AssignPair
                                      left: <Id.Lit_ArrayLhsOpen 'list['>
                                      lhs: 
                                        (sh_lhs_expr.IndexedName
                                          left: <Id.Lit_ArrayLhsOpen 'list['>
                                          name: list
                                          index: {($ Id.VSub_DollarName i)}
                                        )
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (DQ 
                                            (BracedVarSub
                                              left: <Id.Left_DollarBrace '${'>
                                              token: <Id.VSub_Name list>
                                              var_name: list
                                              bracket_op: 
                                                (bracket_op.ArrayIndex
                                                  expr: {($ Id.VSub_DollarName j)}
                                                )
                                              right: <Id.Right_DollarBrace '}'>
                                            )
                                          )
                                        }
                                    )
                                  ]
                                  redirects: []
                                )
                              terminator: <Id.Op_Semi _>
                            )
                            (command.ShAssignment
                              left: <Id.Lit_ArrayLhsOpen 'list['>
                              pairs: [
                                (AssignPair
                                  left: <Id.Lit_ArrayLhsOpen 'list['>
                                  lhs: 
                                    (sh_lhs_expr.IndexedName
                                      left: <Id.Lit_ArrayLhsOpen 'list['>
                                      name: list
                                      index: {($ Id.VSub_DollarName j)}
                                    )
                                  op: assign_op.Equal
                                  rhs: {(DQ ($ Id.VSub_DollarName temp))}
                                )
                              ]
                              redirects: []
                            )
                            (command.DParen
                              left: <Id.Op_DLeftParen _>
                              child: 
                                (arith_expr.UnaryAssign
                                  op_id: Id.Node_PostDPlus
                                  child: ($ Id.Lit_ArithVarLike i)
                                )
                              right: <Id.Op_DRightParen _>
                              redirects: []
                            )
                            (command.DParen
                              left: <Id.Op_DLeftParen _>
                              child: 
                                (arith_expr.UnaryAssign
                                  op_id: Id.Node_PostDMinus
                                  child: ($ Id.Lit_ArithVarLike j)
                                )
                              right: <Id.Op_DRightParen _>
                              redirects: []
                            )
                          ]
                          spids: [270 283]
                        )
                      ]
                      else_action: []
                      fi_kw: <Id.KW_Fi fi>
                      redirects: []
                    )
                  ]
                  right: <Id.KW_Done done>
                )
              redirects: []
            )
            (command.AndOr
              children: [
                (command.DParen
                  left: <Id.Op_DLeftParen _>
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Less
                      left: ($ Id.Lit_ArithVarLike left)
                      right: ($ Id.Lit_ArithVarLike j)
                    )
                  right: <Id.Op_DRightParen _>
                  redirects: []
                )
                (command.Simple
                  blame_tok: <sort_list>
                  more_env: []
                  words: [{<sort_list>} {($ Id.VSub_DollarName left)} {($ Id.VSub_DollarName j)}]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DAmp _>]
            )
            (command.AndOr
              children: [
                (command.DParen
                  left: <Id.Op_DLeftParen _>
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Great
                      left: ($ Id.Lit_ArithVarLike right)
                      right: ($ Id.Lit_ArithVarLike i)
                    )
                  right: <Id.Op_DRightParen _>
                  redirects: []
                )
                (command.Simple
                  blame_tok: <sort_list>
                  more_env: []
                  words: [{<sort_list>} {($ Id.VSub_DollarName i)} {($ Id.VSub_DollarName right)}]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DAmp _>]
            )
            (command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.If
      if_kw: <Id.KW_If if>
      arms: [
        (IfArm
          keyword: <Id.KW_If if>
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DBracket
                      left: <Id.KW_DLeftBracket '[['>
                      expr: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_GlobDEqual
                          left: {($ Id.VSub_Number 0)}
                          right: {<Id.Lit_Other '*'> <sorting.sh>}
                        )
                      right: <Id.Lit_DRightBracket ']]'>
                      redirects: []
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.AndOr
              children: [
                (command.DBracket
                  left: <Id.KW_DLeftBracket '[['>
                  expr: 
                    (bool_expr.Unary
                      op_id: Id.BoolUnary_n
                      child: {($ Id.VSub_DollarName ZSH_VERSION)}
                    )
                  right: <Id.Lit_DRightBracket ']]'>
                  redirects: []
                )
                (command.Simple
                  blame_tok: <setopt>
                  more_env: []
                  words: [{<setopt>} {<ksharrays>}]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DAmp _>]
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<-a>} {<list>}]
              redirects: []
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'list='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'list='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'list='> name:list)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (ShArrayLiteral
                        left: <Id.Op_LParen _>
                        words: []
                        right: <Id.Right_ShArrayLiteral _>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <sort_list>
              more_env: []
              words: [{<sort_list>} {<-1>} {<0>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<-p>} {<list>}]
              redirects: []
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'list='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'list='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'list='> name:list)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (ShArrayLiteral
                        left: <Id.Op_LParen _>
                        words: [{(SQ <one>)}]
                        right: <Id.Right_ShArrayLiteral _>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<-p>} {<list>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <sort_list>
              more_env: []
              words: [{<sort_list>} {<0>} {<0>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<-p>} {<list>}]
              redirects: []
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'list='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'list='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'list='> name:list)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (ShArrayLiteral
                        left: <Id.Op_LParen _>
                        words: [{(SQ <one>)} {(SQ <two>)} {(SQ <three>)}]
                        right: <Id.Right_ShArrayLiteral _>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <sort_list>
              more_env: []
              words: [{<sort_list>} {<0>} {<2>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<-p>} {<list>}]
              redirects: []
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'list='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'list='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'list='> name:list)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (ShArrayLiteral
                        left: <Id.Op_LParen _>
                        words: [{<4>} {<3>} {<2>} {<1>}]
                        right: <Id.Right_ShArrayLiteral _>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <sort_list>
              more_env: []
              words: [{<sort_list>} {<0>} {<3>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<-p>} {<list>}]
              redirects: []
              do_fork: T
            )
          ]
          spids: [386 401]
        )
      ]
      else_action: []
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
  ]
)