(command.CommandList
  children: [
    (command.ShFunction
      name: usage
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.HereDoc
                  op: (Token id:Id.Redir_DLess val:'<<' span_id:181)
                  fd: -1
                  here_begin: {(EOF)}
                  here_end_span_id: 195
                  stdin_parts: [
                    ('usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t tarball]\n')
                    ('                 [-A patterns] [-D destdir] [-I patterns] [-L logfile]\n')
                    ('                 [-M options]\n')
                    (
'       etcupdate build [-B] [-d workdir] [-s source] [-L logfile] [-M options]\n'
                    )
                    ('                 <tarball>\n')
                    ('       etcupdate diff [-d workdir] [-D destdir] [-I patterns] [-L logfile]\n')
                    (
'       etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L logfile]\n'
                    )
                    ('                 [-M options]\n')
                    ('       etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile]\n')
                    ('       etcupdate status [-d workdir] [-D destdir]\n')
                  ]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:197)
              arg_word: {(1)}
            )
          ]
        )
    )
    (command.ShFunction
      name: log
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [{(echo)} {(DQ ('>>>'))} {(DQ ($ Id.VSub_At '$@'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:224)
                  fd: -1
                  arg_word: {(3)}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: panic
      body: 
        (command.BraceGroup
          children: [
            (C {(echo)} {(DQ ('PANIC:'))} {(DQ ($ Id.VSub_At '$@'))})
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:251)
              arg_word: {(10)}
            )
          ]
        )
    )
    (command.ShFunction
      name: warn
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [{(echo)} {(-n)} {(DQ ('  '))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_DGreat val:'>>' span_id:279)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$WARNINGS')}
                )
              ]
            )
            (command.Simple
              words: [{(echo)} {(DQ ($ Id.VSub_At '$@'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_DGreat val:'>>' span_id:290)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$WARNINGS')}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: rule
      body: 
        (command.BraceGroup
          children: [(C {(jot)} {(-b)} {(DQ ($ Id.VSub_Number '$1'))} {(-s)} {(DQ )} {(67)})]
        )
    )
    (command.ShFunction
      name: file_type
      body: 
        (command.BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {(stat)} {(-f)} {(DQ ('%HT'))} {($ Id.VSub_Number '$1')})
                (C {(tr)} {(DQ ('[:upper:]'))} {(DQ ('[:lower:]'))})
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: exists
      body: 
        (command.BraceGroup
          children: [
            (C {(Id.Lit_LBracket '[')} {(-e)} {($ Id.VSub_Number '$1')} {(-o)} {(-L)} 
              {($ Id.VSub_Number '$1')} {(Id.Lit_RBracket ']')}
            )
          ]
        )
    )
    (command.ShFunction
      name: ignore
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(pattern)} {(-)})
            (C {(Id.KW_Set set)} {(-o)} {(noglob)})
            (command.ForEach
              iter_name: pattern
              iter_words: [{($ Id.VSub_DollarName '$IGNORE_FILES')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {(Id.KW_Set set)} {(Id.Lit_Other '+') (o)} {(noglob)})
                    (command.Case
                      to_match: {($ Id.VSub_Number '$1')}
                      arms: [
                        (case_arm
                          pat_list: [{($ Id.VSub_DollarName '$pattern')}]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:470)
                              arg_word: {(0)}
                            )
                          ]
                          spids: [466 467 475 -1]
                        )
                      ]
                    )
                    (C {(Id.KW_Set set)} {(-o)} {(noglob)})
                  ]
                )
            )
            (command.Case
              to_match: {($ Id.VSub_Number '$1')}
              arms: [
                (case_arm
                  pat_list: [{(/.cshrc)} {(/.profile)}]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} 
                                  {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')} {(-ef)} {(${ Id.VSub_Name DESTDIR) (/root) ($ Id.VSub_Number '$1')} {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:535)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:540)
                              arg_word: {(0)}
                            )
                          ]
                          spids: [517 537]
                        )
                      ]
                    )
                  ]
                  spids: [511 514 548 -1]
                )
                (case_arm pat_list:[{(Id.Lit_Star '*')}] spids:[551 552 555 -1])
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:562)
              arg_word: {(1)}
            )
          ]
        )
    )
    (command.ShFunction
      name: always_install
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(pattern)} {(-)})
            (C {(Id.KW_Set set)} {(-o)} {(noglob)})
            (command.ForEach
              iter_name: pattern
              iter_words: [{($ Id.VSub_DollarName '$ALWAYS_INSTALL')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {(Id.KW_Set set)} {(Id.Lit_Other '+') (o)} {(noglob)})
                    (command.Case
                      to_match: {($ Id.VSub_Number '$1')}
                      arms: [
                        (case_arm
                          pat_list: [{($ Id.VSub_DollarName '$pattern')}]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:634)
                              arg_word: {(0)}
                            )
                          ]
                          spids: [630 631 639 -1]
                        )
                      ]
                    )
                    (C {(Id.KW_Set set)} {(-o)} {(noglob)})
                  ]
                )
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:656)
              arg_word: {(1)}
            )
          ]
        )
    )
    (command.ShFunction
      name: build_tree
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(destdir)} {(dir)} {(file)} {(make)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:make)
                  op: assign_op.Equal
                  rhs: {(DQ ('make ') ($ Id.VSub_DollarName '$MAKE_OPTIONS') (' -DNO_FILEMON'))}
                  spids: [691]
                )
              ]
            )
            (C {(log)} 
              {
                (DQ ('Building tree at ') ($ Id.VSub_Number '$1') (' with ') 
                  ($ Id.VSub_DollarName '$make')
                )
              }
            )
            (command.Simple
              words: [{(mkdir)} {(-p)} {($ Id.VSub_Number '$1') (/usr/obj)}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:717)
                  fd: -1
                  arg_word: {(3)}
                )
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:720)
                  fd: 2
                  arg_word: {(1)}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:destdir)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:725)
                        command_list: 
                          (command.CommandList
                            children: [(C {(realpath)} {($ Id.VSub_Number '$1')})]
                          )
                      )
                    }
                  spids: [724]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$preworld'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:746)
                    )
                  ]
                  action: [
                    (command.ForEach
                      iter_name: file
                      iter_words: [{($ Id.VSub_DollarName '$PREWORLD_FILES')}]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:dir)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:772)
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {(dirname)} {(/) ($ Id.VSub_DollarName '$file')})
                                            ]
                                          )
                                      )
                                    }
                                  spids: [771]
                                )
                              ]
                            )
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (command.Simple
                                  words: [
                                    {(mkdir)}
                                    {(-p)}
                                    {($ Id.VSub_Number '$1') (/) ($ Id.VSub_DollarName '$dir')}
                                  ]
                                  redirects: [
                                    (redir.Redir
                                      op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:790)
                                      fd: -1
                                      arg_word: {(3)}
                                    )
                                    (redir.Redir
                                      op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:793)
                                      fd: 2
                                      arg_word: {(1)}
                                    )
                                  ]
                                )
                                (command.ControlFlow
                                  token: (Token id:Id.ControlFlow_Return val:return span_id:798)
                                  arg_word: {(1)}
                                )
                              ]
                            )
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (C {(cp)} {(-p)} 
                                  {($ Id.VSub_DollarName '$SRCDIR') (/) ($ Id.VSub_DollarName '$file')} {($ Id.VSub_Number '$1') (/) ($ Id.VSub_DollarName '$file')}
                                )
                                (command.ControlFlow
                                  token: (Token id:Id.ControlFlow_Return val:return span_id:817)
                                  arg_word: {(1)}
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                  spids: [735 748]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$nobuild'))} 
                              {(Id.Lit_RBracket ']')}
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:838)
                    )
                  ]
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (command.Subshell
                          command_list: 
                            (command.CommandList
                              children: [
                                (command.Sentence
                                  child: (C {(cd)} {($ Id.VSub_DollarName '$SRCDIR')})
                                  terminator: (Token id:Id.Op_Semi val:';' span_id:847)
                                )
                                (command.AndOr
                                  ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
                                  children: [
                                    (C {($ Id.VSub_DollarName '$make')} 
                                      {(Id.Lit_VarLike 'DESTDIR=') ($ Id.VSub_DollarName '$destdir')} {(distrib-dirs)}
                                    )
                                    (command.Simple
                                      words: [
                                        {($ Id.VSub_DollarName '$make')}
                                        {(_obj)}
                                        {(Id.Lit_VarLike 'SUBDIR_OVERRIDE=') (etc)}
                                      ]
                                      more_env: [
                                        (env_pair
                                          name: MAKEOBJDIRPREFIX
                                          val: {($ Id.VSub_DollarName '$destdir') (/usr/obj)}
                                          spids: [859]
                                        )
                                      ]
                                    )
                                    (command.Simple
                                      words: [
                                        {($ Id.VSub_DollarName '$make')}
                                        {(everything)}
                                        {(Id.Lit_VarLike 'SUBDIR_OVERRIDE=') (etc)}
                                      ]
                                      more_env: [
                                        (env_pair
                                          name: MAKEOBJDIRPREFIX
                                          val: {($ Id.VSub_DollarName '$destdir') (/usr/obj)}
                                          spids: [873]
                                        )
                                      ]
                                    )
                                    (command.Simple
                                      words: [
                                        {($ Id.VSub_DollarName '$make')}
                                        {(Id.Lit_VarLike 'DESTDIR=') 
                                          ($ Id.VSub_DollarName '$destdir')
                                        }
                                        {(distribution)}
                                      ]
                                      more_env: [
                                        (env_pair
                                          name: MAKEOBJDIRPREFIX
                                          val: {($ Id.VSub_DollarName '$destdir') (/usr/obj)}
                                          spids: [887]
                                        )
                                      ]
                                    )
                                  ]
                                )
                              ]
                            )
                          redirects: [
                            (redir.Redir
                              op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:901)
                              fd: -1
                              arg_word: {(3)}
                            )
                            (redir.Redir
                              op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:904)
                              fd: 2
                              arg_word: {(1)}
                            )
                          ]
                        )
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Return val:return span_id:909)
                          arg_word: {(1)}
                        )
                      ]
                    )
                  ]
                  spids: [825 840]
                )
              ]
              else_action: [
                (command.AndOr
                  ops: [Id.Op_DPipe]
                  children: [
                    (command.Subshell
                      command_list: 
                        (command.CommandList
                          children: [
                            (command.Sentence
                              child: (C {(cd)} {($ Id.VSub_DollarName '$SRCDIR')})
                              terminator: (Token id:Id.Op_Semi val:';' span_id:921)
                            )
                            (command.AndOr
                              ops: [Id.Op_DAmp]
                              children: [
                                (C {($ Id.VSub_DollarName '$make')} 
                                  {(Id.Lit_VarLike 'DESTDIR=') ($ Id.VSub_DollarName '$destdir')} {(distrib-dirs)}
                                )
                                (C {($ Id.VSub_DollarName '$make')} 
                                  {(Id.Lit_VarLike 'DESTDIR=') ($ Id.VSub_DollarName '$destdir')} {(distribution)}
                                )
                              ]
                            )
                          ]
                        )
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:941)
                          fd: -1
                          arg_word: {(3)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:944)
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:949)
                      arg_word: {(1)}
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  words: [{(chflags)} {(-R)} {(noschg)} {($ Id.VSub_Number '$1')}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:965)
                      fd: -1
                      arg_word: {(3)}
                    )
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:968)
                      fd: 2
                      arg_word: {(1)}
                    )
                  ]
                )
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Return val:return span_id:973)
                  arg_word: {(1)}
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  words: [{(rm)} {(-rf)} {($ Id.VSub_Number '$1') (/usr/obj)}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:985)
                      fd: -1
                      arg_word: {(3)}
                    )
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:988)
                      fd: 2
                      arg_word: {(1)}
                    )
                  ]
                )
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Return val:return span_id:993)
                  arg_word: {(1)}
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  words: [
                    {(rm)}
                    {(-f)}
                    {($ Id.VSub_Number '$1') (/etc/) (Id.Lit_Star '*') (.db)}
                    {($ Id.VSub_Number '$1') (/etc/passwd)}
                    {($ Id.VSub_Number '$1') (/var/db/services.db)}
                  ]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1022)
                      fd: -1
                      arg_word: {(3)}
                    )
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:1025)
                      fd: 2
                      arg_word: {(1)}
                    )
                  ]
                )
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Return val:return span_id:1032)
                  arg_word: {(1)}
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  words: [{(find)} {($ Id.VSub_Number '$1')} {(-type)} {(f)} {(-size)} {(0)} {(-delete)}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1056)
                      fd: -1
                      arg_word: {(3)}
                    )
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:1059)
                      fd: 2
                      arg_word: {(1)}
                    )
                  ]
                )
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Return val:return span_id:1064)
                  arg_word: {(1)}
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  words: [{(find)} {(-d)} {($ Id.VSub_Number '$1')} {(-type)} {(d)} {(-empty)} {(-delete)}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1088)
                      fd: -1
                      arg_word: {(3)}
                    )
                    (redir.Redir
                      op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:1091)
                      fd: 2
                      arg_word: {(1)}
                    )
                  ]
                )
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Return val:return span_id:1096)
                  arg_word: {(1)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:1101)
              arg_word: {(0)}
            )
          ]
        )
    )
    (command.ShFunction
      name: extract_tree
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(files)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$tarball'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1145)
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:files)
                          op: assign_op.Equal
                          rhs: (word.Empty)
                          spids: [1150]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-n)} 
                                  {(DQ ($ Id.VSub_DollarName '$preworld'))} {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:1164)
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:files)
                                  op: assign_op.Equal
                                  rhs: {(DQ ($ Id.VSub_DollarName '$PREWORLD_FILES'))}
                                  spids: [1169]
                                )
                              ]
                            )
                          ]
                          spids: [1153 1166]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (command.Subshell
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (command.AndOr
                                              ops: [Id.Op_DAmp]
                                              children: [
                                                (C {(mkdir)} {(-p)} {($ Id.VSub_DollarName '$NEWTREE')})
                                                (C {(tar)} {(xf)} {($ Id.VSub_DollarName '$tarball')} 
                                                  {(-C)} {($ Id.VSub_DollarName '$NEWTREE')} {($ Id.VSub_DollarName '$files')}
                                                )
                                              ]
                                            )
                                          ]
                                        )
                                      redirects: [
                                        (redir.Redir
                                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1206)
                                          fd: -1
                                          arg_word: {(3)}
                                        )
                                        (redir.Redir
                                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:1209)
                                          fd: 2
                                          arg_word: {(1)}
                                        )
                                      ]
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:1211)
                            )
                          ]
                          action: [
                            (C {(echo)} {(DQ ('Failed to extract new tree.'))})
                            (C {(remove_tree)} {($ Id.VSub_DollarName '$NEWTREE')})
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Exit val:exit span_id:1228)
                              arg_word: {(1)}
                            )
                          ]
                          spids: [1178 1213]
                        )
                      ]
                    )
                  ]
                  spids: [1134 1147]
                )
              ]
              else_action: [
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [(C {(build_tree)} {($ Id.VSub_DollarName '$NEWTREE')})]
                              negated: T
                            )
                          terminator: (Token id:Id.Op_Semi val:';' span_id:1246)
                        )
                      ]
                      action: [
                        (C {(echo)} {(DQ ('Failed to build new tree.'))})
                        (C {(remove_tree)} {($ Id.VSub_DollarName '$NEWTREE')})
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Exit val:exit span_id:1263)
                          arg_word: {(1)}
                        )
                      ]
                      spids: [1239 1248]
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: remove_tree
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [{(rm)} {(-rf)} {($ Id.VSub_Number '$1')}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1299)
                  fd: -1
                  arg_word: {(3)}
                )
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:1302)
                  fd: 2
                  arg_word: {(1)}
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-e)} {($ Id.VSub_Number '$1')} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1315)
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [{(chflags)} {(-R)} {(noschg)} {($ Id.VSub_Number '$1')}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1328)
                          fd: -1
                          arg_word: {(3)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:1331)
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                    (command.Simple
                      words: [{(rm)} {(-rf)} {($ Id.VSub_Number '$1')}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1341)
                          fd: -1
                          arg_word: {(3)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:1344)
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                  ]
                  spids: [1306 1317]
                )
              ]
            )
            (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-e)} {($ Id.VSub_Number '$1')} 
              {(Id.Lit_RBracket ']')}
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:COMPARE_EQUAL)
          op: assign_op.Equal
          rhs: {(0)}
          spids: [1367]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:COMPARE_ONLYFIRST)
          op: assign_op.Equal
          rhs: {(1)}
          spids: [1370]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:COMPARE_ONLYSECOND)
          op: assign_op.Equal
          rhs: {(2)}
          spids: [1373]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:COMPARE_DIFFTYPE)
          op: assign_op.Equal
          rhs: {(3)}
          spids: [1376]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:COMPARE_DIFFLINKS)
          op: assign_op.Equal
          rhs: {(4)}
          spids: [1379]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:COMPARE_DIFFFILES)
          op: assign_op.Equal
          rhs: {(5)}
          spids: [1382]
        )
      ]
    )
    (command.ShFunction
      name: compare
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(first)} {(second)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [(C {(exists)} {($ Id.VSub_Number '$1')})]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1453)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: (C {(exists)} {($ Id.VSub_Number '$2')})
                              terminator: (Token id:Id.Op_Semi val:';' span_id:1463)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:1468)
                              arg_word: {($ Id.VSub_DollarName '$COMPARE_ONLYSECOND')}
                            )
                          ]
                          spids: [1458 1465]
                        )
                      ]
                      else_action: [
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Return val:return span_id:1476)
                          arg_word: {($ Id.VSub_DollarName '$COMPARE_EQUAL')}
                        )
                      ]
                    )
                  ]
                  spids: [1446 1455]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [(C {(exists)} {($ Id.VSub_Number '$2')})]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1491)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:1496)
                      arg_word: {($ Id.VSub_DollarName '$COMPARE_ONLYFIRST')}
                    )
                  ]
                  spids: [1484 1493]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:first)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:1510)
                        command_list: 
                          (command.CommandList
                            children: [(C {(stat)} {(-f)} {(DQ ('%Hp'))} {($ Id.VSub_Number '$1')})]
                          )
                      )
                    }
                  spids: [1509]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:second)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:1526)
                        command_list: 
                          (command.CommandList
                            children: [(C {(stat)} {(-f)} {(DQ ('%Hp'))} {($ Id.VSub_Number '$2')})]
                          )
                      )
                    }
                  spids: [1525]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$first'))} 
                          {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ ($ Id.VSub_DollarName '$second'))} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1557)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:1562)
                      arg_word: {($ Id.VSub_DollarName '$COMPARE_DIFFTYPE')}
                    )
                  ]
                  spids: [1541 1559]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-L)} {($ Id.VSub_Number '$1')} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1584)
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:first)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:1590)
                                command_list: 
                                  (command.CommandList
                                    children: [(C {(readlink)} {($ Id.VSub_Number '$1')})]
                                  )
                              )
                            }
                          spids: [1589]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:second)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:1600)
                                command_list: 
                                  (command.CommandList
                                    children: [(C {(readlink)} {($ Id.VSub_Number '$2')})]
                                  )
                              )
                            }
                          spids: [1599]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$first'))} 
                                  {(Id.Lit_Equals '=')} {(DQ ($ Id.VSub_DollarName '$second'))} {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:1624)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:1629)
                              arg_word: {($ Id.VSub_DollarName '$COMPARE_EQUAL')}
                            )
                          ]
                          spids: [1609 1626]
                        )
                      ]
                      else_action: [
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Return val:return span_id:1637)
                          arg_word: {($ Id.VSub_DollarName '$COMPARE_DIFFLINKS')}
                        )
                      ]
                    )
                  ]
                  spids: [1575 1586]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-f)} {($ Id.VSub_Number '$1')} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1662)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(cmp)} {(-s)} {($ Id.VSub_Number '$1')} {($ Id.VSub_Number '$2')})
                              terminator: (Token id:Id.Op_Semi val:';' span_id:1676)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:1681)
                              arg_word: {($ Id.VSub_DollarName '$COMPARE_EQUAL')}
                            )
                          ]
                          spids: [1667 1678]
                        )
                      ]
                      else_action: [
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Return val:return span_id:1689)
                          arg_word: {($ Id.VSub_DollarName '$COMPARE_DIFFFILES')}
                        )
                      ]
                    )
                  ]
                  spids: [1653 1664]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:1709)
              arg_word: {($ Id.VSub_DollarName '$COMPARE_EQUAL')}
            )
          ]
        )
    )
    (command.ShFunction
      name: fbsdid_only
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [
                {(diff)}
                {(-qI)}
                {(SQ (Token id:Id.Lit_Chars val:'\\$FreeBSD.*\\$' span_id:1744))}
                {($ Id.VSub_Number '$1')}
                {($ Id.VSub_Number '$2')}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:1751)
                  fd: -1
                  arg_word: {(/dev/null)}
                )
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:1754)
                  fd: 2
                  arg_word: {(1)}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: compare_fbsdid
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(cmp)})
            (C {(compare)} {($ Id.VSub_Number '$1')} {($ Id.VSub_Number '$2')})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cmp)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [1801]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.AndOr
                          ops: [Id.Op_DAmp]
                          children: [
                            (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$FREEBSD_ID'))} 
                              {(-a)} {(DQ ($ Id.VSub_DollarName '$cmp'))} {(-eq)} {($ Id.VSub_DollarName '$COMPARE_DIFFFILES')} 
                              {(Id.Lit_RBracket ']')}
                            )
                            (C {(fbsdid_only)} {($ Id.VSub_Number '$1')} {($ Id.VSub_Number '$2')})
                          ]
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1837)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:1842)
                      arg_word: {($ Id.VSub_DollarName '$COMPARE_EQUAL')}
                    )
                  ]
                  spids: [1806 1839]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:1851)
              arg_word: {($ Id.VSub_DollarName '$cmp')}
            )
          ]
        )
    )
    (command.ShFunction
      name: empty_dir
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(contents)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:contents)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:1881)
                        command_list: 
                          (command.CommandList
                            children: [(C {(ls)} {(-A)} {($ Id.VSub_Number '$1')})]
                          )
                      )
                    }
                  spids: [1880]
                )
              ]
            )
            (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$contents'))} 
              {(Id.Lit_RBracket ']')}
            )
          ]
        )
    )
    (command.ShFunction
      name: dir_subset
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(contents)} {(file)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C {(Id.Lit_LBracket '[')} {(-d)} {($ Id.VSub_Number '$1')} {(-a)} {(-d)} 
                              {($ Id.VSub_Number '$2')} {(Id.Lit_RBracket ']')}
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:1958)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:1963)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [1941 1960]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:contents)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:1981)
                        command_list: 
                          (command.CommandList
                            children: [(C {(ls)} {(-A)} {($ Id.VSub_Number '$1')})]
                          )
                      )
                    }
                  spids: [1980]
                )
              ]
            )
            (command.ForEach
              iter_name: file
              iter_words: [{($ Id.VSub_DollarName '$contents')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (C {(compare)} 
                                      {($ Id.VSub_Number '$1') (/) ($ Id.VSub_DollarName '$file')} {($ Id.VSub_Number '$2') (/) ($ Id.VSub_DollarName '$file')}
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:2017)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:2022)
                              arg_word: {(1)}
                            )
                          ]
                          spids: [2004 2019]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-d)} 
                                  {($ Id.VSub_Number '$1') (/) ($ Id.VSub_DollarName '$file')} {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:2042)
                            )
                          ]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.Pipeline
                                          children: [
                                            (C {(dir_subset)} 
                                              {($ Id.VSub_Number '$1') (/) 
                                                ($ Id.VSub_DollarName '$file')
                                              } {($ Id.VSub_Number '$2') (/) ($ Id.VSub_DollarName '$file')}
                                            )
                                          ]
                                          negated: T
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:2060)
                                    )
                                  ]
                                  action: [
                                    (command.ControlFlow
                                      token: (Token id:Id.ControlFlow_Return val:return span_id:2065)
                                      arg_word: {(1)}
                                    )
                                  ]
                                  spids: [2047 2062]
                                )
                              ]
                            )
                          ]
                          spids: [2031 2044]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:2079)
              arg_word: {(0)}
            )
          ]
        )
    )
    (command.ShFunction
      name: empty_destdir
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:2126)
                    )
                  ]
                  action: [
                    (C {(dir_subset)} {($ Id.VSub_DollarName '$DESTDIR') (/) ($ Id.VSub_Number '$1')} 
                      {($ Id.VSub_DollarName '$OLDTREE') (/) ($ Id.VSub_Number '$1')}
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:2142)
                    )
                  ]
                  spids: [2115 2128]
                )
              ]
            )
            (C {(empty_dir)} {($ Id.VSub_DollarName '$DESTDIR') (/) ($ Id.VSub_Number '$1')})
          ]
        )
    )
    (command.ShFunction
      name: diffnode
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(first)} {(second)} {(file)} {(old)} {(new)} {(diffargs)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$FREEBSD_ID'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:2222)
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:diffargs)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ('-I ') 
                                (word_part.EscapedLiteral
                                  token: (Token id:Id.Lit_EscapedChar val:'\\\\' span_id:2230)
                                ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\$' span_id:2231)) ('FreeBSD.*') 
                                (word_part.EscapedLiteral
                                  token: (Token id:Id.Lit_EscapedChar val:'\\\\' span_id:2233)
                                ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\$' span_id:2234))
                              )
                            }
                          spids: [2227]
                        )
                      ]
                    )
                  ]
                  spids: [2211 2224]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:diffargs)
                      op: assign_op.Equal
                      rhs: {(DQ )}
                      spids: [2241]
                    )
                  ]
                )
              ]
            )
            (C {(compare_fbsdid)} {($ Id.VSub_Number '$1') (/) ($ Id.VSub_Number '$3')} 
              {($ Id.VSub_Number '$2') (/) ($ Id.VSub_Number '$3')}
            )
            (command.Case
              to_match: {($ Id.VSub_QMark '$?')}
              arms: [
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_EQUAL')}]
                  spids: [2268 2269 2272 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_ONLYFIRST')}]
                  action: [
                    (C {(echo)})
                    (C {(echo)} {(DQ ('Removed: ') ($ Id.VSub_Number '$3'))})
                    (C {(echo)})
                  ]
                  spids: [2275 2276 2293 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_ONLYSECOND')}]
                  action: [
                    (C {(echo)})
                    (C {(echo)} {(DQ ('Added: ') ($ Id.VSub_Number '$3'))})
                    (C {(echo)})
                  ]
                  spids: [2296 2297 2314 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFTYPE')}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:first)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:2322)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(file_type)} 
                                        {($ Id.VSub_Number '$1') (/) ($ Id.VSub_Number '$3')}
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [2321]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:second)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:2334)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(file_type)} 
                                        {($ Id.VSub_Number '$2') (/) ($ Id.VSub_Number '$3')}
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [2333]
                        )
                      ]
                    )
                    (C {(echo)})
                    (C {(echo)} 
                      {
                        (DQ ('Node changed from a ') ($ Id.VSub_DollarName '$first') (' to a ') 
                          ($ Id.VSub_DollarName '$second') (': ') ($ Id.VSub_Number '$3')
                        )
                      }
                    )
                    (C {(echo)})
                  ]
                  spids: [2317 2318 2363 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFLINKS')}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:first)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:2371)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(readlink)} 
                                        {($ Id.VSub_Number '$1') (/) ($ Id.VSub_DollarName '$file')}
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [2370]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:second)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:2383)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(readlink)} 
                                        {($ Id.VSub_Number '$2') (/) ($ Id.VSub_DollarName '$file')}
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [2382]
                        )
                      ]
                    )
                    (C {(echo)})
                    (C {(echo)} {(DQ ('Link changed: ') ($ Id.VSub_DollarName '$file'))})
                    (C {(rule)} {(DQ ('='))})
                    (C {(echo)} {(DQ (-) ($ Id.VSub_DollarName '$first'))})
                    (C {(echo)} {(DQ ('+') ($ Id.VSub_DollarName '$second'))})
                    (C {(echo)})
                  ]
                  spids: [2366 2367 2431 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFFILES')}]
                  action: [
                    (C {(echo)} {(DQ ('Index: ') ($ Id.VSub_Number '$3'))})
                    (C {(rule)} {(DQ ('='))})
                    (C {(diff)} {(-u)} {($ Id.VSub_DollarName '$diffargs')} {(-L)} 
                      {(DQ ($ Id.VSub_Number '$3') (' (') ($ Id.VSub_Number '$4') (')'))} {($ Id.VSub_Number '$1') (/) ($ Id.VSub_Number '$3')} {(-L)} 
                      {(DQ ($ Id.VSub_Number '$3') (' (') ($ Id.VSub_Number '$5') (')'))} {($ Id.VSub_Number '$2') (/) ($ Id.VSub_Number '$3')}
                    )
                  ]
                  spids: [2434 2435 2486 -1]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: post_update
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(args)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$preworld'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:2531)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:2536)
                    )
                  ]
                  spids: [2520 2533]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-f)} {(${ Id.VSub_Name DESTDIR) (/etc/localtime)} 
                          {(-a)} {(Id.KW_Bang '!')} {(-L)} {(${ Id.VSub_Name DESTDIR) (/etc/localtime)} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:2576)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-f)} 
                                  {(${ Id.VSub_Name DESTDIR) (/var/db/zoneinfo)} {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:2593)
                            )
                          ]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (C {(Id.Lit_LBracket '[')} {(-n)} 
                                          {(DQ (${ Id.VSub_Name DESTDIR))} {(Id.Lit_RBracket ']')}
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:2611)
                                    )
                                  ]
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:args)
                                          op: assign_op.Equal
                                          rhs: {(DQ ('-C ') (${ Id.VSub_Name DESTDIR))}
                                          spids: [2616]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [2598 2613]
                                )
                              ]
                              else_action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:args)
                                      op: assign_op.Equal
                                      rhs: {(DQ )}
                                      spids: [2628]
                                    )
                                  ]
                                )
                              ]
                            )
                            (C {(log)} {(DQ ('tzsetup -r ') (${ Id.VSub_Name args))})
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (C {(Id.Lit_LBracket '[')} {(-z)} 
                                          {(DQ ($ Id.VSub_DollarName '$dryrun'))} {(Id.Lit_RBracket ']')}
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:2657)
                                    )
                                  ]
                                  action: [
                                    (command.Simple
                                      words: [{(tzsetup)} {(-r)} {(${ Id.VSub_Name args)}]
                                      redirects: [
                                        (redir.Redir
                                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:2670)
                                          fd: -1
                                          arg_word: {(3)}
                                        )
                                        (redir.Redir
                                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:2673)
                                          fd: 2
                                          arg_word: {(1)}
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [2646 2659]
                                )
                              ]
                            )
                          ]
                          spids: [2581 2595]
                        )
                      ]
                      else_action: [
                        (C {(warn)} {(DQ ('Needs update: /etc/localtime (required'))} 
                          {(DQ ('manual update via tzsetup(8))'))}
                        )
                      ]
                    )
                  ]
                  spids: [2551 2578]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: install_dirs
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(args)} {(dir)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:dir)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:2741)
                        command_list: 
                          (command.CommandList
                            children: [(C {(dirname)} {($ Id.VSub_Number '$3')})]
                          )
                      )
                    }
                  spids: [2740]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-d)} 
                          {(${ Id.VSub_Number 2) ($ Id.VSub_DollarName '$dir')} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:2775)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:2780)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [2763 2777]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(exists)} {(${ Id.VSub_Number 2) ($ Id.VSub_DollarName '$dir')})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:2805)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                                  {(-a)} {(DQ ($ Id.VSub_Number '$2'))} {(Id.Lit_Equals '=')} {(DQ ($ Id.VSub_DollarName '$DESTDIR'))} 
                                  {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:2849)
                            )
                          ]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (C {(compare)} 
                                          {($ Id.VSub_DollarName '$OLDTREE') (/) 
                                            ($ Id.VSub_DollarName '$dir')
                                          } {($ Id.VSub_DollarName '$DESTDIR') (/) ($ Id.VSub_DollarName '$dir')}
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:2865)
                                    )
                                  ]
                                  action: [
                                    (command.ControlFlow
                                      token: (Token id:Id.ControlFlow_Return val:return span_id:2870)
                                      arg_word: {(0)}
                                    )
                                  ]
                                  spids: [2854 2867]
                                )
                              ]
                            )
                          ]
                          spids: [2826 2851]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:args)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:2883)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(file_type)} 
                                        {(${ Id.VSub_Number 2) ($ Id.VSub_DollarName '$dir')}
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [2882]
                        )
                      ]
                    )
                    (C {(warn)} 
                      {
                        (DQ ('Directory mismatch: ') (${ Id.VSub_Number 2) 
                          ($ Id.VSub_DollarName '$dir') (' (') ($ Id.VSub_DollarName '$args') (')')
                        )
                      }
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:2909)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [2797 2807]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C {(install_dirs)} {($ Id.VSub_Number '$1')} {(DQ ($ Id.VSub_Number '$2'))} 
                              {($ Id.VSub_DollarName '$dir')}
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:2939)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:2944)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [2926 2941]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:args)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:2962)
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(stat)} {(-f)} {(DQ ('-o %Su -g %Sg -m %0Mp%0Lp'))} 
                                {($ Id.VSub_Number '$1') (/) ($ Id.VSub_DollarName '$dir')}
                              )
                            ]
                          )
                      )
                    }
                  spids: [2961]
                )
              ]
            )
            (C {(log)} 
              {
                (DQ ('install -d ') ($ Id.VSub_DollarName '$args') (' ') (${ Id.VSub_Number 2) 
                  ($ Id.VSub_DollarName '$dir')
                )
              }
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:3004)
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [
                        {(install)}
                        {(-d)}
                        {($ Id.VSub_DollarName '$args')}
                        {(${ Id.VSub_Number 2) ($ Id.VSub_DollarName '$dir')}
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3020)
                          fd: -1
                          arg_word: {(3)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:3023)
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                  ]
                  spids: [2993 3006]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:3030)
              arg_word: {(0)}
            )
          ]
        )
    )
    (command.ShFunction
      name: post_install_file
      body: 
        (command.BraceGroup
          children: [
            (command.Case
              to_match: {($ Id.VSub_Number '$1')}
              arms: [
                (case_arm
                  pat_list: [{(/etc/mail/aliases)}]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-z)} 
                                  {(DQ ($ Id.VSub_DollarName '$DESTDIR'))} {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:3082)
                            )
                          ]
                          action: [
                            (C {(log)} {(DQ (newaliases))})
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (C {(Id.Lit_LBracket '[')} {(-z)} 
                                          {(DQ ($ Id.VSub_DollarName '$dryrun'))} {(Id.Lit_RBracket ']')}
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:3105)
                                    )
                                  ]
                                  action: [
                                    (command.Simple
                                      words: [{(newaliases)}]
                                      redirects: [
                                        (redir.Redir
                                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3112)
                                          fd: -1
                                          arg_word: {(3)}
                                        )
                                        (redir.Redir
                                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:3115)
                                          fd: 2
                                          arg_word: {(1)}
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [3094 3107]
                                )
                              ]
                            )
                          ]
                          spids: [3071 3084]
                        )
                      ]
                      else_action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:NEWALIAS_WARN)
                              op: assign_op.Equal
                              rhs: {(yes)}
                              spids: [3125]
                            )
                          ]
                        )
                      ]
                    )
                  ]
                  spids: [3063 3064 3132 -1]
                )
                (case_arm
                  pat_list: [{(/etc/login.conf)}]
                  action: [
                    (C {(log)} {(DQ ('cap_mkdb ') (${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1'))})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                                  {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:3161)
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [{(cap_mkdb)} {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3173)
                                  fd: -1
                                  arg_word: {(3)}
                                )
                                (redir.Redir
                                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:3176)
                                  fd: 2
                                  arg_word: {(1)}
                                )
                              ]
                            )
                          ]
                          spids: [3150 3163]
                        )
                      ]
                    )
                  ]
                  spids: [3135 3136 3183 -1]
                )
                (case_arm
                  pat_list: [{(/etc/master.passwd)}]
                  action: [
                    (C {(log)} 
                      {
                        (DQ ('pwd_mkdb -p -d ') ($ Id.VSub_DollarName '$DESTDIR') ('/etc ') 
                          (${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')
                        )
                      }
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                                  {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:3214)
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [
                                {(pwd_mkdb)}
                                {(-p)}
                                {(-d)}
                                {($ Id.VSub_DollarName '$DESTDIR') (/etc)}
                                {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
                              ]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3235)
                                  fd: -1
                                  arg_word: {(3)}
                                )
                                (redir.Redir
                                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:3238)
                                  fd: 2
                                  arg_word: {(1)}
                                )
                              ]
                            )
                          ]
                          spids: [3203 3216]
                        )
                      ]
                    )
                  ]
                  spids: [3186 3187 3245 -1]
                )
                (case_arm
                  pat_list: [{(/etc/motd)}]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-z)} 
                                  {(DQ ($ Id.VSub_DollarName '$DESTDIR'))} {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:3275)
                            )
                          ]
                          action: [
                            (C {(log)} {(DQ ('sh /etc/rc.d/motd start'))})
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (C {(Id.Lit_LBracket '[')} {(-z)} 
                                          {(DQ ($ Id.VSub_DollarName '$dryrun'))} {(Id.Lit_RBracket ']')}
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:3298)
                                    )
                                  ]
                                  action: [
                                    (command.Simple
                                      words: [{(sh)} {(/etc/rc.d/motd)} {(start)}]
                                      redirects: [
                                        (redir.Redir
                                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3309)
                                          fd: -1
                                          arg_word: {(3)}
                                        )
                                        (redir.Redir
                                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:3312)
                                          fd: 2
                                          arg_word: {(1)}
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [3287 3300]
                                )
                              ]
                            )
                          ]
                          spids: [3264 3277]
                        )
                      ]
                    )
                  ]
                  spids: [3248 3249 3322 -1]
                )
                (case_arm
                  pat_list: [{(/etc/services)}]
                  action: [
                    (C {(log)} 
                      {
                        (DQ ('services_mkdb -q -o ') ($ Id.VSub_DollarName '$DESTDIR') 
                          (/var/db/services.db)
                        )
                      } {(DQ (${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1'))}
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                                  {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:3358)
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [
                                {(services_mkdb)}
                                {(-q)}
                                {(-o)}
                                {($ Id.VSub_DollarName '$DESTDIR') (/var/db/services.db)}
                                {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
                              ]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3379)
                                  fd: -1
                                  arg_word: {(3)}
                                )
                                (redir.Redir
                                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:3382)
                                  fd: 2
                                  arg_word: {(1)}
                                )
                              ]
                            )
                          ]
                          spids: [3347 3360]
                        )
                      ]
                    )
                  ]
                  spids: [3325 3326 3389 -1]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: install_new
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C {(install_dirs)} {($ Id.VSub_DollarName '$NEWTREE')} 
                              {(DQ ($ Id.VSub_DollarName '$DESTDIR'))} {($ Id.VSub_Number '$1')}
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:3430)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:3435)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [3417 3432]
                )
              ]
            )
            (C {(log)} 
              {
                (DQ ('cp -Rp ') (${ Id.VSub_Name NEWTREE) ($ Id.VSub_Number '$1') (' ') 
                  (${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')
                )
              }
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:3470)
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [
                        {(cp)}
                        {(-Rp)}
                        {(${ Id.VSub_Name NEWTREE) ($ Id.VSub_Number '$1')}
                        {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3489)
                          fd: -1
                          arg_word: {(3)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:3492)
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                  ]
                  spids: [3459 3472]
                )
              ]
            )
            (C {(post_install_file)} {($ Id.VSub_Number '$1')})
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:3504)
              arg_word: {(0)}
            )
          ]
        )
    )
    (command.ShFunction
      name: install_resolved
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C {(install_dirs)} {($ Id.VSub_DollarName '$NEWTREE')} 
                              {(DQ ($ Id.VSub_DollarName '$DESTDIR'))} {($ Id.VSub_Number '$1')}
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:3556)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:3561)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [3543 3558]
                )
              ]
            )
            (C {(log)} 
              {
                (DQ ('cp -Rp ') (${ Id.VSub_Name CONFLICTS) ($ Id.VSub_Number '$1') (' ') 
                  (${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')
                )
              }
            )
            (command.Simple
              words: [
                {(cp)}
                {(-Rp)}
                {(${ Id.VSub_Name CONFLICTS) ($ Id.VSub_Number '$1')}
                {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3600)
                  fd: -1
                  arg_word: {(3)}
                )
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:3603)
                  fd: 2
                  arg_word: {(1)}
                )
              ]
            )
            (C {(post_install_file)} {($ Id.VSub_Number '$1')})
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:3612)
              arg_word: {(0)}
            )
          ]
        )
    )
    (command.ShFunction
      name: new_conflict
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:3650)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:3655)
                    )
                  ]
                  spids: [3639 3652]
                )
              ]
            )
            (C {(install_dirs)} {($ Id.VSub_DollarName '$NEWTREE')} 
              {($ Id.VSub_DollarName '$CONFLICTS')} {($ Id.VSub_Number '$1')}
            )
            (command.Simple
              words: [
                {(diff)}
                {(--changed-group-format) (Id.Lit_Equals '=') 
                  (SQ (Token id:Id.Lit_Chars val:'<<<<<<< (local)\n' span_id:3676) 
                    (Token id:Id.Lit_Chars val:'%<=======\n' span_id:3677) (Token id:Id.Lit_Chars val:'%>>>>>>>> (stock)\n' span_id:3678)
                  )
                }
                {($ Id.VSub_DollarName '$DESTDIR') (/) ($ Id.VSub_Number '$1')}
                {($ Id.VSub_DollarName '$NEWTREE') (/) ($ Id.VSub_Number '$1')}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:3689)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$CONFLICTS') (/) ($ Id.VSub_Number '$1')}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: remove_old
      body: 
        (command.BraceGroup
          children: [
            (C {(log)} {(DQ ('rm -f ') (${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1'))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:3736)
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [{(rm)} {(-f)} {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3750)
                          fd: -1
                          arg_word: {(3)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:3753)
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                  ]
                  spids: [3725 3738]
                )
              ]
            )
            (C {(echo)} {(DQ ('  D ') ($ Id.VSub_Number '$1'))})
          ]
        )
    )
    (command.ShFunction
      name: update_unmodified
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(new)} {(old)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-d)} 
                          {($ Id.VSub_DollarName '$DESTDIR') (/) ($ Id.VSub_Number '$1')} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:3825)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: (C {(empty_destdir)} {($ Id.VSub_Number '$1')})
                              terminator: (Token id:Id.Op_Semi val:';' span_id:3835)
                            )
                          ]
                          action: [
                            (C {(log)} 
                              {(DQ ('rmdir ') (${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1'))}
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (C {(Id.Lit_LBracket '[')} {(-z)} 
                                          {(DQ ($ Id.VSub_DollarName '$dryrun'))} {(Id.Lit_RBracket ']')}
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:3862)
                                    )
                                  ]
                                  action: [
                                    (command.Simple
                                      words: [
                                        {(rmdir)}
                                        {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
                                      ]
                                      redirects: [
                                        (redir.Redir
                                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3874)
                                          fd: -1
                                          arg_word: {(3)}
                                        )
                                        (redir.Redir
                                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:3877)
                                          fd: 2
                                          arg_word: {(1)}
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [3851 3864]
                                )
                              ]
                            )
                          ]
                          spids: [3830 3837]
                        )
                      ]
                      else_action: [
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Return val:return span_id:3887)
                          arg_word: {(1)}
                        )
                      ]
                    )
                  ]
                  spids: [3814 3827]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C {(Id.Lit_LBracket '[')} {(-f)} 
                              {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')} {(-a)} {(-f)} {(${ Id.VSub_Name NEWTREE) ($ Id.VSub_Number '$1')} {(Id.Lit_RBracket ']')}
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:3931)
                    )
                  ]
                  action: [
                    (C {(log)} {(DQ ('rm -f ') (${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1'))})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                                  {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:3958)
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [{(rm)} {(-f)} {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3972)
                                  fd: -1
                                  arg_word: {(3)}
                                )
                                (redir.Redir
                                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:3975)
                                  fd: 2
                                  arg_word: {(1)}
                                )
                              ]
                            )
                          ]
                          spids: [3947 3960]
                        )
                      ]
                    )
                  ]
                  spids: [3908 3933]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-d)} 
                          {($ Id.VSub_DollarName '$NEWTREE') (/) ($ Id.VSub_Number '$1')} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:4013)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(empty_dir)} 
                                  {($ Id.VSub_DollarName '$NEWTREE') (/) ($ Id.VSub_Number '$1')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:4025)
                            )
                          ]
                          action: [(C {(echo)} {(DQ ('  D ') ($ Id.VSub_DollarName '$file'))})]
                          spids: [4018 4027]
                        )
                      ]
                      else_action: [(C {(echo)} {(DQ ('  U ') ($ Id.VSub_DollarName '$file'))})]
                    )
                  ]
                  spids: [4002 4015]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(install_new)} {($ Id.VSub_Number '$1')})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:4057)
                    )
                  ]
                  action: [(C {(echo)} {(DQ ('  U ') ($ Id.VSub_DollarName '$file'))})]
                  spids: [4052 4059]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:4073)
              arg_word: {(0)}
            )
          ]
        )
    )
    (command.ShFunction
      name: update_freebsdid
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(new)} {(dest)} {(file)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:new)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:4130)
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(grep)} {(-c)} 
                                {(SQ (Token id:Id.Lit_Chars val:'$FreeBSD.*$' span_id:4142))} {(${ Id.VSub_Name NEWTREE) ($ Id.VSub_Number '$1')}
                              )
                            ]
                          )
                      )
                    }
                  spids: [4129]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:dest)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:4153)
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(grep)} {(-c)} 
                                {(SQ (Token id:Id.Lit_Chars val:'$FreeBSD.*$' span_id:4165))} {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
                              )
                            ]
                          )
                      )
                    }
                  spids: [4152]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$dest'))} {(-eq)} {(0)} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:4188)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:4193)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [4175 4190]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$dest'))} {(-ne)} {(1)} 
                          {(-o)} {(DQ ($ Id.VSub_DollarName '$dest'))} {(-ne)} {(1)} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:4224)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:4229)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [4201 4226]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:new)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:4247)
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(grep)} {(SQ (Token id:Id.Lit_Chars val:'$FreeBSD.*$' span_id:4257))} 
                                {(${ Id.VSub_Name NEWTREE) ($ Id.VSub_Number '$1')}
                              )
                            ]
                          )
                      )
                    }
                  spids: [4246]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:dest)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:4268)
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(grep)} {(SQ (Token id:Id.Lit_Chars val:'$FreeBSD.*$' span_id:4278))} 
                                {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
                              )
                            ]
                          )
                      )
                    }
                  spids: [4267]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$new'))} 
                          {(Id.Lit_Equals '=')} {(DQ ($ Id.VSub_DollarName '$dest'))} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:4303)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:4308)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [4288 4305]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:file)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:4338)
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(mktemp)} {($ Id.VSub_DollarName '$WORKDIR') (/etcupdate-XXXXXXX)})
                            ]
                          )
                      )
                    }
                  spids: [4337]
                )
              ]
            )
            (command.Simple
              words: [
                {(awk)}
                {(SQ (Token id:Id.Lit_Chars val:'/\\$FreeBSD.*\\$/ { exit } { print }' span_id:4351))}
                {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_DGreat val:'>>' span_id:4359)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$file')}
                )
              ]
            )
            (command.Simple
              words: [
                {(awk)}
                {(SQ (Token id:Id.Lit_Chars val:'/\\$FreeBSD.*\\$/ { print }' span_id:4367))}
                {(${ Id.VSub_Name NEWTREE) ($ Id.VSub_Number '$1')}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_DGreat val:'>>' span_id:4375)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$file')}
                )
              ]
            )
            (command.Simple
              words: [
                {(awk)}
                {
                  (SQ 
                    (Token
                      id: Id.Lit_Chars
                      val: '/\\$FreeBSD.*\\$/ { ok = 1; next } { if (ok) print }'
                      span_id: 4383
                    )
                  )
                }
                {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_DGreat val:'>>' span_id:4393)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$file')}
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C {(fbsdid_only)} {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')} 
                              {($ Id.VSub_DollarName '$file')}
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:4423)
                    )
                  ]
                  action: [
                    (C {(rm)} {(-f)} {($ Id.VSub_DollarName '$file')})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:4435)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [4411 4425]
                )
              ]
            )
            (C {(log)} 
              {
                (DQ ('cp ') ($ Id.VSub_DollarName '$file') (' ') (${ Id.VSub_Name DESTDIR) 
                  ($ Id.VSub_Number '$1')
                )
              }
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:4468)
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [
                        {(cp)}
                        {($ Id.VSub_DollarName '$file')}
                        {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:4482)
                          fd: -1
                          arg_word: {(3)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:4485)
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                  ]
                  spids: [4457 4470]
                )
              ]
            )
            (C {(rm)} {(-f)} {($ Id.VSub_DollarName '$file')})
            (C {(post_install_file)} {($ Id.VSub_Number '$1')})
            (C {(echo)} {(DQ ('  M ') ($ Id.VSub_Number '$1'))})
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Return val:return span_id:4512)
              arg_word: {(0)}
            )
          ]
        )
    )
    (command.ShFunction
      name: merge_file
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(res)})
            (command.Simple
              words: [
                {(diff3)}
                {(-E)}
                {(-m)}
                {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
                {(${ Id.VSub_Name OLDTREE) ($ Id.VSub_Number '$1')}
                {(${ Id.VSub_Name NEWTREE) ($ Id.VSub_Number '$1')}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:4575)
                  fd: -1
                  arg_word: {(/dev/null)}
                )
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:4579)
                  fd: 2
                  arg_word: {(3)}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:res)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [4583]
                )
              ]
            )
            (command.Case
              to_match: {($ Id.VSub_DollarName '$res')}
              arms: [
                (case_arm
                  pat_list: [{(0)}]
                  action: [
                    (C {(log)} 
                      {
                        (DQ ('diff3 -E -m ') (${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1') (' ') 
                          (${ Id.VSub_Name OLDTREE) ($ Id.VSub_Number '$1') (' ') (${ Id.VSub_Name NEWTREE) ($ Id.VSub_Number '$1')
                        )
                      }
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                                  {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:4638)
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:temp)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: 
                                          (Token
                                            id: Id.Left_DollarParen
                                            val: '$('
                                            span_id: 4644
                                          )
                                        command_list: 
                                          (command.CommandList
                                            children: [(C {(mktemp)} {(-t)} {(etcupdate)})]
                                          )
                                      )
                                    }
                                  spids: [4643]
                                )
                              ]
                            )
                            (command.Simple
                              words: [
                                {(diff3)}
                                {(-E)}
                                {(-m)}
                                {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
                                {(${ Id.VSub_Name OLDTREE) ($ Id.VSub_Number '$1')}
                                {(${ Id.VSub_Name NEWTREE) ($ Id.VSub_Number '$1')}
                              ]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_Great val:'>' span_id:4674)
                                  fd: -1
                                  arg_word: {(${ Id.VSub_Name temp)}
                                )
                              ]
                            )
                            (command.Simple
                              words: [{(cat)} {(${ Id.VSub_Name temp)}]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_Great val:'>' span_id:4691)
                                  fd: -1
                                  arg_word: {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
                                )
                              ]
                            )
                            (C {(rm)} {(-f)} {(${ Id.VSub_Name temp)})
                          ]
                          spids: [4627 4640]
                        )
                      ]
                    )
                    (C {(post_install_file)} {($ Id.VSub_Number '$1')})
                    (C {(echo)} {(DQ ('  M ') ($ Id.VSub_Number '$1'))})
                  ]
                  spids: [4594 4595 4724 -1]
                )
                (case_arm
                  pat_list: [{(1)}]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                                  {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:4750)
                            )
                          ]
                          action: [
                            (C {(install_dirs)} {($ Id.VSub_DollarName '$NEWTREE')} 
                              {($ Id.VSub_DollarName '$CONFLICTS')} {($ Id.VSub_Number '$1')}
                            )
                            (C {(log)} 
                              {
                                (DQ ('diff3 -m -A ') (${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1') 
                                  (' ') (${ Id.VSub_Name CONFLICTS) ($ Id.VSub_Number '$1')
                                )
                              }
                            )
                            (command.Simple
                              words: [
                                {(diff3)}
                                {(-m)}
                                {(-A)}
                                {(-L)}
                                {(DQ (yours))}
                                {(-L)}
                                {(DQ (original))}
                                {(-L)}
                                {(DQ (new))}
                                {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')}
                                {(${ Id.VSub_Name OLDTREE) ($ Id.VSub_Number '$1')}
                                {(${ Id.VSub_Name NEWTREE) ($ Id.VSub_Number '$1')}
                              ]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_Great val:'>' span_id:4821)
                                  fd: -1
                                  arg_word: {(${ Id.VSub_Name CONFLICTS) ($ Id.VSub_Number '$1')}
                                )
                              ]
                            )
                          ]
                          spids: [4739 4752]
                        )
                      ]
                    )
                    (C {(echo)} {(DQ ('  C ') ($ Id.VSub_Number '$1'))})
                  ]
                  spids: [4727 4728 4842 -1]
                )
                (case_arm
                  pat_list: [{(Id.Lit_Star '*')}]
                  action: [
                    (C {(panic)} {(DQ ('merge failed with status ') ($ Id.VSub_DollarName '$res'))})
                  ]
                  spids: [4845 4846 4857 -1]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: has_conflicts
      body: 
        (command.BraceGroup
          children: [
            (C {(egrep)} {(-q)} 
              {(SQ (Token id:Id.Lit_Chars val:'^(<{7}|\\|{7}|={7}|>{7}) ' span_id:4888))} {($ Id.VSub_DollarName '$CONFLICTS') (/) ($ Id.VSub_Number '$1')}
            )
          ]
        )
    )
    (command.ShFunction
      name: resolve_conflict
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(command)} {(junk)})
            (C {(echo)} {(DQ ("Resolving conflict in '") ($ Id.VSub_Number '$1') ("':"))})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:edit)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [4946]
                )
              ]
            )
            (command.WhileUntil
              keyword: (Token id:Id.KW_While val:while span_id:4949)
              cond: [
                (command.Sentence
                  child: (C {(true)})
                  terminator: (Token id:Id.Op_Semi val:';' span_id:4952)
                )
              ]
              body: 
                (command.DoGroup
                  children: [
                    (C {(echo)} {(-n)} {(DQ ('Select: (p) postpone, (df) diff-full, (e) edit,'))})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [(C {(has_conflicts)} {($ Id.VSub_Number '$1')})]
                                  negated: T
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:4981)
                            )
                          ]
                          action: [(C {(echo)} {(-n)} {(DQ (' (r) resolved,'))})]
                          spids: [4974 4983]
                        )
                      ]
                    )
                    (C {(echo)})
                    (C {(echo)} {(-n)} {(DQ ('        (h) help for more options: '))})
                    (C {(read)} {(command)})
                    (command.Case
                      to_match: {($ Id.VSub_DollarName '$command')}
                      arms: [
                        (case_arm
                          pat_list: [{(df)}]
                          action: [
                            (C {(diff)} {(-u)} {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_Number '$1')} 
                              {(${ Id.VSub_Name CONFLICTS) ($ Id.VSub_Number '$1')}
                            )
                          ]
                          spids: [5022 5023 5041 -1]
                        )
                        (case_arm
                          pat_list: [{(e)}]
                          action: [
                            (C {($ Id.VSub_DollarName '$EDITOR')} 
                              {(${ Id.VSub_Name CONFLICTS) ($ Id.VSub_Number '$1')}
                            )
                          ]
                          spids: [5044 5045 5056 -1]
                        )
                        (case_arm
                          pat_list: [{(h)}]
                          action: [
                            (command.Simple
                              words: [{(cat)}]
                              redirects: [
                                (redir.HereDoc
                                  op: (Token id:Id.Redir_DLess val:'<<' span_id:5065)
                                  fd: -1
                                  here_begin: {(EOF)}
                                  here_end_span_id: 5076
                                  stdin_parts: [
                                    ('  (p)  postpone    - ignore this conflict for now\n')
                                    ('  (df) diff-full   - show all changes made to merged file\n')
                                    ('  (e)  edit        - change merged file in an editor\n')
                                    ('  (r)  resolved    - accept merged version of file\n')
                                    (
'  (mf) mine-full   - accept local version of entire file (ignore new changes)\n'
                                    )
                                    (
'  (tf) theirs-full - accept new version of entire file (lose local changes)\n'
                                    )
                                    ('  (h)  help        - show this list\n')
                                  ]
                                )
                              ]
                            )
                          ]
                          spids: [5059 5060 5078 -1]
                        )
                        (case_arm
                          pat_list: [{(mf)}]
                          action: [
                            (C {(rm)} {(${ Id.VSub_Name CONFLICTS) ($ Id.VSub_Number '$1')})
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:5105)
                            )
                          ]
                          spids: [5081 5082 5108 -1]
                        )
                        (case_arm
                          pat_list: [{(p)}]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:5115)
                            )
                          ]
                          spids: [5111 5112 5118 -1]
                        )
                        (case_arm
                          pat_list: [{(r)}]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: (C {(has_conflicts)} {($ Id.VSub_Number '$1')})
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:5138)
                                    )
                                  ]
                                  action: [
                                    (C {(echo)} 
                                      {
                                        (DQ ("File '") ($ Id.VSub_Number '$1') 
                                          ("' still has conflicts,")
                                        )
                                      } {(DQ ('are you sure? (y/n) '))}
                                    )
                                    (C {(read)} {(junk)})
                                    (command.If
                                      arms: [
                                        (if_arm
                                          cond: [
                                            (command.Sentence
                                              child: 
                                                (C {(Id.Lit_LBracket '[')} 
                                                  {(DQ ($ Id.VSub_DollarName '$junk'))} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ (y))} {(Id.Lit_RBracket ']')}
                                                )
                                              terminator: (Token id:Id.Op_Semi val:';' span_id:5179)
                                            )
                                          ]
                                          action: [
                                            (command.ControlFlow
                                              token: 
                                                (Token
                                                  id: Id.ControlFlow_Continue
                                                  val: continue
                                                  span_id: 5184
                                                )
                                            )
                                          ]
                                          spids: [5163 5181]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [5133 5140]
                                )
                              ]
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.Pipeline
                                          children: [(C {(install_resolved)} {($ Id.VSub_Number '$1')})]
                                          negated: T
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:5201)
                                    )
                                  ]
                                  action: [
                                    (C {(panic)} {(DQ ('Unable to install merged'))} 
                                      {(DQ ('version of ') ($ Id.VSub_Number '$1'))}
                                    )
                                  ]
                                  spids: [5194 5203]
                                )
                              ]
                            )
                            (C {(rm)} {(${ Id.VSub_Name CONFLICTS) ($ Id.VSub_Number '$1')})
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:5231)
                            )
                          ]
                          spids: [5121 5122 5234 -1]
                        )
                        (case_arm
                          pat_list: [{(tf)}]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.Pipeline
                                          children: [(C {(install_new)} {($ Id.VSub_Number '$1')})]
                                          negated: T
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:5260)
                                    )
                                  ]
                                  action: [
                                    (C {(panic)} {(DQ ('Unable to install new'))} 
                                      {(DQ ('version of ') ($ Id.VSub_Number '$1'))}
                                    )
                                  ]
                                  spids: [5253 5262]
                                )
                              ]
                            )
                            (C {(rm)} {(${ Id.VSub_Name CONFLICTS) ($ Id.VSub_Number '$1')})
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:5290)
                            )
                          ]
                          spids: [5237 5238 5293 -1]
                        )
                        (case_arm
                          pat_list: [{(Id.Lit_Star '*')}]
                          action: [(C {(echo)} {(DQ ('Invalid command.'))})]
                          spids: [5296 5297 5307 -1]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: handle_removed_file
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(dest)} {(file)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:file)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [5369]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(ignore)} {($ Id.VSub_DollarName '$file')})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:5378)
                    )
                  ]
                  action: [
                    (C {(log)} {(DQ ('IGNORE: removed file ') ($ Id.VSub_DollarName '$file'))})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:5391)
                    )
                  ]
                  spids: [5373 5380]
                )
              ]
            )
            (C {(compare_fbsdid)} 
              {($ Id.VSub_DollarName '$DESTDIR') (/) ($ Id.VSub_DollarName '$file')} {($ Id.VSub_DollarName '$OLDTREE') (/) ($ Id.VSub_DollarName '$file')}
            )
            (command.Case
              to_match: {($ Id.VSub_QMark '$?')}
              arms: [
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_EQUAL')}]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (C {(Id.Lit_LBracket '[')} {(-d)} 
                                      {($ Id.VSub_DollarName '$DESTDIR') (/) 
                                        ($ Id.VSub_DollarName '$file')
                                      } {(Id.Lit_RBracket ']')}
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:5433)
                            )
                          ]
                          action: [(C {(remove_old)} {($ Id.VSub_DollarName '$file')})]
                          spids: [5420 5435]
                        )
                      ]
                    )
                  ]
                  spids: [5416 5417 5446 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_ONLYFIRST')}]
                  action: [(C {(panic)} {(DQ ('Removed file now missing'))})]
                  spids: [5449 5450 5460 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_ONLYSECOND')}]
                  spids: [5463 5464 5471 -1]
                )
                (case_arm
                  pat_list: [
                    {($ Id.VSub_DollarName '$COMPARE_DIFFTYPE')}
                    {($ Id.VSub_DollarName '$COMPARE_DIFFLINKS')}
                    {($ Id.VSub_DollarName '$COMPARE_DIFFFILES')}
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:dest)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:5483)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(file_type)} 
                                        {($ Id.VSub_DollarName '$DESTDIR') (/) 
                                          ($ Id.VSub_DollarName '$file')
                                        }
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [5482]
                        )
                      ]
                    )
                    (C {(warn)} 
                      {
                        (DQ ('Modified ') ($ Id.VSub_DollarName '$dest') (' remains: ') 
                          ($ Id.VSub_DollarName '$file')
                        )
                      }
                    )
                  ]
                  spids: [5474 5479 5504 -1]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: handle_removed_directory
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(dir)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:dir)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [5537]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(ignore)} {($ Id.VSub_DollarName '$dir')})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:5546)
                    )
                  ]
                  action: [
                    (C {(log)} {(DQ ('IGNORE: removed dir ') ($ Id.VSub_DollarName '$dir'))})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:5559)
                    )
                  ]
                  spids: [5541 5548]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-d)} 
                          {($ Id.VSub_DollarName '$DESTDIR') (/) ($ Id.VSub_DollarName '$dir')} {(-a)} {(-d)} {($ Id.VSub_DollarName '$OLDTREE') (/) ($ Id.VSub_DollarName '$dir')} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:5585)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: (C {(empty_destdir)} {($ Id.VSub_DollarName '$dir')})
                              terminator: (Token id:Id.Op_Semi val:';' span_id:5595)
                            )
                          ]
                          action: [
                            (C {(log)} 
                              {
                                (DQ ('rmdir ') (${ Id.VSub_Name DESTDIR) ($ Id.VSub_DollarName '$dir'))
                              }
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (C {(Id.Lit_LBracket '[')} {(-z)} 
                                          {(DQ ($ Id.VSub_DollarName '$dryrun'))} {(Id.Lit_RBracket ']')}
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:5622)
                                    )
                                  ]
                                  action: [
                                    (command.Simple
                                      words: [
                                        {(rmdir)}
                                        {(${ Id.VSub_Name DESTDIR) ($ Id.VSub_DollarName '$dir')}
                                      ]
                                      redirects: [
                                        (redir.Redir
                                          op: (Token id:Id.Redir_Great val:'>' span_id:5634)
                                          fd: -1
                                          arg_word: {(/dev/null)}
                                        )
                                        (redir.Redir
                                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:5637)
                                          fd: 2
                                          arg_word: {(1)}
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [5611 5624]
                                )
                              ]
                            )
                            (C {(echo)} {(DQ ('  D ') ($ Id.VSub_DollarName '$dir'))})
                          ]
                          spids: [5590 5597]
                        )
                      ]
                      else_action: [
                        (C {(warn)} 
                          {(DQ ('Non-empty directory remains: ') ($ Id.VSub_DollarName '$dir'))}
                        )
                      ]
                    )
                  ]
                  spids: [5566 5587]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: handle_modified_file
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(cmp)} {(dest)} {(file)} {(new)} {(newdestcmp)} {(old)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:file)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [5721]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(ignore)} {($ Id.VSub_DollarName '$file')})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:5730)
                    )
                  ]
                  action: [
                    (C {(log)} {(DQ ('IGNORE: modified file ') ($ Id.VSub_DollarName '$file'))})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:5743)
                    )
                  ]
                  spids: [5725 5732]
                )
              ]
            )
            (C {(compare)} {($ Id.VSub_DollarName '$OLDTREE') (/) ($ Id.VSub_DollarName '$file')} 
              {($ Id.VSub_DollarName '$NEWTREE') (/) ($ Id.VSub_DollarName '$file')}
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cmp)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [5761]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$cmp')} {(-eq)} 
                          {($ Id.VSub_DollarName '$COMPARE_EQUAL')} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:5776)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:5781)
                    )
                  ]
                  spids: [5765 5778]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$cmp')} {(-eq)} 
                          {($ Id.VSub_DollarName '$COMPARE_ONLYFIRST')} {(-o)} {($ Id.VSub_DollarName '$cmp')} {(-eq)} {($ Id.VSub_DollarName '$COMPARE_ONLYSECOND')} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:5807)
                    )
                  ]
                  action: [(C {(panic)} {(DQ ('Changed file now missing'))})]
                  spids: [5788 5809]
                )
              ]
            )
            (C {(compare)} {($ Id.VSub_DollarName '$NEWTREE') (/) ($ Id.VSub_DollarName '$file')} 
              {($ Id.VSub_DollarName '$DESTDIR') (/) ($ Id.VSub_DollarName '$file')}
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:newdestcmp)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [5834]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$newdestcmp')} {(-eq)} 
                          {($ Id.VSub_DollarName '$COMPARE_EQUAL')} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:5849)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:5854)
                    )
                  ]
                  spids: [5838 5851]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.AndOr
                          ops: [Id.Op_DAmp]
                          children: [
                            (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$FREEBSD_ID'))} 
                              {(-a)} {($ Id.VSub_DollarName '$newdestcmp')} {(-eq)} {($ Id.VSub_DollarName '$COMPARE_DIFFFILES')} 
                              {(Id.Lit_RBracket ']')}
                            )
                            (C {(fbsdid_only)} 
                              {($ Id.VSub_DollarName '$NEWTREE') (/) ($ Id.VSub_DollarName '$file')} {($ Id.VSub_DollarName '$DESTDIR') (/) ($ Id.VSub_DollarName '$file')}
                            )
                          ]
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:5906)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: (C {(update_unmodified)} {($ Id.VSub_DollarName '$file')})
                              terminator: (Token id:Id.Op_Semi val:';' span_id:5916)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:5921)
                            )
                          ]
                          spids: [5911 5918]
                        )
                      ]
                      else_action: [(C {(panic)} {(DQ ('Updating FreeBSD ID string failed'))})]
                    )
                  ]
                  spids: [5873 5908]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(compare_fbsdid)} 
                          {($ Id.VSub_DollarName '$OLDTREE') (/) ($ Id.VSub_DollarName '$file')} {($ Id.VSub_DollarName '$DESTDIR') (/) ($ Id.VSub_DollarName '$file')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:5964)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: (C {(update_unmodified)} {($ Id.VSub_DollarName '$file')})
                              terminator: (Token id:Id.Op_Semi val:';' span_id:5974)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:5979)
                            )
                          ]
                          spids: [5969 5976]
                        )
                      ]
                    )
                  ]
                  spids: [5953 5966]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$newdestcmp')} {(-eq)} 
                          {($ Id.VSub_DollarName '$COMPARE_ONLYFIRST')} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:6004)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: (C {(always_install)} {($ Id.VSub_DollarName '$file')})
                              terminator: (Token id:Id.Op_Semi val:';' span_id:6022)
                            )
                          ]
                          action: [
                            (C {(log)} {(DQ ('ALWAYS: adding ') ($ Id.VSub_DollarName '$file'))})
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.Pipeline
                                          children: [
                                            (C {(Id.Lit_LBracket '[')} {(-d)} 
                                              {($ Id.VSub_DollarName '$NEWTREE') (/) 
                                                ($ Id.VSub_DollarName '$file')
                                              } {(Id.Lit_RBracket ']')}
                                            )
                                          ]
                                          negated: T
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:6048)
                                    )
                                  ]
                                  action: [
                                    (command.If
                                      arms: [
                                        (if_arm
                                          cond: [
                                            (command.Sentence
                                              child: 
                                                (C {(install_new)} {($ Id.VSub_DollarName '$file')})
                                              terminator: (Token id:Id.Op_Semi val:';' span_id:6058)
                                            )
                                          ]
                                          action: [
                                            (C {(echo)} {(DQ ('  A ') ($ Id.VSub_DollarName '$file'))})
                                          ]
                                          spids: [6053 6060]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [6035 6050]
                                )
                              ]
                            )
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:6077)
                            )
                          ]
                          spids: [6017 6024]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.AndOr
                                  ops: [Id.Op_DAmp]
                                  children: [
                                    (C {(Id.Lit_LBracket '[')} {(-n)} 
                                      {(DQ ($ Id.VSub_DollarName '$FREEBSD_ID'))} {(-a)} {($ Id.VSub_DollarName '$cmp')} {(-eq)} {($ Id.VSub_DollarName '$COMPARE_DIFFFILES')} 
                                      {(Id.Lit_RBracket ']')}
                                    )
                                    (C {(fbsdid_only)} 
                                      {($ Id.VSub_DollarName '$OLDTREE') (/) 
                                        ($ Id.VSub_DollarName '$file')
                                      } {($ Id.VSub_DollarName '$NEWTREE') (/) ($ Id.VSub_DollarName '$file')}
                                    )
                                  ]
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:6129)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:6134)
                            )
                          ]
                          spids: [6096 6131]
                        )
                      ]
                    )
                    (command.Case
                      to_match: {($ Id.VSub_DollarName '$cmp')}
                      arms: [
                        (case_arm
                          pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFTYPE')}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:old)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:6153)
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {(file_type)} 
                                                {($ Id.VSub_DollarName '$OLDTREE') (/) 
                                                  ($ Id.VSub_DollarName '$file')
                                                }
                                              )
                                            ]
                                          )
                                      )
                                    }
                                  spids: [6152]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:new)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:6165)
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {(file_type)} 
                                                {($ Id.VSub_DollarName '$NEWTREE') (/) 
                                                  ($ Id.VSub_DollarName '$file')
                                                }
                                              )
                                            ]
                                          )
                                      )
                                    }
                                  spids: [6164]
                                )
                              ]
                            )
                            (C {(warn)} 
                              {
                                (DQ ('Remove mismatch: ') ($ Id.VSub_DollarName '$file') (' (') 
                                  ($ Id.VSub_DollarName '$old') (' became ') ($ Id.VSub_DollarName '$new') (')')
                                )
                              }
                            )
                          ]
                          spids: [6148 6149 6189 -1]
                        )
                        (case_arm
                          pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFLINKS')}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:old)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:6197)
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {(readlink)} 
                                                {($ Id.VSub_DollarName '$OLDTREE') (/) 
                                                  ($ Id.VSub_DollarName '$file')
                                                }
                                              )
                                            ]
                                          )
                                      )
                                    }
                                  spids: [6196]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:new)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:6209)
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {(readlink)} 
                                                {($ Id.VSub_DollarName '$NEWTREE') (/) 
                                                  ($ Id.VSub_DollarName '$file')
                                                }
                                              )
                                            ]
                                          )
                                      )
                                    }
                                  spids: [6208]
                                )
                              ]
                            )
                            (C {(warn)} 
                              {
                                (DQ ('Removed link changed: ') ($ Id.VSub_DollarName '$file') (' (') 
                                  (word_part.EscapedLiteral
                                    token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:6228)
                                  ) ($ Id.VSub_DollarName '$old') 
                                  (word_part.EscapedLiteral
                                    token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:6230)
                                  ) (' became ') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:6232)) 
                                  ($ Id.VSub_DollarName '$new') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:6234)) (')')
                                )
                              }
                            )
                          ]
                          spids: [6192 6193 6239 -1]
                        )
                        (case_arm
                          pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFFILES')}]
                          action: [
                            (C {(warn)} {(DQ ('Removed file changed: ') ($ Id.VSub_DollarName '$file'))})
                          ]
                          spids: [6242 6243 6254 -1]
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:6260)
                    )
                  ]
                  spids: [5993 6006]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(always_install)} {($ Id.VSub_DollarName '$file')})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:6288)
                    )
                  ]
                  action: [
                    (C {(log)} {(DQ ('ALWAYS: updating ') ($ Id.VSub_DollarName '$file'))})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: (C {(update_unmodified)} {($ Id.VSub_DollarName '$file')})
                              terminator: (Token id:Id.Op_Semi val:';' span_id:6306)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:6311)
                            )
                          ]
                          spids: [6301 6308]
                        )
                      ]
                    )
                  ]
                  spids: [6283 6290]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.AndOr
                          ops: [Id.Op_DAmp]
                          children: [
                            (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$FREEBSD_ID'))} 
                              {(-a)} {($ Id.VSub_DollarName '$cmp')} {(-eq)} {($ Id.VSub_DollarName '$COMPARE_DIFFFILES')} 
                              {(Id.Lit_RBracket ']')}
                            )
                            (C {(fbsdid_only)} 
                              {($ Id.VSub_DollarName '$OLDTREE') (/) ($ Id.VSub_DollarName '$file')} {($ Id.VSub_DollarName '$NEWTREE') (/) ($ Id.VSub_DollarName '$file')}
                            )
                          ]
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:6366)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: (C {(update_freebsdid)} {($ Id.VSub_DollarName '$file')})
                              terminator: (Token id:Id.Op_Semi val:';' span_id:6376)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Continue val:continue span_id:6381)
                            )
                          ]
                          spids: [6371 6378]
                        )
                      ]
                    )
                  ]
                  spids: [6333 6368]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$cmp')} {(-eq)} 
                          {($ Id.VSub_DollarName '$COMPARE_DIFFTYPE')} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:6418)
                    )
                  ]
                  action: [
                    (command.Case
                      to_match: {($ Id.VSub_DollarName '$newdestcmp')}
                      arms: [
                        (case_arm
                          pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFLINKS')}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:new)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:6435)
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {(readlink)} 
                                                {($ Id.VSub_DollarName '$NEWTREE') (/) 
                                                  ($ Id.VSub_DollarName '$file')
                                                }
                                              )
                                            ]
                                          )
                                      )
                                    }
                                  spids: [6434]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:dest)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:6447)
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {(readlink)} 
                                                {($ Id.VSub_DollarName '$DESTDIR') (/) 
                                                  ($ Id.VSub_DollarName '$file')
                                                }
                                              )
                                            ]
                                          )
                                      )
                                    }
                                  spids: [6446]
                                )
                              ]
                            )
                            (C {(warn)} 
                              {
                                (DQ ('New link conflict: ') ($ Id.VSub_DollarName '$file') (' (') 
                                  (word_part.EscapedLiteral
                                    token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:6466)
                                  ) ($ Id.VSub_DollarName '$new') 
                                  (word_part.EscapedLiteral
                                    token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:6468)
                                  ) (' vs ') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:6470)) 
                                  ($ Id.VSub_DollarName '$dest') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:6472)) (')')
                                )
                              }
                            )
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:6477)
                            )
                          ]
                          spids: [6430 6431 6480 -1]
                        )
                        (case_arm
                          pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFFILES')}]
                          action: [
                            (C {(new_conflict)} {($ Id.VSub_DollarName '$file')})
                            (C {(echo)} {(DQ ('  C ') ($ Id.VSub_DollarName '$file'))})
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:6500)
                            )
                          ]
                          spids: [6483 6484 6503 -1]
                        )
                      ]
                    )
                  ]
                  spids: [6407 6420]
                )
              ]
              else_action: [
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$newdestcmp')} {(-eq)} 
                              {($ Id.VSub_DollarName '$COMPARE_DIFFTYPE')} {(Id.Lit_RBracket ']')}
                            )
                          terminator: (Token id:Id.Op_Semi val:';' span_id:6535)
                        )
                      ]
                      action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:new)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (command_sub
                                    left_token: (Token id:Id.Left_Backtick val:'`' span_id:6541)
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (C {(file_type)} 
                                            {($ Id.VSub_DollarName '$NEWTREE') (/) 
                                              ($ Id.VSub_DollarName '$file')
                                            }
                                          )
                                        ]
                                      )
                                  )
                                }
                              spids: [6540]
                            )
                          ]
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:dest)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (command_sub
                                    left_token: (Token id:Id.Left_Backtick val:'`' span_id:6553)
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (C {(file_type)} 
                                            {($ Id.VSub_DollarName '$DESTDIR') (/) 
                                              ($ Id.VSub_DollarName '$file')
                                            }
                                          )
                                        ]
                                      )
                                  )
                                }
                              spids: [6552]
                            )
                          ]
                        )
                        (C {(warn)} 
                          {
                            (DQ ('Modified mismatch: ') ($ Id.VSub_DollarName '$file') (' (') 
                              ($ Id.VSub_DollarName '$new') (' vs ') ($ Id.VSub_DollarName '$dest') (')')
                            )
                          }
                        )
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Return val:return span_id:6577)
                        )
                      ]
                      spids: [6524 6537]
                    )
                  ]
                )
              ]
            )
            (command.Case
              to_match: {($ Id.VSub_DollarName '$cmp')}
              arms: [
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFTYPE')}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:old)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:6599)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(file_type)} 
                                        {($ Id.VSub_DollarName '$OLDTREE') (/) 
                                          ($ Id.VSub_DollarName '$file')
                                        }
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [6598]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:new)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:6611)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(file_type)} 
                                        {($ Id.VSub_DollarName '$NEWTREE') (/) 
                                          ($ Id.VSub_DollarName '$file')
                                        }
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [6610]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:dest)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:6623)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(file_type)} 
                                        {($ Id.VSub_DollarName '$DESTDIR') (/) 
                                          ($ Id.VSub_DollarName '$file')
                                        }
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [6622]
                        )
                      ]
                    )
                    (C {(warn)} 
                      {
                        (DQ ('Modified ') ($ Id.VSub_DollarName '$dest') (' changed: ') 
                          ($ Id.VSub_DollarName '$file') (' (') ($ Id.VSub_DollarName '$old') (' became ') ($ Id.VSub_DollarName '$new') (')')
                        )
                      }
                    )
                  ]
                  spids: [6594 6595 6649 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFLINKS')}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:old)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:6657)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(readlink)} 
                                        {($ Id.VSub_DollarName '$OLDTREE') (/) 
                                          ($ Id.VSub_DollarName '$file')
                                        }
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [6656]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:new)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:6669)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(readlink)} 
                                        {($ Id.VSub_DollarName '$NEWTREE') (/) 
                                          ($ Id.VSub_DollarName '$file')
                                        }
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [6668]
                        )
                      ]
                    )
                    (C {(warn)} 
                      {
                        (DQ ('Modified link changed: ') ($ Id.VSub_DollarName '$file') (' (') 
                          (word_part.EscapedLiteral
                            token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:6688)
                          ) ($ Id.VSub_DollarName '$old') 
                          (word_part.EscapedLiteral
                            token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:6690)
                          ) (' became ') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:6692)) 
                          ($ Id.VSub_DollarName '$new') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:6694)) (')')
                        )
                      }
                    )
                  ]
                  spids: [6652 6653 6699 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFFILES')}]
                  action: [(C {(merge_file)} {($ Id.VSub_DollarName '$file')})]
                  spids: [6702 6703 6711 -1]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: handle_added_file
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(cmp)} {(dest)} {(file)} {(new)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:file)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [6759]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(ignore)} {($ Id.VSub_DollarName '$file')})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:6768)
                    )
                  ]
                  action: [
                    (C {(log)} {(DQ ('IGNORE: added file ') ($ Id.VSub_DollarName '$file'))})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:6781)
                    )
                  ]
                  spids: [6763 6770]
                )
              ]
            )
            (C {(compare)} {($ Id.VSub_DollarName '$DESTDIR') (/) ($ Id.VSub_DollarName '$file')} 
              {($ Id.VSub_DollarName '$NEWTREE') (/) ($ Id.VSub_DollarName '$file')}
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cmp)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [6799]
                )
              ]
            )
            (command.Case
              to_match: {($ Id.VSub_DollarName '$cmp')}
              arms: [
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_EQUAL')}]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:6814)
                    )
                  ]
                  spids: [6810 6811 6817 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_ONLYFIRST')}]
                  action: [(C {(panic)} {(DQ ('Added file now missing'))})]
                  spids: [6820 6821 6831 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_ONLYSECOND')}]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (C {(Id.Lit_LBracket '[')} {(-d)} 
                                      {($ Id.VSub_DollarName '$NEWTREE') (/) 
                                        ($ Id.VSub_DollarName '$file')
                                      } {(Id.Lit_RBracket ']')}
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:6863)
                            )
                          ]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: (C {(install_new)} {($ Id.VSub_DollarName '$file')})
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:6873)
                                    )
                                  ]
                                  action: [(C {(echo)} {(DQ ('  A ') ($ Id.VSub_DollarName '$file'))})]
                                  spids: [6868 6875]
                                )
                              ]
                            )
                          ]
                          spids: [6850 6865]
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:6892)
                    )
                  ]
                  spids: [6834 6835 6895 -1]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(always_install)} {($ Id.VSub_DollarName '$file')})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:6924)
                    )
                  ]
                  action: [
                    (C {(log)} {(DQ ('ALWAYS: updating ') ($ Id.VSub_DollarName '$file'))})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: (C {(update_unmodified)} {($ Id.VSub_DollarName '$file')})
                              terminator: (Token id:Id.Op_Semi val:';' span_id:6942)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Return val:return span_id:6947)
                            )
                          ]
                          spids: [6937 6944]
                        )
                      ]
                    )
                  ]
                  spids: [6919 6926]
                )
              ]
            )
            (command.Case
              to_match: {($ Id.VSub_DollarName '$cmp')}
              arms: [
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFTYPE')}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:new)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:6969)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(file_type)} 
                                        {($ Id.VSub_DollarName '$NEWTREE') (/) 
                                          ($ Id.VSub_DollarName '$file')
                                        }
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [6968]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:dest)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:6981)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(file_type)} 
                                        {($ Id.VSub_DollarName '$DESTDIR') (/) 
                                          ($ Id.VSub_DollarName '$file')
                                        }
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [6980]
                        )
                      ]
                    )
                    (C {(warn)} 
                      {
                        (DQ ('New file mismatch: ') ($ Id.VSub_DollarName '$file') (' (') 
                          ($ Id.VSub_DollarName '$new') (' vs ') ($ Id.VSub_DollarName '$dest') (')')
                        )
                      }
                    )
                  ]
                  spids: [6964 6965 7005 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFLINKS')}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:new)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:7013)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(readlink)} 
                                        {($ Id.VSub_DollarName '$NEWTREE') (/) 
                                          ($ Id.VSub_DollarName '$file')
                                        }
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [7012]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:dest)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:7025)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(readlink)} 
                                        {($ Id.VSub_DollarName '$DESTDIR') (/) 
                                          ($ Id.VSub_DollarName '$file')
                                        }
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [7024]
                        )
                      ]
                    )
                    (C {(warn)} 
                      {
                        (DQ ('New link conflict: ') ($ Id.VSub_DollarName '$file') (' (') 
                          (word_part.EscapedLiteral
                            token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:7042)
                          ) ($ Id.VSub_DollarName '$new') 
                          (word_part.EscapedLiteral
                            token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:7044)
                          ) (' vs ') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:7046)) 
                          ($ Id.VSub_DollarName '$dest') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:7048)) (')')
                        )
                      }
                    )
                  ]
                  spids: [7008 7009 7053 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName '$COMPARE_DIFFFILES')}]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.AndOr
                                  ops: [Id.Op_DAmp]
                                  children: [
                                    (C {(Id.Lit_LBracket '[')} {(-n)} 
                                      {(DQ ($ Id.VSub_DollarName '$FREEBSD_ID'))} {(Id.Lit_RBracket ']')}
                                    )
                                    (C {(fbsdid_only)} 
                                      {($ Id.VSub_DollarName '$NEWTREE') (/) 
                                        ($ Id.VSub_DollarName '$file')
                                      } {($ Id.VSub_DollarName '$DESTDIR') (/) ($ Id.VSub_DollarName '$file')}
                                    )
                                  ]
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:7101)
                            )
                          ]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: (C {(update_unmodified)} {($ Id.VSub_DollarName '$file')})
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:7111)
                                    )
                                  ]
                                  action: [
                                    (command.ControlFlow
                                      token: (Token id:Id.ControlFlow_Return val:return span_id:7116)
                                    )
                                  ]
                                  spids: [7106 7113]
                                )
                              ]
                              else_action: [(C {(panic)} {(DQ ('Updating FreeBSD ID string failed'))})]
                            )
                          ]
                          spids: [7076 7103]
                        )
                      ]
                    )
                    (C {(new_conflict)} {($ Id.VSub_DollarName '$file')})
                    (C {(echo)} {(DQ ('  C ') ($ Id.VSub_DollarName '$file'))})
                  ]
                  spids: [7056 7057 7151 -1]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: build_cmd
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(dir)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-ne)} {(1)} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7190)
                    )
                  ]
                  action: [(C {(echo)} {(DQ ('Missing required tarball.'))}) (C {(echo)}) (C {(usage)})]
                  spids: [7179 7192]
                )
              ]
            )
            (C {(log)} {(DQ ('build command: ') ($ Id.VSub_Number '$1'))})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:dir)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:7226)
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(mktemp)} {(-d)} 
                                {($ Id.VSub_DollarName '$WORKDIR') (/etcupdate-XXXXXXX)}
                              )
                            ]
                          )
                      )
                    }
                  spids: [7225]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_QMark '$?')} {(-ne)} {(0)} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7249)
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('Unable to create temporary directory.'))})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:7261)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [7238 7251]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [(C {(build_tree)} {($ Id.VSub_DollarName '$dir')})]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7276)
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('Failed to build tree.'))})
                    (C {(remove_tree)} {($ Id.VSub_DollarName '$dir')})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:7293)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [7269 7278]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (command.Simple
                              words: [
                                {(tar)}
                                {(cfj)}
                                {($ Id.VSub_Number '$1')}
                                {(-C)}
                                {($ Id.VSub_DollarName '$dir')}
                                {(.)}
                              ]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:7317)
                                  fd: -1
                                  arg_word: {(3)}
                                )
                                (redir.Redir
                                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:7320)
                                  fd: 2
                                  arg_word: {(1)}
                                )
                              ]
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7322)
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('Failed to create tarball.'))})
                    (C {(remove_tree)} {($ Id.VSub_DollarName '$dir')})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:7339)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [7301 7324]
                )
              ]
            )
            (C {(remove_tree)} {($ Id.VSub_DollarName '$dir')})
          ]
        )
    )
    (command.ShFunction
      name: diff_cmd
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(file)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-ne)} {(0)} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7387)
                    )
                  ]
                  action: [(C {(usage)})]
                  spids: [7376 7389]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C {(Id.Lit_LBracket '[')} {(-d)} {($ Id.VSub_DollarName '$NEWTREE')} 
                              {(Id.Lit_RBracket ']')}
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7414)
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('Reference tree to diff against unavailable.'))})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:7426)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [7403 7416]
                )
              ]
            )
            (command.ForEach
              iter_name: file
              iter_words: [
                {
                  (command_sub
                    left_token: (Token id:Id.Left_Backtick val:'`' span_id:7449)
                    command_list: 
                      (command.CommandList
                        children: [
                          (command.Pipeline
                            children: [
                              (command.Subshell
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (command.Sentence
                                        child: (C {(cd)} {($ Id.VSub_DollarName '$NEWTREE')})
                                        terminator: (Token id:Id.Op_Semi val:';' span_id:7458)
                                      )
                                      (C {(find)} {(.)})
                                    ]
                                  )
                              )
                              (C {(sed)} {(-e)} 
                                {(SQ (Token id:Id.Lit_Chars val:'s/^\\.//' span_id:7472))}
                              )
                            ]
                            negated: F
                          )
                        ]
                      )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: (C {(ignore)} {($ Id.VSub_DollarName '$file')})
                              terminator: (Token id:Id.Op_Semi val:';' span_id:7485)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Continue val:continue span_id:7490)
                            )
                          ]
                          spids: [7480 7487]
                        )
                      ]
                    )
                    (C {(diffnode)} {($ Id.VSub_DollarName '$NEWTREE')} 
                      {(DQ ($ Id.VSub_DollarName '$DESTDIR'))} {($ Id.VSub_DollarName '$file')} {(DQ (stock))} {(DQ (local))}
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: extract_cmd
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-ne)} {(0)} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7561)
                    )
                  ]
                  action: [(C {(usage)})]
                  spids: [7550 7563]
                )
              ]
            )
            (C {(log)} {(DQ ('extract command: tarball=') ($ Id.VSub_DollarName '$tarball'))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-d)} {($ Id.VSub_DollarName '$NEWTREE')} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7591)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [(C {(remove_tree)} {($ Id.VSub_DollarName '$NEWTREE')})]
                                  negated: T
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:7603)
                            )
                          ]
                          action: [
                            (C {(echo)} {(DQ ('Unable to remove current tree.'))})
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Exit val:exit span_id:7615)
                              arg_word: {(1)}
                            )
                          ]
                          spids: [7596 7605]
                        )
                      ]
                    )
                  ]
                  spids: [7582 7593]
                )
              ]
            )
            (C {(extract_tree)})
          ]
        )
    )
    (command.ShFunction
      name: resolve_cmd
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(conflicts)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-ne)} {(0)} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7659)
                    )
                  ]
                  action: [(C {(usage)})]
                  spids: [7648 7661]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C {(Id.Lit_LBracket '[')} {(-d)} {($ Id.VSub_DollarName '$CONFLICTS')} 
                              {(Id.Lit_RBracket ']')}
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7682)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:7687)
                    )
                  ]
                  spids: [7671 7684]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C {(Id.Lit_LBracket '[')} {(-d)} {($ Id.VSub_DollarName '$NEWTREE')} 
                              {(Id.Lit_RBracket ']')}
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7705)
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('The current tree is not present to resolve conflicts.'))})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:7717)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [7694 7707]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:conflicts)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:7727)
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (command.Subshell
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (command.Sentence
                                            child: (C {(cd)} {($ Id.VSub_DollarName '$CONFLICTS')})
                                            terminator: (Token id:Id.Op_Semi val:';' span_id:7736)
                                          )
                                          (C {(find)} {(.)} {(Id.KW_Bang '!')} {(-type)} {(d)})
                                        ]
                                      )
                                  )
                                  (C {(sed)} {(-e)} 
                                    {(SQ (Token id:Id.Lit_Chars val:'s/^\\.//' span_id:7756))}
                                  )
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                  spids: [7726]
                )
              ]
            )
            (command.ForEach
              iter_name: file
              iter_words: [{($ Id.VSub_DollarName '$conflicts')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [(C {(resolve_conflict)} {($ Id.VSub_DollarName '$file')})]
                )
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$NEWALIAS_WARN'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7793)
                    )
                  ]
                  action: [
                    (C {(warn)} {(DQ ('Needs update: /etc/mail/aliases.db'))} 
                      {(DQ ('(requires manual update via newaliases(1))'))}
                    )
                    (C {(echo)})
                    (C {(echo)} {(DQ ('Warnings:'))})
                    (C {(echo)} {(DQ ('  Needs update: /etc/mail/aliases.db'))} 
                      {(DQ ('(requires manual update via newaliases(1))'))}
                    )
                  ]
                  spids: [7782 7795]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: status_cmd
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-ne)} {(0)} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7867)
                    )
                  ]
                  action: [(C {(usage)})]
                  spids: [7856 7869]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-d)} {($ Id.VSub_DollarName '$CONFLICTS')} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7888)
                    )
                  ]
                  action: [
                    (command.Pipeline
                      children: [
                        (command.Subshell
                          command_list: 
                            (command.CommandList
                              children: [
                                (command.Sentence
                                  child: (C {(cd)} {($ Id.VSub_DollarName '$CONFLICTS')})
                                  terminator: (Token id:Id.Op_Semi val:';' span_id:7897)
                                )
                                (C {(find)} {(.)} {(Id.KW_Bang '!')} {(-type)} {(d)})
                              ]
                            )
                        )
                        (C {(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'s/^\\./  C /' span_id:7917))})
                      ]
                      negated: F
                    )
                  ]
                  spids: [7879 7890]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-s)} {($ Id.VSub_DollarName '$WARNINGS')} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7933)
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('Warnings:'))})
                    (C {(cat)} {($ Id.VSub_DollarName '$WARNINGS')})
                  ]
                  spids: [7924 7935]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: update_cmd
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(dir)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-ne)} {(0)} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:7988)
                    )
                  ]
                  action: [(C {(usage)})]
                  spids: [7977 7990]
                )
              ]
            )
            (C {(log)} 
              {
                (DQ ('update command: rerun=') ($ Id.VSub_DollarName '$rerun') (' tarball=') 
                  ($ Id.VSub_DollarName '$tarball') (' preworld=') ($ Id.VSub_DollarName '$preworld')
                )
              }
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} 
                          {
                            (command_sub
                              left_token: (Token id:Id.Left_Backtick val:'`' span_id:8017)
                              command_list: (command.CommandList children:[(C {(id)} {(-u)})])
                            )
                          } {(-ne)} {(0)} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:8030)
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('Must be root to update a tree.'))})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:8042)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [8013 8032]
                )
              ]
            )
            (C {(umask)} {(022)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-e)} {($ Id.VSub_DollarName '$CONFLICTS')} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:8083)
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [
                        {(find)}
                        {(-d)}
                        {($ Id.VSub_DollarName '$CONFLICTS')}
                        {(-type)}
                        {(d)}
                        {(-empty)}
                        {(-delete)}
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:8102)
                          fd: -1
                          arg_word: {(3)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:8105)
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                    (command.Simple
                      words: [{(rmdir)} {($ Id.VSub_DollarName '$CONFLICTS')}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:8113)
                          fd: -1
                          arg_word: {(3)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:8116)
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                  ]
                  spids: [8074 8085]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-d)} {($ Id.VSub_DollarName '$CONFLICTS')} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:8132)
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('Conflicts remain from previous update, aborting.'))})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:8144)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [8123 8134]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$rerun'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:8164)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                                  {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:8192)
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:dir)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:8198)
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {(mktemp)} {(-d)} 
                                                {($ Id.VSub_DollarName '$WORKDIR') 
                                                  (/etcupdate-XXXXXXX)
                                                }
                                              )
                                            ]
                                          )
                                      )
                                    }
                                  spids: [8197]
                                )
                              ]
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_QMark '$?')} {(-ne)} {(0)} 
                                          {(Id.Lit_RBracket ']')}
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:8221)
                                    )
                                  ]
                                  action: [
                                    (C {(echo)} {(DQ ('Unable to create temporary directory.'))})
                                    (command.ControlFlow
                                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:8233)
                                      arg_word: {(1)}
                                    )
                                  ]
                                  spids: [8210 8223]
                                )
                              ]
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (C {(Id.Lit_LBracket '[')} {(-z)} 
                                          {(DQ ($ Id.VSub_DollarName '$preworld'))} {(Id.Lit_RBracket ']')}
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:8261)
                                    )
                                  ]
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:OLDTREE)
                                          op: assign_op.Equal
                                          rhs: {($ Id.VSub_DollarName '$NEWTREE')}
                                          spids: [8266]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [8250 8263]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:NEWTREE)
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_DollarName '$dir')}
                                  spids: [8273]
                                )
                              ]
                            )
                          ]
                          spids: [8181 8194]
                        )
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-n)} 
                                  {(DQ ($ Id.VSub_DollarName '$preworld'))} {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:8297)
                            )
                          ]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.Pipeline
                                          children: [
                                            (C {(remove_tree)} {($ Id.VSub_DollarName '$NEWTREE')})
                                          ]
                                          negated: T
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:8309)
                                    )
                                  ]
                                  action: [
                                    (C {(echo)} {(DQ ('Unable to remove pre-world tree.'))})
                                    (command.ControlFlow
                                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:8321)
                                      arg_word: {(1)}
                                    )
                                  ]
                                  spids: [8302 8311]
                                )
                              ]
                            )
                          ]
                          spids: [8286 8299]
                        )
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-d)} {($ Id.VSub_DollarName '$NEWTREE')} 
                                  {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:8343)
                            )
                          ]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.Pipeline
                                          children: [
                                            (C {(remove_tree)} {($ Id.VSub_DollarName '$OLDTREE')})
                                          ]
                                          negated: T
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:8359)
                                    )
                                  ]
                                  action: [
                                    (C {(echo)} {(DQ ('Unable to remove old tree.'))})
                                    (command.ControlFlow
                                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:8371)
                                      arg_word: {(1)}
                                    )
                                  ]
                                  spids: [8352 8361]
                                )
                              ]
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.Pipeline
                                          children: [
                                            (command.Simple
                                              words: [
                                                {(mv)}
                                                {($ Id.VSub_DollarName '$NEWTREE')}
                                                {($ Id.VSub_DollarName '$OLDTREE')}
                                              ]
                                              redirects: [
                                                (redir.Redir
                                                  op: 
                                                    (Token
                                                      id: Id.Redir_GreatAnd
                                                      val: '>&'
                                                      span_id: 8394
                                                    )
                                                  fd: -1
                                                  arg_word: {(3)}
                                                )
                                                (redir.Redir
                                                  op: 
                                                    (Token
                                                      id: Id.Redir_GreatAnd
                                                      val: '2>&'
                                                      span_id: 8397
                                                    )
                                                  fd: 2
                                                  arg_word: {(1)}
                                                )
                                              ]
                                            )
                                          ]
                                          negated: T
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:8399)
                                    )
                                  ]
                                  action: [
                                    (C {(echo)} {(DQ ('Unable to rename current stock tree.'))})
                                    (command.ControlFlow
                                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:8411)
                                      arg_word: {(1)}
                                    )
                                  ]
                                  spids: [8384 8401]
                                )
                              ]
                            )
                          ]
                          spids: [8334 8345]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (C {(Id.Lit_LBracket '[')} {(-d)} 
                                      {($ Id.VSub_DollarName '$OLDTREE')} {(Id.Lit_RBracket ']')}
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:8434)
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [{(cat)}]
                              redirects: [
                                (redir.HereDoc
                                  op: (Token id:Id.Redir_DLess val:'<<' span_id:8441)
                                  fd: -1
                                  here_begin: {(EOF)}
                                  here_end_span_id: 8446
                                  stdin_parts: [
                                    (
'No previous tree to compare against, a sane comparison is not possible.\n'
                                    )
                                  ]
                                )
                              ]
                            )
                            (C {(log)} {(DQ ('No previous tree to compare against.'))})
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (C {(Id.Lit_LBracket '[')} {(-n)} 
                                          {(DQ ($ Id.VSub_DollarName '$dir'))} {(Id.Lit_RBracket ']')}
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:8466)
                                    )
                                  ]
                                  action: [(C {(rmdir)} {($ Id.VSub_DollarName '$dir')})]
                                  spids: [8455 8468]
                                )
                              ]
                            )
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Exit val:exit span_id:8479)
                              arg_word: {(1)}
                            )
                          ]
                          spids: [8423 8436]
                        )
                      ]
                    )
                    (C {(extract_tree)})
                  ]
                  spids: [8153 8166]
                )
              ]
            )
            (command.Pipeline
              children: [
                (command.Subshell
                  command_list: 
                    (command.CommandList
                      children: [
                        (command.Sentence
                          child: (C {(cd)} {($ Id.VSub_DollarName '$OLDTREE')})
                          terminator: (Token id:Id.Op_Semi val:';' span_id:8507)
                        )
                        (C {(find)} {(.)})
                      ]
                    )
                )
                (C {(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'s/^\\.//' span_id:8521))})
                (command.Simple
                  words: [{(sort)}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:8528)
                      fd: -1
                      arg_word: {($ Id.VSub_DollarName '$WORKDIR') (/old.files)}
                    )
                  ]
                )
              ]
              negated: F
            )
            (command.Pipeline
              children: [
                (command.Subshell
                  command_list: 
                    (command.CommandList
                      children: [
                        (command.Sentence
                          child: (C {(cd)} {($ Id.VSub_DollarName '$NEWTREE')})
                          terminator: (Token id:Id.Op_Semi val:';' span_id:8538)
                        )
                        (C {(find)} {(.)})
                      ]
                    )
                )
                (C {(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'s/^\\.//' span_id:8552))})
                (command.Simple
                  words: [{(sort)}]
                  redirects: [
                    (redir.Redir
                      op: (Token id:Id.Redir_Great val:'>' span_id:8559)
                      fd: -1
                      arg_word: {($ Id.VSub_DollarName '$WORKDIR') (/new.files)}
                    )
                  ]
                )
              ]
              negated: F
            )
            (command.Simple
              words: [
                {(comm)}
                {(-23)}
                {($ Id.VSub_DollarName '$WORKDIR') (/old.files)}
                {($ Id.VSub_DollarName '$WORKDIR') (/new.files)}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:8580)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$WORKDIR') (/removed.files)}
                )
              ]
            )
            (command.Simple
              words: [
                {(comm)}
                {(-13)}
                {($ Id.VSub_DollarName '$WORKDIR') (/old.files)}
                {($ Id.VSub_DollarName '$WORKDIR') (/new.files)}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:8596)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$WORKDIR') (/added.files)}
                )
              ]
            )
            (command.Simple
              words: [
                {(comm)}
                {(-12)}
                {($ Id.VSub_DollarName '$WORKDIR') (/old.files)}
                {($ Id.VSub_DollarName '$WORKDIR') (/new.files)}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:8612)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$WORKDIR') (/both.files)}
                )
              ]
            )
            (C {(rm)} {(-f)} {($ Id.VSub_DollarName '$WARNINGS')})
            (C {(mkdir)} {(-p)} {($ Id.VSub_DollarName '$CONFLICTS')})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$preworld'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:8657)
                    )
                  ]
                  action: [
                    (command.Simple
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'>' span_id:8662)
                          fd: -1
                          arg_word: {($ Id.VSub_DollarName '$WORKDIR') (/removed.files)}
                        )
                      ]
                    )
                  ]
                  spids: [8646 8659]
                )
              ]
            )
            (command.ForEach
              iter_name: file
              iter_words: [
                {
                  (command_sub
                    left_token: (Token id:Id.Left_Backtick val:'`' span_id:8708)
                    command_list: 
                      (command.CommandList
                        children: [(C {(cat)} {($ Id.VSub_DollarName '$WORKDIR') (/removed.files)})]
                      )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [(C {(handle_removed_file)} {($ Id.VSub_DollarName '$file')})]
                )
            )
            (command.ForEach
              iter_name: file
              iter_words: [
                {
                  (command_sub
                    left_token: (Token id:Id.Left_Backtick val:'`' span_id:8752)
                    command_list: 
                      (command.CommandList
                        children: [
                          (C {(sort)} {(-r)} {($ Id.VSub_DollarName '$WORKDIR') (/removed.files)})
                        ]
                      )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [(C {(handle_removed_directory)} {($ Id.VSub_DollarName '$file')})]
                )
            )
            (command.ForEach
              iter_name: file
              iter_words: [
                {
                  (command_sub
                    left_token: (Token id:Id.Left_Backtick val:'`' span_id:8790)
                    command_list: 
                      (command.CommandList
                        children: [(C {(cat)} {($ Id.VSub_DollarName '$WORKDIR') (/both.files)})]
                      )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [(C {(handle_modified_file)} {($ Id.VSub_DollarName '$file')})]
                )
            )
            (command.ForEach
              iter_name: file
              iter_words: [
                {
                  (command_sub
                    left_token: (Token id:Id.Left_Backtick val:'`' span_id:8822)
                    command_list: 
                      (command.CommandList
                        children: [(C {(cat)} {($ Id.VSub_DollarName '$WORKDIR') (/added.files)})]
                      )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [(C {(handle_added_file)} {($ Id.VSub_DollarName '$file')})]
                )
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$NEWALIAS_WARN'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:8855)
                    )
                  ]
                  action: [
                    (C {(warn)} {(DQ ('Needs update: /etc/mail/aliases.db'))} 
                      {(DQ ('(requires manual update via newaliases(1))'))}
                    )
                  ]
                  spids: [8844 8857]
                )
              ]
            )
            (C {(post_update)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-s)} {($ Id.VSub_DollarName '$WARNINGS')} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:8894)
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('Warnings:'))})
                    (C {(cat)} {($ Id.VSub_DollarName '$WARNINGS')})
                  ]
                  spids: [8885 8896]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$dir'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:8926)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} 
                                  {(-o)} {(-n)} {(DQ ($ Id.VSub_DollarName '$rerun'))} {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:8950)
                            )
                          ]
                          action: [(C {(panic)} {(DQ ('Should not have a temporary directory'))})]
                          spids: [8931 8952]
                        )
                      ]
                    )
                    (C {(remove_tree)} {($ Id.VSub_DollarName '$dir')})
                  ]
                  spids: [8915 8928]
                )
              ]
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:command)
          op: assign_op.Equal
          rhs: {(DQ (update))}
          spids: [8986]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-gt)} {(0)} {(Id.Lit_RBracket ']')})
              terminator: (Token id:Id.Op_Semi val:';' span_id:9002)
            )
          ]
          action: [
            (command.Case
              to_match: {(DQ ($ Id.VSub_Number '$1'))}
              arms: [
                (case_arm
                  pat_list: [{(build)} {(diff)} {(extract)} {(status)} {(resolve)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:command)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_Number '$1'))}
                          spids: [9028]
                        )
                      ]
                    )
                    (C {(shift)})
                  ]
                  spids: [9016 9025 9037 -1]
                )
                (case_arm
                  pat_list: [{(-) (Id.Lit_Star '*')}]
                  spids: [9040 9042 9053 -1]
                )
                (case_arm
                  pat_list: [{(Id.Lit_Star '*')}]
                  action: [(C {(usage)})]
                  spids: [9056 9057 9063 -1]
                )
              ]
            )
          ]
          spids: [8991 9004]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SRCDIR)
          op: assign_op.Equal
          rhs: {(/usr/src)}
          spids: [9078]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DESTDIR)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [9085]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:FREEBSD_ID)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [9091]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:ALWAYS_INSTALL)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [9097]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:IGNORE_FILES)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [9103]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:MAKE_OPTIONS)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [9109]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: (C {(Id.Lit_LBracket '[')} {(-r)} {(/etc/etcupdate.conf)} {(Id.Lit_RBracket ']')})
              terminator: (Token id:Id.Op_Semi val:';' span_id:9157)
            )
          ]
          action: [(C {(.)} {(/etc/etcupdate.conf)})]
          spids: [9148 9159]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:tarball)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [9172]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:rerun)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [9174]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:always)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [9176]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:dryrun)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [9178]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:ignore)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [9180]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:nobuild)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [9182]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:preworld)
          op: assign_op.Equal
          rhs: (word.Empty)
          spids: [9184]
        )
      ]
    )
    (command.WhileUntil
      keyword: (Token id:Id.KW_While val:while span_id:9186)
      cond: [
        (command.Sentence
          child: (C {(getopts)} {(DQ ('d:nprs:t:A:BD:FI:L:M:'))} {(option)})
          terminator: (Token id:Id.Op_Semi val:';' span_id:9195)
        )
      ]
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$option'))}
              arms: [
                (case_arm
                  pat_list: [{(d)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:WORKDIR)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTARG')}
                          spids: [9213]
                        )
                      ]
                    )
                  ]
                  spids: [9209 9210 9217 -1]
                )
                (case_arm
                  pat_list: [{(n)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:dryrun)
                          op: assign_op.Equal
                          rhs: {(YES)}
                          spids: [9224]
                        )
                      ]
                    )
                  ]
                  spids: [9220 9221 9228 -1]
                )
                (case_arm
                  pat_list: [{(p)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:preworld)
                          op: assign_op.Equal
                          rhs: {(YES)}
                          spids: [9235]
                        )
                      ]
                    )
                  ]
                  spids: [9231 9232 9239 -1]
                )
                (case_arm
                  pat_list: [{(r)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:rerun)
                          op: assign_op.Equal
                          rhs: {(YES)}
                          spids: [9246]
                        )
                      ]
                    )
                  ]
                  spids: [9242 9243 9250 -1]
                )
                (case_arm
                  pat_list: [{(s)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:SRCDIR)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTARG')}
                          spids: [9257]
                        )
                      ]
                    )
                  ]
                  spids: [9253 9254 9261 -1]
                )
                (case_arm
                  pat_list: [{(t)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:tarball)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTARG')}
                          spids: [9268]
                        )
                      ]
                    )
                  ]
                  spids: [9264 9265 9272 -1]
                )
                (case_arm
                  pat_list: [{(A)}]
                  action: [
                    (C {(Id.KW_Set set)} {(-o)} {(noglob)})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:always)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName '$always') (' ') 
                                ($ Id.VSub_DollarName '$OPTARG')
                              )
                            }
                          spids: [9310]
                        )
                      ]
                    )
                    (C {(Id.KW_Set set)} {(Id.Lit_Other '+') (o)} {(noglob)})
                  ]
                  spids: [9275 9276 9326 -1]
                )
                (case_arm
                  pat_list: [{(B)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:nobuild)
                          op: assign_op.Equal
                          rhs: {(YES)}
                          spids: [9333]
                        )
                      ]
                    )
                  ]
                  spids: [9329 9330 9337 -1]
                )
                (case_arm
                  pat_list: [{(D)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:DESTDIR)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTARG')}
                          spids: [9344]
                        )
                      ]
                    )
                  ]
                  spids: [9340 9341 9348 -1]
                )
                (case_arm
                  pat_list: [{(F)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:FREEBSD_ID)
                          op: assign_op.Equal
                          rhs: {(YES)}
                          spids: [9355]
                        )
                      ]
                    )
                  ]
                  spids: [9351 9352 9359 -1]
                )
                (case_arm
                  pat_list: [{(I)}]
                  action: [
                    (C {(Id.KW_Set set)} {(-o)} {(noglob)})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:ignore)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName '$ignore') (' ') 
                                ($ Id.VSub_DollarName '$OPTARG')
                              )
                            }
                          spids: [9397]
                        )
                      ]
                    )
                    (C {(Id.KW_Set set)} {(Id.Lit_Other '+') (o)} {(noglob)})
                  ]
                  spids: [9362 9363 9413 -1]
                )
                (case_arm
                  pat_list: [{(L)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:LOGFILE)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTARG')}
                          spids: [9420]
                        )
                      ]
                    )
                  ]
                  spids: [9416 9417 9424 -1]
                )
                (case_arm
                  pat_list: [{(M)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:MAKE_OPTIONS)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName '$OPTARG'))}
                          spids: [9431]
                        )
                      ]
                    )
                  ]
                  spids: [9427 9428 9437 -1]
                )
                (case_arm
                  pat_list: [{(Id.Lit_Star '*')}]
                  action: [(C {(echo)}) (C {(usage)})]
                  spids: [9440 9441 9450 -1]
                )
              ]
            )
          ]
        )
    )
    (C {(shift)} 
      {
        (word_part.ArithSub
          anode: 
            (arith_expr.Binary
              op_id: Id.Arith_Minus
              left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:OPTIND span_id:9460))
              right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
            )
        )
      }
    )
    (C {(Id.KW_Set set)} {(-o)} {(noglob)})
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$always'))} 
                  {(Id.Lit_RBracket ']')}
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:9492)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:ALWAYS_INSTALL)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName '$always'))}
                  spids: [9497]
                )
              ]
            )
          ]
          spids: [9481 9494]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$ignore'))} 
                  {(Id.Lit_RBracket ']')}
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:9522)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:IGNORE_FILES)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName '$ignore'))}
                  spids: [9527]
                )
              ]
            )
          ]
          spids: [9511 9524]
        )
      ]
    )
    (C {(Id.KW_Set set)} {(Id.Lit_Other '+') (o)} {(noglob)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:WORKDIR)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: (Token id:Id.VSub_Name val:WORKDIR span_id:9547)
                suffix_op: 
                  (suffix_op.Unary
                    op_id: Id.VTest_ColonHyphen
                    arg_word: 
                      {($ Id.VSub_DollarName '$DESTDIR') (Id.Lit_Slash /) (var) (Id.Lit_Slash /) (db) 
                        (Id.Lit_Slash /) (etcupdate)
                      }
                  )
              )
            }
          spids: [9545]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LOGFILE)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: (Token id:Id.VSub_Name val:LOGFILE span_id:9567)
                suffix_op: 
                  (suffix_op.Unary
                    op_id: Id.VTest_ColonHyphen
                    arg_word: {($ Id.VSub_DollarName '$WORKDIR') (Id.Lit_Slash /) (log)}
                  )
              )
            }
          spids: [9565]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:OLDTREE)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$WORKDIR') (/old)}
          spids: [9578]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:NEWTREE)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$WORKDIR') (/current)}
          spids: [9586]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:CONFLICTS)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$WORKDIR') (/conflicts)}
          spids: [9594]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:WARNINGS)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$WORKDIR') (/warnings)}
          spids: [9602]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:EDITOR)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: (Token id:Id.VSub_Name val:EDITOR span_id:9612)
                suffix_op: 
                  (suffix_op.Unary
                    op_id: Id.VTest_ColonHyphen
                    arg_word: {(Id.Lit_Slash /) (usr) (Id.Lit_Slash /) (bin) (Id.Lit_Slash /) (vi)}
                  )
              )
            }
          spids: [9610]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:PREWORLD_FILES)
          op: assign_op.Equal
          rhs: {(DQ ('etc/master.passwd etc/group'))}
          spids: [9626]
        )
      ]
    )
    (command.Case
      to_match: {($ Id.VSub_DollarName '$command')}
      arms: [
        (case_arm
          pat_list: [{(update)}]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$rerun'))} {(-a)} 
                          {(-n)} {(DQ ($ Id.VSub_DollarName '$tarball'))} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:9674)
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('Only one of -r or -t can be specified.'))})
                    (C {(echo)})
                    (C {(usage)})
                  ]
                  spids: [9655 9676]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$rerun'))} {(-a)} 
                          {(-n)} {(DQ ($ Id.VSub_DollarName '$preworld'))} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:9714)
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('Only one of -p or -r can be specified.'))})
                    (C {(echo)})
                    (C {(usage)})
                  ]
                  spids: [9695 9716]
                )
              ]
            )
          ]
          spids: [9651 9652 9735 -1]
        )
        (case_arm
          pat_list: [{(build)} {(diff)} {(status)}]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} {(-o)} 
                          {(-n)} {(DQ ($ Id.VSub_DollarName '$rerun'))} {(-o)} {(-n)} {(DQ ($ Id.VSub_DollarName '$tarball'))} {(-o)} {(-n)} 
                          {(DQ ($ Id.VSub_DollarName '$preworld'))} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:9783)
                    )
                  ]
                  action: [(C {(usage)})]
                  spids: [9746 9785]
                )
              ]
            )
          ]
          spids: [9738 9743 9794 -1]
        )
        (case_arm
          pat_list: [{(resolve)}]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} {(-o)} 
                          {(-n)} {(DQ ($ Id.VSub_DollarName '$rerun'))} {(-o)} {(-n)} {(DQ ($ Id.VSub_DollarName '$tarball'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:9828)
                    )
                  ]
                  action: [(C {(usage)})]
                  spids: [9801 9830]
                )
              ]
            )
          ]
          spids: [9797 9798 9839 -1]
        )
        (case_arm
          pat_list: [{(extract)}]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$dryrun'))} {(-o)} 
                          {(-n)} {(DQ ($ Id.VSub_DollarName '$rerun'))} {(-o)} {(-n)} {(DQ ($ Id.VSub_DollarName '$preworld'))} 
                          {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:9873)
                    )
                  ]
                  action: [(C {(usage)})]
                  spids: [9846 9875]
                )
              ]
            )
          ]
          spids: [9842 9843 9884 -1]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$preworld'))} 
                  {(Id.Lit_RBracket ']')}
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:9912)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OLDTREE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$NEWTREE')}
                  spids: [9917]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:NEWTREE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$WORKDIR') (/preworld)}
                  spids: [9921]
                )
              ]
            )
          ]
          spids: [9901 9914]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.Pipeline
                  children: [
                    (command.Simple
                      words: [{(mkdir)} {(-p)} {($ Id.VSub_DollarName '$WORKDIR')}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'2>' span_id:9944)
                          fd: 2
                          arg_word: {(/dev/null)}
                        )
                      ]
                    )
                  ]
                  negated: T
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:9946)
            )
          ]
          action: [
            (C {(echo)} {(DQ ('Failed to create work directory ') ($ Id.VSub_DollarName '$WORKDIR'))})
          ]
          spids: [9934 9948]
        )
      ]
    )
    (command.Case
      to_match: {($ Id.VSub_DollarName '$command')}
      arms: [
        (case_arm
          pat_list: [{(diff)} {(resolve)} {(status)}]
          action: [
            (command.Simple
              words: [{(exec)}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_DGreat val:'3>>' span_id:9978)
                  fd: 3
                  arg_word: {($ Id.VSub_DollarName '$LOGFILE')}
                )
              ]
            )
          ]
          spids: [9968 9973 9982 -1]
        )
        (case_arm
          pat_list: [{(Id.Lit_Star '*')}]
          action: [
            (command.Simple
              words: [{(exec)}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'3>' span_id:9991)
                  fd: 3
                  arg_word: {($ Id.VSub_DollarName '$LOGFILE')}
                )
              ]
            )
          ]
          spids: [9985 9986 9995 -1]
        )
      ]
    )
    (C {(${ Id.VSub_Name command) (_cmd)} {(DQ ($ Id.VSub_At '$@'))})
  ]
)