(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:MISC_FUNCTIONS_ARGS)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_At '$@'))}
          spids: [39]
        )
      ]
    )
    (C {<shift>} {($ Id.VSub_Pound '$#')})
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<source>} {(DQ (${ Id.VSub_Name PORTAGE_BIN_PATH) <'/ebuild.sh'>)})
        (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
      ]
    )
    (command.ShFunction
      name: install_symlink_html_docs
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [(C {<___eapi_has_prefix_variables>})]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<local>} {<Id.Lit_VarLike 'ED='> (${ Id.VSub_Name D)})]
                  spids: [72 79]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [(C {<cd>} {(DQ (${ Id.VSub_Name ED))}) (C {<die>} {(DQ <'cd failed'>)})]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ (${ Id.VSub_Name DOC_SYMLINKS_DIR))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<local>} {<mydocdir>} {<docdir>})
                    (command.ForEach
                      iter_name: docdir
                      iter_words: [
                        {
                          (DQ 
                            (braced_var_sub
                              token: <Id.VSub_Name HTMLDOC_DIR>
                              suffix_op: 
                                (suffix_op.Unary
                                  tok: <Id.VTest_ColonHyphen ':-'>
                                  arg_word: 
                                    {<does> <Id.Lit_Slash '/'> <not> <Id.Lit_Slash '/'> <exist>}
                                )
                            )
                          )
                        }
                        {(DQ (${ Id.VSub_Name PF) <'/html'>)}
                        {(DQ (${ Id.VSub_Name PF) <'/HTML'>)}
                        {(DQ (${ Id.VSub_Name P) <'/html'>)}
                        {(DQ (${ Id.VSub_Name P) <'/HTML'>)}
                      ]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (command.Sentence
                                          child: 
                                            (C {<Id.Lit_LBracket '['>} {<-d>} 
                                              {(DQ <'usr/share/doc/'> (${ Id.VSub_Name docdir))} {<Id.Lit_RBracket ']'>}
                                            )
                                          terminator: <Id.Op_Semi _>
                                        )
                                      ]
                                    )
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:mydocdir)
                                          op: assign_op.Equal
                                          rhs: {(DQ <'/usr/share/doc/'> (${ Id.VSub_Name docdir))}
                                          spids: [211]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [191 208]
                                )
                              ]
                            )
                          ]
                        )
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ (${ Id.VSub_Name mydocdir))} 
                                      {<Id.Lit_RBracket ']'>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {<local>} {<mysympath>})
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (command.Sentence
                                          child: 
                                            (C {<Id.Lit_LBracket '['>} {<-z>} 
                                              {(DQ (${ Id.VSub_Name SLOT))} {<-o>} 
                                              {
                                                (DQ 
                                                  (braced_var_sub
                                                    token: <Id.VSub_Name SLOT>
                                                    suffix_op: 
                                                      (suffix_op.Unary
                                                        tok: <Id.VOp1_Percent '%'>
                                                        arg_word: 
                                                          {<Id.Lit_Slash '/'> <Id.Lit_Other '*'>}
                                                      )
                                                  )
                                                )
                                              } {<Id.Lit_Equals '='>} {(DQ <0>)} {<Id.Lit_RBracket ']'>}
                                            )
                                          terminator: <Id.Op_Semi _>
                                        )
                                      ]
                                    )
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:mysympath)
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (DQ (${ Id.VSub_Name DOC_SYMLINKS_DIR) <'/'> 
                                                (${ Id.VSub_Name CATEGORY) <'/'> (${ Id.VSub_Name PN)
                                              )
                                            }
                                          spids: [286]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [250 283]
                                )
                              ]
                              else_action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:mysympath)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (DQ (${ Id.VSub_Name DOC_SYMLINKS_DIR) <'/'> 
                                            (${ Id.VSub_Name CATEGORY) <'/'> (${ Id.VSub_Name PN) <-> 
                                            (braced_var_sub
                                              token: <Id.VSub_Name SLOT>
                                              suffix_op: 
                                                (suffix_op.Unary
                                                  tok: <Id.VOp1_Percent '%'>
                                                  arg_word: {<Id.Lit_Slash '/'> <Id.Lit_Other '*'>}
                                                )
                                            )
                                          )
                                        }
                                      spids: [305]
                                    )
                                  ]
                                )
                              ]
                            )
                            (C {<einfo>} 
                              {
                                (DQ <'Symlinking '> (${ Id.VSub_Name mysympath) 
                                  <' to the HTML documentation'>
                                )
                              }
                            )
                            (C {<dodir>} 
                              {
                                (DQ (${ Id.VSub_Name DOC_SYMLINKS_DIR) <'/'> (${ Id.VSub_Name CATEGORY))
                              }
                            )
                            (C {<dosym>} {(DQ (${ Id.VSub_Name mydocdir))} 
                              {(DQ (${ Id.VSub_Name mysympath))}
                            )
                          ]
                          spids: [226 242]
                        )
                      ]
                    )
                  ]
                  spids: [114 130]
                )
              ]
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:READLINK_F_WORKS)
          op: assign_op.Equal
          rhs: {(DQ )}
          spids: [381]
        )
      ]
    )
    (command.ShFunction
      name: canonicalize
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.Unary
                                  op_id: Id.BoolUnary_z
                                  child: {(${ Id.VSub_Name READLINK_F_WORKS)}
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_GlobDEqual
                                          left: 
                                            {
                                              (command_sub
                                                left_token: <Id.Left_DollarParen '$('>
                                                child: 
                                                  (command.Simple
                                                    words: [{<readlink>} {<-f>} {<-->} {<'/../'>}]
                                                    redirects: [
                                                      (redir
                                                        op: <Id.Redir_Great '2>'>
                                                        loc: (redir_loc.Fd fd:2)
                                                        arg: {<'/dev/null'>}
                                                      )
                                                    ]
                                                    do_fork: T
                                                  )
                                              )
                                            }
                                          right: {(DQ <'/'>)}
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:READLINK_F_WORKS)
                                  op: assign_op.Equal
                                  rhs: {<true>}
                                  spids: [439]
                                )
                              ]
                            )
                          ]
                          spids: [409 436]
                        )
                      ]
                      else_action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:READLINK_F_WORKS)
                              op: assign_op.Equal
                              rhs: {<false>}
                              spids: [446]
                            )
                          ]
                        )
                      ]
                    )
                  ]
                  spids: [392 406]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: (C {(${ Id.VSub_Name READLINK_F_WORKS)})
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<readlink>} {<-f>} {<-->} {(DQ ($ Id.VSub_At '$@'))})
                    (command.ControlFlow token:<Id.ControlFlow_Return return>)
                  ]
                  spids: [456 464]
                )
              ]
            )
            (C {<local>} {<Id.Lit_VarLike 'f='> ($ Id.VSub_Number '$1')} {<b>} 
              {<Id.Lit_VarLike 'n='> <10>} {<Id.Lit_VarLike 'wd='> (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<pwd>}))}
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Id.Arith_Great
                              left: 
                                (arith_expr.UnaryAssign
                                  op_id: Id.Node_PostDMinus
                                  child: <Id.Lit_ArithVarLike n>
                                )
                              right: {<Id.Lit_Digits 0>}
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.WhileUntil
                      keyword: <Id.KW_While while>
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.LogicalAnd
                                      left: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_GlobEqual
                                          left: 
                                            {
                                              (braced_var_sub
                                                token: <Id.VSub_Name f>
                                                suffix_op: 
                                                  (suffix_op.Slice
                                                    begin: 
                                                      (arith_expr.Unary
                                                        op_id: Id.Node_UnaryMinus
                                                        child: {<Id.Lit_Digits 1>}
                                                      )
                                                  )
                                              )
                                            }
                                          right: {<'/'>}
                                        )
                                      right: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_gt
                                          left: 
                                            {
                                              (braced_var_sub
                                                token: <Id.VSub_Name f>
                                                prefix_op: (Id.VSub_Pound)
                                              )
                                            }
                                          right: {<1>}
                                        )
                                    )
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      body: 
                        (command.DoGroup
                          children: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:f)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: <Id.VSub_Name f>
                                        suffix_op: 
                                          (suffix_op.Unary
                                            tok: <Id.VOp1_Percent '%'>
                                            arg_word: {<Id.Lit_Slash '/'>}
                                          )
                                      )
                                    }
                                  spids: [552]
                                )
                              ]
                            )
                          ]
                        )
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:b)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name f>
                                suffix_op: 
                                  (suffix_op.Unary
                                    tok: <Id.VOp1_DPound '##'>
                                    arg_word: {<Id.Lit_Other '*'> <Id.Lit_Slash '/'>}
                                  )
                              )
                            }
                          spids: [563]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (command.Simple
                          words: [
                            {<cd>}
                            {
                              (DQ 
                                (braced_var_sub
                                  token: <Id.VSub_Name f>
                                  suffix_op: 
                                    (suffix_op.Unary
                                      tok: <Id.VOp1_Percent '%'>
                                      arg_word: {(DQ (${ Id.VSub_Name b))}
                                    )
                                )
                              )
                            }
                          ]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '2>'>
                              loc: (redir_loc.Fd fd:2)
                              arg: {<'/dev/null'>}
                            )
                          ]
                          do_fork: T
                        )
                        (command.ControlFlow
                          token: <Id.ControlFlow_Break break>
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.LogicalNot
                                          child: 
                                            (bool_expr.Unary
                                              op_id: Id.BoolUnary_L
                                              child: {(${ Id.VSub_Name b)}
                                            )
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:f)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: <Id.Left_DollarParen '$('>
                                        child: (C {<pwd>} {<-P>})
                                      )
                                    }
                                  spids: [612]
                                )
                              ]
                            )
                            (C {<echo>} 
                              {
                                (DQ 
                                  (braced_var_sub
                                    token: <Id.VSub_Name f>
                                    suffix_op: 
                                      (suffix_op.Unary
                                        tok: <Id.VOp1_Percent '%'>
                                        arg_word: {<Id.Lit_Slash '/'>}
                                      )
                                  ) <'/'> (${ Id.VSub_Name b)
                                )
                              }
                            )
                            (C {<cd>} {(DQ (${ Id.VSub_Name wd))})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<0>}
                            )
                          ]
                          spids: [594 609]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:f)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<readlink>} {(DQ (${ Id.VSub_Name b))})
                              )
                            }
                          spids: [652]
                        )
                      ]
                    )
                  ]
                )
            )
            (C {<cd>} {(DQ (${ Id.VSub_Name wd))})
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<1>})
          ]
        )
    )
    (command.ShFunction
      name: prepcompress
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<-a>} {<include>} {<exclude>} {<incl_d>} {<incl_f>})
            (C {<local>} {<f>} {<g>} {<i>} {<real_f>} {<real_d>})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [(C {<___eapi_has_prefix_variables>})]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<local>} {<Id.Lit_VarLike 'ED='> (${ Id.VSub_Name D)})]
                  spids: [716 723]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:real_d)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<canonicalize>} {(DQ (${ Id.VSub_Name ED))})
                      )
                    }
                  spids: [742]
                )
              ]
            )
            (command.ForExpr
              init: 
                (arith_expr.BinaryAssign
                  op_id: Id.Arith_Equal
                  left: <Id.Lit_ArithVarLike i>
                  right: {<Id.Lit_Digits 0>}
                )
              cond: 
                (arith_expr.Binary
                  op_id: Id.Arith_Less
                  left: <Id.Lit_ArithVarLike i>
                  right: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Name PORTAGE_DOCOMPRESS>
                        prefix_op: (Id.VSub_Pound)
                        bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                      )
                    }
                )
              update: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:<Id.Lit_ArithVarLike i>)
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:real_f)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (C {<canonicalize>} 
                                    {
                                      (DQ (${ Id.VSub_Name ED) 
                                        (braced_var_sub
                                          token: <Id.VSub_Name PORTAGE_DOCOMPRESS>
                                          bracket_op: 
                                            (bracket_op.ArrayIndex
                                              expr: <Id.Lit_ArithVarLike i>
                                            )
                                        )
                                      )
                                    }
                                  )
                              )
                            }
                          spids: [788]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:f)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name real_f>
                                suffix_op: 
                                  (suffix_op.Unary
                                    tok: <Id.VOp1_Pound '#'>
                                    arg_word: {(DQ (${ Id.VSub_Name real_d))}
                                  )
                              )
                            }
                          spids: [806]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.AndOr
                                  ops: [Id.Op_DAmp]
                                  children: [
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_GlobNEqual
                                          left: {(${ Id.VSub_Name real_f)}
                                          right: {(DQ (${ Id.VSub_Name f))}
                                        )
                                    )
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.LogicalOr
                                          left: 
                                            (bool_expr.Unary
                                              op_id: Id.BoolUnary_d
                                              child: {(${ Id.VSub_Name real_f)}
                                            )
                                          right: 
                                            (bool_expr.Unary
                                              op_id: Id.BoolUnary_f
                                              child: {(${ Id.VSub_Name real_f)}
                                            )
                                        )
                                    )
                                  ]
                                )
                              ]
                            )
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.IndexedName
                                      name: include
                                      index: 
                                        {
                                          (braced_var_sub
                                            token: <Id.VSub_Name include>
                                            prefix_op: (Id.VSub_Pound)
                                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                          )
                                        }
                                    )
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: <Id.VSub_Name f>
                                        suffix_op: 
                                          (suffix_op.Unary
                                            tok: <Id.VTest_ColonHyphen ':-'>
                                            arg_word: {<Id.Lit_Slash '/'>}
                                          )
                                      )
                                    }
                                  spids: [860]
                                )
                              ]
                            )
                          ]
                          spids: [818 857]
                        )
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_ge
                                          left: {(${ Id.VSub_Name i)}
                                          right: {<3>}
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {<ewarn>} {(DQ <'prepcompress:'>)} 
                              {
                                (DQ <'ignoring nonexistent path \''> 
                                  (braced_var_sub
                                    token: <Id.VSub_Name PORTAGE_DOCOMPRESS>
                                    bracket_op: (bracket_op.ArrayIndex expr:<Id.Lit_ArithVarLike i>)
                                  ) <'\''>
                                )
                              }
                            )
                          ]
                          spids: [884 899]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.ForExpr
              init: 
                (arith_expr.BinaryAssign
                  op_id: Id.Arith_Equal
                  left: <Id.Lit_ArithVarLike i>
                  right: {<Id.Lit_Digits 0>}
                )
              cond: 
                (arith_expr.Binary
                  op_id: Id.Arith_Less
                  left: <Id.Lit_ArithVarLike i>
                  right: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Name PORTAGE_DOCOMPRESS_SKIP>
                        prefix_op: (Id.VSub_Pound)
                        bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                      )
                    }
                )
              update: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:<Id.Lit_ArithVarLike i>)
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:real_f)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (C {<canonicalize>} 
                                    {
                                      (DQ (${ Id.VSub_Name ED) 
                                        (braced_var_sub
                                          token: <Id.VSub_Name PORTAGE_DOCOMPRESS_SKIP>
                                          bracket_op: 
                                            (bracket_op.ArrayIndex
                                              expr: <Id.Lit_ArithVarLike i>
                                            )
                                        )
                                      )
                                    }
                                  )
                              )
                            }
                          spids: [962]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:f)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name real_f>
                                suffix_op: 
                                  (suffix_op.Unary
                                    tok: <Id.VOp1_Pound '#'>
                                    arg_word: {(DQ (${ Id.VSub_Name real_d))}
                                  )
                              )
                            }
                          spids: [980]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.AndOr
                                  ops: [Id.Op_DAmp]
                                  children: [
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_GlobNEqual
                                          left: {(${ Id.VSub_Name real_f)}
                                          right: {(DQ (${ Id.VSub_Name f))}
                                        )
                                    )
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.LogicalOr
                                          left: 
                                            (bool_expr.Unary
                                              op_id: Id.BoolUnary_d
                                              child: {(${ Id.VSub_Name real_f)}
                                            )
                                          right: 
                                            (bool_expr.Unary
                                              op_id: Id.BoolUnary_f
                                              child: {(${ Id.VSub_Name real_f)}
                                            )
                                        )
                                    )
                                  ]
                                )
                              ]
                            )
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.IndexedName
                                      name: exclude
                                      index: 
                                        {
                                          (braced_var_sub
                                            token: <Id.VSub_Name exclude>
                                            prefix_op: (Id.VSub_Pound)
                                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                          )
                                        }
                                    )
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: <Id.VSub_Name f>
                                        suffix_op: 
                                          (suffix_op.Unary
                                            tok: <Id.VTest_ColonHyphen ':-'>
                                            arg_word: {<Id.Lit_Slash '/'>}
                                          )
                                      )
                                    }
                                  spids: [1034]
                                )
                              ]
                            )
                          ]
                          spids: [992 1031]
                        )
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_ge
                                          left: {(${ Id.VSub_Name i)}
                                          right: {<1>}
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {<ewarn>} {(DQ <'prepcompress:'>)} 
                              {
                                (DQ <'ignoring nonexistent path \''> 
                                  (braced_var_sub
                                    token: <Id.VSub_Name PORTAGE_DOCOMPRESS_SKIP>
                                    bracket_op: (bracket_op.ArrayIndex expr:<Id.Lit_ArithVarLike i>)
                                  ) <'\''>
                                )
                              }
                            )
                          ]
                          spids: [1058 1073]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.ForExpr
              init: 
                (arith_expr.BinaryAssign
                  op_id: Id.Arith_Equal
                  left: <Id.Lit_ArithVarLike i>
                  right: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Minus
                      left: 
                        {
                          (braced_var_sub
                            token: <Id.VSub_Name include>
                            prefix_op: (Id.VSub_Pound)
                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                          )
                        }
                      right: {<Id.Lit_Digits 1>}
                    )
                )
              cond: 
                (arith_expr.Binary
                  op_id: Id.Arith_GreatEqual
                  left: <Id.Lit_ArithVarLike i>
                  right: {<Id.Lit_Digits 0>}
                )
              update: (arith_expr.UnaryAssign op_id:Id.Node_PostDMinus child:<Id.Lit_ArithVarLike i>)
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:f)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name include>
                                bracket_op: (bracket_op.ArrayIndex expr:<Id.Lit_ArithVarLike i>)
                              )
                            }
                          spids: [1157]
                        )
                      ]
                    )
                    (command.ForEach
                      iter_name: g
                      iter_words: [
                        {
                          (DQ 
                            (braced_var_sub
                              token: <Id.VSub_Name include>
                              bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                            )
                          )
                        }
                      ]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (command.Sentence
                                          child: 
                                            (command.DBracket
                                              expr: 
                                                (bool_expr.Binary
                                                  op_id: Id.BoolBinary_GlobDEqual
                                                  left: {(${ Id.VSub_Name f)}
                                                  right: 
                                                    {
                                                      (DQ 
                                                        (braced_var_sub
                                                          token: <Id.VSub_Name g>
                                                          suffix_op: 
                                                            (suffix_op.Unary
                                                              tok: <Id.VOp1_Percent '%'>
                                                              arg_word: {<Id.Lit_Slash '/'>}
                                                            )
                                                        )
                                                      ) <'/'> <Id.Lit_Other '*'>
                                                    }
                                                )
                                            )
                                          terminator: <Id.Op_Semi _>
                                        )
                                      ]
                                    )
                                  action: [
                                    (C {<unset>} 
                                      {<Id.Lit_ArrayLhsOpen 'include['> <i> <Id.Lit_RBracket ']'>}
                                    )
                                    (command.ControlFlow
                                      token: <Id.ControlFlow_Continue continue>
                                      arg_word: {<2>}
                                    )
                                  ]
                                  spids: [1185 1208]
                                )
                              ]
                            )
                          ]
                        )
                    )
                    (command.ForEach
                      iter_name: g
                      iter_words: [
                        {
                          (DQ 
                            (braced_var_sub
                              token: <Id.VSub_Name exclude>
                              bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                            )
                          )
                        }
                      ]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (command.Sentence
                                          child: 
                                            (command.DBracket
                                              expr: 
                                                (bool_expr.LogicalOr
                                                  left: 
                                                    (bool_expr.Binary
                                                      op_id: Id.BoolBinary_GlobEqual
                                                      left: {(${ Id.VSub_Name f)}
                                                      right: {(DQ (${ Id.VSub_Name g))}
                                                    )
                                                  right: 
                                                    (bool_expr.Binary
                                                      op_id: Id.BoolBinary_GlobDEqual
                                                      left: {(${ Id.VSub_Name f)}
                                                      right: 
                                                        {
                                                          (DQ 
                                                            (braced_var_sub
                                                              token: <Id.VSub_Name g>
                                                              suffix_op: 
                                                                (suffix_op.Unary
                                                                  tok: <Id.VOp1_Percent '%'>
                                                                  arg_word: {<Id.Lit_Slash '/'>}
                                                                )
                                                            )
                                                          ) <'/'> <Id.Lit_Other '*'>
                                                        }
                                                    )
                                                )
                                            )
                                          terminator: <Id.Op_Semi _>
                                        )
                                      ]
                                    )
                                  action: [
                                    (C {<unset>} 
                                      {<Id.Lit_ArrayLhsOpen 'include['> <i> <Id.Lit_RBracket ']'>}
                                    )
                                    (command.ControlFlow
                                      token: <Id.ControlFlow_Continue continue>
                                      arg_word: {<2>}
                                    )
                                  ]
                                  spids: [1248 1285]
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                )
            )
            (command.ForExpr
              init: 
                (arith_expr.BinaryAssign
                  op_id: Id.Arith_Equal
                  left: <Id.Lit_ArithVarLike i>
                  right: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Minus
                      left: 
                        {
                          (braced_var_sub
                            token: <Id.VSub_Name exclude>
                            prefix_op: (Id.VSub_Pound)
                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                          )
                        }
                      right: {<Id.Lit_Digits 1>}
                    )
                )
              cond: 
                (arith_expr.Binary
                  op_id: Id.Arith_GreatEqual
                  left: <Id.Lit_ArithVarLike i>
                  right: {<Id.Lit_Digits 0>}
                )
              update: (arith_expr.UnaryAssign op_id:Id.Node_PostDMinus child:<Id.Lit_ArithVarLike i>)
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:f)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name exclude>
                                bracket_op: (bracket_op.ArrayIndex expr:<Id.Lit_ArithVarLike i>)
                              )
                            }
                          spids: [1359]
                        )
                      ]
                    )
                    (command.ForEach
                      iter_name: g
                      iter_words: [
                        {
                          (DQ 
                            (braced_var_sub
                              token: <Id.VSub_Name exclude>
                              bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                            )
                          )
                        }
                      ]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (command.Sentence
                                          child: 
                                            (command.DBracket
                                              expr: 
                                                (bool_expr.Binary
                                                  op_id: Id.BoolBinary_GlobDEqual
                                                  left: {(${ Id.VSub_Name f)}
                                                  right: 
                                                    {
                                                      (DQ 
                                                        (braced_var_sub
                                                          token: <Id.VSub_Name g>
                                                          suffix_op: 
                                                            (suffix_op.Unary
                                                              tok: <Id.VOp1_Percent '%'>
                                                              arg_word: {<Id.Lit_Slash '/'>}
                                                            )
                                                        )
                                                      ) <'/'> <Id.Lit_Other '*'>
                                                    }
                                                )
                                            )
                                          terminator: <Id.Op_Semi _>
                                        )
                                      ]
                                    )
                                  action: [
                                    (C {<unset>} 
                                      {<Id.Lit_ArrayLhsOpen 'exclude['> <i> <Id.Lit_RBracket ']'>}
                                    )
                                    (command.ControlFlow
                                      token: <Id.ControlFlow_Continue continue>
                                      arg_word: {<2>}
                                    )
                                  ]
                                  spids: [1387 1410]
                                )
                              ]
                            )
                          ]
                        )
                    )
                    (command.ForEach
                      iter_name: g
                      iter_words: [
                        {
                          (DQ 
                            (braced_var_sub
                              token: <Id.VSub_Name include>
                              bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                            )
                          )
                        }
                      ]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.AndOr
                              ops: [Id.Op_DAmp]
                              children: [
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_GlobDEqual
                                      left: {(${ Id.VSub_Name f)}
                                      right: 
                                        {
                                          (DQ 
                                            (braced_var_sub
                                              token: <Id.VSub_Name g>
                                              suffix_op: 
                                                (suffix_op.Unary
                                                  tok: <Id.VOp1_Percent '%'>
                                                  arg_word: {<Id.Lit_Slash '/'>}
                                                )
                                            )
                                          ) <'/'> <Id.Lit_Other '*'>
                                        }
                                    )
                                )
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Continue continue>
                                  arg_word: {<2>}
                                )
                              ]
                            )
                          ]
                        )
                    )
                    (C {<unset>} {<Id.Lit_ArrayLhsOpen 'exclude['> <i> <Id.Lit_RBracket ']'>})
                  ]
                )
            )
            (command.ForEach
              iter_name: f
              iter_words: [
                {
                  (DQ 
                    (braced_var_sub
                      token: <Id.VSub_Name include>
                      bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                    )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Unary
                                          op_id: Id.BoolUnary_d
                                          child: {(${ Id.VSub_Name ED) (${ Id.VSub_Name f)}
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.IndexedName
                                      name: incl_d
                                      index: 
                                        {
                                          (braced_var_sub
                                            token: <Id.VSub_Name incl_d>
                                            prefix_op: (Id.VSub_Pound)
                                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                          )
                                        }
                                    )
                                  op: assign_op.Equal
                                  rhs: {(${ Id.VSub_Name f)}
                                  spids: [1533]
                                )
                              ]
                            )
                          ]
                          spids: [1514 1530]
                        )
                      ]
                      else_action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: 
                                (sh_lhs_expr.IndexedName
                                  name: incl_f
                                  index: 
                                    {
                                      (braced_var_sub
                                        token: <Id.VSub_Name incl_f>
                                        prefix_op: (Id.VSub_Pound)
                                        bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                      )
                                    }
                                )
                              op: assign_op.Equal
                              rhs: {(${ Id.VSub_Name f)}
                              spids: [1558]
                            )
                          ]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_gt
                      left: 
                        {
                          (braced_var_sub
                            token: <Id.VSub_Name incl_d>
                            prefix_op: (Id.VSub_Pound)
                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                          )
                        }
                      right: {<0>}
                    )
                )
                (C {<ecompressdir>} {<--limit>} 
                  {
                    (braced_var_sub
                      token: <Id.VSub_Name PORTAGE_DOCOMPRESS_SIZE_LIMIT>
                      suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:{<0>})
                    )
                  } {<--queue>} 
                  {
                    (DQ 
                      (braced_var_sub
                        token: <Id.VSub_Name incl_d>
                        bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                      )
                    )
                  }
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_gt
                      left: 
                        {
                          (braced_var_sub
                            token: <Id.VSub_Name incl_f>
                            prefix_op: (Id.VSub_Pound)
                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                          )
                        }
                      right: {<0>}
                    )
                )
                (C {<ecompress>} {<--queue>} 
                  {
                    (DQ 
                      (braced_var_sub
                        token: <Id.VSub_Name incl_f>
                        bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                        suffix_op: 
                          (suffix_op.PatSub
                            pat: {}
                            replace: {(${ Id.VSub_Name ED)}
                            replace_mode: Id.Lit_Pound
                          )
                      )
                    )
                  }
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_gt
                      left: 
                        {
                          (braced_var_sub
                            token: <Id.VSub_Name exclude>
                            prefix_op: (Id.VSub_Pound)
                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                          )
                        }
                      right: {<0>}
                    )
                )
                (C {<ecompressdir>} {<--ignore>} 
                  {
                    (DQ 
                      (braced_var_sub
                        token: <Id.VSub_Name exclude>
                        bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                      )
                    )
                  }
                )
              ]
            )
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
        )
    )
    (command.ShFunction
      name: install_qa_check
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<d>} {<f>} {<i>} {<qa_var>} {<x>} {<paths>} 
              {<Id.Lit_VarLike 'qa_checks='> (sh_array_literal left:<Id.Op_LParen _>)} {<Id.Lit_VarLike 'checks_run='> (sh_array_literal left:<Id.Op_LParen _>)}
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [(C {<___eapi_has_prefix_variables>})]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<local>} {<Id.Lit_VarLike 'EPREFIX='>} 
                      {<Id.Lit_VarLike 'ED='> (${ Id.VSub_Name D)}
                    )
                  ]
                  spids: [1742 1749]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [(C {<cd>} {(DQ (${ Id.VSub_Name ED))}) (C {<die>} {(DQ <'cd failed'>)})]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:paths)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (sh_array_literal
                        left: <Id.Op_LParen _>
                        words: [
                          {(DQ (${ Id.VSub_Name PORTAGE_OVERRIDE_EPREFIX)) 
                            <'/usr/local/lib/install-qa-check.d'>
                          }
                          {(DQ (${ Id.VSub_Name PORTAGE_OVERRIDE_EPREFIX)) 
                            <'/usr/lib/install-qa-check.d'>
                          }
                        ]
                      )
                    }
                  spids: [1788]
                )
              ]
            )
            (command.ForEach
              iter_name: d
              iter_words: [
                {
                  (DQ 
                    (braced_var_sub
                      token: <Id.VSub_Name PORTAGE_ECLASS_LOCATIONS>
                      bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                    )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:paths)
                          op: assign_op.PlusEqual
                          rhs: 
                            {
                              (sh_array_literal
                                left: <Id.Op_LParen _>
                                words: [{(DQ (${ Id.VSub_Name d)) <'/metadata/install-qa-check.d'>}]
                              )
                            }
                          spids: [1847]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:paths)
                  op: assign_op.PlusEqual
                  rhs: 
                    {
                      (sh_array_literal
                        left: <Id.Op_LParen _>
                        words: [
                          {(DQ (${ Id.VSub_Name PORTAGE_OVERRIDE_EPREFIX)) 
                            <'/usr/lib/portage/install-qa-check.d'>
                          }
                          {(DQ (${ Id.VSub_Name PORTAGE_BIN_PATH)) <'/install-qa-check.d'>}
                        ]
                      )
                    }
                  spids: [1866]
                )
              ]
            )
            (command.ForEach
              iter_name: d
              iter_words: [
                {
                  (DQ 
                    (braced_var_sub
                      token: <Id.VSub_Name paths>
                      bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                    )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.ForEach
                      iter_name: f
                      iter_words: [{(DQ (${ Id.VSub_Name d)) <'/'> <Id.Lit_Star '*'>}]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.AndOr
                              ops: [Id.Op_DAmp]
                              children: [
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Unary
                                      op_id: Id.BoolUnary_f
                                      child: {(${ Id.VSub_Name f)}
                                    )
                                )
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:qa_checks)
                                      op: assign_op.PlusEqual
                                      rhs: 
                                        {
                                          (sh_array_literal
                                            left: <Id.Op_LParen _>
                                            words: [
                                              {
                                                (DQ 
                                                  (braced_var_sub
                                                    token: <Id.VSub_Name f>
                                                    suffix_op: 
                                                      (suffix_op.Unary
                                                        tok: <Id.VOp1_DPound '##'>
                                                        arg_word: 
                                                          {<Id.Lit_Other '*'> <Id.Lit_Slash '/'>}
                                                      )
                                                  )
                                                )
                                              }
                                            ]
                                          )
                                        }
                                      spids: [1951]
                                    )
                                  ]
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                )
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: (C {<read>} {<-r>} {<-d>} {(SQ )} {<f>})
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.ForEach
                      iter_name: d
                      iter_words: [
                        {
                          (DQ 
                            (braced_var_sub
                              token: <Id.VSub_Name paths>
                              bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                            )
                          )
                        }
                      ]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.AndOr
                              ops: [Id.Op_DAmp]
                              children: [
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Unary
                                      op_id: Id.BoolUnary_f
                                      child: {(${ Id.VSub_Name d) <'/'> (${ Id.VSub_Name f)}
                                    )
                                )
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Break break>
                                )
                              ]
                            )
                          ]
                        )
                    )
                    (command.Subshell
                      child: 
                        (command.CommandList
                          children: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:_IN_INSTALL_QA_CHECK)
                                  op: assign_op.Equal
                                  rhs: {<1>}
                                  spids: [2063]
                                )
                              ]
                            )
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (C {<source>} {(DQ (${ Id.VSub_Name d) <'/'> (${ Id.VSub_Name f))})
                                (C {<eerror>} 
                                  {
                                    (DQ <'Post-install QA check '> (${ Id.VSub_Name f) 
                                      <' failed to run'>
                                    )
                                  }
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                )
              redirects: [
                (redir
                  op: <Id.Redir_Less '<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    {
                      (command_sub
                        left_token: <Id.Left_ProcSubIn '<('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<printf>} {(DQ <'%s'> <Id.Lit_BadBackslash '\\'> <0>)} 
                                {
                                  (DQ 
                                    (braced_var_sub
                                      token: <Id.VSub_Name qa_checks>
                                      bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                    )
                                  )
                                }
                              )
                              (command.Simple
                                words: [{<sort>} {<-u>} {<-z>}]
                                more_env: [(env_pair name:LC_ALL val:{<C>} spids:[2119])]
                                do_fork: T
                              )
                            ]
                            negated: F
                          )
                      )
                    }
                )
              ]
            )
            (C {<export>} {<STRIP_MASK>})
            (C {<prepall>})
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [(C {<___eapi_has_docompress>}) (C {<prepcompress>})]
            )
            (C {<ecompressdir>} {<--dequeue>})
            (C {<ecompress>} {<--dequeue>})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              words: [{<type>} {<-P>} {<scanelf>}]
                              redirects: [
                                (redir
                                  op: <Id.Redir_Great '>'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {<'/dev/null'>}
                                )
                              ]
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<rm>} {<-f>} 
                      (word.BracedTree
                        parts: [
                          (DQ ($ Id.VSub_DollarName '$PORTAGE_BUILDDIR'))
                          <'/build-info/NEEDED'>
                          (word_part.BracedTuple words:[{} {<.ELF.2>}])
                        ]
                      )
                    )
                    (command.Pipeline
                      children: [
                        (C {<scanelf>} {<-qyRF>} {(SQ <'%a;%p;%S;%r;%n'>)} {(DQ (${ Id.VSub_Name D))})
                        (BraceGroup
                          children: [
                            (command.WhileUntil
                              keyword: <Id.KW_While while>
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (command.Sentence
                                      child: 
                                        (command.Simple
                                          words: [{<read>} {<-r>} {<l>}]
                                          more_env: [
                                            (env_pair
                                              name: IFS
                                              val: (word.Empty)
                                              spids: [2228]
                                            )
                                          ]
                                          do_fork: T
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                  ]
                                )
                              body: 
                                (command.DoGroup
                                  children: [
                                    (command.Sentence
                                      child: 
                                        (command.ShAssignment
                                          pairs: [
                                            (assign_pair
                                              lhs: (sh_lhs_expr.Name name:arch)
                                              op: assign_op.Equal
                                              rhs: 
                                                {
                                                  (braced_var_sub
                                                    token: <Id.VSub_Name l>
                                                    suffix_op: 
                                                      (suffix_op.Unary
                                                        tok: <Id.VOp1_DPercent '%%'>
                                                        arg_word: {<';'> <Id.Lit_Other '*'>}
                                                      )
                                                  )
                                                }
                                              spids: [2240]
                                            )
                                          ]
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:l)
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (braced_var_sub
                                                token: <Id.VSub_Name l>
                                                suffix_op: 
                                                  (suffix_op.Unary
                                                    tok: <Id.VOp1_Pound '#'>
                                                    arg_word: {<Id.Lit_Other '*'> <';'>}
                                                  )
                                              )
                                            }
                                          spids: [2249]
                                        )
                                      ]
                                    )
                                    (command.Sentence
                                      child: 
                                        (command.ShAssignment
                                          pairs: [
                                            (assign_pair
                                              lhs: (sh_lhs_expr.Name name:obj)
                                              op: assign_op.Equal
                                              rhs: 
                                                {
                                                  (DQ <'/'> 
                                                    (braced_var_sub
                                                      token: <Id.VSub_Name l>
                                                      suffix_op: 
                                                        (suffix_op.Unary
                                                          tok: <Id.VOp1_DPercent '%%'>
                                                          arg_word: {<';'> <Id.Lit_Other '*'>}
                                                        )
                                                    )
                                                  )
                                                }
                                              spids: [2258]
                                            )
                                          ]
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:l)
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (braced_var_sub
                                                token: <Id.VSub_Name l>
                                                suffix_op: 
                                                  (suffix_op.Unary
                                                    tok: <Id.VOp1_Pound '#'>
                                                    arg_word: {<Id.Lit_Other '*'> <';'>}
                                                  )
                                              )
                                            }
                                          spids: [2270]
                                        )
                                      ]
                                    )
                                    (command.Sentence
                                      child: 
                                        (command.ShAssignment
                                          pairs: [
                                            (assign_pair
                                              lhs: (sh_lhs_expr.Name name:soname)
                                              op: assign_op.Equal
                                              rhs: 
                                                {
                                                  (braced_var_sub
                                                    token: <Id.VSub_Name l>
                                                    suffix_op: 
                                                      (suffix_op.Unary
                                                        tok: <Id.VOp1_DPercent '%%'>
                                                        arg_word: {<';'> <Id.Lit_Other '*'>}
                                                      )
                                                  )
                                                }
                                              spids: [2279]
                                            )
                                          ]
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:l)
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (braced_var_sub
                                                token: <Id.VSub_Name l>
                                                suffix_op: 
                                                  (suffix_op.Unary
                                                    tok: <Id.VOp1_Pound '#'>
                                                    arg_word: {<Id.Lit_Other '*'> <';'>}
                                                  )
                                              )
                                            }
                                          spids: [2288]
                                        )
                                      ]
                                    )
                                    (command.Sentence
                                      child: 
                                        (command.ShAssignment
                                          pairs: [
                                            (assign_pair
                                              lhs: (sh_lhs_expr.Name name:rpath)
                                              op: assign_op.Equal
                                              rhs: 
                                                {
                                                  (braced_var_sub
                                                    token: <Id.VSub_Name l>
                                                    suffix_op: 
                                                      (suffix_op.Unary
                                                        tok: <Id.VOp1_DPercent '%%'>
                                                        arg_word: {<';'> <Id.Lit_Other '*'>}
                                                      )
                                                  )
                                                }
                                              spids: [2297]
                                            )
                                          ]
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                    (command.Sentence
                                      child: 
                                        (command.ShAssignment
                                          pairs: [
                                            (assign_pair
                                              lhs: (sh_lhs_expr.Name name:l)
                                              op: assign_op.Equal
                                              rhs: 
                                                {
                                                  (braced_var_sub
                                                    token: <Id.VSub_Name l>
                                                    suffix_op: 
                                                      (suffix_op.Unary
                                                        tok: <Id.VOp1_Pound '#'>
                                                        arg_word: {<Id.Lit_Other '*'> <';'>}
                                                      )
                                                  )
                                                }
                                              spids: [2306]
                                            )
                                          ]
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                    (command.AndOr
                                      ops: [Id.Op_DAmp]
                                      children: [
                                        (C {<Id.Lit_LBracket '['>} {(DQ (${ Id.VSub_Name rpath))} 
                                          {<Id.Lit_Equals '='>} {(DQ <'  -  '>)} {<Id.Lit_RBracket ']'>}
                                        )
                                        (command.ShAssignment
                                          pairs: [
                                            (assign_pair
                                              lhs: (sh_lhs_expr.Name name:rpath)
                                              op: assign_op.Equal
                                              rhs: {(DQ )}
                                              spids: [2333]
                                            )
                                          ]
                                        )
                                      ]
                                    )
                                    (command.Sentence
                                      child: 
                                        (command.ShAssignment
                                          pairs: [
                                            (assign_pair
                                              lhs: (sh_lhs_expr.Name name:needed)
                                              op: assign_op.Equal
                                              rhs: 
                                                {
                                                  (braced_var_sub
                                                    token: <Id.VSub_Name l>
                                                    suffix_op: 
                                                      (suffix_op.Unary
                                                        tok: <Id.VOp1_DPercent '%%'>
                                                        arg_word: {<';'> <Id.Lit_Other '*'>}
                                                      )
                                                  )
                                                }
                                              spids: [2338]
                                            )
                                          ]
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:l)
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (braced_var_sub
                                                token: <Id.VSub_Name l>
                                                suffix_op: 
                                                  (suffix_op.Unary
                                                    tok: <Id.VOp1_Pound '#'>
                                                    arg_word: {<Id.Lit_Other '*'> <';'>}
                                                  )
                                              )
                                            }
                                          spids: [2347]
                                        )
                                      ]
                                    )
                                    (command.Simple
                                      words: [
                                        {<echo>}
                                        {(DQ (${ Id.VSub_Name obj) <' '> (${ Id.VSub_Name needed))}
                                      ]
                                      redirects: [
                                        (redir
                                          op: <Id.Redir_DGreat '>>'>
                                          loc: (redir_loc.Fd fd:1)
                                          arg: 
                                            {(DQ (${ Id.VSub_Name PORTAGE_BUILDDIR)) 
                                              <'/build-info/NEEDED'>
                                            }
                                        )
                                      ]
                                      do_fork: T
                                    )
                                    (command.Simple
                                      words: [
                                        {<echo>}
                                        {
                                          (DQ 
                                            (braced_var_sub
                                              token: <Id.VSub_Name arch>
                                              suffix_op: (suffix_op.Slice begin:{<Id.Lit_Digits 3>})
                                            ) <';'> (${ Id.VSub_Name obj) <';'> (${ Id.VSub_Name soname) <';'> (${ Id.VSub_Name rpath) <';'> 
                                            (${ Id.VSub_Name needed)
                                          )
                                        }
                                      ]
                                      redirects: [
                                        (redir
                                          op: <Id.Redir_DGreat '>>'>
                                          loc: (redir_loc.Fd fd:1)
                                          arg: 
                                            {(DQ (${ Id.VSub_Name PORTAGE_BUILDDIR)) 
                                              <'/build-info/NEEDED.ELF.2'>
                                            }
                                        )
                                      ]
                                      do_fork: T
                                    )
                                  ]
                                )
                            )
                          ]
                        )
                      ]
                      negated: F
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ (${ Id.VSub_Name QA_SONAME_NO_SYMLINK))} 
                          {<Id.Lit_RBracket ']'>}
                        )
                        (command.Simple
                          words: [{<echo>} {(DQ (${ Id.VSub_Name QA_SONAME_NO_SYMLINK))}]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: 
                                {(DQ (${ Id.VSub_Name PORTAGE_BUILDDIR)) 
                                  <'/build-info/QA_SONAME_NO_SYMLINK'>
                                }
                            )
                          ]
                          do_fork: T
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.AndOr
                                      ops: [Id.Op_DAmp]
                                      children: [
                                        (C {<has>} {<binchecks>} {(${ Id.VSub_Name RESTRICT)})
                                        (C {<Id.Lit_LBracket '['>} {<-s>} 
                                          {
                                            (DQ (${ Id.VSub_Name PORTAGE_BUILDDIR) 
                                              <'/build-info/NEEDED.ELF.2'>
                                            )
                                          } {<Id.Lit_RBracket ']'>}
                                        )
                                      ]
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {<eqawarn>} 
                              {
                                (DQ 
                                  <
'QA Notice: RESTRICT=binchecks prevented checks on these ELF files:'
                                  >
                                )
                              }
                            )
                            (C {<eqawarn>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    child: 
                                      (command.WhileUntil
                                        keyword: <Id.KW_While while>
                                        cond: 
                                          (condition.Shell
                                            commands: [
                                              (command.Sentence
                                                child: (C {<read>} {<-r>} {<x>})
                                                terminator: <Id.Op_Semi _>
                                              )
                                            ]
                                          )
                                        body: 
                                          (command.DoGroup
                                            children: [
                                              (command.Sentence
                                                child: 
                                                  (command.ShAssignment
                                                    pairs: [
                                                      (assign_pair
                                                        lhs: (sh_lhs_expr.Name name:x)
                                                        op: assign_op.Equal
                                                        rhs: 
                                                          {
                                                            (braced_var_sub
                                                              token: <Id.VSub_Name x>
                                                              suffix_op: 
                                                                (suffix_op.Unary
                                                                  tok: <Id.VOp1_Pound '#'>
                                                                  arg_word: {<Id.Lit_Other '*'> <';'>}
                                                                )
                                                            )
                                                          }
                                                        spids: [2511]
                                                      )
                                                    ]
                                                  )
                                                terminator: <Id.Op_Semi _>
                                              )
                                              (command.Sentence
                                                child: 
                                                  (command.ShAssignment
                                                    pairs: [
                                                      (assign_pair
                                                        lhs: (sh_lhs_expr.Name name:x)
                                                        op: assign_op.Equal
                                                        rhs: 
                                                          {
                                                            (braced_var_sub
                                                              token: <Id.VSub_Name x>
                                                              suffix_op: 
                                                                (suffix_op.Unary
                                                                  tok: <Id.VOp1_DPercent '%%'>
                                                                  arg_word: {<';'> <Id.Lit_Other '*'>}
                                                                )
                                                            )
                                                          }
                                                        spids: [2521]
                                                      )
                                                    ]
                                                  )
                                                terminator: <Id.Op_Semi _>
                                              )
                                              (command.Sentence
                                                child: 
                                                  (C {<echo>} 
                                                    {
                                                      (DQ 
                                                        (braced_var_sub
                                                          token: <Id.VSub_Name x>
                                                          suffix_op: 
                                                            (suffix_op.Unary
                                                              tok: <Id.VOp1_Pound '#'>
                                                              arg_word: {(${ Id.VSub_Name EPREFIX)}
                                                            )
                                                        )
                                                      )
                                                    }
                                                  )
                                                terminator: <Id.Op_Semi _>
                                              )
                                            ]
                                          )
                                        redirects: [
                                          (redir
                                            op: <Id.Redir_Less '<'>
                                            loc: (redir_loc.Fd fd:0)
                                            arg: 
                                              {(DQ (${ Id.VSub_Name PORTAGE_BUILDDIR)) 
                                                <'/build-info/NEEDED.ELF.2'>
                                              }
                                          )
                                        ]
                                      )
                                  )
                                )
                              }
                            )
                          ]
                          spids: [2457 2486]
                        )
                      ]
                    )
                  ]
                  spids: [2173 2187]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<rm>} {<-f>} 
                  (word.BracedTree
                    parts: [
                      (DQ (${ Id.VSub_Name ED))
                      <'/usr/share/info/dir'>
                      (word_part.BracedTuple words:[{} {<.gz>} {<.bz2>}])
                    ]
                  )
                )
                (C {<die>} {(DQ <'rm failed!'>)})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: postinst_qa_check
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<d>} {<f>} {<paths>} 
              {<Id.Lit_VarLike 'qa_checks='> (sh_array_literal left:<Id.Op_LParen _>)}
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [(C {<___eapi_has_prefix_variables>})]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<local>} {<Id.Lit_VarLike 'EPREFIX='>} 
                      {<Id.Lit_VarLike 'EROOT='> (${ Id.VSub_Name ROOT)}
                    )
                  ]
                  spids: [2618 2625]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [(C {<cd>} {(DQ (${ Id.VSub_Name EROOT))}) (C {<die>} {(DQ <'cd failed'>)})]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:paths)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (sh_array_literal
                        left: <Id.Op_LParen _>
                        words: [
                          {(DQ (${ Id.VSub_Name PORTAGE_OVERRIDE_EPREFIX)) 
                            <'/usr/local/lib/postinst-qa-check.d'>
                          }
                          {(DQ (${ Id.VSub_Name PORTAGE_OVERRIDE_EPREFIX)) 
                            <'/usr/lib/postinst-qa-check.d'>
                          }
                        ]
                      )
                    }
                  spids: [2664]
                )
              ]
            )
            (command.ForEach
              iter_name: d
              iter_words: [
                {
                  (DQ 
                    (braced_var_sub
                      token: <Id.VSub_Name PORTAGE_ECLASS_LOCATIONS>
                      bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                    )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:paths)
                          op: assign_op.PlusEqual
                          rhs: 
                            {
                              (sh_array_literal
                                left: <Id.Op_LParen _>
                                words: [{(DQ (${ Id.VSub_Name d)) <'/metadata/postinst-qa-check.d'>}]
                              )
                            }
                          spids: [2723]
                        )
                      ]
                    )
                  ]
                )
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:paths)
                  op: assign_op.PlusEqual
                  rhs: 
                    {
                      (sh_array_literal
                        left: <Id.Op_LParen _>
                        words: [
                          {(DQ (${ Id.VSub_Name PORTAGE_OVERRIDE_EPREFIX)) 
                            <'/usr/lib/portage/postinst-qa-check.d'>
                          }
                          {(DQ (${ Id.VSub_Name PORTAGE_BIN_PATH)) <'/postinst-qa-check.d'>}
                        ]
                      )
                    }
                  spids: [2742]
                )
              ]
            )
            (command.ForEach
              iter_name: d
              iter_words: [
                {
                  (DQ 
                    (braced_var_sub
                      token: <Id.VSub_Name paths>
                      bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                    )
                  )
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.ForEach
                      iter_name: f
                      iter_words: [{(DQ (${ Id.VSub_Name d)) <'/'> <Id.Lit_Star '*'>}]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.AndOr
                              ops: [Id.Op_DAmp]
                              children: [
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Unary
                                      op_id: Id.BoolUnary_f
                                      child: {(${ Id.VSub_Name f)}
                                    )
                                )
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:qa_checks)
                                      op: assign_op.PlusEqual
                                      rhs: 
                                        {
                                          (sh_array_literal
                                            left: <Id.Op_LParen _>
                                            words: [
                                              {
                                                (DQ 
                                                  (braced_var_sub
                                                    token: <Id.VSub_Name f>
                                                    suffix_op: 
                                                      (suffix_op.Unary
                                                        tok: <Id.VOp1_DPound '##'>
                                                        arg_word: 
                                                          {<Id.Lit_Other '*'> <Id.Lit_Slash '/'>}
                                                      )
                                                  )
                                                )
                                              }
                                            ]
                                          )
                                        }
                                      spids: [2827]
                                    )
                                  ]
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                )
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: (C {<read>} {<-r>} {<-d>} {(SQ )} {<f>})
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.ForEach
                      iter_name: d
                      iter_words: [
                        {
                          (DQ 
                            (braced_var_sub
                              token: <Id.VSub_Name paths>
                              bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                            )
                          )
                        }
                      ]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.AndOr
                              ops: [Id.Op_DAmp]
                              children: [
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Unary
                                      op_id: Id.BoolUnary_f
                                      child: {(${ Id.VSub_Name d) <'/'> (${ Id.VSub_Name f)}
                                    )
                                )
                                (command.ControlFlow
                                  token: <Id.ControlFlow_Break break>
                                )
                              ]
                            )
                          ]
                        )
                    )
                    (command.Subshell
                      child: 
                        (command.CommandList
                          children: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:_IN_INSTALL_QA_CHECK)
                                  op: assign_op.Equal
                                  rhs: {<1>}
                                  spids: [2939]
                                )
                              ]
                            )
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (C {<source>} {(DQ (${ Id.VSub_Name d) <'/'> (${ Id.VSub_Name f))})
                                (C {<eerror>} 
                                  {
                                    (DQ <'Post-postinst QA check '> (${ Id.VSub_Name f) 
                                      <' failed to run'>
                                    )
                                  }
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                )
              redirects: [
                (redir
                  op: <Id.Redir_Less '<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    {
                      (command_sub
                        left_token: <Id.Left_ProcSubIn '<('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<printf>} {(DQ <'%s'> <Id.Lit_BadBackslash '\\'> <0>)} 
                                {
                                  (DQ 
                                    (braced_var_sub
                                      token: <Id.VSub_Name qa_checks>
                                      bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                    )
                                  )
                                }
                              )
                              (command.Simple
                                words: [{<sort>} {<-u>} {<-z>}]
                                more_env: [(env_pair name:LC_ALL val:{<C>} spids:[2995])]
                                do_fork: T
                              )
                            ]
                            negated: F
                          )
                      )
                    }
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: install_mask
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'root='> (DQ ($ Id.VSub_Number '$1'))})
            (C {<shift>})
            (C {<local>} {<Id.Lit_VarLike 'install_mask='> (DQ ($ Id.VSub_Star '$*'))})
            (C {<local>} {<Id.Lit_VarLike 'shopts='> ($ Id.VSub_Hyphen '$-')})
            (C {<set>} {<-o>} {<noglob>})
            (C {<local>} {<no_inst>})
            (command.ForEach
              iter_name: no_inst
              iter_words: [{(${ Id.VSub_Name install_mask)}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {<set>} {<Id.Lit_Other '+'> <o>} {<noglob>})
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.LogicalOr
                                          left: 
                                            (bool_expr.Unary
                                              op_id: Id.BoolUnary_e
                                              child: 
                                                {(DQ (${ Id.VSub_Name root)) <'/'> 
                                                  (${ Id.VSub_Name no_inst)
                                                }
                                            )
                                          right: 
                                            (bool_expr.LogicalOr
                                              left: 
                                                (bool_expr.Unary
                                                  op_id: Id.BoolUnary_L
                                                  child: 
                                                    {(DQ (${ Id.VSub_Name root)) <'/'> 
                                                      (${ Id.VSub_Name no_inst)
                                                    }
                                                )
                                              right: 
                                                (bool_expr.Binary
                                                  op_id: Id.BoolBinary_GlobNEqual
                                                  left: 
                                                    {(DQ (${ Id.VSub_Name root)) <'/'> 
                                                      (${ Id.VSub_Name no_inst)
                                                    }
                                                  right: 
                                                    {
                                                      (command_sub
                                                        left_token: <Id.Left_DollarParen '$('>
                                                        child: 
                                                          (C {<echo>} 
                                                            {(DQ (${ Id.VSub_Name root)) <'/'> 
                                                              (${ Id.VSub_Name no_inst)
                                                            }
                                                          )
                                                      )
                                                    }
                                                )
                                            )
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (C {<__quiet_mode>})
                                (C {<einfo>} {(DQ <'Removing '> (${ Id.VSub_Name no_inst))})
                              ]
                            )
                            (command.Simple
                              words: [
                                {<rm>}
                                {<-Rf>}
                                {(DQ (${ Id.VSub_Name root)) <'/'> (${ Id.VSub_Name no_inst)}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_GreatAnd '>&'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {<'/dev/null'>}
                                )
                              ]
                              do_fork: T
                            )
                          ]
                          spids: [3108 3171]
                        )
                      ]
                    )
                    (command.Pipeline
                      children: [
                        (command.Simple
                          words: [
                            {<find>}
                            {(DQ (${ Id.VSub_Name root))}
                            {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\('>)}
                            {<-path>}
                            {(DQ (${ Id.VSub_Name no_inst))}
                            {<-or>}
                            {<-name>}
                            {(DQ (${ Id.VSub_Name no_inst))}
                            {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\)'>)}
                            {<-print0>}
                          ]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '2>'>
                              loc: (redir_loc.Fd fd:2)
                              arg: {<'/dev/null'>}
                            )
                          ]
                          do_fork: T
                        )
                        (command.Simple
                          words: [{<sort>} {<-z>}]
                          more_env: [(env_pair name:LC_ALL val:{<C>} spids:[3272])]
                          do_fork: T
                        )
                        (command.WhileUntil
                          keyword: <Id.KW_While while>
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: (C {<read>} {<-r>} {<-d>} {(SQ )})
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          body: 
                            (command.DoGroup
                              children: [
                                (command.AndOr
                                  ops: [Id.Op_DPipe]
                                  children: [
                                    (C {<__quiet_mode>})
                                    (C {<einfo>} 
                                      {
                                        (DQ <'Removing /'> 
                                          (braced_var_sub
                                            token: <Id.VSub_Name REPLY>
                                            suffix_op: 
                                              (suffix_op.Unary
                                                tok: <Id.VOp1_Pound '#'>
                                                arg_word: {(${ Id.VSub_Name root)}
                                              )
                                          )
                                        )
                                      }
                                    )
                                  ]
                                )
                                (command.Simple
                                  words: [{<rm>} {<-Rf>} {(DQ (${ Id.VSub_Name REPLY))}]
                                  redirects: [
                                    (redir
                                      op: <Id.Redir_GreatAnd '>&'>
                                      loc: (redir_loc.Fd fd:1)
                                      arg: {<'/dev/null'>}
                                    )
                                  ]
                                  do_fork: T
                                )
                              ]
                            )
                        )
                      ]
                      negated: F
                    )
                  ]
                )
            )
            (C {<set>} {<Id.Lit_Other '+'> <o>} {<noglob>})
            (C {<set>} {<-> (${ Id.VSub_Name shopts)})
          ]
        )
    )
    (command.ShFunction
      name: preinst_mask
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ (${ Id.VSub_Name D))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<eerror>} {(DQ (${ Id.VSub_Name FUNCNAME) <': D is unset'>)})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [3366 3381]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [(C {<___eapi_has_prefix_variables>})]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<local>} {<Id.Lit_VarLike 'ED='> (${ Id.VSub_Name D)})]
                  spids: [3403 3410]
                )
              ]
            )
            (C {<cd>} {(DQ (${ Id.VSub_Name T))})
            (C {<local>} {<f>})
            (command.ForEach
              iter_name: f
              iter_words: [{<man>} {<info>} {<doc>}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<has>} {<no> (${ Id.VSub_Name f)} 
                                      {($ Id.VSub_DollarName '$FEATURES')}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:INSTALL_MASK)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ (${ Id.VSub_Name INSTALL_MASK) <' /usr/share/'> 
                                        (${ Id.VSub_Name f)
                                      )
                                    }
                                  spids: [3483]
                                )
                              ]
                            )
                          ]
                          spids: [3468 3480]
                        )
                      ]
                    )
                  ]
                )
            )
            (C {<install_mask>} {(DQ (${ Id.VSub_Name ED))} {(DQ (${ Id.VSub_Name INSTALL_MASK))})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.AndOr
                              ops: [Id.Op_DPipe Id.Op_DPipe]
                              children: [
                                (C {<has>} {<nodoc>} {($ Id.VSub_DollarName '$FEATURES')})
                                (C {<has>} {<noman>} {($ Id.VSub_DollarName '$FEATURES')})
                                (C {<has>} {<noinfo>} {($ Id.VSub_DollarName '$FEATURES')})
                              ]
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.Simple
                      words: [{<rmdir>} {(DQ (${ Id.VSub_Name ED) <'usr/share'>)}]
                      redirects: [
                        (redir
                          op: <Id.Redir_AndGreat '&>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<'/dev/null'>}
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  spids: [3522 3547]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: preinst_sfperms
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ (${ Id.VSub_Name D))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<eerror>} {(DQ (${ Id.VSub_Name FUNCNAME) <': D is unset'>)})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [3576 3591]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [(C {<___eapi_has_prefix_variables>})]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<local>} {<Id.Lit_VarLike 'ED='> (${ Id.VSub_Name D)})]
                  spids: [3613 3620]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: (C {<has>} {<sfperms>} {($ Id.VSub_DollarName '$FEATURES')})
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<local>} {<i>})
                    (command.Pipeline
                      children: [
                        (C {<find>} {(DQ (${ Id.VSub_Name ED))} {<-type>} {<f>} {<-perm>} {<-4000>} 
                          {<-print0>}
                        )
                        (command.WhileUntil
                          keyword: <Id.KW_While while>
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<read>} {<-r>} {<-d>} 
                                      {
                                        (single_quoted
                                          left: <Id.Left_DollarSingleQuote '$\''>
                                          tokens: [<Id.Char_OneChar '\\0'>]
                                          multiline: F
                                        )
                                      } {<i>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          body: 
                            (command.DoGroup
                              children: [
                                (command.If
                                  arms: [
                                    (if_arm
                                      cond: 
                                        (condition.Shell
                                          commands: [
                                            (command.Sentence
                                              child: 
                                                (C {<Id.Lit_LBracket '['>} {<-n>} 
                                                  {
                                                    (DQ 
                                                      (command_sub
                                                        left_token: <Id.Left_DollarParen '$('>
                                                        child: 
                                                          (C {<find>} {(DQ ($ Id.VSub_DollarName '$i'))} 
                                                            {<-perm>} {<-2000>}
                                                          )
                                                      )
                                                    )
                                                  } {<Id.Lit_RBracket ']'>}
                                                )
                                              terminator: <Id.Op_Semi _>
                                            )
                                          ]
                                        )
                                      action: [
                                        (C {<ebegin>} 
                                          {
                                            (DQ <'>>> SetUID and SetGID: [chmod o-r] /'> 
                                              (braced_var_sub
                                                token: <Id.VSub_Name i>
                                                suffix_op: 
                                                  (suffix_op.Unary
                                                    tok: <Id.VOp1_Pound '#'>
                                                    arg_word: {(${ Id.VSub_Name ED)}
                                                  )
                                              )
                                            )
                                          }
                                        )
                                        (C {<chmod>} {<o-r>} {(DQ ($ Id.VSub_DollarName '$i'))})
                                        (C {<eend>} {($ Id.VSub_QMark '$?')})
                                      ]
                                      spids: [3697 3721]
                                    )
                                  ]
                                  else_action: [
                                    (C {<ebegin>} 
                                      {
                                        (DQ <'>>> SetUID: [chmod go-r] /'> 
                                          (braced_var_sub
                                            token: <Id.VSub_Name i>
                                            suffix_op: 
                                              (suffix_op.Unary
                                                tok: <Id.VOp1_Pound '#'>
                                                arg_word: {(${ Id.VSub_Name ED)}
                                              )
                                          )
                                        )
                                      }
                                    )
                                    (C {<chmod>} {<go-r>} {(DQ ($ Id.VSub_DollarName '$i'))})
                                    (C {<eend>} {($ Id.VSub_QMark '$?')})
                                  ]
                                )
                              ]
                            )
                        )
                      ]
                      negated: F
                    )
                    (command.Pipeline
                      children: [
                        (C {<find>} {(DQ (${ Id.VSub_Name ED))} {<-type>} {<f>} {<-perm>} {<-2000>} 
                          {<-print0>}
                        )
                        (command.WhileUntil
                          keyword: <Id.KW_While while>
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<read>} {<-r>} {<-d>} 
                                      {
                                        (single_quoted
                                          left: <Id.Left_DollarSingleQuote '$\''>
                                          tokens: [<Id.Char_OneChar '\\0'>]
                                          multiline: F
                                        )
                                      } {<i>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          body: 
                            (command.DoGroup
                              children: [
                                (command.If
                                  arms: [
                                    (if_arm
                                      cond: 
                                        (condition.Shell
                                          commands: [
                                            (command.Sentence
                                              child: 
                                                (C {<Id.Lit_LBracket '['>} {<-n>} 
                                                  {
                                                    (DQ 
                                                      (command_sub
                                                        left_token: <Id.Left_DollarParen '$('>
                                                        child: 
                                                          (C {<find>} {(DQ ($ Id.VSub_DollarName '$i'))} 
                                                            {<-perm>} {<-4000>}
                                                          )
                                                      )
                                                    )
                                                  } {<Id.Lit_RBracket ']'>}
                                                )
                                              terminator: <Id.Op_Semi _>
                                            )
                                          ]
                                        )
                                      action: [(C {<true>})]
                                      spids: [3830 3854]
                                    )
                                  ]
                                  else_action: [
                                    (C {<ebegin>} 
                                      {
                                        (DQ <'>>> SetGID: [chmod o-r] /'> 
                                          (braced_var_sub
                                            token: <Id.VSub_Name i>
                                            suffix_op: 
                                              (suffix_op.Unary
                                                tok: <Id.VOp1_Pound '#'>
                                                arg_word: {(${ Id.VSub_Name ED)}
                                              )
                                          )
                                        )
                                      }
                                    )
                                    (C {<chmod>} {<o-r>} {(DQ ($ Id.VSub_DollarName '$i'))})
                                    (C {<eend>} {($ Id.VSub_QMark '$?')})
                                  ]
                                )
                              ]
                            )
                        )
                      ]
                      negated: F
                    )
                  ]
                  spids: [3639 3648]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: preinst_suid_scan
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ (${ Id.VSub_Name D))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<eerror>} {(DQ (${ Id.VSub_Name FUNCNAME) <': D is unset'>)})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [3917 3932]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [(C {<___eapi_has_prefix_variables>})]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<local>} {<Id.Lit_VarLike 'ED='> (${ Id.VSub_Name D)})]
                  spids: [3954 3961]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: (C {<has>} {<suidctl>} {($ Id.VSub_DollarName '$FEATURES')})
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<local>} {<i>} {<sfconf>} {<x>})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:sfconf)
                          op: assign_op.Equal
                          rhs: {(${ Id.VSub_Name PORTAGE_CONFIGROOT) <'etc/portage/suidctl.conf'>}
                          spids: [4001]
                        )
                      ]
                    )
                    (C {<addwrite>} {(DQ (${ Id.VSub_Name sfconf))})
                    (C {<__vecho>} {(DQ <'>>> Performing suid scan in '> (${ Id.VSub_Name ED))})
                    (command.ForEach
                      iter_name: i
                      iter_words: [
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (C {<find>} {(DQ (${ Id.VSub_Name ED))} {<-type>} {<f>} 
                                {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\('>)} {<-perm>} {<-4000>} {<-o>} {<-perm>} {<-2000>} {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\)'>)}
                              )
                          )
                        }
                      ]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (command.Sentence
                                          child: 
                                            (C {<Id.Lit_LBracket '['>} {<-s>} 
                                              {(DQ (${ Id.VSub_Name sfconf))} {<Id.Lit_RBracket ']'>}
                                            )
                                          terminator: <Id.Op_Semi _>
                                        )
                                      ]
                                    )
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:install_path)
                                          op: assign_op.Equal
                                          rhs: 
                                            {<'/'> 
                                              (braced_var_sub
                                                token: <Id.VSub_Name i>
                                                suffix_op: 
                                                  (suffix_op.Unary
                                                    tok: <Id.VOp1_Pound '#'>
                                                    arg_word: {(${ Id.VSub_Name ED)}
                                                  )
                                              )
                                            }
                                          spids: [4096]
                                        )
                                      ]
                                    )
                                    (command.If
                                      arms: [
                                        (if_arm
                                          cond: 
                                            (condition.Shell
                                              commands: [
                                                (command.Sentence
                                                  child: 
                                                    (C {<grep>} {<-q>} 
                                                      {
                                                        (DQ <'^'> (${ Id.VSub_Name install_path) 
                                                          (word_part.EscapedLiteral
                                                            token: <Id.Lit_EscapedChar '\\$'>
                                                          )
                                                        )
                                                      } {(DQ (${ Id.VSub_Name sfconf))}
                                                    )
                                                  terminator: <Id.Op_Semi _>
                                                )
                                              ]
                                            )
                                          action: [
                                            (C {<__vecho>} 
                                              {
                                                (DQ <'- '> (${ Id.VSub_Name install_path) 
                                                  <' is an approved suid file'>
                                                )
                                              }
                                            )
                                          ]
                                          spids: [4107 4129]
                                        )
                                      ]
                                      else_action: [
                                        (C {<__vecho>} 
                                          {
                                            (DQ <'>>> Removing sbit on non registered '> 
                                              (${ Id.VSub_Name install_path)
                                            )
                                          }
                                        )
                                        (command.Simple
                                          words: [{<sleep>} {<1.5>}]
                                          more_env: [(env_pair name:LC_ALL val:{<C>} spids:[4156])]
                                          do_fork: T
                                        )
                                        (command.ShAssignment
                                          pairs: [
                                            (assign_pair
                                              lhs: (sh_lhs_expr.Name name:ls_ret)
                                              op: assign_op.Equal
                                              rhs: 
                                                {
                                                  (command_sub
                                                    left_token: <Id.Left_DollarParen '$('>
                                                    child: 
                                                      (C {<ls>} {<-ldh>} {(DQ (${ Id.VSub_Name i))})
                                                  )
                                                }
                                              spids: [4164]
                                            )
                                          ]
                                        )
                                        (C {<chmod>} {<ugo-s>} {(DQ (${ Id.VSub_Name i))})
                                        (command.AndOr
                                          ops: [Id.Op_DPipe]
                                          children: [
                                            (command.Simple
                                              words: [
                                                {<grep>}
                                                {
                                                  (DQ <'^#'> (${ Id.VSub_Name install_path) 
                                                    <Id.Lit_Dollar '$'>
                                                  )
                                                }
                                                {(DQ (${ Id.VSub_Name sfconf))}
                                              ]
                                              redirects: [
                                                (redir
                                                  op: <Id.Redir_Great '>'>
                                                  loc: (redir_loc.Fd fd:1)
                                                  arg: {<'/dev/null'>}
                                                )
                                              ]
                                              do_fork: T
                                            )
                                            (BraceGroup
                                              children: [
                                                (C {<__vecho>} 
                                                  {
                                                    (DQ <'>>> Appending commented out entry to '> 
                                                      (${ Id.VSub_Name sfconf) <' for '> (${ Id.VSub_Name PF)
                                                    )
                                                  }
                                                )
                                                (command.Simple
                                                  words: [
                                                    {<echo>}
                                                    {
                                                      (DQ <'## '> 
                                                        (braced_var_sub
                                                          token: <Id.VSub_Name ls_ret>
                                                          suffix_op: 
                                                            (suffix_op.Unary
                                                              tok: <Id.VOp1_Percent '%'>
                                                              arg_word: 
                                                                {(${ Id.VSub_Name ED) 
                                                                  <Id.Lit_Other '*'>
                                                                }
                                                            )
                                                        ) (${ Id.VSub_Name install_path)
                                                      )
                                                    }
                                                  ]
                                                  redirects: [
                                                    (redir
                                                      op: <Id.Redir_DGreat '>>'>
                                                      loc: (redir_loc.Fd fd:1)
                                                      arg: {(DQ (${ Id.VSub_Name sfconf))}
                                                    )
                                                  ]
                                                  do_fork: T
                                                )
                                                (command.Simple
                                                  words: [
                                                    {<echo>}
                                                    {(DQ <'#'> (${ Id.VSub_Name install_path))}
                                                  ]
                                                  redirects: [
                                                    (redir
                                                      op: <Id.Redir_DGreat '>>'>
                                                      loc: (redir_loc.Fd fd:1)
                                                      arg: {(DQ (${ Id.VSub_Name sfconf))}
                                                    )
                                                  ]
                                                  do_fork: T
                                                )
                                              ]
                                            )
                                          ]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [4078 4093]
                                )
                              ]
                              else_action: [
                                (C {<__vecho>} 
                                  {
                                    (DQ <'suidctl feature set but you are lacking a '> 
                                      (${ Id.VSub_Name sfconf)
                                    )
                                  }
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                  spids: [3980 3989]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: preinst_selinux_labels
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ (${ Id.VSub_Name D))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<eerror>} {(DQ (${ Id.VSub_Name FUNCNAME) <': D is unset'>)})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [4317 4332]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: (C {<has>} {<selinux>} {(${ Id.VSub_Name FEATURES)})
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.AndOr
                                      ops: [Id.Op_DAmp]
                                      children: [
                                        (C {<Id.Lit_LBracket '['>} {<-f>} {<'/selinux/context'>} {<-o>} 
                                          {<-f>} {<'/sys/fs/selinux/context'>} {<Id.Lit_RBracket ']'>}
                                        )
                                        (C {<Id.Lit_LBracket '['>} {<-x>} {<'/usr/sbin/setfiles'>} {<-a>} 
                                          {<-x>} {<'/usr/sbin/selinuxconfig'>} {<Id.Lit_RBracket ']'>}
                                        )
                                      ]
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {<__vecho>} {(DQ <'>>> Setting SELinux security labels'>)})
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (command.Subshell
                                  child: 
                                    (command.CommandList
                                      children: [
                                        (command.Sentence
                                          child: 
                                            (command.AndOr
                                              ops: [Id.Op_DPipe]
                                              children: [
                                                (C {<eval>} 
                                                  {
                                                    (DQ 
                                                      (command_sub
                                                        left_token: <Id.Left_DollarParen '$('>
                                                        child: (C {<'/usr/sbin/selinuxconfig'>})
                                                      )
                                                    )
                                                  }
                                                )
                                                (C {<die>} 
                                                  {(DQ <'Failed to determine SELinux policy paths.'>)}
                                                )
                                              ]
                                            )
                                          terminator: <Id.Op_Semi _>
                                        )
                                        (C {<addwrite>} {<'/selinux/context'>})
                                        (C {<addwrite>} {<'/sys/fs/selinux/context'>})
                                        (C {<'/usr/sbin/setfiles'>} {<-F>} 
                                          {(DQ (${ Id.VSub_Name file_contexts_path))} {<-r>} {(DQ (${ Id.VSub_Name D))} {(DQ (${ Id.VSub_Name D))}
                                        )
                                      ]
                                    )
                                )
                                (C {<die>} {(DQ <'Failed to set SELinux security labels.'>)})
                              ]
                            )
                          ]
                          spids: [4379 4414]
                        )
                      ]
                      else_action: [(C {<__vecho>} {(DQ <'!!! Unable to set SELinux security labels'>)})]
                    )
                  ]
                  spids: [4353 4364]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: __dyn_package
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<PROOT>})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [(C {<___eapi_has_prefix_variables>})]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<local>} {<Id.Lit_VarLike 'EPREFIX='>} 
                      {<Id.Lit_VarLike 'ED='> (${ Id.VSub_Name D)}
                    )
                  ]
                  spids: [4534 4541]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [(C {<cd>} {(DQ (${ Id.VSub_Name T))}) (C {<die>})]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.Unary
                                  op_id: Id.BoolUnary_n
                                  child: {(${ Id.VSub_Name PKG_INSTALL_MASK)}
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:PROOT)
                          op: assign_op.Equal
                          rhs: {(${ Id.VSub_Name T) <'/packaging/'>}
                          spids: [4598]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<rm>} {<-rf>} {(DQ (${ Id.VSub_Name PROOT))})
                        (C {<die>} {(DQ <'failed removing stale package tree'>)})
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<cp>} {<-pPR>} 
                          {
                            (command_sub
                              left_token: <Id.Left_DollarParen '$('>
                              child: 
                                (command.AndOr
                                  ops: [Id.Op_DAmp]
                                  children: [
                                    (command.Pipeline
                                      children: [(C {<cp>} {<--help>}) (C {<grep>} {<-qs>} {<-e-l>})]
                                      negated: F
                                    )
                                    (C {<echo>} {<-l>})
                                  ]
                                )
                            )
                          } {(DQ (${ Id.VSub_Name D))} {(DQ (${ Id.VSub_Name PROOT))}
                        )
                        (C {<die>} {(DQ <'failed creating packaging tree'>)})
                      ]
                    )
                    (C {<install_mask>} 
                      {
                        (DQ 
                          (braced_var_sub
                            token: <Id.VSub_Name PROOT>
                            suffix_op: 
                              (suffix_op.Unary
                                tok: <Id.VOp1_Percent '%'>
                                arg_word: {<Id.Lit_Slash '/'>}
                              )
                          ) (${ Id.VSub_Name EPREFIX) <'/'>
                        )
                      } {(DQ (${ Id.VSub_Name PKG_INSTALL_MASK))}
                    )
                  ]
                  spids: [4581 4595]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:PROOT)
                      op: assign_op.Equal
                      rhs: {(${ Id.VSub_Name D)}
                      spids: [4706]
                    )
                  ]
                )
              ]
            )
            (C {<local>} {<Id.Lit_VarLike 'tar_options='> (DQ )})
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobEqual
                      left: {($ Id.VSub_DollarName '$PORTAGE_VERBOSE')}
                      right: {<1>}
                    )
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:tar_options)
                      op: assign_op.PlusEqual
                      rhs: {(DQ <' -v'>)}
                      spids: [4735]
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<has>} {<xattr>} {(${ Id.VSub_Name FEATURES)})
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobDEqual
                      left: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (command.Simple
                                words: [{<tar>} {<--help>}]
                                redirects: [
                                  (redir
                                    op: <Id.Redir_Great '2>'>
                                    loc: (redir_loc.Fd fd:2)
                                    arg: {<'/dev/null'>}
                                  )
                                ]
                                do_fork: T
                              )
                          )
                        }
                      right: {<Id.Lit_Other '*'> <--xattrs> <Id.Lit_Other '*'>}
                    )
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:tar_options)
                      op: assign_op.PlusEqual
                      rhs: {(DQ <' --xattrs'>)}
                      spids: [4773]
                    )
                  ]
                )
              ]
            )
            (C {<export>} {<Id.Lit_VarLike 'SANDBOX_ON='> (DQ <0>)})
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ (${ Id.VSub_Name PORTAGE_BINPKG_TMPFILE))} 
                  {<Id.Lit_RBracket ']'>}
                )
                (C {<die>} {(DQ <'PORTAGE_BINPKG_TMPFILE is unset'>)})
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<mkdir>} {<-p>} 
                  {
                    (DQ 
                      (braced_var_sub
                        token: <Id.VSub_Name PORTAGE_BINPKG_TMPFILE>
                        suffix_op: 
                          (suffix_op.Unary
                            tok: <Id.VOp1_Percent '%'>
                            arg_word: {<Id.Lit_Slash '/'> <Id.Lit_Other '*'>}
                          )
                      )
                    )
                  }
                )
                (C {<die>} {(DQ <'mkdir failed'>)})
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ (${ Id.VSub_Name PORTAGE_COMPRESSION_COMMAND))} 
                  {<Id.Lit_RBracket ']'>}
                )
                (C {<die>} {(DQ <'PORTAGE_COMPRESSION_COMMAND is unset'>)})
              ]
            )
            (command.Pipeline
              children: [
                (C {<tar>} {($ Id.VSub_DollarName '$tar_options')} {<-cf>} {<->} 
                  {($ Id.VSub_DollarName '$PORTAGE_BINPKG_TAR_OPTS')} {<-C>} {(DQ (${ Id.VSub_Name PROOT))} {<.>}
                )
                (command.Simple
                  words: [{($ Id.VSub_DollarName '$PORTAGE_COMPRESSION_COMMAND')} {<-c>}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(DQ ($ Id.VSub_DollarName '$PORTAGE_BINPKG_TMPFILE'))}
                    )
                  ]
                  do_fork: T
                )
              ]
              negated: F
            )
            (C {<assert>} 
              {
                (DQ <'failed to pack binary package: \''> 
                  ($ Id.VSub_DollarName '$PORTAGE_BINPKG_TMPFILE') <'\''>
                )
              }
            )
            (command.Simple
              words: [
                {
                  (DQ 
                    (braced_var_sub
                      token: <Id.VSub_Name PORTAGE_PYTHON>
                      suffix_op: 
                        (suffix_op.Unary
                          tok: <Id.VTest_ColonHyphen ':-'>
                          arg_word: 
                            {<Id.Lit_Slash '/'> <usr> <Id.Lit_Slash '/'> <bin> <Id.Lit_Slash '/'> 
                              <python>
                            }
                        )
                    )
                  )
                }
                {(DQ ($ Id.VSub_DollarName '$PORTAGE_BIN_PATH')) <'/xpak-helper.py'>}
                {<recompose>}
                {(DQ ($ Id.VSub_DollarName '$PORTAGE_BINPKG_TMPFILE'))}
                {(DQ ($ Id.VSub_DollarName '$PORTAGE_BUILDDIR') <'/build-info'>)}
              ]
              more_env: [
                (env_pair
                  name: PYTHONPATH
                  val: 
                    {
                      (braced_var_sub
                        token: <Id.VSub_Name PORTAGE_PYTHONPATH>
                        suffix_op: 
                          (suffix_op.Unary
                            tok: <Id.VTest_ColonHyphen ':-'>
                            arg_word: {(${ Id.VSub_Name PORTAGE_PYM_PATH)}
                          )
                      )
                    }
                  spids: [4907]
                )
              ]
              do_fork: T
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-ne>} {<0>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<rm>} {<-f>} {(DQ (${ Id.VSub_Name PORTAGE_BINPKG_TMPFILE))})
                    (C {<die>} {(DQ <'Failed to append metadata to the tbz2 file'>)})
                  ]
                  spids: [4950 4963]
                )
              ]
            )
            (C {<local>} {<Id.Lit_VarLike 'md5_hash='> (DQ )})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              words: [{<type>} {<md5sum>}]
                              redirects: [
                                (redir
                                  op: <Id.Redir_AndGreat '&>'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {<'/dev/null'>}
                                )
                              ]
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:md5_hash)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<md5sum>} {(DQ (${ Id.VSub_Name PORTAGE_BINPKG_TMPFILE))})
                              )
                            }
                          spids: [5008]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:md5_hash)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name md5_hash>
                                suffix_op: 
                                  (suffix_op.Unary
                                    tok: <Id.VOp1_DPercent '%%'>
                                    arg_word: {<' '> <Id.Lit_Other '*'>}
                                  )
                              )
                            }
                          spids: [5020]
                        )
                      ]
                    )
                  ]
                  spids: [4994 5005]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              words: [{<type>} {<md5>}]
                              redirects: [
                                (redir
                                  op: <Id.Redir_AndGreat '&>'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {<'/dev/null'>}
                                )
                              ]
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:md5_hash)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<md5>} {(DQ (${ Id.VSub_Name PORTAGE_BINPKG_TMPFILE))})
                              )
                            }
                          spids: [5043]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:md5_hash)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name md5_hash>
                                suffix_op: 
                                  (suffix_op.Unary
                                    tok: <Id.VOp1_DPound '##'>
                                    arg_word: {<Id.Lit_Other '*'> <' '>}
                                  )
                              )
                            }
                          spids: [5055]
                        )
                      ]
                    )
                  ]
                  spids: [5029 5040]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ (${ Id.VSub_Name md5_hash))} 
                  {<Id.Lit_RBracket ']'>}
                )
                (command.Simple
                  words: [{<echo>} {(${ Id.VSub_Name md5_hash)}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(DQ (${ Id.VSub_Name PORTAGE_BUILDDIR)) <'/build-info/BINPKGMD5'>}
                    )
                  ]
                  do_fork: T
                )
              ]
            )
            (C {<__vecho>} {(DQ <'>>> Done.'>)})
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DBracket
                  expr: 
                    (bool_expr.Unary
                      op_id: Id.BoolUnary_n
                      child: {(${ Id.VSub_Name PKG_INSTALL_MASK)}
                    )
                )
                (C {<rm>} {<-rf>} {(DQ (${ Id.VSub_Name PROOT))})
              ]
            )
            (C {<cd>} {(DQ (${ Id.VSub_Name PORTAGE_BUILDDIR))})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  redirects: [
                    (redir
                      op: <Id.Redir_DGreat '>>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(DQ ($ Id.VSub_DollarName '$PORTAGE_BUILDDIR') <'/.packaged'>)}
                    )
                  ]
                  do_fork: F
                )
                (C {<die>} 
                  {
                    (DQ <'Failed to create '> ($ Id.VSub_DollarName '$PORTAGE_BUILDDIR') <'/.packaged'>)
                  }
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: __dyn_spec
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'sources_dir='> (${ Id.VSub_Name T) <'/rpmbuild/SOURCES'>})
            (C {<mkdir>} {<-p>} {(DQ (${ Id.VSub_Name sources_dir))})
            (C {<declare>} {<-a>} 
              {<Id.Lit_VarLike 'tar_args='> 
                (sh_array_literal
                  left: <Id.Op_LParen _>
                  words: [{(DQ (${ Id.VSub_Name EBUILD))}]
                )
              }
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DBracket
                  expr: (bool_expr.Unary op_id:Id.BoolUnary_d child:{(${ Id.VSub_Name FILESDIR)})
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:tar_args)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (sh_array_literal
                            left: <Id.Op_LParen _>
                            words: [{(DQ (${ Id.VSub_Name EBUILD))} {(DQ (${ Id.VSub_Name FILESDIR))}]
                          )
                        }
                      spids: [5218]
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<tar>} {<czf>} 
                  {(DQ (${ Id.VSub_Name sources_dir) <'/'> (${ Id.VSub_Name PF) <.tar.gz>)} {(DQ (braced_var_sub token:<Id.VSub_Name tar_args> bracket_op:(bracket_op.WholeArray op_id:Id.Lit_At)))}
                )
                (C {<die>} {(DQ <'Failed to create base rpm tarball.'>)})
              ]
            )
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<__END1__>}
                      here_end_span_id: 5338
                      stdin_parts: [
                        <'Summary: '>
                        (${ Id.VSub_Name DESCRIPTION)
                        <'\n'>
                        <'Name: '>
                        (${ Id.VSub_Name PN)
                        <'\n'>
                        <'Version: '>
                        (${ Id.VSub_Name PV)
                        <'\n'>
                        <'Release: '>
                        (${ Id.VSub_Name PR)
                        <'\n'>
                        <'License: GPL\n'>
                        <'Group: portage/'>
                        (${ Id.VSub_Name CATEGORY)
                        <'\n'>
                        <'Source: '>
                        (${ Id.VSub_Name PF)
                        <'.tar.gz\n'>
                        <'%description\n'>
                        (${ Id.VSub_Name DESCRIPTION)
                        <'\n'>
                        <'\n'>
                        (${ Id.VSub_Name HOMEPAGE)
                        <'\n'>
                        <'\n'>
                        <'%prep\n'>
                        <'%setup -c\n'>
                        <'\n'>
                        <'%build\n'>
                        <'\n'>
                        <'%install\n'>
                        <'\n'>
                        <'%clean\n'>
                        <'\n'>
                        <'%files\n'>
                        <'/\n'>
                      ]
                    )
                )
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {(${ Id.VSub_Name PF) <.spec>}
                )
              ]
              do_fork: T
            )
          ]
        )
    )
    (command.ShFunction
      name: __dyn_rpm
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [(C {<___eapi_has_prefix_variables>})]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<local>} {<Id.Lit_VarLike 'EPREFIX='>})]
                  spids: [5350 5357]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [(C {<cd>} {(DQ (${ Id.VSub_Name T))}) (C {<die>} {(DQ <'cd failed'>)})]
            )
            (C {<local>} 
              {<Id.Lit_VarLike 'machine_name='> 
                (braced_var_sub
                  token: <Id.VSub_Name CHOST>
                  suffix_op: 
                    (suffix_op.Unary
                      tok: <Id.VOp1_DPercent '%%'>
                      arg_word: {<-> <Id.Lit_Other '*'>}
                    )
                )
              }
            )
            (C {<local>} 
              {<Id.Lit_VarLike 'dest_dir='> (${ Id.VSub_Name T) <'/rpmbuild/RPMS/'> 
                (${ Id.VSub_Name machine_name)
              }
            )
            (C {<addwrite>} {(DQ (${ Id.VSub_Name RPMDIR))})
            (C {<__dyn_spec>})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  words: [
                    {<rpmbuild>}
                    {<-bb>}
                    {<--clean>}
                    {<--nodeps>}
                    {<--rmsource>}
                    {(DQ (${ Id.VSub_Name PF) <.spec>)}
                    {<--buildroot>}
                    {(DQ (${ Id.VSub_Name D))}
                    {<--target>}
                    {(DQ (${ Id.VSub_Name CHOST))}
                  ]
                  more_env: [(env_pair name:HOME val:{(${ Id.VSub_Name T)} spids:[5421])]
                  do_fork: T
                )
                (C {<die>} {(DQ <'Failed to integrate rpm spec file'>)})
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<install>} {<-D>} 
                  {
                    (DQ (${ Id.VSub_Name dest_dir) <'/'> (${ Id.VSub_Name PN) <-> (${ Id.VSub_Name PV) <-> 
                      (${ Id.VSub_Name PR) <.> (${ Id.VSub_Name machine_name) <.rpm>
                    )
                  } 
                  {
                    (DQ (${ Id.VSub_Name RPMDIR) <'/'> (${ Id.VSub_Name CATEGORY) <'/'> 
                      (${ Id.VSub_Name PN) <-> (${ Id.VSub_Name PV) <-> (${ Id.VSub_Name PR) <.rpm>
                    )
                  }
                )
                (C {<die>} {(DQ <'Failed to move rpm'>)})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: die_hooks
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DBracket
                  expr: 
                    (bool_expr.Unary
                      op_id: Id.BoolUnary_f
                      child: {($ Id.VSub_DollarName '$PORTAGE_BUILDDIR') <'/.die_hooks'>}
                    )
                )
                (command.ControlFlow token:<Id.ControlFlow_Return return>)
              ]
            )
            (C {<local>} {<x>})
            (command.ForEach
              iter_name: x
              iter_words: [{($ Id.VSub_DollarName '$EBUILD_DEATH_HOOKS')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.Simple
                      words: [{($ Id.VSub_DollarName '$x')}]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                  ]
                )
            )
            (command.Simple
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {(DQ ($ Id.VSub_DollarName '$PORTAGE_BUILDDIR') <'/.die_hooks'>)}
                )
              ]
              do_fork: F
            )
          ]
        )
    )
    (command.ShFunction
      name: success_hooks
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<x>})
            (command.ForEach
              iter_name: x
              iter_words: [{($ Id.VSub_DollarName '$EBUILD_SUCCESS_HOOKS')}]
              do_arg_iter: F
              body: (command.DoGroup children:[(C {($ Id.VSub_DollarName '$x')})])
            )
          ]
        )
    )
    (command.ShFunction
      name: install_hooks
      body: 
        (BraceGroup
          children: [
            (C {<local>} 
              {<Id.Lit_VarLike 'hooks_dir='> 
                (DQ (${ Id.VSub_Name PORTAGE_CONFIGROOT) <'etc/portage/hooks/install'>)
              }
            )
            (C {<local>} {<fp>})
            (C {<local>} {<Id.Lit_VarLike 'ret='> <0>})
            (C {<shopt>} {<-s>} {<nullglob>})
            (command.ForEach
              iter_name: fp
              iter_words: [{(DQ (${ Id.VSub_Name hooks_dir)) <'/'> <Id.Lit_Star '*'>}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<Id.Lit_LBracket '['>} {<-x>} {(DQ ($ Id.VSub_DollarName '$fp'))} 
                                      {<Id.Lit_RBracket ']'>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {(DQ ($ Id.VSub_DollarName '$fp'))})
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:ret)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (word_part.ArithSub
                                        anode: 
                                          (arith_expr.Binary
                                            op_id: Id.Arith_Pipe
                                            left: {($ Id.VSub_DollarName '$ret')}
                                            right: {($ Id.VSub_QMark '$?')}
                                          )
                                      )
                                    }
                                  spids: [5701]
                                )
                              ]
                            )
                          ]
                          spids: [5680 5693]
                        )
                      ]
                    )
                  ]
                )
            )
            (C {<shopt>} {<-u>} {<nullglob>})
            (command.ControlFlow
              token: <Id.ControlFlow_Return return>
              arg_word: {($ Id.VSub_DollarName '$ret')}
            )
          ]
        )
    )
    (command.ShFunction
      name: eqatag
      body: (BraceGroup children:[(C {<__eqatag>} {(DQ (${ Id.VSub_At '@'))})])
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ (${ Id.VSub_Name MISC_FUNCTIONS_ARGS))} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<__source_all_bashrcs>})
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$PORTAGE_DEBUG'))} 
                  {<Id.Lit_Equals '='> <Id.Lit_Equals '='>} {(DQ <1>)} {<Id.Lit_RBracket ']'>}
                )
                (C {<set>} {<-x>})
              ]
            )
            (command.ForEach
              iter_name: x
              iter_words: [{(${ Id.VSub_Name MISC_FUNCTIONS_ARGS)}]
              do_arg_iter: F
              body: (command.DoGroup children:[(C {(${ Id.VSub_Name x)})])
            )
            (C {<unset>} {<x>})
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.DBracket
                  expr: 
                    (bool_expr.Unary
                      op_id: Id.BoolUnary_n
                      child: {($ Id.VSub_DollarName '$PORTAGE_EBUILD_EXIT_FILE')}
                    )
                )
                (command.Simple
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(DQ ($ Id.VSub_DollarName '$PORTAGE_EBUILD_EXIT_FILE'))}
                    )
                  ]
                  do_fork: F
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.Unary
                                  op_id: Id.BoolUnary_n
                                  child: {($ Id.VSub_DollarName '$PORTAGE_IPC_DAEMON')}
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.DBracket
                      expr: 
                        (bool_expr.LogicalNot
                          child: 
                            (bool_expr.Unary
                              op_id: Id.BoolUnary_s
                              child: {($ Id.VSub_DollarName '$SANDBOX_LOG')}
                            )
                        )
                    )
                    (C {(DQ ($ Id.VSub_DollarName '$PORTAGE_BIN_PATH')) <'/ebuild-ipc'>} 
                      {<Id.ControlFlow_Exit exit>} {($ Id.VSub_QMark '$?')}
                    )
                  ]
                  spids: [5839 5851]
                )
              ]
            )
          ]
          spids: [5752 5767]
        )
      ]
    )
    (C {<Id.Lit_Colon ':'>})
  ]
)