(command.CommandList
  children: [
    (C {(Id.Lit_Other ':')} {(included)} {(from)} {(t2016)} {(and)} {(others)})
    (C {(.)} {(./test-lib.sh)})
    (command.ShFunction
      name: set_state
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (command.Simple
                  words: [{(echo)} {(DQ ($ Id.VSub_Number '$3'))}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:32)
                      fd: -1
                      arg_word: {(DQ ($ Id.VSub_Number '$1'))}
                    )
                  ]
                )
                (C {(git)} {(add)} {(DQ ($ Id.VSub_Number '$1'))})
                (command.Simple
                  words: [{(echo)} {(DQ ($ Id.VSub_Number '$2'))}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:58)
                      fd: -1
                      arg_word: {(DQ ($ Id.VSub_Number '$1'))}
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: save_state
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:noslash)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (DQ 
                            (command_sub
                              left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:77)
                              command_list: 
                                (command.CommandList
                                  children: [
                                    (command.Pipeline
                                      children: [
                                        (C {(echo)} {(DQ ($ Id.VSub_Number '$1'))})
                                        (C {(tr)} {(/)} {(_)})
                                      ]
                                      negated: F
                                    )
                                  ]
                                )
                            )
                          )
                        }
                      spids: [75]
                    )
                  ]
                )
                (command.Simple
                  words: [{(cat)} {(DQ ($ Id.VSub_Number '$1'))}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:103)
                      fd: -1
                      arg_word: {(_worktree_) (DQ ($ Id.VSub_DollarName '$noslash'))}
                    )
                  ]
                )
                (command.Simple
                  words: [{(git)} {(show)} {(Id.Lit_Other ':') (DQ ($ Id.VSub_Number '$1'))}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:122)
                      fd: -1
                      arg_word: {(_index_) (DQ ($ Id.VSub_DollarName '$noslash'))}
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: set_and_save_state
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {(set_state)} {(DQ ($ Id.VSub_At '$@'))})
                (C {(save_state)} {(DQ ($ Id.VSub_Number '$1'))})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: verify_state
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {(test)} 
                  {
                    (DQ 
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:169)
                        command_list: 
                          (command.CommandList
                            children: [(C {(cat)} {(DQ ($ Id.VSub_Number '$1'))})]
                          )
                      )
                    )
                  } {(Id.Lit_Equals '=')} {(DQ ($ Id.VSub_Number '$2'))}
                )
                (C {(test)} 
                  {
                    (DQ 
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:190)
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(git)} {(show)} {(Id.Lit_Other ':') (DQ ($ Id.VSub_Number '$1'))})
                            ]
                          )
                      )
                    )
                  } {(Id.Lit_Equals '=')} {(DQ ($ Id.VSub_Number '$3'))}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: verify_saved_state
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:noslash)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (DQ 
                            (command_sub
                              left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:221)
                              command_list: 
                                (command.CommandList
                                  children: [
                                    (command.Pipeline
                                      children: [
                                        (C {(echo)} {(DQ ($ Id.VSub_Number '$1'))})
                                        (C {(tr)} {(/)} {(_)})
                                      ]
                                      negated: F
                                    )
                                  ]
                                )
                            )
                          )
                        }
                      spids: [219]
                    )
                  ]
                )
                (C {(verify_state)} {(DQ ($ Id.VSub_Number '$1'))} 
                  {
                    (DQ 
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:248)
                        command_list: 
                          (command.CommandList
                            children: [(C {(cat)} {(_worktree_) (DQ ($ Id.VSub_DollarName '$noslash'))})]
                          )
                      )
                    )
                  } 
                  {
                    (DQ 
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:259)
                        command_list: 
                          (command.CommandList
                            children: [(C {(cat)} {(_index_) (DQ ($ Id.VSub_DollarName '$noslash'))})]
                          )
                      )
                    )
                  }
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: save_head
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [{(git)} {(rev-parse)} {(HEAD)}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:286)
                  fd: -1
                  arg_word: {(_head)}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: verify_saved_head
      body: 
        (command.BraceGroup
          children: [
            (C {(test)} 
              {
                (DQ 
                  (command_sub
                    left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:304)
                    command_list: (command.CommandList children:[(C {(cat)} {(_head)})])
                  )
                )
              } {(Id.Lit_Equals '=')} 
              {
                (DQ 
                  (command_sub
                    left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:314)
                    command_list: (command.CommandList children:[(C {(git)} {(rev-parse)} {(HEAD)})])
                  )
                )
              }
            )
          ]
        )
    )
  ]
)