(command.CommandList
  children: [
    (C {<Id.Lit_Colon ':'>} 
      {
        (braced_var_sub
          token: <Id.VSub_Name MERGE_TOOLS_DIR>
          suffix_op: 
            (suffix_op.Unary
              tok: <Id.VTest_Equals '='>
              arg_word: 
                {(command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<git>} {<--exec-path>})) 
                  <Id.Lit_Slash '/'> <mergetools>
                }
            )
        )
      }
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:IFS)
          op: assign_op.Equal
          rhs: {(SQ <'\n'>)}
          spids: [19]
        )
      ]
    )
    (command.ShFunction
      name: mode_ok
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: (condition.Shell commands:[(C {<diff_mode>})])
                  action: [(C {<can_diff>})]
                  spids: [33 38]
                )
                (if_arm
                  cond: (condition.Shell commands:[(C {<merge_mode>})])
                  action: [(C {<can_merge>})]
                  spids: [44 49]
                )
              ]
              else_action: [(C {<false>})]
            )
          ]
        )
    )
    (command.ShFunction
      name: is_available
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:merge_tool_path)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: (C {<translate_merge_tool_path>} {(DQ ($ Id.VSub_Number '$1'))})
                          )
                        }
                      spids: [74]
                    )
                  ]
                )
                (command.Simple
                  words: [{<type>} {(DQ ($ Id.VSub_DollarName '$merge_tool_path'))}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {<'/dev/null'>}
                    )
                    (redir
                      op: <Id.Redir_GreatAnd '2>&'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<1>}
                    )
                  ]
                  do_fork: T
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: list_config_tools
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:section)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [109]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:line_prefix)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Number 2>
                        suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:{})
                      )
                    }
                  spids: [113]
                )
              ]
            )
            (command.Pipeline
              children: [
                (C {<git>} {<config>} {<--get-regexp>} 
                  {($ Id.VSub_DollarName '$section') (SQ <'\\..*\\.cmd'>)}
                )
                (command.WhileUntil
                  keyword: <Id.KW_While while>
                  cond: (condition.Shell commands:[(C {<read>} {<-r>} {<key>} {<value>})])
                  body: 
                    (command.DoGroup
                      children: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:toolname)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (braced_var_sub
                                    token: <Id.VSub_Name key>
                                    suffix_op: 
                                      (suffix_op.Unary
                                        tok: <Id.VOp1_Pound '#'>
                                        arg_word: {($ Id.VSub_DollarName '$section') <.>}
                                      )
                                  )
                                }
                              spids: [149]
                            )
                          ]
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:toolname)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (braced_var_sub
                                    token: <Id.VSub_Name toolname>
                                    suffix_op: 
                                      (suffix_op.Unary
                                        tok: <Id.VOp1_Percent '%'>
                                        arg_word: {<.cmd>}
                                      )
                                  )
                                }
                              spids: [158]
                            )
                          ]
                        )
                        (C {<printf>} {(DQ <'%s%s'> <Id.Lit_BadBackslash '\\'> <n>)} 
                          {(DQ ($ Id.VSub_DollarName '$line_prefix'))} {(DQ ($ Id.VSub_DollarName '$toolname'))}
                        )
                      ]
                    )
                )
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: show_tool_names
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:condition)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Number 1>
                        suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:{<true>})
                      )
                    }
                  spids: [197]
                )
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:per_line_prefix)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Number 2>
                        suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:{})
                      )
                    }
                  spids: [204]
                )
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:preamble)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Number 3>
                        suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:{})
                      )
                    }
                  spids: [210]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:not_found_msg)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Number 4>
                        suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:{})
                      )
                    }
                  spids: [217]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:extra_content)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Number 5>
                        suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:{})
                      )
                    }
                  spids: [224]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:shown_any)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [232]
                )
              ]
            )
            (command.Pipeline
              children: [
                (command.Subshell
                  child: 
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [(C {<cd>} {(DQ ($ Id.VSub_DollarName '$MERGE_TOOLS_DIR'))}) (C {<ls>})]
                    )
                )
                (BraceGroup
                  children: [
                    (command.WhileUntil
                      keyword: <Id.KW_While while>
                      cond: (condition.Shell commands:[(C {<read>} {<toolname>})])
                      body: 
                        (command.DoGroup
                          children: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (command.AndOr
                                          ops: [Id.Op_DAmp]
                                          children: [
                                            (command.Simple
                                              words: [
                                                {<setup_tool>}
                                                {(DQ ($ Id.VSub_DollarName '$toolname'))}
                                              ]
                                              redirects: [
                                                (redir
                                                  op: <Id.Redir_Great '2>'>
                                                  loc: (redir_loc.Fd fd:2)
                                                  arg: {<'/dev/null'>}
                                                )
                                              ]
                                              do_fork: T
                                            )
                                            (command.Subshell
                                              child: 
                                                (C {<eval>} {(DQ ($ Id.VSub_DollarName '$condition'))} 
                                                  {(DQ ($ Id.VSub_DollarName '$toolname'))}
                                                )
                                            )
                                          ]
                                        )
                                      ]
                                    )
                                  action: [
                                    (command.If
                                      arms: [
                                        (if_arm
                                          cond: 
                                            (condition.Shell
                                              commands: [
                                                (C {<test>} {<-n>} 
                                                  {(DQ ($ Id.VSub_DollarName '$preamble'))}
                                                )
                                              ]
                                            )
                                          action: [
                                            (C {<printf>} {(DQ <'%s'> <Id.Lit_BadBackslash '\\'> <n>)} 
                                              {(DQ ($ Id.VSub_DollarName '$preamble'))}
                                            )
                                            (command.ShAssignment
                                              pairs: [
                                                (assign_pair
                                                  lhs: (sh_lhs_expr.Name name:preamble)
                                                  op: assign_op.Equal
                                                  rhs: (word.Empty)
                                                  spids: [321]
                                                )
                                              ]
                                            )
                                          ]
                                          spids: [294 305]
                                        )
                                      ]
                                    )
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:shown_any)
                                          op: assign_op.Equal
                                          rhs: {<yes>}
                                          spids: [327]
                                        )
                                      ]
                                    )
                                    (C {<printf>} {(DQ <'%s%s'> <Id.Lit_BadBackslash '\\'> <n>)} 
                                      {(DQ ($ Id.VSub_DollarName '$per_line_prefix'))} {(DQ ($ Id.VSub_DollarName '$toolname'))}
                                    )
                                  ]
                                  spids: [264 291]
                                )
                              ]
                            )
                          ]
                        )
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$extra_content'))})
                              ]
                            )
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$preamble'))})
                                      ]
                                    )
                                  action: [
                                    (C {<printf>} {(DQ <'%s'>)} {(DQ ($ Id.VSub_DollarName '$preamble'))})
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:preamble)
                                          op: assign_op.Equal
                                          rhs: (word.Empty)
                                          spids: [402]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [369 380]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:shown_any)
                                  op: assign_op.Equal
                                  rhs: {<yes>}
                                  spids: [408]
                                )
                              ]
                            )
                            (C {<printf>} 
                              {(DQ <Id.Lit_BadBackslash '\\'> <'n%s'> <Id.Lit_BadBackslash '\\'> <n>)} {(DQ ($ Id.VSub_DollarName '$extra_content'))}
                            )
                          ]
                          spids: [355 366]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.AndOr
                                  ops: [Id.Op_DAmp]
                                  children: [
                                    (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$preamble'))})
                                    (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$not_found_msg'))})
                                  ]
                                )
                              ]
                            )
                          action: [
                            (C {<printf>} {(DQ <'%s'> <Id.Lit_BadBackslash '\\'> <n>)} 
                              {(DQ ($ Id.VSub_DollarName '$not_found_msg'))}
                            )
                          ]
                          spids: [430 451]
                        )
                      ]
                    )
                    (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$shown_any'))})
                  ]
                )
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: diff_mode
      body: 
        (BraceGroup
          children: [
            (C {<test>} {(DQ ($ Id.VSub_DollarName '$TOOL_MODE'))} {<Id.Lit_Equals '='>} {<diff>})
          ]
        )
    )
    (command.ShFunction
      name: merge_mode
      body: 
        (BraceGroup
          children: [
            (C {<test>} {(DQ ($ Id.VSub_DollarName '$TOOL_MODE'))} {<Id.Lit_Equals '='>} {<merge>})
          ]
        )
    )
    (command.ShFunction
      name: translate_merge_tool_path
      body: (BraceGroup children:[(C {<echo>} {(DQ ($ Id.VSub_Number '$1'))})])
    )
    (command.ShFunction
      name: check_unchanged
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<test>} {(DQ ($ Id.VSub_DollarName '$MERGED'))} {<-nt>} 
                          {(DQ ($ Id.VSub_DollarName '$BACKUP'))}
                        )
                      ]
                    )
                  action: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})]
                  spids: [550 565]
                )
              ]
              else_action: [
                (command.WhileUntil
                  keyword: <Id.KW_While while>
                  cond: (condition.Shell commands:[(C {<true>})])
                  body: 
                    (command.DoGroup
                      children: [
                        (C {<echo>} {(DQ ($ Id.VSub_DollarName '$MERGED') <' seems unchanged.'>)})
                        (C {<printf>} {(DQ <'Was the merge successful [y/n]? '>)})
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {<read>} {<answer>})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<1>}
                            )
                          ]
                        )
                        (command.Case
                          to_match: {(DQ ($ Id.VSub_DollarName '$answer'))}
                          arms: [
                            (case_arm
                              pat_list: [{<y> <Id.Lit_Star '*'>} {<Y> <Id.Lit_Star '*'>}]
                              action: [
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Return return>
                                  arg_word: {<0>}
                                )
                              ]
                              spids: [619 624 630 -1]
                            )
                            (case_arm
                              pat_list: [{<n> <Id.Lit_Star '*'>} {<N> <Id.Lit_Star '*'>}]
                              action: [
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Return return>
                                  arg_word: {<1>}
                                )
                              ]
                              spids: [633 638 644 -1]
                            )
                          ]
                        )
                      ]
                    )
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: valid_tool
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<setup_tool>} {(DQ ($ Id.VSub_Number '$1'))})
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {<0>}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cmd)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<get_merge_tool_cmd>} {(DQ ($ Id.VSub_Number '$1'))})
                      )
                    }
                  spids: [679]
                )
              ]
            )
            (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$cmd'))})
          ]
        )
    )
    (command.ShFunction
      name: setup_user_tool
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:merge_tool_cmd)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<get_merge_tool_cmd>} {(DQ ($ Id.VSub_DollarName '$tool'))})
                      )
                    }
                  spids: [708]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$merge_tool_cmd'))})
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {<1>}
                )
              ]
            )
            (command.ShFunction
              name: diff_cmd
              body: 
                (BraceGroup
                  children: [
                    (command.Subshell
                      child: (C {<eval>} {($ Id.VSub_DollarName '$merge_tool_cmd')})
                    )
                  ]
                )
            )
            (command.ShFunction
              name: merge_cmd
              body: 
                (BraceGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:trust_exit_code)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (command.AndOr
                                    ops: [Id.Op_DPipe]
                                    children: [
                                      (C {<git>} {<config>} {<--bool>} 
                                        {(DQ <mergetool.> ($ Id.VSub_Number '$1') <.trustExitCode>)}
                                      )
                                      (C {<echo>} {<false>})
                                    ]
                                  )
                              )
                            }
                          spids: [763]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (C {<test>} {(DQ ($ Id.VSub_DollarName '$trust_exit_code'))} 
                                  {<Id.Lit_Equals '='>} {(DQ <false>)}
                                )
                              ]
                            )
                          action: [
                            (C {<touch>} {(DQ ($ Id.VSub_DollarName '$BACKUP'))})
                            (command.Subshell
                              child: (C {<eval>} {($ Id.VSub_DollarName '$merge_tool_cmd')})
                            )
                            (C {<check_unchanged>})
                          ]
                          spids: [787 802]
                        )
                      ]
                      else_action: [
                        (command.Subshell
                          child: (C {<eval>} {($ Id.VSub_DollarName '$merge_tool_cmd')})
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: setup_tool
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:tool)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [852]
                )
              ]
            )
            (command.ShFunction
              name: can_merge
              body: 
                (BraceGroup
                  children: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})]
                )
            )
            (command.ShFunction
              name: can_diff
              body: 
                (BraceGroup
                  children: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})]
                )
            )
            (command.ShFunction
              name: diff_cmd
              body: 
                (BraceGroup
                  children: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<1>})]
                )
            )
            (command.ShFunction
              name: merge_cmd
              body: 
                (BraceGroup
                  children: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<1>})]
                )
            )
            (command.ShFunction
              name: translate_merge_tool_path
              body: (BraceGroup children:[(C {<echo>} {(DQ ($ Id.VSub_Number '$1'))})])
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Pipeline
                          children: [
                            (C {<test>} {<-f>} 
                              {
                                (DQ ($ Id.VSub_DollarName '$MERGE_TOOLS_DIR') <'/'> 
                                  ($ Id.VSub_DollarName '$tool')
                                )
                              }
                            )
                          ]
                          negated: T
                        )
                      ]
                    )
                  action: [
                    (C {<setup_user_tool>})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {($ Id.VSub_QMark '$?')}
                    )
                  ]
                  spids: [950 965]
                )
              ]
            )
            (C {<.>} 
              {(DQ ($ Id.VSub_DollarName '$MERGE_TOOLS_DIR') <'/'> ($ Id.VSub_DollarName '$tool'))}
            )
            (C {<setup_user_tool>})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.AndOr
                          ops: [Id.Op_DAmp]
                          children: [
                            (C {<merge_mode>})
                            (command.Pipeline
                              children: [(C {<can_merge>})]
                              negated: T
                            )
                          ]
                        )
                      ]
                    )
                  action: [
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (DQ <'error: \''> ($ Id.VSub_DollarName '$tool') 
                            <'\' can not be used to resolve merges'>
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [1005 1016]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.AndOr
                          ops: [Id.Op_DAmp]
                          children: [
                            (C {<diff_mode>})
                            (command.Pipeline
                              children: [(C {<can_diff>})]
                              negated: T
                            )
                          ]
                        )
                      ]
                    )
                  action: [
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (DQ <'error: \''> ($ Id.VSub_DollarName '$tool') 
                            <'\' can only be used to resolve merges'>
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [1036 1047]
                )
              ]
            )
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
        )
    )
    (command.ShFunction
      name: get_merge_tool_cmd
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:merge_tool)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [1085]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: (condition.Shell commands:[(C {<diff_mode>})])
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<git>} {<config>} 
                          {(DQ <difftool.> ($ Id.VSub_DollarName '$merge_tool') <.cmd>)}
                        )
                        (C {<git>} {<config>} 
                          {(DQ <mergetool.> ($ Id.VSub_DollarName '$merge_tool') <.cmd>)}
                        )
                      ]
                    )
                  ]
                  spids: [1091 1096]
                )
              ]
              else_action: [
                (C {<git>} {<config>} {(DQ <mergetool.> ($ Id.VSub_DollarName '$merge_tool') <.cmd>)})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: run_merge_tool
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:GIT_PREFIX)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Name GIT_PREFIX>
                        suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:{<.>})
                      )
                    }
                  spids: [1161]
                )
              ]
            )
            (C {<export>} {<GIT_PREFIX>})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:merge_tool_path)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: (C {<get_merge_tool_path>} {(DQ ($ Id.VSub_Number '$1'))})
                          )
                        }
                      spids: [1175]
                    )
                  ]
                )
                (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:base_present)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$2'))}
                  spids: [1189]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<setup_tool>} {(DQ ($ Id.VSub_Number '$1'))})
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {<1>}
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: (condition.Shell commands:[(C {<merge_mode>})])
                  action: [(C {<run_merge_cmd>} {(DQ ($ Id.VSub_Number '$1'))})]
                  spids: [1214 1219]
                )
              ]
              else_action: [(C {<run_diff_cmd>} {(DQ ($ Id.VSub_Number '$1'))})]
            )
          ]
        )
    )
    (command.ShFunction
      name: run_diff_cmd
      body: (BraceGroup children:[(C {<diff_cmd>} {(DQ ($ Id.VSub_Number '$1'))})])
    )
    (command.ShFunction
      name: run_merge_cmd
      body: (BraceGroup children:[(C {<merge_cmd>} {(DQ ($ Id.VSub_Number '$1'))})])
    )
    (command.ShFunction
      name: list_merge_tool_candidates
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: (condition.Shell commands:[(C {<merge_mode>})])
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:tools)
                          op: assign_op.Equal
                          rhs: {(DQ <tortoisemerge>)}
                          spids: [1300]
                        )
                      ]
                    )
                  ]
                  spids: [1292 1297]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:tools)
                      op: assign_op.Equal
                      rhs: {(DQ <kompare>)}
                      spids: [1309]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [(C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$DISPLAY'))})]
                    )
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (C {<test>} {<-n>} 
                                  {(DQ ($ Id.VSub_DollarName '$GNOME_DESKTOP_SESSION_ID'))}
                                )
                              ]
                            )
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:tools)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ <'meld opendiff kdiff3 tkdiff xxdiff '> 
                                        ($ Id.VSub_DollarName '$tools')
                                      )
                                    }
                                  spids: [1346]
                                )
                              ]
                            )
                          ]
                          spids: [1332 1343]
                        )
                      ]
                      else_action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:tools)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (DQ <'opendiff kdiff3 tkdiff xxdiff meld '> 
                                    ($ Id.VSub_DollarName '$tools')
                                  )
                                }
                              spids: [1356]
                            )
                          ]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:tools)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName '$tools') 
                                <' gvimdiff diffuse diffmerge ecmerge'>
                              )
                            }
                          spids: [1366]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:tools)
                          op: assign_op.Equal
                          rhs: 
                            {(DQ ($ Id.VSub_DollarName '$tools') <' p4merge araxis bc codecompare'>)}
                          spids: [1373]
                        )
                      ]
                    )
                  ]
                  spids: [1318 1329]
                )
              ]
            )
            (command.Case
              to_match: 
                {
                  (DQ 
                    (braced_var_sub
                      token: <Id.VSub_Name VISUAL>
                      suffix_op: 
                        (suffix_op.Unary
                          tok: <Id.VTest_ColonHyphen ':-'>
                          arg_word: {($ Id.VSub_DollarName '$EDITOR')}
                        )
                    )
                  )
                }
              arms: [
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'> <vim> <Id.Lit_Star '*'>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:tools)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName '$tools') <' vimdiff emerge'>)}
                          spids: [1402]
                        )
                      ]
                    )
                  ]
                  spids: [1396 1399 1409 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:tools)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName '$tools') <' emerge vimdiff'>)}
                          spids: [1416]
                        )
                      ]
                    )
                  ]
                  spids: [1412 1413 1423 -1]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: show_tool_help
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:tool_opt)
                  op: assign_op.Equal
                  rhs: {(DQ <'\'git '> (${ Id.VSub_Name TOOL_MODE) <'tool --tool=<tool>\''>)}
                  spids: [1439]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:tab)
                  op: assign_op.Equal
                  rhs: {(SQ <'\t'>)}
                  spids: [1450]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:LF)
                  op: assign_op.Equal
                  rhs: {(SQ <'\n'>)}
                  spids: [1456]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:any_shown)
                  op: assign_op.Equal
                  rhs: {<no>}
                  spids: [1462]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cmd_name)
                  op: assign_op.Equal
                  rhs: {(${ Id.VSub_Name TOOL_MODE) <tool>}
                  spids: [1467]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:config_tools)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (BraceGroup
                                children: [
                                  (command.AndOr
                                    ops: [Id.Op_DAmp]
                                    children: [
                                      (C {<diff_mode>})
                                      (C {<list_config_tools>} {<difftool>} 
                                        {
                                          (DQ ($ Id.VSub_DollarName '$tab') 
                                            ($ Id.VSub_DollarName '$tab')
                                          )
                                        }
                                      )
                                    ]
                                  )
                                  (C {<list_config_tools>} {<mergetool>} 
                                    {(DQ ($ Id.VSub_DollarName '$tab') ($ Id.VSub_DollarName '$tab'))}
                                  )
                                ]
                              )
                              (C {<sort>})
                            ]
                            negated: F
                          )
                      )
                    }
                  spids: [1474]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:extra_content)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [1511]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [(C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$config_tools'))})]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:extra_content)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ (${ Id.VSub_Name tab) <'user-defined:'> (${ Id.VSub_Name LF) 
                                ($ Id.VSub_DollarName '$config_tools')
                              )
                            }
                          spids: [1528]
                        )
                      ]
                    )
                  ]
                  spids: [1514 1525]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<show_tool_names>} {(SQ <'mode_ok && is_available'>)} 
                  {(DQ ($ Id.VSub_DollarName '$tab') ($ Id.VSub_DollarName '$tab'))} {(DQ ($ Id.VSub_DollarName '$tool_opt') <' may be set to one of the following:'>)} 
                  {
                    (DQ <'No suitable tool for \'git '> ($ Id.VSub_DollarName '$cmd_name') 
                      <' --tool=<tool>\' found.'>
                    )
                  } {(DQ ($ Id.VSub_DollarName '$extra_content'))}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:any_shown)
                      op: assign_op.Equal
                      rhs: {<yes>}
                      spids: [1580]
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<show_tool_names>} {(SQ <'mode_ok && ! is_available'>)} 
                  {(DQ ($ Id.VSub_DollarName '$tab') ($ Id.VSub_DollarName '$tab'))} {(DQ (${ Id.VSub_Name LF) <'The following tools are valid, but not currently available:'>)}
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:any_shown)
                      op: assign_op.Equal
                      rhs: {<yes>}
                      spids: [1608]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<test>} {(DQ ($ Id.VSub_DollarName '$any_shown'))} {<Id.Lit_Equals '='>} 
                          {<yes>}
                        )
                      ]
                    )
                  action: [
                    (C {<echo>})
                    (C {<echo>} {(DQ <'Some of the tools listed above only work in a windowed'>)})
                    (C {<echo>} 
                      {(DQ <'environment. If run in a terminal-only session, they will fail.'>)}
                    )
                  ]
                  spids: [1613 1626]
                )
              ]
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
          ]
        )
    )
    (command.ShFunction
      name: guess_merge_tool
      body: 
        (BraceGroup
          children: [
            (C {<list_merge_tool_candidates>})
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})
                (redir
                  op: <Id.Redir_DLessDash '<<-'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<EOF>}
                      here_end_span_id: 1692
                      stdin_parts: [
                        <'\n'>
                        <'This message is displayed because \''>
                        ($ Id.VSub_DollarName '$TOOL_MODE')
                        <'.tool\' is not configured.\n'>
                        <'See \'git '>
                        (${ Id.VSub_Name TOOL_MODE)
                        <'tool --tool-help\' or \'git help config\' for more details.\n'>
                        <'\'git '>
                        (${ Id.VSub_Name TOOL_MODE)
                        <'tool\' will now attempt to use one of the following tools:\n'>
                        ($ Id.VSub_DollarName '$tools')
                        <'\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:IFS)
                  op: assign_op.Equal
                  rhs: {(SQ <' '>)}
                  spids: [1699]
                )
              ]
            )
            (command.ForEach
              iter_name: tool
              iter_words: [{($ Id.VSub_DollarName '$tools')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.AndOr
                      ops: [Id.Op_DAmp Id.Op_DAmp]
                      children: [
                        (C {<is_available>} {(DQ ($ Id.VSub_DollarName '$tool'))})
                        (C {<echo>} {(DQ ($ Id.VSub_DollarName '$tool'))})
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                          arg_word: {<0>}
                        )
                      ]
                    )
                  ]
                )
            )
            (command.Simple
              words: [{<echo>} {(DQ <'No known '> (${ Id.VSub_Name TOOL_MODE) <' tool is available.'>)}]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<1>})
          ]
        )
    )
    (command.ShFunction
      name: get_configured_merge_tool
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: (condition.Shell commands:[(C {<diff_mode>})])
                  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 '$('>
                                child: 
                                  (command.AndOr
                                    ops: [Id.Op_DPipe]
                                    children: [
                                      (C {<git>} {<config>} {<diff.tool>})
                                      (C {<git>} {<config>} {<merge.tool>})
                                    ]
                                  )
                              )
                            }
                          spids: [1787]
                        )
                      ]
                    )
                  ]
                  spids: [1779 1784]
                )
              ]
              else_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 '$('>
                            child: (C {<git>} {<config>} {<merge.tool>})
                          )
                        }
                      spids: [1808]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.AndOr
                          ops: [Id.Op_DAmp]
                          children: [
                            (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$merge_tool'))})
                            (command.Pipeline
                              children: [(C {<valid_tool>} {(DQ ($ Id.VSub_DollarName '$merge_tool'))})]
                              negated: T
                            )
                          ]
                        )
                      ]
                    )
                  action: [
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (DQ <'git config option '> ($ Id.VSub_DollarName '$TOOL_MODE') 
                            <'.tool set to unknown tool: '> ($ Id.VSub_DollarName '$merge_tool')
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>} {(DQ <'Resetting to default...'>)}]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [1821 1842]
                )
              ]
            )
            (C {<echo>} {(DQ ($ Id.VSub_DollarName '$merge_tool'))})
          ]
        )
    )
    (command.ShFunction
      name: get_merge_tool_path
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:merge_tool)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [1897]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Pipeline
                          children: [(C {<valid_tool>} {(DQ ($ Id.VSub_DollarName '$merge_tool'))})]
                          negated: T
                        )
                      ]
                    )
                  action: [
                    (command.Simple
                      words: [
                        {<echo>}
                        {(DQ <'Unknown merge tool '> ($ Id.VSub_DollarName '$merge_tool'))}
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [1903 1914]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: (condition.Shell commands:[(C {<diff_mode>})])
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:merge_tool_path)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (command.AndOr
                                    ops: [Id.Op_DPipe]
                                    children: [
                                      (C {<git>} {<config>} 
                                        {<difftool.> (DQ ($ Id.VSub_DollarName '$merge_tool')) <.path>}
                                      )
                                      (C {<git>} {<config>} 
                                        {<mergetool.> (DQ ($ Id.VSub_DollarName '$merge_tool')) 
                                          <.path>
                                        }
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [1944]
                        )
                      ]
                    )
                  ]
                  spids: [1936 1941]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:merge_tool_path)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (C {<git>} {<config>} 
                                {<mergetool.> (DQ ($ Id.VSub_DollarName '$merge_tool')) <.path>}
                              )
                          )
                        }
                      spids: [1974]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [(C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$merge_tool_path'))})]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:merge_tool_path)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (C {<translate_merge_tool_path>} 
                                    {(DQ ($ Id.VSub_DollarName '$merge_tool'))}
                                  )
                              )
                            }
                          spids: [2005]
                        )
                      ]
                    )
                  ]
                  spids: [1991 2002]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.AndOr
                          ops: [Id.Op_DAmp]
                          children: [
                            (C {<test>} {<-z>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    child: 
                                      (C {<get_merge_tool_cmd>} 
                                        {(DQ ($ Id.VSub_DollarName '$merge_tool'))}
                                      )
                                  )
                                )
                              }
                            )
                            (command.Pipeline
                              children: [
                                (command.Simple
                                  words: [{<type>} {(DQ ($ Id.VSub_DollarName '$merge_tool_path'))}]
                                  redirects: [
                                    (redir
                                      op: <Id.Redir_Great '>'>
                                      loc: (redir_loc.Fd fd:1)
                                      arg: {<'/dev/null'>}
                                    )
                                    (redir
                                      op: <Id.Redir_GreatAnd '2>&'>
                                      loc: (redir_loc.Fd fd:2)
                                      arg: {<1>}
                                    )
                                  ]
                                  do_fork: T
                                )
                              ]
                              negated: T
                            )
                          ]
                        )
                      ]
                    )
                  action: [
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (DQ <'The '> ($ Id.VSub_DollarName '$TOOL_MODE') <' tool '> 
                            ($ Id.VSub_DollarName '$merge_tool') <' is not available as'>
                          )
                        }
                        {(DQ <'\''> ($ Id.VSub_DollarName '$merge_tool_path') <'\''>)}
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [2018 2052]
                )
              ]
            )
            (C {<echo>} {(DQ ($ Id.VSub_DollarName '$merge_tool_path'))})
          ]
        )
    )
    (command.ShFunction
      name: get_merge_tool
      body: 
        (BraceGroup
          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 '$('>
                        child: (C {<get_configured_merge_tool>})
                      )
                    }
                  spids: [2105]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [(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 '$('>
                                    child: (C {<guess_merge_tool>})
                                  )
                                }
                              spids: [2129]
                            )
                          ]
                        )
                        (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
                      ]
                    )
                  ]
                  spids: [2115 2126]
                )
              ]
            )
            (C {<echo>} {(DQ ($ Id.VSub_DollarName '$merge_tool'))})
          ]
        )
    )
    (command.ShFunction
      name: mergetool_find_win32_cmd
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:executable)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [2159]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:sub_directory)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$2')}
                  spids: [2163]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Simple
                          words: [{<type>} {<-p>} {(DQ ($ Id.VSub_DollarName '$executable'))}]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<'/dev/null'>}
                            )
                            (redir
                              op: <Id.Redir_GreatAnd '2>&'>
                              loc: (redir_loc.Fd fd:2)
                              arg: {<1>}
                            )
                          ]
                          do_fork: T
                        )
                      ]
                    )
                  action: [
                    (C {<printf>} {(SQ <'%s'>)} {(DQ ($ Id.VSub_DollarName '$executable'))})
                    (command.ControlFlow token:<Id.ControlFlow_Return return>)
                  ]
                  spids: [2172 2189]
                )
              ]
            )
            (command.ForEach
              iter_name: directory
              iter_words: [
                {
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: 
                      (command.Pipeline
                        children: [
                          (C {<env>})
                          (C {<grep>} {<-Ei>} {(SQ <'^PROGRAM(FILES(\\(X86\\))?|W6432)='>)})
                          (C {<cut>} {<-d>} {(SQ <'='>)} {<-f>} {<2->})
                          (C {<sort>} {<-u>})
                        ]
                        negated: F
                      )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.AndOr
                                  ops: [Id.Op_DAmp]
                                  children: [
                                    (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$directory'))})
                                    (C {<test>} {<-x>} 
                                      {
                                        (DQ ($ Id.VSub_DollarName '$directory') <'/'> 
                                          ($ Id.VSub_DollarName '$sub_directory') <'/'> ($ Id.VSub_DollarName '$executable')
                                        )
                                      }
                                    )
                                  ]
                                )
                              ]
                            )
                          action: [
                            (C {<printf>} {(SQ <'%s'>)} 
                              {
                                (DQ ($ Id.VSub_DollarName '$directory') <'/'> 
                                  ($ Id.VSub_DollarName '$sub_directory') <'/'> ($ Id.VSub_DollarName '$executable')
                                )
                              }
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                            )
                          ]
                          spids: [2259 2284]
                        )
                      ]
                    )
                  ]
                )
            )
            (C {<printf>} {(SQ <'%s'>)} {(DQ ($ Id.VSub_DollarName '$executable'))})
          ]
        )
    )
  ]
)