(command.CommandList
  children: [
    (C {<Id.Lit_Colon ':'>} 
      {
        (braced_var_sub
          left: <Id.Left_DollarBrace '${'>
          token: <Id.VSub_Name MERGE_TOOLS_DIR>
          var_name: MERGE_TOOLS_DIR
          suffix_op: 
            (suffix_op.Unary
              op: <Id.VTest_Equals _>
              arg_word: 
                {
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: (C {<git>} {<--exec-path>})
                    right: <Id.Eof_RParen _>
                  ) <Id.Lit_Slash '/'> <mergetools>
                }
            )
          right: <Id.Right_DollarBrace '}'>
        )
      }
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'IFS='> name:IFS)
          op: assign_op.Equal
          rhs: {(SQ <'\n'>)}
          spids: [19]
        )
      ]
      redirects: []
    )
    (command.ShFunction
      name: mode_ok
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          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>})]
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: is_available
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: 
                        (sh_lhs_expr.Name
                          left: <Id.Lit_VarLike 'merge_tool_path='>
                          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))})
                            right: <Id.Eof_RParen _>
                          )
                        }
                      spids: [74]
                    )
                  ]
                  redirects: []
                )
                (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>}
                    )
                  ]
                  more_env: []
                  do_fork: T
                )
              ]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: list_config_tools
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'section='> name:section)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                  spids: [109]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'line_prefix='> name:line_prefix)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        left: <Id.Left_DollarBrace '${'>
                        token: <Id.VSub_Number 2>
                        var_name: 2
                        suffix_op: (suffix_op.Unary op:<Id.VTest_ColonHyphen _> arg_word:{})
                        right: <Id.Right_DollarBrace '}'>
                      )
                    }
                  spids: [113]
                )
              ]
              redirects: []
            )
            (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 left:<Id.Lit_VarLike 'toolname='> name:toolname)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (braced_var_sub
                                    left: <Id.Left_DollarBrace '${'>
                                    token: <Id.VSub_Name key>
                                    var_name: key
                                    suffix_op: 
                                      (suffix_op.Unary
                                        op: <Id.VOp1_Pound '#'>
                                        arg_word: {($ Id.VSub_DollarName section) <.>}
                                      )
                                    right: <Id.Right_DollarBrace '}'>
                                  )
                                }
                              spids: [149]
                            )
                          ]
                          redirects: []
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'toolname='> name:toolname)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (braced_var_sub
                                    left: <Id.Left_DollarBrace '${'>
                                    token: <Id.VSub_Name toolname>
                                    var_name: toolname
                                    suffix_op: 
                                      (suffix_op.Unary
                                        op: <Id.VOp1_Percent '%'>
                                        arg_word: {<.cmd>}
                                      )
                                    right: <Id.Right_DollarBrace '}'>
                                  )
                                }
                              spids: [158]
                            )
                          ]
                          redirects: []
                        )
                        (C {<printf>} {(DQ <'%s%s'> <Id.Lit_BadBackslash '\\'> <n>)} 
                          {(DQ ($ Id.VSub_DollarName line_prefix))} {(DQ ($ Id.VSub_DollarName toolname))}
                        )
                      ]
                    )
                  redirects: []
                )
              ]
              negated: F
              stderr_indices: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: show_tool_names
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'condition='> name:condition)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        left: <Id.Left_DollarBrace '${'>
                        token: <Id.VSub_Number 1>
                        var_name: 1
                        suffix_op: (suffix_op.Unary op:<Id.VTest_ColonHyphen _> arg_word:{<true>})
                        right: <Id.Right_DollarBrace '}'>
                      )
                    }
                  spids: [197]
                )
                (assign_pair
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'per_line_prefix='>
                      name: per_line_prefix
                    )
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        left: <Id.Left_DollarBrace '${'>
                        token: <Id.VSub_Number 2>
                        var_name: 2
                        suffix_op: (suffix_op.Unary op:<Id.VTest_ColonHyphen _> arg_word:{})
                        right: <Id.Right_DollarBrace '}'>
                      )
                    }
                  spids: [204]
                )
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'preamble='> name:preamble)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        left: <Id.Left_DollarBrace '${'>
                        token: <Id.VSub_Number 3>
                        var_name: 3
                        suffix_op: (suffix_op.Unary op:<Id.VTest_ColonHyphen _> arg_word:{})
                        right: <Id.Right_DollarBrace '}'>
                      )
                    }
                  spids: [210]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'not_found_msg='> name:not_found_msg)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        left: <Id.Left_DollarBrace '${'>
                        token: <Id.VSub_Number 4>
                        var_name: 4
                        suffix_op: (suffix_op.Unary op:<Id.VTest_ColonHyphen _> arg_word:{})
                        right: <Id.Right_DollarBrace '}'>
                      )
                    }
                  spids: [217]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'extra_content='> name:extra_content)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        left: <Id.Left_DollarBrace '${'>
                        token: <Id.VSub_Number 5>
                        var_name: 5
                        suffix_op: (suffix_op.Unary op:<Id.VTest_ColonHyphen _> arg_word:{})
                        right: <Id.Right_DollarBrace '}'>
                      )
                    }
                  spids: [224]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'shown_any='> name:shown_any)
                  op: assign_op.Equal
                  rhs: (rhs_word.Empty)
                  spids: [232]
                )
              ]
              redirects: []
            )
            (command.Pipeline
              children: [
                (command.Subshell
                  child: 
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [(C {<cd>} {(DQ ($ Id.VSub_DollarName MERGE_TOOLS_DIR))}) (C {<ls>})]
                    )
                  redirects: []
                )
                (BraceGroup
                  left: <Id.Lit_LBrace '{'>
                  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'>}
                                                )
                                              ]
                                              more_env: []
                                              do_fork: T
                                            )
                                            (command.Subshell
                                              child: 
                                                (C {<eval>} {(DQ ($ Id.VSub_DollarName condition))} 
                                                  {(DQ ($ Id.VSub_DollarName toolname))}
                                                )
                                              redirects: []
                                            )
                                          ]
                                        )
                                      ]
                                    )
                                  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
                                                      left: <Id.Lit_VarLike 'preamble='>
                                                      name: preamble
                                                    )
                                                  op: assign_op.Equal
                                                  rhs: (rhs_word.Empty)
                                                  spids: [321]
                                                )
                                              ]
                                              redirects: []
                                            )
                                          ]
                                          spids: [294 305]
                                        )
                                      ]
                                      else_action: []
                                      redirects: []
                                    )
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: 
                                            (sh_lhs_expr.Name
                                              left: <Id.Lit_VarLike 'shown_any='>
                                              name: shown_any
                                            )
                                          op: assign_op.Equal
                                          rhs: {<yes>}
                                          spids: [327]
                                        )
                                      ]
                                      redirects: []
                                    )
                                    (C {<printf>} {(DQ <'%s%s'> <Id.Lit_BadBackslash '\\'> <n>)} 
                                      {(DQ ($ Id.VSub_DollarName per_line_prefix))} {(DQ ($ Id.VSub_DollarName toolname))}
                                    )
                                  ]
                                  spids: [264 291]
                                )
                              ]
                              else_action: []
                              redirects: []
                            )
                          ]
                        )
                      redirects: []
                    )
                    (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
                                              left: <Id.Lit_VarLike 'preamble='>
                                              name: preamble
                                            )
                                          op: assign_op.Equal
                                          rhs: (rhs_word.Empty)
                                          spids: [402]
                                        )
                                      ]
                                      redirects: []
                                    )
                                  ]
                                  spids: [369 380]
                                )
                              ]
                              else_action: []
                              redirects: []
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.Name
                                      left: <Id.Lit_VarLike 'shown_any='>
                                      name: shown_any
                                    )
                                  op: assign_op.Equal
                                  rhs: {<yes>}
                                  spids: [408]
                                )
                              ]
                              redirects: []
                            )
                            (C {<printf>} 
                              {(DQ <Id.Lit_BadBackslash '\\'> <'n%s'> <Id.Lit_BadBackslash '\\'> <n>)} {(DQ ($ Id.VSub_DollarName extra_content))}
                            )
                          ]
                          spids: [355 366]
                        )
                      ]
                      else_action: []
                      redirects: []
                    )
                    (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]
                        )
                      ]
                      else_action: []
                      redirects: []
                    )
                    (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName shown_any))})
                  ]
                  redirects: []
                  right: <Id.Lit_RBrace '}'>
                )
              ]
              negated: F
              stderr_indices: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: diff_mode
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<test>} {(DQ ($ Id.VSub_DollarName TOOL_MODE))} {<Id.Lit_Equals '='>} {<diff>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: merge_mode
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<test>} {(DQ ($ Id.VSub_DollarName TOOL_MODE))} {<Id.Lit_Equals '='>} {<merge>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: translate_merge_tool_path
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [(C {<echo>} {(DQ ($ Id.VSub_Number 1))})]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: check_unchanged
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          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]
                            )
                          ]
                          redirects: []
                        )
                      ]
                    )
                  redirects: []
                )
              ]
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: valid_tool
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          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 left:<Id.Lit_VarLike 'cmd='> 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))})
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [679]
                )
              ]
              redirects: []
            )
            (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName cmd))})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: setup_user_tool
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'merge_tool_cmd='> 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))})
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [708]
                )
              ]
              redirects: []
            )
            (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
                  left: <Id.Lit_LBrace '{'>
                  children: [
                    (command.Subshell
                      child: (C {<eval>} {($ Id.VSub_DollarName merge_tool_cmd)})
                      redirects: []
                    )
                  ]
                  redirects: []
                  right: <Id.Lit_RBrace '}'>
                )
            )
            (command.ShFunction
              name: merge_cmd
              body: 
                (BraceGroup
                  left: <Id.Lit_LBrace '{'>
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'trust_exit_code='>
                              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>})
                                    ]
                                  )
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [763]
                        )
                      ]
                      redirects: []
                    )
                    (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)})
                              redirects: []
                            )
                            (C {<check_unchanged>})
                          ]
                          spids: [787 802]
                        )
                      ]
                      else_action: [
                        (command.Subshell
                          child: (C {<eval>} {($ Id.VSub_DollarName merge_tool_cmd)})
                          redirects: []
                        )
                      ]
                      redirects: []
                    )
                  ]
                  redirects: []
                  right: <Id.Lit_RBrace '}'>
                )
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: setup_tool
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tool='> name:tool)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                  spids: [852]
                )
              ]
              redirects: []
            )
            (command.ShFunction
              name: can_merge
              body: 
                (BraceGroup
                  left: <Id.Lit_LBrace '{'>
                  children: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})]
                  redirects: []
                  right: <Id.Lit_RBrace '}'>
                )
            )
            (command.ShFunction
              name: can_diff
              body: 
                (BraceGroup
                  left: <Id.Lit_LBrace '{'>
                  children: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})]
                  redirects: []
                  right: <Id.Lit_RBrace '}'>
                )
            )
            (command.ShFunction
              name: diff_cmd
              body: 
                (BraceGroup
                  left: <Id.Lit_LBrace '{'>
                  children: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<1>})]
                  redirects: []
                  right: <Id.Lit_RBrace '}'>
                )
            )
            (command.ShFunction
              name: merge_cmd
              body: 
                (BraceGroup
                  left: <Id.Lit_LBrace '{'>
                  children: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<1>})]
                  redirects: []
                  right: <Id.Lit_RBrace '}'>
                )
            )
            (command.ShFunction
              name: translate_merge_tool_path
              body: 
                (BraceGroup
                  left: <Id.Lit_LBrace '{'>
                  children: [(C {<echo>} {(DQ ($ Id.VSub_Number 1))})]
                  redirects: []
                  right: <Id.Lit_RBrace '}'>
                )
            )
            (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
                          stderr_indices: []
                        )
                      ]
                    )
                  action: [
                    (C {<setup_user_tool>})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {($ Id.VSub_QMark '?')}
                    )
                  ]
                  spids: [950 965]
                )
              ]
              else_action: []
              redirects: []
            )
            (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
                              stderr_indices: []
                            )
                          ]
                        )
                      ]
                    )
                  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>})]
                      more_env: []
                      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
                              stderr_indices: []
                            )
                          ]
                        )
                      ]
                    )
                  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>})]
                      more_env: []
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [1036 1047]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: get_merge_tool_cmd
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          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 ($ Id.VSub_Number 1))}
                  spids: [1085]
                )
              ]
              redirects: []
            )
            (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>)})
              ]
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: run_merge_tool
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'GIT_PREFIX='> name:GIT_PREFIX)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (braced_var_sub
                        left: <Id.Left_DollarBrace '${'>
                        token: <Id.VSub_Name GIT_PREFIX>
                        var_name: GIT_PREFIX
                        suffix_op: (suffix_op.Unary op:<Id.VTest_ColonHyphen _> arg_word:{<.>})
                        right: <Id.Right_DollarBrace '}'>
                      )
                    }
                  spids: [1161]
                )
              ]
              redirects: []
            )
            (C {<export>} {<GIT_PREFIX>})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: 
                        (sh_lhs_expr.Name
                          left: <Id.Lit_VarLike 'merge_tool_path='>
                          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))})
                            right: <Id.Eof_RParen _>
                          )
                        }
                      spids: [1175]
                    )
                  ]
                  redirects: []
                )
                (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'base_present='> name:base_present)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 2))}
                  spids: [1189]
                )
              ]
              redirects: []
            )
            (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))})]
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: run_diff_cmd
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [(C {<diff_cmd>} {(DQ ($ Id.VSub_Number 1))})]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: run_merge_cmd
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [(C {<merge_cmd>} {(DQ ($ Id.VSub_Number 1))})]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: list_merge_tool_candidates
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: (condition.Shell commands:[(C {<merge_mode>})])
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tools='> name:tools)
                          op: assign_op.Equal
                          rhs: {(DQ <tortoisemerge>)}
                          spids: [1300]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [1292 1297]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tools='> name:tools)
                      op: assign_op.Equal
                      rhs: {(DQ <kompare>)}
                      spids: [1309]
                    )
                  ]
                  redirects: []
                )
              ]
              redirects: []
            )
            (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 left:<Id.Lit_VarLike 'tools='> name:tools)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ <'meld opendiff kdiff3 tkdiff xxdiff '> 
                                        ($ Id.VSub_DollarName tools)
                                      )
                                    }
                                  spids: [1346]
                                )
                              ]
                              redirects: []
                            )
                          ]
                          spids: [1332 1343]
                        )
                      ]
                      else_action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tools='> name:tools)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (DQ <'opendiff kdiff3 tkdiff xxdiff meld '> 
                                    ($ Id.VSub_DollarName tools)
                                  )
                                }
                              spids: [1356]
                            )
                          ]
                          redirects: []
                        )
                      ]
                      redirects: []
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tools='> name:tools)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName tools) <' gvimdiff diffuse diffmerge ecmerge'>)
                            }
                          spids: [1366]
                        )
                      ]
                      redirects: []
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tools='> name:tools)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName tools) <' p4merge araxis bc codecompare'>)}
                          spids: [1373]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [1318 1329]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.Case
              to_match: 
                {
                  (DQ 
                    (braced_var_sub
                      left: <Id.Left_DollarBrace '${'>
                      token: <Id.VSub_Name VISUAL>
                      var_name: VISUAL
                      suffix_op: 
                        (suffix_op.Unary
                          op: <Id.VTest_ColonHyphen _>
                          arg_word: {($ Id.VSub_DollarName EDITOR)}
                        )
                      right: <Id.Right_DollarBrace '}'>
                    )
                  )
                }
              arms: [
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'> <vim> <Id.Lit_Star '*'>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tools='> name:tools)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName tools) <' vimdiff emerge'>)}
                          spids: [1402]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [1396 1399 1409 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tools='> name:tools)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName tools) <' emerge vimdiff'>)}
                          spids: [1416]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [1412 1413 1423 -1]
                )
              ]
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: show_tool_help
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tool_opt='> name:tool_opt)
                  op: assign_op.Equal
                  rhs: {(DQ <'\'git '> (${ Id.VSub_Name TOOL_MODE) <'tool --tool=<tool>\''>)}
                  spids: [1439]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tab='> name:tab)
                  op: assign_op.Equal
                  rhs: {(SQ <'\t'>)}
                  spids: [1450]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'LF='> name:LF)
                  op: assign_op.Equal
                  rhs: {(SQ <'\n'>)}
                  spids: [1456]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'any_shown='> name:any_shown)
                  op: assign_op.Equal
                  rhs: {<no>}
                  spids: [1462]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'cmd_name='> name:cmd_name)
                  op: assign_op.Equal
                  rhs: {(${ Id.VSub_Name TOOL_MODE) <tool>}
                  spids: [1467]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'config_tools='> name:config_tools)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (BraceGroup
                                left: <Id.Lit_LBrace '{'>
                                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))}
                                  )
                                ]
                                redirects: []
                                right: <Id.Lit_RBrace '}'>
                              )
                              (C {<sort>})
                            ]
                            negated: F
                            stderr_indices: []
                          )
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [1474]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'extra_content='> name:extra_content)
                  op: assign_op.Equal
                  rhs: (rhs_word.Empty)
                  spids: [1511]
                )
              ]
              redirects: []
            )
            (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
                              left: <Id.Lit_VarLike 'extra_content='>
                              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]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [1514 1525]
                )
              ]
              else_action: []
              redirects: []
            )
            (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 left:<Id.Lit_VarLike 'any_shown='> name:any_shown)
                      op: assign_op.Equal
                      rhs: {<yes>}
                      spids: [1580]
                    )
                  ]
                  redirects: []
                )
              ]
            )
            (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 left:<Id.Lit_VarLike 'any_shown='> name:any_shown)
                      op: assign_op.Equal
                      rhs: {<yes>}
                      spids: [1608]
                    )
                  ]
                  redirects: []
                )
              ]
            )
            (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]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: guess_merge_tool
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          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'>
                      ]
                    )
                )
              ]
              more_env: []
              do_fork: T
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'IFS='> name:IFS)
                  op: assign_op.Equal
                  rhs: {(SQ <' '>)}
                  spids: [1699]
                )
              ]
              redirects: []
            )
            (command.ForEach
              iter_names: [tool]
              iterable: (for_iter.Words words:[{($ Id.VSub_DollarName tools)}])
              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>}
                        )
                      ]
                    )
                  ]
                )
              redirects: []
            )
            (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>})]
              more_env: []
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<1>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: get_configured_merge_tool
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: (condition.Shell commands:[(C {<diff_mode>})])
                  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: 
                            {
                              (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>})
                                    ]
                                  )
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [1787]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [1779 1784]
                )
              ]
              else_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: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: (C {<git>} {<config>} {<merge.tool>})
                            right: <Id.Eof_RParen _>
                          )
                        }
                      spids: [1808]
                    )
                  ]
                  redirects: []
                )
              ]
              redirects: []
            )
            (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
                              stderr_indices: []
                            )
                          ]
                        )
                      ]
                    )
                  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>})]
                      more_env: []
                      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>})]
                      more_env: []
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [1821 1842]
                )
              ]
              else_action: []
              redirects: []
            )
            (C {<echo>} {(DQ ($ Id.VSub_DollarName merge_tool))})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: get_merge_tool_path
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          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 ($ Id.VSub_Number 1))}
                  spids: [1897]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Pipeline
                          children: [(C {<valid_tool>} {(DQ ($ Id.VSub_DollarName merge_tool))})]
                          negated: T
                          stderr_indices: []
                        )
                      ]
                    )
                  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>})]
                      more_env: []
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [1903 1914]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: (condition.Shell commands:[(C {<diff_mode>})])
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'merge_tool_path='>
                              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>}
                                      )
                                    ]
                                  )
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [1944]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [1936 1941]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: 
                        (sh_lhs_expr.Name
                          left: <Id.Lit_VarLike 'merge_tool_path='>
                          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>}
                              )
                            right: <Id.Eof_RParen _>
                          )
                        }
                      spids: [1974]
                    )
                  ]
                  redirects: []
                )
              ]
              redirects: []
            )
            (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
                              left: <Id.Lit_VarLike 'merge_tool_path='>
                              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))}
                                  )
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [2005]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [1991 2002]
                )
              ]
              else_action: []
              redirects: []
            )
            (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))})
                                    right: <Id.Eof_RParen _>
                                  )
                                )
                              }
                            )
                            (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>}
                                    )
                                  ]
                                  more_env: []
                                  do_fork: T
                                )
                              ]
                              negated: T
                              stderr_indices: []
                            )
                          ]
                        )
                      ]
                    )
                  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>})]
                      more_env: []
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [2018 2052]
                )
              ]
              else_action: []
              redirects: []
            )
            (C {<echo>} {(DQ ($ Id.VSub_DollarName merge_tool_path))})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: get_merge_tool
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          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: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<get_configured_merge_tool>})
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [2105]
                )
              ]
              redirects: []
            )
            (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
                                  left: <Id.Lit_VarLike 'merge_tool='>
                                  name: merge_tool
                                )
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    child: (C {<guess_merge_tool>})
                                    right: <Id.Eof_RParen _>
                                  )
                                }
                              spids: [2129]
                            )
                          ]
                          redirects: []
                        )
                        (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
                      ]
                    )
                  ]
                  spids: [2115 2126]
                )
              ]
              else_action: []
              redirects: []
            )
            (C {<echo>} {(DQ ($ Id.VSub_DollarName merge_tool))})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: mergetool_find_win32_cmd
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'executable='> name:executable)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                  spids: [2159]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sub_directory='> name:sub_directory)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 2)}
                  spids: [2163]
                )
              ]
              redirects: []
            )
            (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>}
                            )
                          ]
                          more_env: []
                          do_fork: T
                        )
                      ]
                    )
                  action: [
                    (C {<printf>} {(SQ <'%s'>)} {(DQ ($ Id.VSub_DollarName executable))})
                    (command.ControlFlow token:<Id.ControlFlow_Return return>)
                  ]
                  spids: [2172 2189]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.ForEach
              iter_names: [directory]
              iterable: 
                (for_iter.Words
                  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
                            stderr_indices: []
                          )
                        right: <Id.Eof_RParen _>
                      )
                    }
                  ]
                )
              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]
                        )
                      ]
                      else_action: []
                      redirects: []
                    )
                  ]
                )
              redirects: []
            )
            (C {<printf>} {(SQ <'%s'>)} {(DQ ($ Id.VSub_DollarName executable))})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
  ]
)