(command.CommandList
  children: [
    (command.ShFunction
      name: sort_list
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DParen
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_NEqual
                      left: {($ Id.VSub_Pound '$#')}
                      right: {<Id.Lit_Digits 2>}
                    )
                )
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {<1>}
                )
              ]
            )
            (C {<typeset>} {<-i>} {<Id.Lit_VarLike 'left='> ($ Id.VSub_Number '$1')})
            (command.AndOr
              ops: [Id.Op_DPipe Id.Op_DAmp]
              children: [
                (command.DParen
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Less
                      left: <Id.Lit_ArithVarLike left>
                      right: {<Id.Lit_Digits 0>}
                    )
                )
                (command.DParen
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_DEqual
                      left: {<Id.Lit_Digits 0>}
                      right: 
                        {
                          (braced_var_sub
                            token: <Id.VSub_Name list>
                            prefix_op: (Id.VSub_Pound)
                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                          )
                        }
                    )
                )
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {<2>}
                )
              ]
            )
            (C {<typeset>} {<-i>} {<Id.Lit_VarLike 'right='> ($ Id.VSub_Number '$2')})
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DParen
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_GreatEqual
                      left: <Id.Lit_ArithVarLike right>
                      right: 
                        {
                          (braced_var_sub
                            token: <Id.VSub_Name list>
                            prefix_op: (Id.VSub_Pound)
                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                          )
                        }
                    )
                )
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {<3>}
                )
              ]
            )
            (command.Sentence
              child: (C {<typeset>} {<-i>} {<Id.Lit_VarLike 'i='> ($ Id.VSub_DollarName '$left')})
              terminator: <Id.Op_Semi _>
            )
            (C {<typeset>} {<-i>} {<Id.Lit_VarLike 'j='> ($ Id.VSub_DollarName '$right')})
            (command.Sentence
              child: (C {<typeset>} {<-i>} {<mid>})
              terminator: <Id.Op_Semi _>
            )
            (command.DParen
              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>}
                    )
                )
            )
            (command.Sentence
              child: (C {<typeset>} {<partition_item>})
              terminator: <Id.Op_Semi _>
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:partition_item)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <Id.VSub_Name list>
                          bracket_op: (bracket_op.ArrayIndex expr:{($ Id.VSub_DollarName '$mid')})
                        )
                      )
                    }
                  spids: [157]
                )
              ]
            )
            (C {<typeset>} {<temp>})
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Id.Arith_Great
                              left: <Id.Lit_ArithVarLike j>
                              right: <Id.Lit_ArithVarLike i>
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:item)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name list>
                                bracket_op: (bracket_op.ArrayIndex expr:<Id.Lit_ArithVarLike i>)
                              )
                            }
                          spids: [189]
                        )
                      ]
                    )
                    (command.WhileUntil
                      keyword: <Id.KW_While while>
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.Op_Less
                                      left: 
                                        {
                                          (DQ 
                                            (braced_var_sub
                                              token: <Id.VSub_Name list>
                                              bracket_op: 
                                                (bracket_op.ArrayIndex
                                                  expr: {($ Id.VSub_DollarName '$i')}
                                                )
                                            )
                                          )
                                        }
                                      right: {(DQ ($ Id.VSub_DollarName '$partition_item'))}
                                    )
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      body: 
                        (command.DoGroup
                          children: [
                            (command.DParen
                              child: 
                                (arith_expr.UnaryAssign
                                  op_id: Id.Node_PostDPlus
                                  child: <Id.Lit_ArithVarLike i>
                                )
                            )
                          ]
                        )
                    )
                    (command.WhileUntil
                      keyword: <Id.KW_While while>
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.Op_Great
                                      left: 
                                        {
                                          (DQ 
                                            (braced_var_sub
                                              token: <Id.VSub_Name list>
                                              bracket_op: 
                                                (bracket_op.ArrayIndex
                                                  expr: {($ Id.VSub_DollarName '$j')}
                                                )
                                            )
                                          )
                                        }
                                      right: {(DQ ($ Id.VSub_DollarName '$partition_item'))}
                                    )
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      body: 
                        (command.DoGroup
                          children: [
                            (command.DParen
                              child: 
                                (arith_expr.UnaryAssign
                                  op_id: Id.Node_PostDMinus
                                  child: <Id.Lit_ArithVarLike j>
                                )
                            )
                          ]
                        )
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DParen
                                      child: 
                                        (arith_expr.Binary
                                          op_id: Id.Arith_LessEqual
                                          left: <Id.Lit_ArithVarLike i>
                                          right: <Id.Lit_ArithVarLike j>
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.Sentence
                              child: 
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:temp)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (DQ 
                                            (braced_var_sub
                                              token: <Id.VSub_Name list>
                                              bracket_op: 
                                                (bracket_op.ArrayIndex
                                                  expr: {($ Id.VSub_DollarName '$i')}
                                                )
                                            )
                                          )
                                        }
                                      spids: [286]
                                    )
                                  ]
                                )
                              terminator: <Id.Op_Semi _>
                            )
                            (command.Sentence
                              child: 
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: 
                                        (sh_lhs_expr.IndexedName
                                          name: list
                                          index: {($ Id.VSub_DollarName '$i')}
                                        )
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (DQ 
                                            (braced_var_sub
                                              token: <Id.VSub_Name list>
                                              bracket_op: 
                                                (bracket_op.ArrayIndex
                                                  expr: {($ Id.VSub_DollarName '$j')}
                                                )
                                            )
                                          )
                                        }
                                      spids: [297]
                                    )
                                  ]
                                )
                              terminator: <Id.Op_Semi _>
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.IndexedName
                                      name: list
                                      index: {($ Id.VSub_DollarName '$j')}
                                    )
                                  op: assign_op.Equal
                                  rhs: {(DQ ($ Id.VSub_DollarName '$temp'))}
                                  spids: [312]
                                )
                              ]
                            )
                            (command.DParen
                              child: 
                                (arith_expr.UnaryAssign
                                  op_id: Id.Node_PostDPlus
                                  child: <Id.Lit_ArithVarLike i>
                                )
                            )
                            (command.DParen
                              child: 
                                (arith_expr.UnaryAssign
                                  op_id: Id.Node_PostDMinus
                                  child: <Id.Lit_ArithVarLike j>
                                )
                            )
                          ]
                          spids: [270 283]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DParen
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Less
                      left: <Id.Lit_ArithVarLike left>
                      right: <Id.Lit_ArithVarLike j>
                    )
                )
                (C {<sort_list>} {($ Id.VSub_DollarName '$left')} {($ Id.VSub_DollarName '$j')})
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DParen
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Great
                      left: <Id.Lit_ArithVarLike right>
                      right: <Id.Lit_ArithVarLike i>
                    )
                )
                (C {<sort_list>} {($ Id.VSub_DollarName '$i')} {($ Id.VSub_DollarName '$right')})
              ]
            )
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DBracket
                      expr: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_GlobDEqual
                          left: {($ Id.VSub_Number '$0')}
                          right: {<Id.Lit_Other '*'> <sorting.sh>}
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DBracket
                  expr: 
                    (bool_expr.Unary
                      op_id: Id.BoolUnary_n
                      child: {($ Id.VSub_DollarName '$ZSH_VERSION')}
                    )
                )
                (C {<setopt>} {<ksharrays>})
              ]
            )
            (C {<typeset>} {<-a>} {<list>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:list)
                  op: assign_op.Equal
                  rhs: {(sh_array_literal left:<Id.Op_LParen _>)}
                  spids: [427]
                )
              ]
            )
            (C {<sort_list>} {<-1>} {<0>})
            (C {<typeset>} {<-p>} {<list>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:list)
                  op: assign_op.Equal
                  rhs: {(sh_array_literal left:<Id.Op_LParen _> words:[{(SQ <one>)}])}
                  spids: [447]
                )
              ]
            )
            (C {<typeset>} {<-p>} {<list>})
            (C {<sort_list>} {<0>} {<0>})
            (C {<typeset>} {<-p>} {<list>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:list)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (sh_array_literal
                        left: <Id.Op_LParen _>
                        words: [{(SQ <one>)} {(SQ <two>)} {(SQ <three>)}]
                      )
                    }
                  spids: [477]
                )
              ]
            )
            (C {<sort_list>} {<0>} {<2>})
            (C {<typeset>} {<-p>} {<list>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:list)
                  op: assign_op.Equal
                  rhs: {(sh_array_literal left:<Id.Op_LParen _> words:[{<4>} {<3>} {<2>} {<1>}])}
                  spids: [507]
                )
              ]
            )
            (C {<sort_list>} {<0>} {<3>})
            (C {<typeset>} {<-p>} {<list>})
          ]
          spids: [386 401]
        )
      ]
    )
  ]
)