(CommandList
  children: [
    (FuncDef
      name: blank_tempdir
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Number "$1"))} {(Lit_Other "]")})
                (C {(dienow)})
              ]
              op_id: Op_DAmp
            )
            (AndOr
              children: [(C {(touch)} {(-c)} {(DQ ($ VSub_Number "$1"))}) (C {(dienow)})]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$NO_CLEANUP"))} {(Lit_Other "]")})
                (C {(rm)} {(-rf)} {(DQ ($ VSub_Number "$1"))})
              ]
              op_id: Op_DAmp
            )
            (AndOr
              children: [(C {(mkdir)} {(-p)} {(DQ ($ VSub_Number "$1"))}) (C {(dienow)})]
              op_id: Op_DPipe
            )
          ]
          spids: [16]
        )
      spids: [12 15]
    )
    (FuncDef
      name: sha1file
      body: 
        (BraceGroup
          children: [
            (Pipeline
              children: [
                (C {(sha1sum)} {(/dev/null)} {(DQ ($ VSub_At "$@"))})
                (C {(tail)} {(-n)} {(Lit_Other "+") (2)})
                (C {(awk)} {(SQ <"{print $1}">)})
              ]
              negated: False
            )
          ]
          spids: [100]
        )
      spids: [96 99]
    )
    (FuncDef
      name: actually_dienow
      body: 
        (BraceGroup
          children: [
            (SimpleCommand
              words: [
                {(echo)}
                {(-e)}
                {
                  (DQ (EscapedLiteralPart token:<Lit_EscapedChar "\\n">) 
                    (EscapedLiteralPart token:<Lit_EscapedChar "\\e">) ("[31mExiting due to errors (") ($ VSub_Name "$ARCH_NAME") (" ") ($ VSub_Name "$STAGE_NAME") (" ") 
                    ($ VSub_Name "$PACKAGE") (")") (EscapedLiteralPart token:<Lit_EscapedChar "\\e">) ("[0m")
                  )
                }
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[163])]
            )
            (C {(exit)} {(1)})
          ]
          spids: [142]
        )
      spids: [138 141]
    )
    (C {(trap)} {(actually_dienow)} {(SIGUSR1)})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:TOPSHELL)
          op: Equal
          rhs: {($ VSub_Dollar "$$")}
          spids: [180]
        )
      ]
      spids: [180]
    )
    (FuncDef
      name: dienow
      body: 
        (BraceGroup
          children: [(C {(kill)} {(-USR1)} {($ VSub_Name "$TOPSHELL")}) (C {(exit)} {(1)})]
          spids: [188]
        )
      spids: [184 187]
    )
    (FuncDef
      name: dotprogress
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:x) op:Equal rhs:{(0)} spids:[219])]
              spids: [219]
            )
            (While
              cond: [(C {(read)} {(i)})]
              body: 
                (DoGroup
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:x)
                          op: Equal
                          rhs: 
                            {
                              (ArithSubPart
                                anode: 
                                  (ArithBinary
                                    op_id: Arith_Plus
                                    left: (ArithWord w:{($ VSub_Name "$x")})
                                    right: (ArithWord w:{(Lit_Digits 1)})
                                  )
                                spids: [234 240]
                              )
                            }
                          spids: [233]
                        )
                      ]
                      spids: [233]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (DBracket
                              expr: 
                                (BoolBinary
                                  op_id: BoolBinary_eq
                                  left: {(DQ ($ VSub_Name "$x"))}
                                  right: {(25)}
                                )
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:x)
                                  op: Equal
                                  rhs: {(0)}
                                  spids: [261]
                                )
                              ]
                              spids: [261]
                            )
                            (C {(echo)} {(-n)} {(.)})
                          ]
                          spids: [-1 258]
                        )
                      ]
                      spids: [-1 272]
                    )
                  ]
                  spids: [230 275]
                )
            )
            (C {(echo)})
          ]
          spids: [216]
        )
      spids: [212 215]
    )
    (FuncDef
      name: announce
      body: 
        (BraceGroup
          children: [
            (C {(echo)} 
              {
                (DQ ("=== ") ($ VSub_Number "$1") (" (") ($ VSub_Name "$ARCH_NAME") (" ") 
                  ($ VSub_Name "$STAGE_NAME") (")")
                )
              }
            )
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$NO_TITLE_BAR"))} {(Lit_Other "]")})
                (C {(echo)} {(-en)} 
                  {
                    (DQ (EscapedLiteralPart token:<Lit_EscapedChar "\\0">) ("33]2;") 
                      ($ VSub_Name "$ARCH_NAME") (" ") ($ VSub_Name "$STAGE_NAME") (" ") ($ VSub_Number "$1") 
                      (EscapedLiteralPart token:<Lit_EscapedChar "\\0">) (07)
                    )
                  }
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [291]
        )
      spids: [287 290]
    )
    (FuncDef
      name: maybe_quiet
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$FORK"))} {(Lit_Other "]")})
                (AndOr
                  children: [(C {(cat)}) (C {(grep)} {(DQ ("^==="))})]
                  op_id: Op_DPipe
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [355]
        )
      spids: [351 354]
    )
    (FuncDef
      name: maybe_fork
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$BUILD_VERBOSE"))} {(Lit_Other "]")})
                (C {(echo)} {(DQ ($ VSub_Star "$*"))})
              ]
              op_id: Op_DPipe
            )
            (If
              arms: [
                (if_arm
                  cond: [(C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$FORK"))} {(Lit_Other "]")})]
                  action: [(C {(eval)} {(DQ ($ VSub_Star "$*"))})]
                  spids: [-1 427]
                )
              ]
              else_action: [
                (Sentence
                  child: (C {(eval)} {(DQ ($ VSub_Star "$*"))})
                  terminator: <Op_Amp "&">
                )
              ]
              spids: [437 449]
            )
          ]
          spids: [391]
        )
      spids: [387 390]
    )
    (FuncDef
      name: killtree
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:KIDS) op:Equal rhs:{(DQ )} spids:[467])]
              spids: [465]
            )
            (While
              cond: [(C {(Lit_Other "[")} {($ VSub_Pound "$#")} {(-ne)} {(0)} {(Lit_Other "]")})]
              body: 
                (DoGroup
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:KIDS)
                          op: Equal
                          rhs: 
                            {
                              (DQ ($ VSub_Name "$KIDS") (" ") 
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [(C {(pgrep)} {(-P) ($ VSub_Number "$1")})]
                                    )
                                  left_token: <Left_CommandSub "$(">
                                  spids: [493 498]
                                )
                              )
                            }
                          spids: [489]
                        )
                      ]
                      spids: [489]
                    )
                    (C {(shift)})
                  ]
                  spids: [486 505]
                )
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:KIDS)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [(C {(echo)} {(-n)} {($ VSub_Name "$KIDS")})]
                            )
                          left_token: <Left_CommandSub "$(">
                          spids: [511 517]
                        )
                      )
                    }
                  spids: [509]
                )
              ]
              spids: [509]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (C {(Lit_Other "[")} {(KW_Bang "!")} {(-z)} {(DQ ($ VSub_Name "$KIDS"))} 
                      {(Lit_Other "]")}
                    )
                  ]
                  action: [
                    (C {(killtree)} {($ VSub_Name "$KIDS")})
                    (SimpleCommand
                      words: [{(kill)} {($ VSub_Name "$KIDS")}]
                      redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[552])]
                    )
                  ]
                  spids: [-1 536]
                )
              ]
              spids: [-1 556]
            )
          ]
          spids: [462]
        )
      spids: [458 461]
    )
    (FuncDef
      name: path_search
      body: 
        (BraceGroup
          children: [
            (Pipeline
              children: [
                (C {(echo)} {(DQ ($ VSub_Number "$1"))})
                (C {(sed)} {(SQ <"s/:/\\n/g">)})
                (While
                  cond: [(C {(read)} {(DIR)})]
                  body: 
                    (DoGroup
                      children: [
                        (Pipeline
                          children: [
                            (C {(find)} {(DQ ($ VSub_Name "$DIR") (/))} {(-maxdepth)} {(1)} {(-mindepth)} 
                              {(1)} {(-name)} {(DQ ($ VSub_Number "$2"))}
                            )
                            (C {(sed)} {(SQ <"s@.*/@@">)})
                            (While
                              cond: [(C {(read)} {(FILE)})]
                              body: 
                                (DoGroup
                                  children: [
                                    (C {(eval)} {(DQ ($ VSub_Number "$3"))})
                                    (C {(echo)} {($ VSub_Name "$FILE")})
                                  ]
                                  spids: [658 679]
                                )
                            )
                          ]
                          negated: False
                        )
                      ]
                      spids: [615 682]
                    )
                )
              ]
              negated: False
            )
          ]
          spids: [576]
        )
      spids: [572 575]
    )
    (FuncDef
      name: check_prerequisite
      body: 
        (BraceGroup
          children: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (C {(Lit_Other "[")} {(-z)} 
                      {
                        (DQ 
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [(C {(which)} {(DQ ($ VSub_Number "$1"))})]
                              )
                            left_token: <Left_CommandSub "$(">
                            spids: [705 711]
                          )
                        )
                      } {(Lit_Other "]")}
                    )
                  ]
                  action: [
                    (AndOr
                      children: [
                        (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$FAIL_QUIET"))} {(Lit_Other "]")})
                        (SimpleCommand
                          words: [
                            {(echo)}
                            {(No)}
                            {(DQ ($ VSub_Number "$1"))}
                            {(KW_In in)}
                            {(SQ <"$PATH">) (.)}
                          ]
                          redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[747])]
                        )
                      ]
                      op_id: Op_DAmp
                    )
                    (C {(dienow)})
                  ]
                  spids: [-1 717]
                )
              ]
              spids: [-1 754]
            )
          ]
          spids: [695]
        )
      spids: [691 694]
    )
    (FuncDef
      name: collapse_hardlinks
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:SHA1LIST) op:Equal rhs:{(DQ )} spids:[773])]
              spids: [773]
            )
            (Pipeline
              children: [
                (C {(find)} {(DQ ($ VSub_Number "$1"))} {(-type)} {(f)})
                (While
                  cond: [(C {(read)} {(FILE)})]
                  body: 
                    (DoGroup
                      children: [
                        (C {(echo)} {(DQ ($ VSub_Name "$FILE"))})
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:SHA1)
                              op: Equal
                              rhs: 
                                {
                                  (CommandSubPart
                                    command_list: 
                                      (CommandList
                                        children: [(C {(sha1file)} {(DQ ($ VSub_Name "$FILE"))})]
                                      )
                                    left_token: <Left_CommandSub "$(">
                                    spids: [808 814]
                                  )
                                }
                              spids: [807]
                            )
                          ]
                          spids: [807]
                        )
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:MATCH)
                              op: Equal
                              rhs: 
                                {
                                  (CommandSubPart
                                    command_list: 
                                      (CommandList
                                        children: [
                                          (Pipeline
                                            children: [
                                              (C {(echo)} {(DQ ($ VSub_Name "$SHA1LIST"))})
                                              (C {(grep)} {(DQ ("^") ($ VSub_Name "$SHA1"))})
                                            ]
                                            negated: False
                                          )
                                        ]
                                      )
                                    left_token: <Left_CommandSub "$(">
                                    spids: [818 833]
                                  )
                                }
                              spids: [817]
                            )
                          ]
                          spids: [817]
                        )
                        (If
                          arms: [
                            (if_arm
                              cond: [
                                (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$MATCH"))} 
                                  {(Lit_Other "]")}
                                )
                              ]
                              action: [
                                (Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (LhsName name:SHA1LIST)
                                      op: Equal
                                      rhs: 
                                        {
                                          (DQ ($ VSub_Name "$SHA1LIST") ("\n") ($ VSub_Name "$SHA1") 
                                            (" ") ($ VSub_Name "$FILE")
                                          )
                                        }
                                      spids: [856]
                                    )
                                  ]
                                  spids: [856]
                                )
                              ]
                              spids: [-1 849]
                            )
                          ]
                          else_action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:FILE2)
                                  op: Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (CommandSubPart
                                          command_list: 
                                            (CommandList
                                              children: [
                                                (Pipeline
                                                  children: [
                                                    (C {(echo)} {(DQ ($ VSub_Name "$MATCH"))})
                                                    (C {(sed)} {(SQ <"s/[^ ]* //">)})
                                                  ]
                                                  negated: False
                                                )
                                              ]
                                            )
                                          left_token: <Left_CommandSub "$(">
                                          spids: [871 885]
                                        )
                                      )
                                    }
                                  spids: [869]
                                )
                              ]
                              spids: [869]
                            )
                            (AndOr
                              children: [
                                (C {(cmp)} {(-s)} {(DQ ($ VSub_Name "$FILE"))} 
                                  {(DQ ($ VSub_Name "$FILE2"))}
                                )
                                (ControlFlow
                                  token: <ControlFlow_Continue continue>
                                )
                              ]
                              op_id: Op_DPipe
                            )
                            (AndOr
                              children: [
                                (C {(ln)} {(-f)} {(DQ ($ VSub_Name "$FILE"))} 
                                  {(DQ ($ VSub_Name "$FILE2"))}
                                )
                                (C {(dienow)})
                              ]
                              op_id: Op_DPipe
                            )
                          ]
                          spids: [866 923]
                        )
                      ]
                      spids: [797 926]
                    )
                )
              ]
              negated: False
            )
          ]
          spids: [770]
        )
      spids: [766 769]
    )
    (FuncDef
      name: is_in_list
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(DQ ($ VSub_Number "$2"))} {(Lit_Other "=") (Lit_Other "=")} 
                  {(all)} {(Lit_Other "]")}
                )
                (C {(Lit_Other "[")} {(KW_Bang "!")} {(-z)} 
                  {
                    (DQ 
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(echo)} 
                                    {(Lit_Comma ",") (DQ ($ VSub_Number "$2")) (Lit_Comma ",")}
                                  )
                                  (C {(grep)} 
                                    {(Lit_Comma ",") (DQ ($ VSub_Number "$1")) (Lit_Comma ",")}
                                  )
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [964 982]
                      )
                    )
                  } {(Lit_Other "]")}
                )
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [939]
        )
      spids: [935 938]
    )
  ]
)