(CommandList
  children: [
    (FuncDef
      name: version_command
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:cmd)
                  op: Equal
                  rhs: {($ VSub_Number "$1")}
                  spids: [9]
                )
              ]
              spids: [7]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:plugin)
                  op: Equal
                  rhs: {($ VSub_Number "$2")}
                  spids: [15]
                )
              ]
              spids: [13]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other "[")} {(DQ ($ VSub_Pound "$#"))} {(-lt)} {(DQ (3))} 
                          {(Lit_Other "]")}
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ("Usage: asdf ") ($ VSub_Name "$cmd") (" <name> <version>"))})
                    (C {(exit)} {(1)})
                  ]
                  spids: [-1 37]
                )
              ]
              spids: [-1 54]
            )
            (C {(shift)} {(2)})
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:versions)
                  op: Equal
                  rhs: {(ArrayLiteralPart words:[{(DQ ($ VSub_At "$@"))}])}
                  spids: [65]
                )
              ]
              spids: [63]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:file) op:Equal spids:[76])]
              spids: [74]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$cmd"))} {(Lit_Other "=")} {(DQ (global))} 
                          {(Lit_Other "]")}
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:file)
                          op: Equal
                          rhs: {(DQ ($ VSub_Name "$HOME") (/.tool-versions))}
                          spids: [99]
                        )
                      ]
                      spids: [99]
                    )
                  ]
                  spids: [-1 96]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:file)
                      op: Equal
                      rhs: 
                        {
                          (DQ 
                            (CommandSubPart
                              command_list: (CommandList children:[(C {(pwd)})])
                              left_token: <Left_CommandSub "$(">
                              spids: [111 113]
                            ) (/.tool-versions)
                          )
                        }
                      spids: [109]
                    )
                  ]
                  spids: [109]
                )
              ]
              spids: [106 118]
            )
            (C {(check_if_plugin_exists)} {(DQ ($ VSub_Name "$plugin"))})
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:version) op:Equal spids:[132])]
              spids: [130]
            )
            (ForEach
              iter_name: version
              iter_words: [
                {
                  (DQ 
                    (BracedVarSub
                      token: <VSub_Name versions>
                      bracket_op: (WholeArray op_id:Lit_At)
                      spids: [142 147]
                    )
                  )
                }
              ]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (C {(check_if_version_exists)} {(DQ ($ VSub_Name "$plugin"))} 
                      {(DQ ($ VSub_Name "$version"))}
                    )
                  ]
                  spids: [151 165]
                )
              spids: [140 149]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (AndOr
                          children: [
                            (C {(Lit_Other "[")} {(-f)} {(DQ ($ VSub_Name "$file"))} {(Lit_Other "]")})
                            (SimpleCommand
                              words: [
                                {(grep)}
                                {(DQ ($ VSub_Name "$plugin"))}
                                {(DQ ($ VSub_Name "$file"))}
                              ]
                              redirects: [
                                (Redir
                                  op_id: Redir_Great
                                  fd: -1
                                  arg_word: {(/dev/null)}
                                  spids: [193]
                                )
                              ]
                            )
                          ]
                          op_id: Op_DAmp
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (C {(sed)} {(-i)} {(-e)} 
                      {
                        (DQ (s/) ($ VSub_Name "$plugin") (" .*/") ($ VSub_Name "$plugin") (" ") 
                          (BracedVarSub
                            token: <VSub_Name versions>
                            bracket_op: (WholeArray op_id:Arith_Star)
                            spids: [213 218]
                          ) (/)
                        )
                      } {(DQ ($ VSub_Name "$file"))}
                    )
                  ]
                  spids: [-1 198]
                )
              ]
              else_action: [
                (SimpleCommand
                  words: [
                    {(echo)}
                    {
                      (DQ ($ VSub_Name "$plugin") (" ") 
                        (BracedVarSub
                          token: <VSub_Name versions>
                          bracket_op: (WholeArray op_id:Arith_Star)
                          spids: [235 240]
                        )
                      )
                    }
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_DGreat
                      fd: -1
                      arg_word: {(DQ ($ VSub_Name "$file"))}
                      spids: [243]
                    )
                  ]
                )
              ]
              spids: [227 250]
            )
          ]
          spids: [4]
        )
      spids: [0 3]
    )
    (FuncDef
      name: local_command
      body: 
        (BraceGroup
          children: [(C {(version_command)} {(DQ (local))} {($ VSub_At "$@")})]
          spids: [259]
        )
      spids: [255 258]
    )
    (FuncDef
      name: global_command
      body: 
        (BraceGroup
          children: [(C {(version_command)} {(DQ (global))} {($ VSub_At "$@")})]
          spids: [281]
        )
      spids: [277 280]
    )
  ]
)