(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:USAGE)
          op: assign_op.Equal
          rhs: 
            {
              (SQ 
                <
'[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [-O<orderfile>] [file to merge] ...'
                >
              )
            }
          spids: [31]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SUBDIRECTORY_OK)
          op: assign_op.Equal
          rhs: {<Yes>}
          spids: [36]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:NONGIT_OK)
          op: assign_op.Equal
          rhs: {<Yes>}
          spids: [39]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:OPTIONS_SPEC)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [42]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:TOOL_MODE)
          op: assign_op.Equal
          rhs: {<merge>}
          spids: [44]
        )
      ]
    )
    (C {<.>} {<git-sh-setup>})
    (C {<.>} {<git-mergetool--lib>})
    (command.ShFunction
      name: is_symlink
      body: 
        (command.BraceGroup
          children: [(C {<test>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {<120000>})]
        )
    )
    (command.ShFunction
      name: is_submodule
      body: 
        (command.BraceGroup
          children: [(C {<test>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {<160000>})]
        )
    )
    (command.ShFunction
      name: local_present
      body: 
        (command.BraceGroup
          children: [(C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$local_mode'))})]
        )
    )
    (command.ShFunction
      name: remote_present
      body: 
        (command.BraceGroup
          children: [(C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$remote_mode'))})]
        )
    )
    (command.ShFunction
      name: base_present
      body: 
        (command.BraceGroup
          children: [(C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$base_mode'))})]
        )
    )
    (command.ShFunction
      name: mergetool_tmpdir_init
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {<test>} 
                      {
                        (DQ 
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            command_list: 
                              (command.CommandList
                                children: [(C {<git>} {<config>} {<--bool>} {<mergetool.writeToTemp>})]
                              )
                          )
                        )
                      } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<true>}
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:MERGETOOL_TMPDIR)
                          op: assign_op.Equal
                          rhs: {<.>}
                          spids: [191]
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<0>}
                    )
                  ]
                  spids: [166 188]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:MERGETOOL_TMPDIR)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (command.Simple
                                        words: [{<mktemp>} {<-d>} {<-t>} {(DQ <git-mergetool-XXXXXX>)}]
                                        redirects: [
                                          (redir.Redir
                                            op: <Id.Redir_Great '2>'>
                                            fd: 2
                                            arg_word: {</dev/null>}
                                          )
                                        ]
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [205]
                        )
                      ]
                    )
                  ]
                  action: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})]
                  spids: [203 222]
                )
              ]
            )
            (C {<die>} {(DQ <"error: mktemp is needed when 'mergetool.writeToTemp' is true">)})
          ]
        )
    )
    (command.ShFunction
      name: cleanup_temp_files
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {<test>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {<--save-backup>})
                  ]
                  action: [
                    (C {<rm>} {<-rf>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED') <.orig>)})
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<test>} {<-e>} {(DQ ($ Id.VSub_DollarName '$BACKUP'))})
                        (C {<mv>} {<-->} {(DQ ($ Id.VSub_DollarName '$BACKUP'))} 
                          {(DQ ($ Id.VSub_DollarName '$MERGED') <.orig>)}
                        )
                      ]
                    )
                    (C {<rm>} {<-f>} {<-->} {(DQ ($ Id.VSub_DollarName '$LOCAL'))} 
                      {(DQ ($ Id.VSub_DollarName '$REMOTE'))} {(DQ ($ Id.VSub_DollarName '$BASE'))}
                    )
                  ]
                  spids: [250 263]
                )
              ]
              else_action: [
                (C {<rm>} {<-f>} {<-->} {(DQ ($ Id.VSub_DollarName '$LOCAL'))} 
                  {(DQ ($ Id.VSub_DollarName '$REMOTE'))} {(DQ ($ Id.VSub_DollarName '$BASE'))} {(DQ ($ Id.VSub_DollarName '$BACKUP'))}
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {<test>} {(DQ ($ Id.VSub_DollarName '$MERGETOOL_TMPDIR'))} 
                      {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <.>)}
                    )
                  ]
                  action: [(C {<rmdir>} {(DQ ($ Id.VSub_DollarName '$MERGETOOL_TMPDIR'))})]
                  spids: [350 366]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: describe_file
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:mode)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [389]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:branch)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$2'))}
                  spids: [395]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:file)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$3'))}
                  spids: [401]
                )
              ]
            )
            (C {<printf>} {(DQ <'  {%s}: '>)} {(DQ ($ Id.VSub_DollarName '$branch'))})
            (command.If
              arms: [
                (if_arm
                  cond: [(C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$mode'))})]
                  action: [(C {<echo>} {(DQ <deleted>)})]
                  spids: [419 430]
                )
                (if_arm
                  cond: [(C {<is_symlink>} {(DQ ($ Id.VSub_DollarName '$mode'))})]
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <"a symbolic link -> '"> 
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            command_list: 
                              (command.CommandList
                                children: [(C {<cat>} {(DQ ($ Id.VSub_DollarName '$file'))})]
                              )
                          ) <"'">
                        )
                      }
                    )
                  ]
                  spids: [440 449]
                )
                (if_arm
                  cond: [(C {<is_submodule>} {(DQ ($ Id.VSub_DollarName '$mode'))})]
                  action: [(C {<echo>} {(DQ <'submodule commit '> ($ Id.VSub_DollarName '$file'))})]
                  spids: [467 476]
                )
                (if_arm
                  cond: [(C {<base_present>})]
                  action: [(C {<echo>} {(DQ <'modified file'>)})]
                  spids: [487 492]
                )
              ]
              else_action: [(C {<echo>} {(DQ <'created file'>)})]
            )
          ]
        )
    )
    (command.ShFunction
      name: resolve_symlink_merge
      body: 
        (command.BraceGroup
          children: [
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [(C {<true>})]
              body: 
                (command.DoGroup
                  children: [
                    (C {<printf>} {(DQ <'Use (l)ocal or (r)emote, or (a)bort? '>)})
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<read>} {<ans>})
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                          arg_word: {<1>}
                        )
                      ]
                    )
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName '$ans'))}
                      arms: [
                        (case_arm
                          pat_list: [
                            {<Id.Lit_LBracket '['> <lL> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (C {<git>} {<checkout-index>} {<-f>} {<--stage> <Id.Lit_Equals '='> <2>} 
                              {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                            )
                            (C {<git>} {<add>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))})
                            (C {<cleanup_temp_files>} {<--save-backup>})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<0>}
                            )
                          ]
                          spids: [560 564 605 -1]
                        )
                        (case_arm
                          pat_list: [
                            {<Id.Lit_LBracket '['> <rR> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (C {<git>} {<checkout-index>} {<-f>} {<--stage> <Id.Lit_Equals '='> <3>} 
                              {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                            )
                            (C {<git>} {<add>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))})
                            (C {<cleanup_temp_files>} {<--save-backup>})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<0>}
                            )
                          ]
                          spids: [608 612 653 -1]
                        )
                        (case_arm
                          pat_list: [
                            {<Id.Lit_LBracket '['> <aA> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [656 660 668 -1]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: resolve_deleted_merge
      body: 
        (command.BraceGroup
          children: [
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [(C {<true>})]
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [(C {<base_present>})]
                          action: [
                            (C {<printf>} {(DQ <'Use (m)odified or (d)eleted file, or (a)bort? '>)})
                          ]
                          spids: [695 700]
                        )
                      ]
                      else_action: [
                        (C {<printf>} {(DQ <'Use (c)reated or (d)eleted file, or (a)bort? '>)})
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<read>} {<ans>})
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                          arg_word: {<1>}
                        )
                      ]
                    )
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName '$ans'))}
                      arms: [
                        (case_arm
                          pat_list: [
                            {<Id.Lit_LBracket '['> <mMcC> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (C {<git>} {<add>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))})
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (C {<test>} {(DQ ($ Id.VSub_DollarName '$merge_keep_backup'))} 
                                      {<Id.Lit_Equals '='>} {(DQ <true>)}
                                    )
                                  ]
                                  action: [(C {<cleanup_temp_files>} {<--save-backup>})]
                                  spids: [761 776]
                                )
                              ]
                              else_action: [(C {<cleanup_temp_files>})]
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<0>}
                            )
                          ]
                          spids: [743 747 798 -1]
                        )
                        (case_arm
                          pat_list: [
                            {<Id.Lit_LBracket '['> <dD> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (command.Simple
                              words: [{<git>} {<rm>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))}]
                              redirects: [
                                (redir.Redir
                                  op: <Id.Redir_Great '>'>
                                  fd: -1
                                  arg_word: {</dev/null>}
                                )
                              ]
                            )
                            (C {<cleanup_temp_files>})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<0>}
                            )
                          ]
                          spids: [801 805 831 -1]
                        )
                        (case_arm
                          pat_list: [
                            {<Id.Lit_LBracket '['> <aA> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (C {<test>} {(DQ ($ Id.VSub_DollarName '$merge_keep_temporaries'))} 
                                      {<Id.Lit_Equals '='>} {(DQ <false>)}
                                    )
                                  ]
                                  action: [(C {<cleanup_temp_files>})]
                                  spids: [841 856]
                                )
                              ]
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [834 838 870 -1]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: resolve_submodule_merge
      body: 
        (command.BraceGroup
          children: [
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [(C {<true>})]
              body: 
                (command.DoGroup
                  children: [
                    (C {<printf>} {(DQ <'Use (l)ocal or (r)emote, or (a)bort? '>)})
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<read>} {<ans>})
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                          arg_word: {<1>}
                        )
                      ]
                    )
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName '$ans'))}
                      arms: [
                        (case_arm
                          pat_list: [
                            {<Id.Lit_LBracket '['> <lL> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Pipeline
                                      children: [(C {<local_present>})]
                                      negated: T
                                    )
                                  ]
                                  action: [
                                    (command.If
                                      arms: [
                                        (if_arm
                                          cond: [
                                            (C {<test>} {<-n>} 
                                              {
                                                (DQ 
                                                  (command_sub
                                                    left_token: <Id.Left_DollarParen '$('>
                                                    command_list: 
                                                      (command.CommandList
                                                        children: [
                                                          (C {<git>} {<ls-tree>} {<HEAD>} {<-->} 
                                                            {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                                                          )
                                                        ]
                                                      )
                                                  )
                                                )
                                              }
                                            )
                                          ]
                                          action: [
                                            (command.AndOr
                                              ops: [Id.Op_DPipe]
                                              children: [
                                                (command.Pipeline
                                                  children: [
                                                    (C {<git>} {<ls-tree>} {<--full-name>} {<-r>} {<HEAD>} 
                                                      {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                                                    )
                                                    (C {<git>} {<update-index>} {<--index-info>})
                                                  ]
                                                  negated: F
                                                )
                                                (command.ControlFlow
                                                  token: <Id.ControlFlow_Exit exit>
                                                  arg_word: {($ Id.VSub_QMark '$?')}
                                                )
                                              ]
                                            )
                                          ]
                                          spids: [941 964]
                                        )
                                      ]
                                      else_action: [
                                        (command.AndOr
                                          ops: [Id.Op_DAmp]
                                          children: [
                                            (C {<test>} {<-e>} {(DQ ($ Id.VSub_DollarName '$MERGED'))})
                                            (C {<mv>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))} 
                                              {(DQ ($ Id.VSub_DollarName '$BACKUP'))}
                                            )
                                          ]
                                        )
                                        (C {<git>} {<update-index>} {<--force-remove>} 
                                          {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                                        )
                                        (C {<cleanup_temp_files>} {<--save-backup>})
                                      ]
                                    )
                                  ]
                                  spids: [931 938]
                                )
                                (if_arm
                                  cond: [
                                    (C {<is_submodule>} {(DQ ($ Id.VSub_DollarName '$local_mode'))})
                                  ]
                                  action: [
                                    (C {<stage_submodule>} {(DQ ($ Id.VSub_DollarName '$MERGED'))} 
                                      {(DQ ($ Id.VSub_DollarName '$local_sha1'))}
                                    )
                                  ]
                                  spids: [1048 1057]
                                )
                              ]
                              else_action: [
                                (C {<git>} {<checkout-index>} {<-f>} {<--stage> <Id.Lit_Equals '='> <2>} 
                                  {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                                )
                                (C {<git>} {<add>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))})
                              ]
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<0>}
                            )
                          ]
                          spids: [924 928 1110 -1]
                        )
                        (case_arm
                          pat_list: [
                            {<Id.Lit_LBracket '['> <rR> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Pipeline
                                      children: [(C {<remote_present>})]
                                      negated: T
                                    )
                                  ]
                                  action: [
                                    (command.If
                                      arms: [
                                        (if_arm
                                          cond: [
                                            (C {<test>} {<-n>} 
                                              {
                                                (DQ 
                                                  (command_sub
                                                    left_token: <Id.Left_DollarParen '$('>
                                                    command_list: 
                                                      (command.CommandList
                                                        children: [
                                                          (C {<git>} {<ls-tree>} {<MERGE_HEAD>} {<-->} 
                                                            {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                                                          )
                                                        ]
                                                      )
                                                  )
                                                )
                                              }
                                            )
                                          ]
                                          action: [
                                            (command.AndOr
                                              ops: [Id.Op_DPipe]
                                              children: [
                                                (command.Pipeline
                                                  children: [
                                                    (C {<git>} {<ls-tree>} {<--full-name>} {<-r>} 
                                                      {<MERGE_HEAD>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                                                    )
                                                    (C {<git>} {<update-index>} {<--index-info>})
                                                  ]
                                                  negated: F
                                                )
                                                (command.ControlFlow
                                                  token: <Id.ControlFlow_Exit exit>
                                                  arg_word: {($ Id.VSub_QMark '$?')}
                                                )
                                              ]
                                            )
                                          ]
                                          spids: [1130 1153]
                                        )
                                      ]
                                      else_action: [
                                        (command.AndOr
                                          ops: [Id.Op_DAmp]
                                          children: [
                                            (C {<test>} {<-e>} {(DQ ($ Id.VSub_DollarName '$MERGED'))})
                                            (C {<mv>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))} 
                                              {(DQ ($ Id.VSub_DollarName '$BACKUP'))}
                                            )
                                          ]
                                        )
                                        (C {<git>} {<update-index>} {<--force-remove>} 
                                          {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [1120 1127]
                                )
                                (if_arm
                                  cond: [
                                    (C {<is_submodule>} {(DQ ($ Id.VSub_DollarName '$remote_mode'))})
                                  ]
                                  action: [
                                    (command.AndOr
                                      ops: [Id.Op_DAmp Id.Op_DAmp]
                                      children: [
                                        (command.Pipeline
                                          children: [
                                            (C {<is_submodule>} 
                                              {(DQ ($ Id.VSub_DollarName '$local_mode'))}
                                            )
                                          ]
                                          negated: T
                                        )
                                        (C {<test>} {<-e>} {(DQ ($ Id.VSub_DollarName '$MERGED'))})
                                        (C {<mv>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))} 
                                          {(DQ ($ Id.VSub_DollarName '$BACKUP'))}
                                        )
                                      ]
                                    )
                                    (C {<stage_submodule>} {(DQ ($ Id.VSub_DollarName '$MERGED'))} 
                                      {(DQ ($ Id.VSub_DollarName '$remote_sha1'))}
                                    )
                                  ]
                                  spids: [1232 1241]
                                )
                              ]
                              else_action: [
                                (command.AndOr
                                  ops: [Id.Op_DAmp]
                                  children: [
                                    (C {<test>} {<-e>} {(DQ ($ Id.VSub_DollarName '$MERGED'))})
                                    (C {<mv>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))} 
                                      {(DQ ($ Id.VSub_DollarName '$BACKUP'))}
                                    )
                                  ]
                                )
                                (C {<git>} {<checkout-index>} {<-f>} {<--stage> <Id.Lit_Equals '='> <3>} 
                                  {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                                )
                                (C {<git>} {<add>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))})
                              ]
                            )
                            (C {<cleanup_temp_files>} {<--save-backup>})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<0>}
                            )
                          ]
                          spids: [1113 1117 1357 -1]
                        )
                        (case_arm
                          pat_list: [
                            {<Id.Lit_LBracket '['> <aA> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [1360 1364 1372 -1]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: stage_submodule
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:path)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [1391]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:submodule_sha1)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$2'))}
                  spids: [1397]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<mkdir>} {<-p>} {(DQ ($ Id.VSub_DollarName '$path'))})
                (C {<die>} 
                  {
                    (DQ <'fatal: unable to create directory for module at '> 
                      ($ Id.VSub_DollarName '$path')
                    )
                  }
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:work_tree_root)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.AndOr
                                ops: [Id.Op_DAmp]
                                children: [(C {<cd_to_toplevel>}) (C {<pwd>})]
                              )
                            ]
                          )
                      )
                    }
                  spids: [1426]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:work_rel_path)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.AndOr
                                ops: [Id.Op_DAmp]
                                children: [
                                  (C {<cd>} {(DQ ($ Id.VSub_DollarName '$path'))})
                                  (command.Simple
                                    words: [{<git>} {<rev-parse>} {<--show-prefix>}]
                                    more_env: [
                                      (env_pair
                                        name: GIT_WORK_TREE
                                        val: {(DQ (${ Id.VSub_Name work_tree_root))}
                                        spids: [1447]
                                      )
                                    ]
                                  )
                                ]
                              )
                            ]
                          )
                      )
                    }
                  spids: [1436]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$work_rel_path'))})
                (C {<die>} 
                  {
                    (DQ <'fatal: unable to get path of module '> ($ Id.VSub_DollarName '$path') 
                      <' relative to work tree'>
                    )
                  }
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<git>} {<update-index>} {<--add>} {<--replace>} {<--cacheinfo>} {<160000>} 
                  {(DQ ($ Id.VSub_DollarName '$submodule_sha1'))} 
                  {
                    (DQ 
                      (braced_var_sub
                        token: <Id.VSub_Name work_rel_path>
                        suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{<Id.Lit_Slash />})
                      )
                    )
                  }
                )
                (C {<die>})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: checkout_staged_file
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:tmpfile)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {<expr>} 
                                {
                                  (DQ 
                                    (command_sub
                                      left_token: <Id.Left_DollarParen '$('>
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (command.Simple
                                              words: [
                                                {<git>}
                                                {<checkout-index>}
                                                {<--temp>}
                                                {<--stage> <Id.Lit_Equals '='> 
                                                  (DQ ($ Id.VSub_Number '$1'))
                                                }
                                                {(DQ ($ Id.VSub_Number '$2'))}
                                              ]
                                              redirects: [
                                                (redir.Redir
                                                  op: <Id.Redir_Great '2>'>
                                                  fd: 2
                                                  arg_word: {</dev/null>}
                                                )
                                              ]
                                            )
                                          ]
                                        )
                                    )
                                  )
                                } {<Id.Lit_Other ':'>} {(SQ <'\\([^\t]*\\)\t'>)}
                              )
                            ]
                          )
                      )
                    }
                  spids: [1523]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<test>} {($ Id.VSub_QMark '$?')} {<-eq>} {<0>})
                        (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$tmpfile'))})
                      ]
                    )
                  ]
                  action: [
                    (C {<mv>} {<-->} 
                      {
                        (DQ 
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            command_list: 
                              (command.CommandList
                                children: [(C {<git>} {<rev-parse>} {<--show-cdup>})]
                              )
                          ) ($ Id.VSub_DollarName '$tmpfile')
                        )
                      } {(DQ ($ Id.VSub_Number '$3'))}
                    )
                  ]
                  spids: [1563 1584]
                )
              ]
              else_action: [
                (command.Simple
                  redirects: [
                    (redir.Redir
                      op: <Id.Redir_Great '>'>
                      fd: -1
                      arg_word: {(DQ ($ Id.VSub_Number '$3'))}
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: merge_file
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:MERGED)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [1629]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:f)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {<git>} {<ls-files>} {<-u>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))})
                            ]
                          )
                      )
                    }
                  spids: [1636]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$f'))})]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (C {<test>} {<Id.KW_Bang '!'>} {<-f>} {(DQ ($ Id.VSub_DollarName '$MERGED'))})
                          ]
                          action: [
                            (C {<echo>} {(DQ ($ Id.VSub_DollarName '$MERGED') <': file not found'>)})
                          ]
                          spids: [1666 1679]
                        )
                      ]
                      else_action: [
                        (C {<echo>} 
                          {(DQ ($ Id.VSub_DollarName '$MERGED') <': file does not need merging'>)}
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [1652 1663]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:BASE)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {<expr>} {(DQ ($ Id.VSub_DollarName '$MERGED'))} 
                                        {<Id.Lit_Other ':'>} {(SQ <'\\(.*\\)\\.[^/]*$'>)}
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [1715]
                        )
                      ]
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:ext)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {<expr>} {(DQ ($ Id.VSub_DollarName '$MERGED'))} 
                                        {<Id.Lit_Other ':'>} {(SQ <'.*\\(\\.[^/]*\\)$'>)}
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [1734]
                        )
                      ]
                    )
                  ]
                  spids: [1713 1731]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:BASE)
                      op: assign_op.Equal
                      rhs: {($ Id.VSub_DollarName '$MERGED')}
                      spids: [1753]
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:ext)
                      op: assign_op.Equal
                      rhs: (word.Empty)
                      spids: [1757]
                    )
                  ]
                )
              ]
            )
            (C {<mergetool_tmpdir_init>})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {<test>} {(DQ ($ Id.VSub_DollarName '$MERGETOOL_TMPDIR'))} 
                      {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <.>)}
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:BASE)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name BASE>
                                suffix_op: 
                                  (suffix_op.Unary
                                    op_id: Id.VOp1_DPound
                                    arg_word: {<'*'> <Id.Lit_Slash />}
                                  )
                              )
                            }
                          spids: [1795]
                        )
                      ]
                    )
                  ]
                  spids: [1768 1784]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:BACKUP)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$MERGETOOL_TMPDIR') </> (${ Id.VSub_Name BASE) 
                        <_BACKUP_> ($ Id.VSub_Dollar '$$') ($ Id.VSub_DollarName '$ext')
                      )
                    }
                  spids: [1808]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:LOCAL)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$MERGETOOL_TMPDIR') </> (${ Id.VSub_Name BASE) 
                        <_LOCAL_> ($ Id.VSub_Dollar '$$') ($ Id.VSub_DollarName '$ext')
                      )
                    }
                  spids: [1821]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:REMOTE)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$MERGETOOL_TMPDIR') </> (${ Id.VSub_Name BASE) 
                        <_REMOTE_> ($ Id.VSub_Dollar '$$') ($ Id.VSub_DollarName '$ext')
                      )
                    }
                  spids: [1834]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:BASE)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$MERGETOOL_TMPDIR') </> (${ Id.VSub_Name BASE) <_BASE_> 
                        ($ Id.VSub_Dollar '$$') ($ Id.VSub_DollarName '$ext')
                      )
                    }
                  spids: [1847]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:base_mode)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {<git>} {<ls-files>} {<-u>} {<-->} 
                                    {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                                  )
                                  (C {<awk>} {(SQ <'{if ($3==1) print $1;}'>)})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                  spids: [1861]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:local_mode)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {<git>} {<ls-files>} {<-u>} {<-->} 
                                    {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                                  )
                                  (C {<awk>} {(SQ <'{if ($3==2) print $1;}'>)})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                  spids: [1885]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:remote_mode)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {<git>} {<ls-files>} {<-u>} {<-->} 
                                    {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                                  )
                                  (C {<awk>} {(SQ <'{if ($3==3) print $1;}'>)})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                  spids: [1909]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<is_submodule>} {(DQ ($ Id.VSub_DollarName '$local_mode'))})
                        (C {<is_submodule>} {(DQ ($ Id.VSub_DollarName '$remote_mode'))})
                      ]
                    )
                  ]
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <"Submodule merge conflict for '"> ($ Id.VSub_DollarName '$MERGED') <"':">)
                      }
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:local_sha1)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (command.Pipeline
                                        children: [
                                          (C {<git>} {<ls-files>} {<-u>} {<-->} 
                                            {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                                          )
                                          (C {<awk>} {(SQ <'{if ($3==2) print $2;}'>)})
                                        ]
                                        negated: F
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [1963]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:remote_sha1)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (command.Pipeline
                                        children: [
                                          (C {<git>} {<ls-files>} {<-u>} {<-->} 
                                            {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                                          )
                                          (C {<awk>} {(SQ <'{if ($3==3) print $2;}'>)})
                                        ]
                                        negated: F
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [1987]
                        )
                      ]
                    )
                    (C {<describe_file>} {(DQ ($ Id.VSub_DollarName '$local_mode'))} {(DQ <local>)} 
                      {(DQ ($ Id.VSub_DollarName '$local_sha1'))}
                    )
                    (C {<describe_file>} {(DQ ($ Id.VSub_DollarName '$remote_mode'))} {(DQ <remote>)} 
                      {(DQ ($ Id.VSub_DollarName '$remote_sha1'))}
                    )
                    (C {<resolve_submodule_merge>})
                    (command.ControlFlow token:<Id.ControlFlow_Return return>)
                  ]
                  spids: [1934 1951]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {<test>} {<-f>} {(DQ ($ Id.VSub_DollarName '$MERGED'))})]
                  action: [
                    (C {<mv>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))} 
                      {(DQ ($ Id.VSub_DollarName '$BACKUP'))}
                    )
                    (C {<cp>} {<-->} {(DQ ($ Id.VSub_DollarName '$BACKUP'))} 
                      {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                    )
                  ]
                  spids: [2051 2062]
                )
              ]
            )
            (C {<mkdir>} {<-p>} 
              {
                (DQ 
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    command_list: 
                      (command.CommandList
                        children: [(C {<dirname>} {(DQ ($ Id.VSub_DollarName '$MERGED'))})]
                      )
                  )
                )
              }
            )
            (C {<checkout_staged_file>} {<1>} {(DQ ($ Id.VSub_DollarName '$MERGED'))} 
              {(DQ ($ Id.VSub_DollarName '$BASE'))}
            )
            (C {<checkout_staged_file>} {<2>} {(DQ ($ Id.VSub_DollarName '$MERGED'))} 
              {(DQ ($ Id.VSub_DollarName '$LOCAL'))}
            )
            (C {<checkout_staged_file>} {<3>} {(DQ ($ Id.VSub_DollarName '$MERGED'))} 
              {(DQ ($ Id.VSub_DollarName '$REMOTE'))}
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$local_mode'))})
                        (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$remote_mode'))})
                      ]
                    )
                  ]
                  action: [
                    (C {<echo>} 
                      {(DQ <"Deleted merge conflict for '"> ($ Id.VSub_DollarName '$MERGED') <"':">)}
                    )
                    (C {<describe_file>} {(DQ ($ Id.VSub_DollarName '$local_mode'))} {(DQ <local>)} 
                      {(DQ ($ Id.VSub_DollarName '$LOCAL'))}
                    )
                    (C {<describe_file>} {(DQ ($ Id.VSub_DollarName '$remote_mode'))} {(DQ <remote>)} 
                      {(DQ ($ Id.VSub_DollarName '$REMOTE'))}
                    )
                    (C {<resolve_deleted_merge>})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:status)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_QMark '$?')}
                          spids: [2224]
                        )
                      ]
                    )
                    (command.Simple
                      words: [
                        {<rmdir>}
                        {<-p>}
                        {
                          (DQ 
                            (command_sub
                              left_token: <Id.Left_DollarParen '$('>
                              command_list: 
                                (command.CommandList
                                  children: [(C {<dirname>} {(DQ ($ Id.VSub_DollarName '$MERGED'))})]
                                )
                            )
                          )
                        }
                      ]
                      redirects: [(redir.Redir op:<Id.Redir_Great '2>'> fd:2 arg_word:{</dev/null>})]
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {($ Id.VSub_DollarName '$status')}
                    )
                  ]
                  spids: [2158 2179]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<is_symlink>} {(DQ ($ Id.VSub_DollarName '$local_mode'))})
                        (C {<is_symlink>} {(DQ ($ Id.VSub_DollarName '$remote_mode'))})
                      ]
                    )
                  ]
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <"Symbolic link merge conflict for '"> ($ Id.VSub_DollarName '$MERGED') 
                          <"':">
                        )
                      }
                    )
                    (C {<describe_file>} {(DQ ($ Id.VSub_DollarName '$local_mode'))} {(DQ <local>)} 
                      {(DQ ($ Id.VSub_DollarName '$LOCAL'))}
                    )
                    (C {<describe_file>} {(DQ ($ Id.VSub_DollarName '$remote_mode'))} {(DQ <remote>)} 
                      {(DQ ($ Id.VSub_DollarName '$REMOTE'))}
                    )
                    (C {<resolve_symlink_merge>})
                    (command.ControlFlow token:<Id.ControlFlow_Return return>)
                  ]
                  spids: [2255 2272]
                )
              ]
            )
            (C {<echo>} {(DQ <"Normal merge conflict for '"> ($ Id.VSub_DollarName '$MERGED') <"':">)})
            (C {<describe_file>} {(DQ ($ Id.VSub_DollarName '$local_mode'))} {(DQ <local>)} 
              {(DQ ($ Id.VSub_DollarName '$LOCAL'))}
            )
            (C {<describe_file>} {(DQ ($ Id.VSub_DollarName '$remote_mode'))} {(DQ <remote>)} 
              {(DQ ($ Id.VSub_DollarName '$REMOTE'))}
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<test>} {(DQ ($ Id.VSub_DollarName '$guessed_merge_tool'))} 
                          {<Id.Lit_Equals '='>} {<true>}
                        )
                        (C {<test>} {(DQ ($ Id.VSub_DollarName '$prompt'))} {<Id.Lit_Equals '='>} 
                          {<true>}
                        )
                      ]
                    )
                  ]
                  action: [
                    (C {<printf>} {(DQ <'Hit return to start merge resolution tool (%s): '>)} 
                      {(DQ ($ Id.VSub_DollarName '$merge_tool'))}
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<read>} {<ans>})
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                          arg_word: {<1>}
                        )
                      ]
                    )
                  ]
                  spids: [2363 2388]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {<base_present>})]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:present)
                          op: assign_op.Equal
                          rhs: {<true>}
                          spids: [2425]
                        )
                      ]
                    )
                  ]
                  spids: [2417 2422]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:present)
                      op: assign_op.Equal
                      rhs: {<false>}
                      spids: [2432]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Pipeline
                      children: [
                        (C {<run_merge_tool>} {(DQ ($ Id.VSub_DollarName '$merge_tool'))} 
                          {(DQ ($ Id.VSub_DollarName '$present'))}
                        )
                      ]
                      negated: T
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [{<echo>} {(DQ <'merge of '> ($ Id.VSub_DollarName '$MERGED') <' failed'>)}]
                      redirects: [(redir.Redir op:<Id.Redir_GreatAnd '1>&'> fd:1 arg_word:{<2>})]
                    )
                    (C {<mv>} {<-->} {(DQ ($ Id.VSub_DollarName '$BACKUP'))} 
                      {(DQ ($ Id.VSub_DollarName '$MERGED'))}
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (C {<test>} {(DQ ($ Id.VSub_DollarName '$merge_keep_temporaries'))} 
                              {<Id.Lit_Equals '='>} {(DQ <false>)}
                            )
                          ]
                          action: [(C {<cleanup_temp_files>})]
                          spids: [2484 2499]
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [2440 2455]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {<test>} {(DQ ($ Id.VSub_DollarName '$merge_keep_backup'))} {<Id.Lit_Equals '='>} 
                      {(DQ <true>)}
                    )
                  ]
                  action: [
                    (C {<mv>} {<-->} {(DQ ($ Id.VSub_DollarName '$BACKUP'))} 
                      {(DQ ($ Id.VSub_DollarName '$MERGED') <.orig>)}
                    )
                  ]
                  spids: [2518 2533]
                )
              ]
              else_action: [(C {<rm>} {<-->} {(DQ ($ Id.VSub_DollarName '$BACKUP'))})]
            )
            (C {<git>} {<add>} {<-->} {(DQ ($ Id.VSub_DollarName '$MERGED'))})
            (C {<cleanup_temp_files>})
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
        )
    )
    (command.ShFunction
      name: prompt_after_failed_merge
      body: 
        (command.BraceGroup
          children: [
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [(C {<true>})]
              body: 
                (command.DoGroup
                  children: [
                    (C {<printf>} {(DQ <'Continue merging other unresolved paths [y/n]? '>)})
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<read>} {<ans>})
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                          arg_word: {<1>}
                        )
                      ]
                    )
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName '$ans'))}
                      arms: [
                        (case_arm
                          pat_list: [
                            {<Id.Lit_LBracket '['> <yY> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<0>}
                            )
                          ]
                          spids: [2630 2634 2642 -1]
                        )
                        (case_arm
                          pat_list: [
                            {<Id.Lit_LBracket '['> <nN> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [2645 2649 2657 -1]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: print_noop_and_exit
      body: 
        (command.BraceGroup
          children: [
            (C {<echo>} {(DQ <'No files need merging'>)})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
          ]
        )
    )
    (command.ShFunction
      name: main
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:prompt)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [(C {<git>} {<config>} {<--bool>} {<mergetool.prompt>})]
                          )
                      )
                    }
                  spids: [2698]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:guessed_merge_tool)
                  op: assign_op.Equal
                  rhs: {<false>}
                  spids: [2710]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:orderfile)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [2714]
                )
              ]
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [(C {<test>} {($ Id.VSub_Pound '$#')} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<0>})]
              body: 
                (command.DoGroup
                  children: [
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_Number '$1'))}
                      arms: [
                        (case_arm
                          pat_list: [{<--tool-help> <Id.Lit_Equals '='> <Id.Lit_Star '*'>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:TOOL_MODE)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: <Id.VSub_Number 1>
                                        suffix_op: 
                                          (suffix_op.Unary
                                            op_id: Id.VOp1_Pound
                                            arg_word: {<'--tool-help='>}
                                          )
                                      )
                                    }
                                  spids: [2748]
                                )
                              ]
                            )
                            (C {<show_tool_help>})
                          ]
                          spids: [2742 2745 2759 -1]
                        )
                        (case_arm
                          pat_list: [{<--tool-help>}]
                          action: [(C {<show_tool_help>})]
                          spids: [2762 2763 2769 -1]
                        )
                        (case_arm
                          pat_list: [{<-t>} {<--tool> <Id.Lit_Star '*'>}]
                          action: [
                            (command.Case
                              to_match: {(DQ ($ Id.VSub_Pound '$#') <','> ($ Id.VSub_Number '$1'))}
                              arms: [
                                (case_arm
                                  pat_list: [
                                    {<Id.Lit_Star '*'> <Id.Lit_Comma ','> <Id.Lit_Star '*'> 
                                      <Id.Lit_Equals '='> <Id.Lit_Star '*'>
                                    }
                                  ]
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:merge_tool)
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (command_sub
                                                left_token: <Id.Left_DollarParen '$('>
                                                command_list: 
                                                  (command.CommandList
                                                    children: [
                                                      (C {<expr>} {(DQ <z> ($ Id.VSub_Number '$1'))} 
                                                        {<Id.Lit_Other ':'>} {(SQ <'z-[^=]*=\\(.*\\)'>)}
                                                      )
                                                    ]
                                                  )
                                              )
                                            }
                                          spids: [2798]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [2790 2795 2815 -1]
                                )
                                (case_arm
                                  pat_list: [{<1> <Id.Lit_Comma ','> <Id.Lit_Star '*'>}]
                                  action: [(C {<usage>})]
                                  spids: [2818 2821 2826 -1]
                                )
                                (case_arm
                                  pat_list: [{<Id.Lit_Star '*'>}]
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:merge_tool)
                                          op: assign_op.Equal
                                          rhs: {(DQ ($ Id.VSub_Number '$2'))}
                                          spids: [2833]
                                        )
                                      ]
                                    )
                                    (C {<shift>})
                                  ]
                                  spids: [2829 2830 2841 -1]
                                )
                              ]
                            )
                          ]
                          spids: [2772 2776 2847 -1]
                        )
                        (case_arm
                          pat_list: [{<-y>} {<--no-prompt>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:prompt)
                                  op: assign_op.Equal
                                  rhs: {<false>}
                                  spids: [2856]
                                )
                              ]
                            )
                          ]
                          spids: [2850 2853 2860 -1]
                        )
                        (case_arm
                          pat_list: [{<--prompt>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:prompt)
                                  op: assign_op.Equal
                                  rhs: {<true>}
                                  spids: [2867]
                                )
                              ]
                            )
                          ]
                          spids: [2863 2864 2871 -1]
                        )
                        (case_arm
                          pat_list: [{<-O> <Id.Lit_Star '*'>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:orderfile)
                                  op: assign_op.Equal
                                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                                  spids: [2879]
                                )
                              ]
                            )
                          ]
                          spids: [2874 2876 2885 -1]
                        )
                        (case_arm
                          pat_list: [{<-->}]
                          action: [
                            (C {<shift>})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Break break>
                            )
                          ]
                          spids: [2888 2889 2898 -1]
                        )
                        (case_arm
                          pat_list: [{<-> <Id.Lit_Star '*'>}]
                          action: [(C {<usage>})]
                          spids: [2901 2903 2909 -1]
                        )
                        (case_arm
                          pat_list: [{<Id.Lit_Star '*'>}]
                          action: [(command.ControlFlow token:<Id.ControlFlow_Break break>)]
                          spids: [2912 2913 2919 -1]
                        )
                      ]
                    )
                    (C {<shift>})
                  ]
                )
            )
            (C {<git_dir_init>})
            (C {<require_work_tree>})
            (command.If
              arms: [
                (if_arm
                  cond: [(C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$merge_tool'))})]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:merge_tool)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                command_list: 
                                  (command.CommandList
                                    children: [(C {<get_configured_merge_tool>})]
                                  )
                              )
                            }
                          spids: [2957]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [(C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$merge_tool'))})]
                          action: [
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:merge_tool)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (command_sub
                                            left_token: <Id.Left_DollarParen '$('>
                                            command_list: 
                                              (command.CommandList
                                                children: [(C {<guess_merge_tool>})]
                                              )
                                          )
                                        }
                                      spids: [2981]
                                    )
                                  ]
                                )
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Exit exit>
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:guessed_merge_tool)
                                  op: assign_op.Equal
                                  rhs: {<true>}
                                  spids: [2991]
                                )
                              ]
                            )
                          ]
                          spids: [2967 2978]
                        )
                      ]
                    )
                  ]
                  spids: [2939 2950]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:merge_keep_backup)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          command_list: 
                            (command.CommandList
                              children: [
                                (command.AndOr
                                  ops: [Id.Op_DPipe]
                                  children: [
                                    (C {<git>} {<config>} {<--bool>} {<mergetool.keepBackup>})
                                    (C {<echo>} {<true>})
                                  ]
                                )
                              ]
                            )
                        )
                      )
                    }
                  spids: [3001]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:merge_keep_temporaries)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          command_list: 
                            (command.CommandList
                              children: [
                                (command.AndOr
                                  ops: [Id.Op_DPipe]
                                  children: [
                                    (C {<git>} {<config>} {<--bool>} {<mergetool.keepTemporaries>})
                                    (C {<echo>} {<false>})
                                  ]
                                )
                              ]
                            )
                        )
                      )
                    }
                  spids: [3021]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<test>} {($ Id.VSub_Pound '$#')} {<-eq>} {<0>})
                        (C {<test>} {<-e>} {(DQ ($ Id.VSub_DollarName '$GIT_DIR') </MERGE_RR>)})
                      ]
                    )
                  ]
                  action: [
                    (C {<Id.KW_Set set>} {<-->} 
                      {
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          command_list: 
                            (command.CommandList
                              children: [(C {<git>} {<rerere>} {<remaining>})]
                            )
                        )
                      }
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [(C {<test>} {($ Id.VSub_Pound '$#')} {<-eq>} {<0>})]
                          action: [(C {<print_noop_and_exit>})]
                          spids: [3080 3091]
                        )
                      ]
                    )
                  ]
                  spids: [3042 3064]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:files)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {<git>} {<-c>} {<core.quotePath> <Id.Lit_Equals '='> <false>} {<diff>} 
                                {<--name-only>} {<--diff-filter> <Id.Lit_Equals '='> <U>} 
                                {
                                  (braced_var_sub
                                    token: <Id.VSub_Name orderfile>
                                    suffix_op: 
                                      (suffix_op.Unary
                                        op_id: Id.VTest_ColonPlus
                                        arg_word: {(DQ ($ Id.VSub_DollarName '$orderfile'))}
                                      )
                                  )
                                } {<-->} {(DQ ($ Id.VSub_At '$@'))}
                              )
                            ]
                          )
                      )
                    }
                  spids: [3104]
                )
              ]
            )
            (C {<cd_to_toplevel>})
            (command.If
              arms: [
                (if_arm
                  cond: [(C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$files'))})]
                  action: [(C {<print_noop_and_exit>})]
                  spids: [3147 3158]
                )
              ]
            )
            (C {<printf>} {(DQ <'Merging:'> <Id.Lit_Other '\\'> <n>)})
            (C {<printf>} {(DQ <'%s'> <Id.Lit_Other '\\'> <n>)} {(DQ ($ Id.VSub_DollarName '$files'))})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:rc)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [3191]
                )
              ]
            )
            (command.ForEach
              iter_name: i
              iter_words: [{($ Id.VSub_DollarName '$files')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {<printf>} {(DQ <Id.Lit_Other '\\'> <n>)})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Pipeline
                              children: [(C {<merge_file>} {(DQ ($ Id.VSub_DollarName '$i'))})]
                              negated: T
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:rc)
                                  op: assign_op.Equal
                                  rhs: {<1>}
                                  spids: [3229]
                                )
                              ]
                            )
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (C {<prompt_after_failed_merge>})
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Exit exit>
                                  arg_word: {<1>}
                                )
                              ]
                            )
                          ]
                          spids: [3215 3226]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.ControlFlow
              token: <Id.ControlFlow_Exit exit>
              arg_word: {($ Id.VSub_DollarName '$rc')}
            )
          ]
        )
    )
    (C {<main>} {(DQ ($ Id.VSub_At '$@'))})
  ]
)