(command.CommandList
  children: [
    (C {(set)} {(-o)} {(nounset)})
    (C {(set)} {(-o)} {(pipefail)})
    (C {(set)} {(-o)} {(errexit)})
    (command.Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:THIS_DIR)
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (command.AndOr
                        ops: [Op_DAmp]
                        children: [
                          (C {(cd)} 
                            {
                              (word_part.CommandSubPart
                                command_list: 
                                  (command.CommandList
                                    children: [(C {(dirname)} {($ VSub_Number '$0')})]
                                  )
                                left_token: <Left_DollarParen '$('>
                              )
                            }
                          )
                          (C {(pwd)})
                        ]
                      )
                    ]
                  )
                left_token: <Left_DollarParen '$('>
              )
            }
        )
      ]
    )
    (C {(source)} {($ VSub_DollarName '$THIS_DIR') (/common.sh)})
    (command.Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:REPO_ROOT)
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (command.AndOr
                        ops: [Op_DAmp]
                        children: [(C {(cd)} {($ VSub_DollarName '$THIS_DIR') (/..)}) (C {(pwd)})]
                      )
                    ]
                  )
                left_token: <Left_DollarParen '$('>
              )
            }
        )
      ]
    )
    (command.FuncDef
      name: _all-py-files
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:fmt) op:Equal rhs:{($ VSub_Number '$1')})]
            )
            (C {(oil-python-sources)} {($ VSub_DollarName '$REPO_ROOT')} 
              {(DQ ($ VSub_DollarName '$fmt'))}
            )
            (C {(cat)} {($ VSub_DollarName '$REPO_ROOT') (/_build/py-to-compile.txt)} 
              (word.BracedWordTree
                parts: [
                  ($ VSub_DollarName '$REPO_ROOT')
                  (/_build/)
                  (word_part.BracedTuple words:[{(oil)} {(opy)}])
                  (/py-to-compile.txt)
                ]
              )
            )
          ]
        )
    )
    (command.FuncDef
      name: all-py-files
      body: 
        (command.BraceGroup
          children: [
            (command.Pipeline
              children: [(C {(_all-py-files)} {(DQ ($ VSub_At '$@'))}) (C {(sort)}) (C {(uniq)})]
              negated: F
            )
          ]
        )
    )
    (command.FuncDef
      name: _copy
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:dest_dir)
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                )
              ]
            )
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:src_path)
                  op: Equal
                  rhs: {($ VSub_Number '$2')}
                )
              ]
            )
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:dest_rel_path)
                  op: Equal
                  rhs: {($ VSub_Number '$3')}
                )
              ]
            )
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:dest)
                  op: Equal
                  rhs: {($ VSub_DollarName '$dest_dir') (/) ($ VSub_DollarName '$dest_rel_path')}
                )
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:dest)
                  op: Equal
                  rhs: 
                    {
                      (word_part.BracedVarSub
                        token: <VSub_Name dest>
                        suffix_op: (suffix_op.StringUnary op_id:VOp1_Percent arg_word:{(c)})
                      )
                    }
                )
              ]
            )
            (C {(mkdir)} {(-p)} 
              {
                (word_part.CommandSubPart
                  command_list: 
                    (command.CommandList
                      children: [(C {(dirname)} {($ VSub_DollarName '$dest')})]
                    )
                  left_token: <Left_DollarParen '$('>
                )
              }
            )
            (C {(cp)} {(-v)} {(--no-target-directory)} {($ VSub_DollarName '$src_path')} 
              {($ VSub_DollarName '$dest')}
            )
          ]
        )
    )
    (command.FuncDef
      name: import
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:dest) op:Equal rhs:{(_regtest/src)})]
            )
            (C {(mkdir)} {(-p)} {($ VSub_DollarName '$dest')})
            (command.Pipeline
              children: [
                (C {(all-py-files)} {(SQ <'%p %P\\n'>)})
                (C {(xargs)} {(-n)} {(2)} {(--)} {($ VSub_Number '$0')} {(_copy)} 
                  {($ VSub_DollarName '$dest')}
                )
              ]
              negated: F
            )
          ]
        )
    )
    (command.FuncDef
      name: manifest
      body: 
        (command.BraceGroup
          children: [
            (C {(find)} {(_regtest/src)} {(-type)} {(f)} {(-a)} {(-printf)} {(SQ <'%p %Pc\\n'>)})
          ]
        )
    )
    (command.FuncDef
      name: compile
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:pat)
                  op: Equal
                  rhs: 
                    {
                      (word_part.BracedVarSub
                        token: <VSub_Number 1>
                        suffix_op: (suffix_op.StringUnary op_id:VTest_ColonHyphen arg_word:{})
                      )
                    }
                )
              ]
            )
            (command.Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:dest) op:Equal rhs:{(_tmp/regtest)})]
            )
            (C {(mkdir)} {(-p)} {($ VSub_DollarName '$dest')})
            (command.TimeBlock
              pipeline: 
                (command.Pipeline
                  children: [
                    (C {(manifest)})
                    (C {(egrep)} {(DQ ($ VSub_DollarName '$pat'))})
                    (C {(./build.sh)} {(compile-manifest)} {($ VSub_DollarName '$dest')})
                  ]
                  negated: F
                )
            )
          ]
        )
    )
    (command.FuncDef
      name: checksum
      body: 
        (command.BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {(find)} {(_tmp/regtest)} {(-type)} {(f)})
                (C {(xargs)} {($ VSub_DollarName '$THIS_DIR') (/../bin/opyc)} {(dis-md5)})
                (C {(sort)} {(-n)})
              ]
              negated: F
            )
          ]
        )
    )
    (command.FuncDef
      name: verify-golden
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C {(checksum)})
                            (C {(diff)} {(-u)} {(_regtest/dis-md5.golden.txt)} {(-)})
                          ]
                          negated: F
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(echo)} {(OK)})]
                )
              ]
              else_action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})]
            )
          ]
        )
    )
    (command.FuncDef
      name: lines
      body: 
        (command.BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {(find)} {(_regtest/src)} {(-type)} {(f)})
                (C {(xargs)} {(wc)} {(-l)})
                (C {(sort)} {(-n)})
              ]
              negated: F
            )
          ]
        )
    )
    (command.FuncDef
      name: compare-one
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:rel_path)
                  op: Equal
                  rhs: {(SQ <opy/compiler2/transformer.pyc>)}
                )
              ]
            )
            (C {(ls)} {(-l)} {(_tmp/regtest/) ($ VSub_DollarName '$rel_path')})
            (command.Pipeline
              children: [
                (C {(unzip)} {(-p)} {($ VSub_DollarName '$rel_path')} {(_tmp/flanders/bytecode-opy.zip)})
                (C {(od)} {(-c)})
              ]
              negated: F
            )
          ]
        )
    )
    (command.FuncDef
      name: smoke-three-modes
      body: 
        (command.BraceGroup
          children: [
            (C {(compile)} {(oil)})
            (C {($ VSub_DollarName '$THIS_DIR') (/../bin/opyc)} {(eval)} {(SQ <'1+2*3'>)})
            (command.Pipeline
              children: [
                (C {(echo)} {(SQ <'4+5*6'>)})
                (C {($ VSub_DollarName '$THIS_DIR') (/../bin/opyc)} {(repl)})
              ]
              negated: F
            )
          ]
        )
    )
    (C {(DQ ($ VSub_At '$@'))})
  ]
)