(command.CommandList
  children: [
    (command.ShFunction
      name: relpath
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DPipe]
              children: [
                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-ge>} {<1>} {<Id.Lit_RBracket ']'>})
                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-le>} {<2>} {<Id.Lit_RBracket ']'>})
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {<1>}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:current)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <Id.VSub_Number 2>
                          suffix_op: 
                            (suffix_op.Unary
                              op_id: Id.VTest_ColonPlus
                              arg_word: {(DQ ($ Id.VSub_Number '$1'))}
                            )
                        )
                      )
                    }
                  spids: [51]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:target)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <Id.VSub_Number 2>
                          suffix_op: 
                            (suffix_op.Unary
                              op_id: Id.VTest_ColonHyphen
                              arg_word: {(DQ ($ Id.VSub_Number '$1'))}
                            )
                        )
                      )
                    }
                  spids: [63]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$target'))} 
                  {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<.>} {<Id.Lit_RBracket ']'>}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:target)
                      op: assign_op.Equal
                      rhs: {<'/'>}
                      spids: [90]
                    )
                  ]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:target)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ <'/'> 
                        (braced_var_sub
                          token: <Id.VSub_Name target>
                          suffix_op: 
                            (suffix_op.Unary
                              op_id: Id.VOp1_DPound
                              arg_word: {<Id.Lit_Slash '/'>}
                            )
                        )
                      )
                    }
                  spids: [94]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$current'))} 
                  {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<.>} {<Id.Lit_RBracket ']'>}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:current)
                      op: assign_op.Equal
                      rhs: {<'/'>}
                      spids: [120]
                    )
                  ]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:current)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <Id.VSub_Name current>
                          suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonEquals arg_word:{(DQ <'/'>)})
                        )
                      )
                    }
                  spids: [124]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:current)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ <'/'> 
                        (braced_var_sub
                          token: <Id.VSub_Name current>
                          suffix_op: 
                            (suffix_op.Unary
                              op_id: Id.VOp1_DPound
                              arg_word: {<Id.Lit_Slash '/'>}
                            )
                        )
                      )
                    }
                  spids: [136]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:appendix)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <Id.VSub_Name target>
                          suffix_op: 
                            (suffix_op.Unary
                              op_id: Id.VOp1_DPound
                              arg_word: {<Id.Lit_Slash '/'>}
                            )
                        )
                      )
                    }
                  spids: [147]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:relative)
                  op: assign_op.Equal
                  rhs: {(SQ )}
                  spids: [157]
                )
              ]
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:appendix)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (DQ 
                            (braced_var_sub
                              token: <Id.VSub_Name target>
                              suffix_op: 
                                (suffix_op.Unary
                                  op_id: Id.VOp1_Pound
                                  arg_word: 
                                    {(DQ ($ Id.VSub_DollarName '$current')) <Id.Lit_Slash '/'>}
                                )
                            )
                          )
                        }
                      spids: [164]
                    )
                  ]
                )
                (command.Sentence
                  child: 
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$current'))} 
                          {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(SQ <'/'>)} {<Id.Lit_RBracket ']'>}
                        )
                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$appendix'))} 
                          {<Id.Lit_Equals '='>} {(DQ ($ Id.VSub_DollarName '$target'))} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$current'))} 
                                  {<Id.Lit_Equals '='>} {(DQ ($ Id.VSub_DollarName '$appendix'))} {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:relative)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (braced_var_sub
                                          token: <Id.VSub_Name relative>
                                          suffix_op: 
                                            (suffix_op.Unary
                                              op_id: Id.VTest_ColonHyphen
                                              arg_word: {<.>}
                                            )
                                        )
                                      )
                                    }
                                  spids: [232]
                                )
                              ]
                            )
                            (C {<echo>} 
                              {
                                (DQ 
                                  (braced_var_sub
                                    token: <Id.VSub_Name relative>
                                    suffix_op: 
                                      (suffix_op.Unary
                                        op_id: Id.VOp1_Pound
                                        arg_word: {<Id.Lit_Slash '/'>}
                                      )
                                  )
                                )
                              }
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<0>}
                            )
                          ]
                          spids: [212 229]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:current)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ 
                                (braced_var_sub
                                  token: <Id.VSub_Name current>
                                  suffix_op: 
                                    (suffix_op.Unary
                                      op_id: Id.VOp1_Percent
                                      arg_word: {<Id.Lit_Slash '/'> <'*'>}
                                    )
                                )
                              )
                            }
                          spids: [261]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:relative)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName '$relative') 
                                (braced_var_sub
                                  token: <Id.VSub_Name relative>
                                  suffix_op: 
                                    (suffix_op.Unary
                                      op_id: Id.VTest_ColonPlus
                                      arg_word: {<Id.Lit_Slash '/'>}
                                    )
                                ) <..>
                              )
                            }
                          spids: [272]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:relative)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$relative') 
                        (braced_var_sub
                          token: <Id.VSub_Name relative>
                          suffix_op: 
                            (suffix_op.Unary
                              op_id: Id.VTest_ColonPlus
                              arg_word: 
                                {
                                  (braced_var_sub
                                    token: <Id.VSub_Name appendix>
                                    suffix_op: 
                                      (suffix_op.Unary
                                        op_id: Id.VTest_ColonPlus
                                        arg_word: {<Id.Lit_Slash '/'>}
                                      )
                                  )
                                }
                            )
                        ) 
                        (braced_var_sub
                          token: <Id.VSub_Name appendix>
                          suffix_op: 
                            (suffix_op.Unary
                              op_id: Id.VOp1_Pound
                              arg_word: {<Id.Lit_Slash '/'>}
                            )
                        )
                      )
                    }
                  spids: [287]
                )
              ]
            )
            (C {<echo>} {(DQ ($ Id.VSub_DollarName '$relative'))})
          ]
        )
    )
    (C {<relpath>} {(DQ ($ Id.VSub_At '$@'))})
  ]
)