(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'TOOL_MODE='> name:TOOL_MODE)
          op: assign_op.Equal
          rhs: {<diff>}
          spids: [19]
        )
      ]
      redirects: []
    )
    (C {<.>} {<git-mergetool--lib>})
    (command.ShFunction
      name: should_prompt
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'prompt_merge='> name:prompt_merge)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.AndOr
                            ops: [Id.Op_DPipe]
                            children: [
                              (C {<git>} {<config>} {<--bool>} {<mergetool.prompt>})
                              (C {<echo>} {<true>})
                            ]
                          )
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [41]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'prompt='> name:prompt)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.AndOr
                            ops: [Id.Op_DPipe]
                            children: [
                              (C {<git>} {<config>} {<--bool>} {<difftool.prompt>})
                              (C {<echo>} {($ Id.VSub_DollarName prompt_merge)})
                            ]
                          )
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [59]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<test>} {(DQ ($ Id.VSub_DollarName prompt))} {<Id.Lit_Equals '='>} {<true>})
                      ]
                    )
                  action: [(C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName GIT_DIFFTOOL_NO_PROMPT))})]
                  spids: [77 90]
                )
              ]
              else_action: [(C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName GIT_DIFFTOOL_PROMPT))})]
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: use_ext_cmd
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [(C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName GIT_DIFFTOOL_EXTCMD))})]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: launch_merge_tool
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'MERGED='> name:MERGED)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                  spids: [165]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'LOCAL='> name:LOCAL)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 2))}
                  spids: [171]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'REMOTE='> name:REMOTE)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 3))}
                  spids: [177]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'BASE='> name:BASE)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                  spids: [183]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: (condition.Shell commands:[(C {<should_prompt>})])
                  action: [
                    (C {<printf>} 
                      {
                        (DQ <Id.Lit_BadBackslash '\\'> <'nViewing (%s/%s): \'%s\''> 
                          <Id.Lit_BadBackslash '\\'> <n>
                        )
                      } {(DQ ($ Id.VSub_DollarName GIT_DIFF_PATH_COUNTER))} {(DQ ($ Id.VSub_DollarName GIT_DIFF_PATH_TOTAL))} 
                      {(DQ ($ Id.VSub_DollarName MERGED))}
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: (condition.Shell commands:[(C {<use_ext_cmd>})])
                          action: [
                            (C {<printf>} {(DQ <'Launch \'%s\' [Y/n]? '>)} 
                              {(DQ ($ Id.VSub_DollarName GIT_DIFFTOOL_EXTCMD))}
                            )
                          ]
                          spids: [230 235]
                        )
                      ]
                      else_action: [
                        (C {<printf>} {(DQ <'Launch \'%s\' [Y/n]? '>)} 
                          {(DQ ($ Id.VSub_DollarName merge_tool))}
                        )
                      ]
                      redirects: []
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<read>} {<ans>})
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (C {<test>} {(DQ ($ Id.VSub_DollarName ans))} {<Id.Lit_Equals '='>} {<n>})
                              ]
                            )
                          action: [(command.ControlFlow token:<Id.ControlFlow_Return return>)]
                          spids: [277 290]
                        )
                      ]
                      else_action: []
                      redirects: []
                    )
                  ]
                  spids: [198 203]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: (condition.Shell commands:[(C {<use_ext_cmd>})])
                  action: [
                    (C {<export>} {<BASE>})
                    (C {<eval>} {($ Id.VSub_DollarName GIT_DIFFTOOL_EXTCMD)} {(SQ <'"$LOCAL"'>)} 
                      {(SQ <'"$REMOTE"'>)}
                    )
                  ]
                  spids: [303 308]
                )
              ]
              else_action: [(C {<run_merge_tool>} {(DQ ($ Id.VSub_DollarName merge_tool))})]
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Pipeline
                  children: [(C {<use_ext_cmd>})]
                  negated: T
                  stderr_indices: []
                )
              ]
            )
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [(C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName GIT_DIFF_TOOL))})]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'merge_tool='> name:merge_tool)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName GIT_DIFF_TOOL))}
                          spids: [367]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [353 364]
                )
              ]
              else_action: [
                (command.AndOr
                  ops: [Id.Op_DPipe]
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'merge_tool='> name:merge_tool)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ 
                                (command_sub
                                  left_token: <Id.Left_DollarParen '$('>
                                  child: (C {<get_merge_tool>})
                                  right: <Id.Eof_RParen _>
                                )
                              )
                            }
                          spids: [376]
                        )
                      ]
                      redirects: []
                    )
                    (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
                  ]
                )
              ]
              redirects: []
            )
          ]
          spids: [344 350]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [(C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName GIT_DIFFTOOL_DIRDIFF))})]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'LOCAL='> name:LOCAL)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                  spids: [406]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'REMOTE='> name:REMOTE)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 2))}
                  spids: [412]
                )
              ]
              redirects: []
            )
            (C {<run_merge_tool>} {(DQ ($ Id.VSub_DollarName merge_tool))} {<false>})
          ]
          spids: [393 403]
        )
      ]
      else_action: [
        (command.WhileUntil
          keyword: <Id.KW_While while>
          cond: (condition.Shell commands:[(C {<test>} {($ Id.VSub_Pound '#')} {<-gt>} {<6>})])
          body: 
            (command.DoGroup
              children: [
                (C {<launch_merge_tool>} {(DQ ($ Id.VSub_Number 1))} {(DQ ($ Id.VSub_Number 2))} 
                  {(DQ ($ Id.VSub_Number 5))}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'status='> name:status)
                      op: assign_op.Equal
                      rhs: {($ Id.VSub_QMark '?')}
                      spids: [462]
                    )
                  ]
                  redirects: []
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: 
                        (condition.Shell
                          commands: [(C {<test>} {($ Id.VSub_DollarName status)} {<-ge>} {<126>})]
                        )
                      action: [
                        (command.ControlFlow
                          token: <Id.ControlFlow_Exit exit>
                          arg_word: {($ Id.VSub_DollarName status)}
                        )
                      ]
                      spids: [466 477]
                    )
                  ]
                  else_action: []
                  redirects: []
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.AndOr
                              ops: [Id.Op_DAmp]
                              children: [
                                (C {<test>} {(DQ ($ Id.VSub_DollarName status))} 
                                  {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<0>}
                                )
                                (C {<test>} {(DQ ($ Id.VSub_DollarName GIT_DIFFTOOL_TRUST_EXIT_CODE))} 
                                  {<Id.Lit_Equals '='>} {<true>}
                                )
                              ]
                            )
                          ]
                        )
                      action: [
                        (command.ControlFlow
                          token: <Id.ControlFlow_Exit exit>
                          arg_word: {($ Id.VSub_DollarName status)}
                        )
                      ]
                      spids: [497 524]
                    )
                  ]
                  else_action: []
                  redirects: []
                )
                (C {<shift>} {<7>})
              ]
            )
          redirects: []
        )
      ]
      redirects: []
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
  ]
)