(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:bases)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [22]
        )
        (assign_pair
          lhs: (sh_lhs_expr.Name name:head)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [24]
        )
        (assign_pair
          lhs: (sh_lhs_expr.Name name:remotes)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [26]
        )
        (assign_pair
          lhs: (sh_lhs_expr.Name name:sep_seen)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [28]
        )
      ]
    )
    (command.ForEach
      iter_name: arg
      do_arg_iter: T
      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 name:sep_seen)
                          op: assign_op.Equal
                          rhs: {<yes>}
                          spids: [59]
                        )
                      ]
                    )
                  ]
                  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 name:head)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$arg')}
                          spids: [74]
                        )
                      ]
                    )
                  ]
                  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 name:remotes)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName '$remotes') ($ Id.VSub_DollarName '$arg') <' '>)
                            }
                          spids: [88]
                        )
                      ]
                    )
                  ]
                  spids: [81 85 96 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:bases)
                          op: assign_op.Equal
                          rhs: 
                            {(DQ ($ Id.VSub_DollarName '$bases') ($ Id.VSub_DollarName '$arg') <' '>)}
                          spids: [103]
                        )
                      ]
                    )
                  ]
                  spids: [99 100 111 -1]
                )
              ]
            )
          ]
        )
    )
    (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]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [(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]
        )
      ]
    )
    (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: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:result_tree)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Simple
                                words: [{<git>} {<write-tree>}]
                                redirects: [
                                  (redir.Redir
                                    op: <Id.Redir_Great '2>'>
                                    fd: 2
                                    arg_word: {</dev/null>}
                                  )
                                ]
                              )
                            ]
                          )
                      )
                    }
                  spids: [213]
                )
              ]
            )
          ]
          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: [(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>})]
        )
      ]
    )
  ]
)