(command.CommandList
  children: [
    (command.ShFunction
      name: git_rebase__am
      body: 
        (command.BraceGroup
          children: [
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$action'))}
              arms: [
                (case_arm
                  pat_list: [{(Id.ControlFlow_Continue continue)}]
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {(git)} {(am)} {(--resolved)} 
                          {(--resolvemsg) (Id.Lit_Equals '=') (DQ ($ Id.VSub_DollarName '$resolvemsg'))} 
                          {
                            (braced_var_sub
                              token: (Token id:Id.VSub_Name val:gpg_sign_opt span_id:78)
                              suffix_op: 
                                (suffix_op.Unary
                                  op_id: Id.VTest_ColonPlus
                                  arg_word: {(DQ ($ Id.VSub_DollarName '$gpg_sign_opt'))}
                                )
                            )
                          }
                        )
                        (C {(move_to_original_branch)})
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:91)
                    )
                  ]
                  spids: [59 60 94 -1]
                )
                (case_arm
                  pat_list: [{(skip)}]
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {(git)} {(am)} {(--skip)} 
                          {(--resolvemsg) (Id.Lit_Equals '=') (DQ ($ Id.VSub_DollarName '$resolvemsg'))}
                        )
                        (C {(move_to_original_branch)})
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:118)
                    )
                  ]
                  spids: [96 97 121 -1]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(-z)} {(DQ ($ Id.VSub_DollarName '$rebase_root'))})]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:revisions)
                          op: assign_op.Equal
                          rhs: 
                            {($ Id.VSub_DollarName '$upstream') (...) 
                              ($ Id.VSub_DollarName '$orig_head')
                            }
                          spids: [143]
                        )
                      ]
                    )
                  ]
                  spids: [126 140]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:revisions)
                      op: assign_op.Equal
                      rhs: {($ Id.VSub_DollarName '$onto') (...) ($ Id.VSub_DollarName '$orig_head')}
                      spids: [151]
                    )
                  ]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:ret)
                  op: assign_op.Equal
                  rhs: {(0)}
                  spids: [159]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(-n)} {(DQ ($ Id.VSub_DollarName '$keep_empty'))})]
                  action: [
                    (C {(git)} {(cherry-pick)} 
                      {
                        (braced_var_sub
                          token: (Token id:Id.VSub_Name val:gpg_sign_opt span_id:196)
                          suffix_op: 
                            (suffix_op.Unary
                              op_id: Id.VTest_ColonPlus
                              arg_word: {(DQ ($ Id.VSub_DollarName '$gpg_sign_opt'))}
                            )
                        )
                      } {(--allow-empty)} {(--right-only)} {(DQ ($ Id.VSub_DollarName '$revisions'))} 
                      {
                        (braced_var_sub
                          token: (Token id:Id.VSub_Name val:restrict_revision span_id:216)
                          suffix_op: 
                            (suffix_op.Unary
                              op_id: Id.VTest_Plus
                              arg_word: {('^') ($ Id.VSub_DollarName '$restrict_revision')}
                            )
                        )
                      }
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:ret)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_QMark '$?')}
                          spids: [223]
                        )
                      ]
                    )
                  ]
                  spids: [162 172]
                )
              ]
              else_action: [
                (C {(rm)} {(-f)} {(DQ ($ Id.VSub_DollarName '$GIT_DIR') (/rebased-patches))})
                (command.Simple
                  words: [
                    {(git)}
                    {(format-patch)}
                    {(-k)}
                    {(--stdout)}
                    {(--full-index)}
                    {(--cherry-pick)}
                    {(--right-only)}
                    {(--src-prefix) (Id.Lit_Equals '=') (a/)}
                    {(--dst-prefix) (Id.Lit_Equals '=') (b/)}
                    {(--no-renames)}
                    {(--no-cover-letter)}
                    {(DQ ($ Id.VSub_DollarName '$revisions'))}
                    {
                      (braced_var_sub
                        token: (Token id:Id.VSub_Name val:restrict_revision span_id:275)
                        suffix_op: 
                          (suffix_op.Unary
                            op_id: Id.VTest_Plus
                            arg_word: {('^') ($ Id.VSub_DollarName '$restrict_revision')}
                          )
                      )
                    }
                  ]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:283)
                      fd: -1
                      arg_word: {(DQ ($ Id.VSub_DollarName '$GIT_DIR') (/rebased-patches))}
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:ret)
                      op: assign_op.Equal
                      rhs: {($ Id.VSub_QMark '$?')}
                      spids: [290]
                    )
                  ]
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (C {(test)} {(0)} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} 
                          {($ Id.VSub_DollarName '$ret')}
                        )
                      ]
                      action: [
                        (C {(rm)} {(-f)} {(DQ ($ Id.VSub_DollarName '$GIT_DIR') (/rebased-patches))})
                        (command.Case
                          to_match: {(DQ ($ Id.VSub_DollarName '$head_name'))}
                          arms: [
                            (case_arm
                              pat_list: [{(refs/heads/) (Id.Lit_Star '*')}]
                              action: [
                                (C {(git)} {(checkout)} {(-q)} {(DQ ($ Id.VSub_DollarName '$head_name'))})
                              ]
                              spids: [329 331 345 -1]
                            )
                            (case_arm
                              pat_list: [{(Id.Lit_Star '*')}]
                              action: [
                                (C {(git)} {(checkout)} {(-q)} {(DQ ($ Id.VSub_DollarName '$orig_head'))})
                              ]
                              spids: [348 349 363 -1]
                            )
                          ]
                        )
                        (command.Simple
                          words: [{(cat)}]
                          redirects: [
                            (redir.Redir
                              op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:372)
                              fd: -1
                              arg_word: {(2)}
                            )
                            (redir.HereDoc
                              op: (Token id:Id.Redir_DLessDash val:'<<-' span_id:375)
                              fd: -1
                              here_begin: {(EOF)}
                              here_end_span_id: 388
                              stdin_parts: [
                                ('\n')
                                ('git encountered an error while preparing the patches to replay\n')
                                ('these revisions:\n')
                                ('\n')
                                ('    ')
                                ($ Id.VSub_DollarName '$revisions')
                                ('\n')
                                ('\n')
                                ('As a result, git cannot rebase them.\n')
                              ]
                            )
                          ]
                        )
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Return val:return span_id:390)
                          arg_word: {($ Id.VSub_DollarName '$ret')}
                        )
                      ]
                      spids: [295 307]
                    )
                  ]
                )
                (command.Simple
                  words: [
                    {(git)}
                    {(am)}
                    {($ Id.VSub_DollarName '$git_am_opt')}
                    {(--rebasing)}
                    {(--resolvemsg) (Id.Lit_Equals '=') (DQ ($ Id.VSub_DollarName '$resolvemsg'))}
                    {
                      (braced_var_sub
                        token: (Token id:Id.VSub_Name val:gpg_sign_opt span_id:416)
                        suffix_op: 
                          (suffix_op.Unary
                            op_id: Id.VTest_ColonPlus
                            arg_word: {(DQ ($ Id.VSub_DollarName '$gpg_sign_opt'))}
                          )
                      )
                    }
                  ]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Less val:'<' span_id:423)
                      fd: -1
                      arg_word: {(DQ ($ Id.VSub_DollarName '$GIT_DIR') (/rebased-patches))}
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:ret)
                      op: assign_op.Equal
                      rhs: {($ Id.VSub_QMark '$?')}
                      spids: [430]
                    )
                  ]
                )
                (C {(rm)} {(-f)} {(DQ ($ Id.VSub_DollarName '$GIT_DIR') (/rebased-patches))})
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {(test)} {(0)} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} 
                      {($ Id.VSub_DollarName '$ret')}
                    )
                  ]
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {(test)} {(-d)} {(DQ ($ Id.VSub_DollarName '$state_dir'))})
                        (C {(write_basic_state)})
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:474)
                      arg_word: {($ Id.VSub_DollarName '$ret')}
                    )
                  ]
                  spids: [447 458]
                )
              ]
            )
            (C {(move_to_original_branch)})
          ]
        )
    )
    (C {(git_rebase__am)})
  ]
)