(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'bases='> name:bases)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [22]
        )
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'head='> name:head)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [24]
        )
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'remotes='> name:remotes)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [26]
        )
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sep_seen='> name:sep_seen)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [28]
        )
      ]
      redirects: []
    )
    (command.ForEach
      iter_names: [arg]
      iterable: (for_iter.Args)
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: 
                {
                  (DQ <','> ($ Id.VSub_DollarName sep_seen) <','> ($ Id.VSub_DollarName head) <','> 
                    ($ Id.VSub_DollarName arg) <','>
                  )
                }
              arms: [
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'> <Id.Lit_Comma ','> <--> <Id.Lit_Comma ','>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sep_seen='> name:sep_seen)
                          op: assign_op.Equal
                          rhs: {<yes>}
                          spids: [59]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [52 56 63 -1]
                )
                (case_arm
                  pat_list: [
                    {<Id.Lit_Comma ','> <yes> <Id.Lit_Comma ','> <Id.Lit_Comma ','> <Id.Lit_Star '*'>}
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'head='> name:head)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName arg)}
                          spids: [74]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [66 71 78 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Comma ','> <yes> <Id.Lit_Comma ','> <Id.Lit_Star '*'>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'remotes='> name:remotes)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName remotes) ($ Id.VSub_DollarName arg) <' '>)}
                          spids: [88]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [81 85 96 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'bases='> name:bases)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName bases) ($ Id.VSub_DollarName arg) <' '>)}
                          spids: [103]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [99 100 111 -1]
                )
              ]
              redirects: []
            )
          ]
        )
      redirects: []
    )
    (command.Case
      to_match: {(DQ ($ Id.VSub_DollarName remotes))}
      arms: [
        (case_arm
          pat_list: [
            {<Id.Lit_QMark '?'> <Id.Lit_Star '*'> (SQ <' '>) <Id.Lit_QMark '?'> <Id.Lit_Star '*'>}
          ]
          action: [(command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<2>})]
          spids: [130 137 144 -1]
        )
      ]
      redirects: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [(C {<test>} {(SQ )} {<Id.Lit_Equals '='>} {(DQ ($ Id.VSub_DollarName bases))})]
            )
          action: [(command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<2>})]
          spids: [152 165]
        )
      ]
      else_action: []
      redirects: []
    )
    (C {<git>} {<update-index>} {<-q>} {<--refresh>})
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<git>} {<read-tree>} {<-u>} {<-m>} {<--aggressive>} {($ Id.VSub_DollarName bases)} 
          {($ Id.VSub_DollarName head)} {($ Id.VSub_DollarName remotes)}
        )
        (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<2>})
      ]
    )
    (C {<echo>} {(DQ <'Trying simple merge.'>)})
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'result_tree='> name:result_tree)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (command.Simple
                                words: [{<git>} {<write-tree>}]
                                redirects: [
                                  (redir
                                    op: <Id.Redir_Great '2>'>
                                    loc: (redir_loc.Fd fd:2)
                                    arg: {<'/dev/null'>}
                                  )
                                ]
                                more_env: []
                                do_fork: T
                              )
                            right: <Id.Eof_RParen _>
                          )
                        }
                      spids: [213]
                    )
                  ]
                  redirects: []
                )
              ]
            )
          action: [(command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})]
          spids: [211 223]
        )
      ]
      else_action: [
        (C {<echo>} {(DQ <'Simple merge failed, trying Automatic merge.'>)})
        (command.If
          arms: [
            (if_arm
              cond: 
                (condition.Shell
                  commands: [(C {<git-merge-index>} {<-o>} {<git-merge-one-file>} {<-a>})]
                )
              action: [(command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})]
              spids: [240 251]
            )
          ]
          else_action: [(command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})]
          redirects: []
        )
      ]
      redirects: []
    )
  ]
)