(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:TOOL_MODE spids:[19])
          op: Equal
          rhs: {(diff)}
          spids: [19]
        )
      ]
      spids: [19]
    )
    (C {(.)} {(git-mergetool--lib)})
    (command.FuncDef
      name: should_prompt
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:prompt_merge spids:[41])
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.AndOr
                                ops: [Op_DPipe]
                                children: [
                                  (C {(git)} {(config)} {(--bool)} {(mergetool.prompt)})
                                  (C {(echo)} {(true)})
                                ]
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [42 56]
                      )
                    }
                  spids: [41]
                )
              ]
              spids: [41]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:prompt spids:[59])
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.AndOr
                                ops: [Op_DPipe]
                                children: [
                                  (C {(git)} {(config)} {(--bool)} {(difftool.prompt)})
                                  (C {(echo)} {($ VSub_Name '$prompt_merge')})
                                ]
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [60 74]
                      )
                    }
                  spids: [59]
                )
              ]
              spids: [59]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(DQ ($ VSub_Name '$prompt'))} {(Lit_Other '=')} {(true)})]
                  action: [(C {(test)} {(-z)} {(DQ ($ VSub_Name '$GIT_DIFFTOOL_NO_PROMPT'))})]
                  spids: [16777215 90]
                )
              ]
              else_action: [(C {(test)} {(-n)} {(DQ ($ VSub_Name '$GIT_DIFFTOOL_PROMPT'))})]
              spids: [102 114]
            )
          ]
          spids: [38]
        )
      spids: [33 37]
    )
    (command.FuncDef
      name: use_ext_cmd
      body: 
        (command.BraceGroup
          children: [(C {(test)} {(-n)} {(DQ ($ VSub_Name '$GIT_DIFFTOOL_EXTCMD'))})]
          spids: [127]
        )
      spids: [122 126]
    )
    (command.FuncDef
      name: launch_merge_tool
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:MERGED spids:[165])
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [165]
                )
              ]
              spids: [165]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:LOCAL spids:[171])
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$2'))}
                  spids: [171]
                )
              ]
              spids: [171]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:REMOTE spids:[177])
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$3'))}
                  spids: [177]
                )
              ]
              spids: [177]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:BASE spids:[183])
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [183]
                )
              ]
              spids: [183]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(should_prompt)})]
                  action: [
                    (C {(printf)} 
                      {(DQ (Lit_Other '\\') ("nViewing (%s/%s): '%s'") (Lit_Other '\\') (n))} {(DQ ($ VSub_Name '$GIT_DIFF_PATH_COUNTER'))} {(DQ ($ VSub_Name '$GIT_DIFF_PATH_TOTAL'))} 
                      {(DQ ($ VSub_Name '$MERGED'))}
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [(C {(use_ext_cmd)})]
                          action: [
                            (C {(printf)} {(DQ ("Launch '%s' [Y/n]? "))} 
                              {(DQ ($ VSub_Name '$GIT_DIFFTOOL_EXTCMD'))}
                            )
                          ]
                          spids: [16777215 235]
                        )
                      ]
                      else_action: [
                        (C {(printf)} {(DQ ("Launch '%s' [Y/n]? "))} {(DQ ($ VSub_Name '$merge_tool'))})
                      ]
                      spids: [251 265]
                    )
                    (command.AndOr
                      ops: [Op_DPipe]
                      children: [
                        (C {(read)} {(ans)})
                        (command.ControlFlow
                          token: <ControlFlow_Return return>
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [(C {(test)} {(DQ ($ VSub_Name '$ans'))} {(Lit_Other '=')} {(n)})]
                          action: [(command.ControlFlow token:<ControlFlow_Return return>)]
                          spids: [16777215 290]
                        )
                      ]
                      spids: [16777215 296]
                    )
                  ]
                  spids: [16777215 203]
                )
              ]
              spids: [16777215 299]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(use_ext_cmd)})]
                  action: [
                    (C {(export)} {(BASE)})
                    (C {(eval)} {($ VSub_Name '$GIT_DIFFTOOL_EXTCMD')} {(SQ <'"$LOCAL"'>)} 
                      {(SQ <'"$REMOTE"'>)}
                    )
                  ]
                  spids: [16777215 308]
                )
              ]
              else_action: [(C {(run_merge_tool)} {(DQ ($ VSub_Name '$merge_tool'))})]
              spids: [329 339]
            )
          ]
          spids: [146]
        )
      spids: [141 145]
    )
    (command.If
      arms: [
        (if_arm
          cond: [(command.Pipeline children:[(C {(use_ext_cmd)})] negated:T)]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(-n)} {(DQ ($ VSub_Name '$GIT_DIFF_TOOL'))})]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:merge_tool spids:[367])
                          op: Equal
                          rhs: {(DQ ($ VSub_Name '$GIT_DIFF_TOOL'))}
                          spids: [367]
                        )
                      ]
                      spids: [367]
                    )
                  ]
                  spids: [16777215 364]
                )
              ]
              else_action: [
                (command.AndOr
                  ops: [Op_DPipe]
                  children: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:merge_tool spids:[376])
                          op: Equal
                          rhs: 
                            {
                              (DQ 
                                (word_part.CommandSubPart
                                  command_list: 
                                    (command.CommandList
                                      children: [(C {(get_merge_tool)})]
                                    )
                                  left_token: <Left_CommandSub '$('>
                                  spids: [378 380]
                                )
                              )
                            }
                          spids: [376]
                        )
                      ]
                      spids: [376]
                    )
                    (command.ControlFlow token:<ControlFlow_Exit exit>)
                  ]
                )
              ]
              spids: [373 388]
            )
          ]
          spids: [16777215 350]
        )
      ]
      spids: [16777215 390]
    )
    (command.If
      arms: [
        (if_arm
          cond: [(C {(test)} {(-n)} {(DQ ($ VSub_Name '$GIT_DIFFTOOL_DIRDIFF'))})]
          action: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:LOCAL spids:[406])
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [406]
                )
              ]
              spids: [406]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:REMOTE spids:[412])
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$2'))}
                  spids: [412]
                )
              ]
              spids: [412]
            )
            (C {(run_merge_tool)} {(DQ ($ VSub_Name '$merge_tool'))} {(false)})
          ]
          spids: [16777215 403]
        )
      ]
      else_action: [
        (command.WhileUntil
          keyword: <KW_While while>
          cond: [(C {(test)} {($ VSub_Pound '$#')} {(-gt)} {(6)})]
          body: 
            (command.DoGroup
              children: [
                (C {(launch_merge_tool)} {(DQ ($ VSub_Number '$1'))} {(DQ ($ VSub_Number '$2'))} 
                  {(DQ ($ VSub_Number '$5'))}
                )
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:status spids:[462])
                      op: Equal
                      rhs: {($ VSub_QMark '$?')}
                      spids: [462]
                    )
                  ]
                  spids: [462]
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: [(C {(test)} {($ VSub_Name '$status')} {(-ge)} {(126)})]
                      action: [
                        (command.ControlFlow
                          token: <ControlFlow_Exit exit>
                          arg_word: {($ VSub_Name '$status')}
                        )
                      ]
                      spids: [16777215 477]
                    )
                  ]
                  spids: [16777215 493]
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.AndOr
                          ops: [Op_DAmp]
                          children: [
                            (C {(test)} {(DQ ($ VSub_Name '$status'))} {(KW_Bang '!') (Lit_Other '=')} 
                              {(0)}
                            )
                            (C {(test)} {(DQ ($ VSub_Name '$GIT_DIFFTOOL_TRUST_EXIT_CODE'))} 
                              {(Lit_Other '=')} {(true)}
                            )
                          ]
                        )
                      ]
                      action: [
                        (command.ControlFlow
                          token: <ControlFlow_Exit exit>
                          arg_word: {($ VSub_Name '$status')}
                        )
                      ]
                      spids: [16777215 524]
                    )
                  ]
                  spids: [16777215 532]
                )
                (C {(shift)} {(7)})
              ]
              spids: [444 540]
            )
        )
      ]
      spids: [426 542]
    )
    (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})
  ]
)