(command.CommandList
  children: [
    (C {<set>} {<-e>})
    (C {<set>} {<-o>} {<pipefail>})
    (command.ShFunction
      name: usage
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {(SQ <EOF>)}
                      here_end_span_id: 76
                      stdin_parts: [
                        <'To run, I need:\n'>
                        <
'- to be in a container generated by the Dockerfile at the top of the Docker\n'
                        >
                        <'  repository;\n'>
                        <'- to be provided with the location of an S3 bucket and path, in\n'>
                        <
'  environment variables AWS_S3_BUCKET and AWS_S3_BUCKET_PATH (default: \'\');\n'
                        >
                        <
'- to be provided with AWS credentials for this S3 bucket, in environment\n'
                        >
                        <'  variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY;\n'>
                        <'- a generous amount of good will and nice manners.\n'>
                        <
'The canonical way to run me is to run the image produced by the Dockerfile: e.g.:"\n'
                        >
                        <'\n'>
                        <'docker run -e AWS_S3_BUCKET=test.docker.com \\\n'>
                        <'           -e AWS_ACCESS_KEY_ID     \\\n'>
                        <'           -e AWS_SECRET_ACCESS_KEY \\\n'>
                        <'           -e AWS_DEFAULT_REGION    \\\n'>
                        <'           -it --privileged         \\\n'>
                        <'           docker ./hack/release.sh\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
        )
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$AWS_S3_BUCKET'))} 
          {<Id.Lit_RBracket ']'>}
        )
        (C {<usage>})
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$AWS_ACCESS_KEY_ID'))} 
          {<Id.Lit_RBracket ']'>}
        )
        (C {<usage>})
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$AWS_SECRET_ACCESS_KEY'))} 
          {<Id.Lit_RBracket ']'>}
        )
        (C {<usage>})
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<Id.Lit_LBracket '['>} {<-d>} {<'/go/src/github.com/docker/docker'>} {<Id.Lit_RBracket ']'>})
        (C {<usage>})
      ]
    )
    (C {<cd>} {<'/go/src/github.com/docker/docker'>})
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<Id.Lit_LBracket '['>} {<-x>} {<'hack/make.sh'>} {<Id.Lit_RBracket ']'>})
        (C {<usage>})
      ]
    )
    (C {<export>} {<AWS_DEFAULT_REGION>})
    (C {<Id.Lit_Colon ':'>} 
      {
        (braced_var_sub
          token: <Id.VSub_Name AWS_DEFAULT_REGION>
          suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonEquals ':='> arg_word:{<us-west-1>})
        )
      }
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:AWS_CLI)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: <Id.VSub_Name AWS_CLI>
                suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:{(SQ <aws>)})
              )
            }
          spids: [163]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:RELEASE_BUNDLES)
          op: assign_op.Equal
          rhs: {(sh_array_literal left:<Id.Op_LParen _> words:[{<binary>} {<cross>} {<tgz>}])}
          spids: [173]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number '$1'))} 
                      {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(SQ <--release-regardless-of-test-failure>)} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:RELEASE_BUNDLES)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (sh_array_literal
                        left: <Id.Op_LParen _>
                        words: [
                          {<test-unit>}
                          {
                            (DQ 
                              (braced_var_sub
                                token: <Id.VSub_Name RELEASE_BUNDLES>
                                bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                              )
                            )
                          }
                          {<test-integration>}
                        ]
                      )
                    }
                  spids: [209]
                )
              ]
            )
          ]
          spids: [188 206]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:VERSION)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    redirects: [(redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<VERSION>})]
                    do_fork: F
                  )
              )
            }
          spids: [234]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:BUCKET)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$AWS_S3_BUCKET')}
          spids: [241]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:BUCKET_PATH)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$BUCKET')}
          spids: [244]
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (command.DBracket
          expr: 
            (bool_expr.Unary
              op_id: Id.BoolUnary_n
              child: {(DQ ($ Id.VSub_DollarName '$AWS_S3_BUCKET_PATH'))}
            )
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:BUCKET_PATH)
              op: assign_op.PlusEqual
              rhs: {<'/'> ($ Id.VSub_DollarName '$AWS_S3_BUCKET_PATH')}
              spids: [259]
            )
          ]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (command.Simple
                          words: [{<command>} {<-v>} {<git>}]
                          redirects: [
                            (redir
                              op: <Id.Redir_AndGreat '&>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<'/dev/null'>}
                            )
                          ]
                          do_fork: T
                        )
                        (command.Simple
                          words: [{<git>} {<rev-parse>}]
                          redirects: [
                            (redir
                              op: <Id.Redir_AndGreat '&>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<'/dev/null'>}
                            )
                          ]
                          do_fork: T
                        )
                      ]
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (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 {<git>} {<status>} {<--porcelain>} 
                                        {<--untracked-files> <Id.Lit_Equals '='> <no>}
                                      )
                                  )
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {(DQ <'You cannot run the release script on a repo with uncommitted changes'>)}
                    )
                    (C {<usage>})
                  ]
                  spids: [290 313]
                )
              ]
            )
          ]
          spids: [264 287]
        )
      ]
    )
    (command.ShFunction
      name: setup_s3
      body: 
        (BraceGroup
          children: [
            (C {<echo>} {(DQ <'Setting up S3'>)})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  words: [
                    {($ Id.VSub_DollarName '$AWS_CLI')}
                    {<s3>}
                    {<mb>}
                    {(DQ <'s3://'> ($ Id.VSub_DollarName '$BUCKET'))}
                  ]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '2>'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<'/dev/null'>}
                    )
                  ]
                  do_fork: T
                )
                (C {<true>})
              ]
            )
            (command.Simple
              words: [
                {($ Id.VSub_DollarName '$AWS_CLI')}
                {<s3>}
                {<ls>}
                {(DQ <'s3://'> ($ Id.VSub_DollarName '$BUCKET'))}
              ]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'/dev/null'>})]
              do_fork: T
            )
            (C {($ Id.VSub_DollarName '$AWS_CLI')} {<s3>} {<website>} {<--index-document>} {<index>} 
              {<--error-document>} {<error>} {(DQ <'s3://'> ($ Id.VSub_DollarName '$BUCKET'))}
            )
          ]
        )
    )
    (command.ShFunction
      name: write_to_s3
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:DEST)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [439]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:F)
                  op: assign_op.Equal
                  rhs: {(command_sub left_token:<Id.Left_Backtick '`'> child:(C {<mktemp>}))}
                  spids: [443]
                )
              ]
            )
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {(DQ ($ Id.VSub_DollarName '$F'))}
                )
              ]
              do_fork: T
            )
            (C {($ Id.VSub_DollarName '$AWS_CLI')} {<s3>} {<cp>} {<--acl>} {<public-read>} 
              {<--content-type>} {(SQ <'text/plain'>)} {(DQ ($ Id.VSub_DollarName '$F'))} {(DQ ($ Id.VSub_DollarName '$DEST'))}
            )
            (C {<rm>} {<-f>} {(DQ ($ Id.VSub_DollarName '$F'))})
          ]
        )
    )
    (command.ShFunction
      name: s3_url
      body: 
        (BraceGroup
          children: [
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$BUCKET'))}
              arms: [
                (case_arm
                  pat_list: [{<get.docker.com>} {<test.docker.com>} {<experimental.docker.com>}]
                  action: [(C {<echo>} {(DQ <'https://'> ($ Id.VSub_DollarName '$BUCKET_PATH'))})]
                  spids: [512 517 528 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:BASE_URL)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ <'http://'> (${ Id.VSub_Name BUCKET) <.s3-website-> 
                                (${ Id.VSub_Name AWS_DEFAULT_REGION) <.amazonaws.com>
                              )
                            }
                          spids: [535]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Unary
                                          op_id: Id.BoolUnary_n
                                          child: {(DQ ($ Id.VSub_DollarName '$AWS_S3_BUCKET_PATH'))}
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {<echo>} 
                              {
                                (DQ ($ Id.VSub_DollarName '$BASE_URL') <'/'> 
                                  ($ Id.VSub_DollarName '$AWS_S3_BUCKET_PATH')
                                )
                              }
                            )
                          ]
                          spids: [549 563]
                        )
                      ]
                      else_action: [(C {<echo>} {(DQ ($ Id.VSub_DollarName '$BASE_URL'))})]
                    )
                  ]
                  spids: [531 532 588 -1]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: build_all
      body: 
        (BraceGroup
          children: [
            (C {<echo>} {(DQ <'Building release'>)})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [
                                (C {<'./hack/make.sh'>} 
                                  {
                                    (DQ 
                                      (braced_var_sub
                                        token: <Id.VSub_Name RELEASE_BUNDLES>
                                        bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                      )
                                    )
                                  }
                                )
                              ]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.Simple
                      words: [{<echo>}]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>} {(SQ <'The build or tests appear to have failed.'>)}]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>}]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [
                        {<echo>}
                        {(SQ <'You, as the release  maintainer, now have a couple options:'>)}
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>} {(SQ <'- delay release and fix issues'>)}]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>} {(SQ <'- delay release and fix issues'>)}]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [
                        {<echo>}
                        {(SQ <'- did we mention how important this is?  issues need fixing :)'>)}
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>}]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (SQ 
                            <
'As a final LAST RESORT, you (because only you, the release maintainer,'
                            >
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (SQ 
                            <
' really knows all the hairy problems at hand with the current release'
                            >
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (SQ 
                            <
' issues) may bypass this checking by running this script again with the'
                            >
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (SQ 
                            <
' single argument of "--release-regardless-of-test-failure", which will skip'
                            >
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (SQ 
                            <
' running the test suite, and will only build the binaries and packages.  Please'
                            >
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>} {(SQ <' avoid using this if at all possible.'>)}]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>}]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (SQ 
                            <
'Regardless, we cannot stress enough the scarcity with which this bypass'
                            >
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (SQ 
                            <
' should be used.  If there are release issues, we should always err on the'
                            >
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>} {(SQ <' side of caution.'>)}]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.Simple
                      words: [{<echo>}]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [610 626]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: upload_release_build
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:src)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [816]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:dst)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$2'))}
                  spids: [822]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:latest)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$3'))}
                  spids: [828]
                )
              ]
            )
            (C {<echo>})
            (C {<echo>} {(DQ <'Uploading '> ($ Id.VSub_DollarName '$src'))})
            (C {<echo>} {(DQ <'  to '> ($ Id.VSub_DollarName '$dst'))})
            (C {<echo>})
            (C {($ Id.VSub_DollarName '$AWS_CLI')} {<s3>} {<cp>} {<--follow-symlinks>} {<--acl>} 
              {<public-read>} {(DQ ($ Id.VSub_DollarName '$src'))} {(DQ ($ Id.VSub_DollarName '$dst'))}
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$latest'))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<echo>})
                    (C {<echo>} {(DQ <'Copying to '> ($ Id.VSub_DollarName '$latest'))})
                    (C {<echo>})
                    (C {($ Id.VSub_DollarName '$AWS_CLI')} {<s3>} {<cp>} {<--acl>} {<public-read>} 
                      {(DQ ($ Id.VSub_DollarName '$dst'))} {(DQ ($ Id.VSub_DollarName '$latest'))}
                    )
                  ]
                  spids: [878 889]
                )
              ]
            )
            (command.ForEach
              iter_name: hashAlgo
              iter_words: [{<md5>} {<sha256>}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<Id.Lit_LBracket '['>} {<-e>} 
                                      {
                                        (DQ ($ Id.VSub_DollarName '$src') <.> 
                                          ($ Id.VSub_DollarName '$hashAlgo')
                                        )
                                      } {<Id.Lit_RBracket ']'>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {<echo>})
                            (C {<echo>} 
                              {
                                (DQ <'Uploading '> ($ Id.VSub_DollarName '$src') <.> 
                                  ($ Id.VSub_DollarName '$hashAlgo')
                                )
                              }
                            )
                            (C {<echo>} 
                              {
                                (DQ <'  to '> ($ Id.VSub_DollarName '$dst') <.> 
                                  ($ Id.VSub_DollarName '$hashAlgo')
                                )
                              }
                            )
                            (C {<echo>})
                            (C {($ Id.VSub_DollarName '$AWS_CLI')} {<s3>} {<cp>} {<--follow-symlinks>} 
                              {<--acl>} {<public-read>} {<--content-type> <Id.Lit_Equals '='> (SQ <'text/plain'>)} 
                              {
                                (DQ ($ Id.VSub_DollarName '$src') <.> 
                                  ($ Id.VSub_DollarName '$hashAlgo')
                                )
                              } {(DQ ($ Id.VSub_DollarName '$dst') <.> ($ Id.VSub_DollarName '$hashAlgo'))}
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (command.Sentence
                                          child: 
                                            (C {<Id.Lit_LBracket '['>} 
                                              {(DQ ($ Id.VSub_DollarName '$latest'))} {<Id.Lit_RBracket ']'>}
                                            )
                                          terminator: <Id.Op_Semi _>
                                        )
                                      ]
                                    )
                                  action: [
                                    (C {<echo>})
                                    (C {<echo>} 
                                      {
                                        (DQ <'Copying to '> ($ Id.VSub_DollarName '$latest') <.> 
                                          ($ Id.VSub_DollarName '$hashAlgo')
                                        )
                                      }
                                    )
                                    (C {<echo>})
                                    (C {($ Id.VSub_DollarName '$AWS_CLI')} {<s3>} {<cp>} {<--acl>} 
                                      {<public-read>} {(DQ ($ Id.VSub_DollarName '$dst') <.> ($ Id.VSub_DollarName '$hashAlgo'))} 
                                      {
                                        (DQ ($ Id.VSub_DollarName '$latest') <.> 
                                          ($ Id.VSub_DollarName '$hashAlgo')
                                        )
                                      }
                                    )
                                  ]
                                  spids: [1022 1033]
                                )
                              ]
                            )
                          ]
                          spids: [947 962]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: release_build
      body: 
        (BraceGroup
          children: [
            (C {<echo>} {(DQ <'Releasing binaries'>)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:GOOS)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [1100]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:GOARCH)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$2')}
                  spids: [1104]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:binDir)
                  op: assign_op.Equal
                  rhs: 
                    {<'bundles/'> ($ Id.VSub_DollarName '$VERSION') <'/cross/'> 
                      ($ Id.VSub_DollarName '$GOOS') <'/'> ($ Id.VSub_DollarName '$GOARCH')
                    }
                  spids: [1109]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:tgzDir)
                  op: assign_op.Equal
                  rhs: 
                    {<'bundles/'> ($ Id.VSub_DollarName '$VERSION') <'/tgz/'> 
                      ($ Id.VSub_DollarName '$GOOS') <'/'> ($ Id.VSub_DollarName '$GOARCH')
                    }
                  spids: [1118]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:binary)
                  op: assign_op.Equal
                  rhs: {<docker-> ($ Id.VSub_DollarName '$VERSION')}
                  spids: [1127]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:zipExt)
                  op: assign_op.Equal
                  rhs: {(DQ <.tgz>)}
                  spids: [1132]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:binaryExt)
                  op: assign_op.Equal
                  rhs: {(DQ )}
                  spids: [1138]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:tgz)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$binary') ($ Id.VSub_DollarName '$zipExt')}
                  spids: [1143]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:latestBase)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [1149]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$NOLATEST'))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:latestBase)
                          op: assign_op.Equal
                          rhs: {<docker-latest>}
                          spids: [1168]
                        )
                      ]
                    )
                  ]
                  spids: [1152 1165]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:s3Os)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$GOOS')}
                  spids: [1189]
                )
              ]
            )
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$s3Os'))}
              arms: [
                (case_arm
                  pat_list: [{<darwin>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:s3Os)
                          op: assign_op.Equal
                          rhs: {<Darwin>}
                          spids: [1206]
                        )
                      ]
                    )
                  ]
                  spids: [1202 1203 1210 -1]
                )
                (case_arm
                  pat_list: [{<freebsd>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:s3Os)
                          op: assign_op.Equal
                          rhs: {<FreeBSD>}
                          spids: [1217]
                        )
                      ]
                    )
                  ]
                  spids: [1213 1214 1221 -1]
                )
                (case_arm
                  pat_list: [{<linux>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:s3Os)
                          op: assign_op.Equal
                          rhs: {<Linux>}
                          spids: [1228]
                        )
                      ]
                    )
                  ]
                  spids: [1224 1225 1232 -1]
                )
                (case_arm
                  pat_list: [{<solaris>}]
                  action: [
                    (C {<echo>} {<skipping>} {<solaris>} {<release>})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<0>}
                    )
                  ]
                  spids: [1235 1236 1253 -1]
                )
                (case_arm
                  pat_list: [{<windows>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:s3Os)
                          op: assign_op.Equal
                          rhs: {<Windows>}
                          spids: [1264]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:zipExt)
                          op: assign_op.Equal
                          rhs: {(DQ <.zip>)}
                          spids: [1268]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:binaryExt)
                          op: assign_op.Equal
                          rhs: {(DQ <.exe>)}
                          spids: [1274]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:tgz)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$binary') ($ Id.VSub_DollarName '$zipExt')}
                          spids: [1280]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:binary)
                          op: assign_op.PlusEqual
                          rhs: {($ Id.VSub_DollarName '$binaryExt')}
                          spids: [1285]
                        )
                      ]
                    )
                  ]
                  spids: [1256 1257 1289 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (DQ <'error: can\'t convert '> ($ Id.VSub_DollarName '$s3Os') 
                            <' to an appropriate value for \'uname -s\''>
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [1292 1293 1313 -1]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:s3Arch)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName '$GOARCH')}
                  spids: [1320]
                )
              ]
            )
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$s3Arch'))}
              arms: [
                (case_arm
                  pat_list: [{<amd64>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:s3Arch)
                          op: assign_op.Equal
                          rhs: {<x86_64>}
                          spids: [1337]
                        )
                      ]
                    )
                  ]
                  spids: [1333 1334 1341 -1]
                )
                (case_arm
                  pat_list: [{<386>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:s3Arch)
                          op: assign_op.Equal
                          rhs: {<i386>}
                          spids: [1348]
                        )
                      ]
                    )
                  ]
                  spids: [1344 1345 1352 -1]
                )
                (case_arm
                  pat_list: [{<arm>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:s3Arch)
                          op: assign_op.Equal
                          rhs: {<armel>}
                          spids: [1359]
                        )
                      ]
                    )
                  ]
                  spids: [1355 1356 1367 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (DQ <'error: can\'t convert '> ($ Id.VSub_DollarName '$s3Arch') 
                            <' to an appropriate value for \'uname -m\''>
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [1370 1371 1391 -1]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:s3Dir)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ <'s3://'> ($ Id.VSub_DollarName '$BUCKET_PATH') <'/builds/'> 
                        ($ Id.VSub_DollarName '$s3Os') <'/'> ($ Id.VSub_DollarName '$s3Arch')
                      )
                    }
                  spids: [1398]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:latestTgz)
                  op: assign_op.Equal
                  rhs: (word.Empty)
                  spids: [1413]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$latestBase'))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:latestTgz)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName '$s3Dir') <'/'> 
                                ($ Id.VSub_DollarName '$latestBase') ($ Id.VSub_DollarName '$zipExt')
                              )
                            }
                          spids: [1442]
                        )
                      ]
                    )
                  ]
                  spids: [1416 1427]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-f>} 
                              {
                                (DQ ($ Id.VSub_DollarName '$tgzDir') <'/'> 
                                  ($ Id.VSub_DollarName '$tgz')
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.Simple
                      words: [
                        {<echo>}
                        {
                          (DQ <'error: can\'t find '> ($ Id.VSub_DollarName '$tgzDir') <'/'> 
                            ($ Id.VSub_DollarName '$tgz') <' - was it packaged properly?'>
                          )
                        }
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [1455 1472]
                )
              ]
            )
            (C {<upload_release_build>} 
              {(DQ ($ Id.VSub_DollarName '$tgzDir') <'/'> ($ Id.VSub_DollarName '$tgz'))} {(DQ ($ Id.VSub_DollarName '$s3Dir') <'/'> ($ Id.VSub_DollarName '$tgz'))} 
              {(DQ ($ Id.VSub_DollarName '$latestTgz'))}
            )
          ]
        )
    )
    (command.ShFunction
      name: release_binaries
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<Id.Lit_LBracket '['>} 
                  {
                    (DQ 
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (C {<find>} {<'bundles/'> ($ Id.VSub_DollarName '$VERSION')} {<-path>} 
                            {
                              (DQ <'bundles/'> ($ Id.VSub_DollarName '$VERSION') <'/cross/*/*/docker-'> 
                                ($ Id.VSub_DollarName '$VERSION')
                              )
                            }
                          )
                      )
                    )
                  } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ )} {<Id.Lit_RBracket ']'>}
                )
                (BraceGroup
                  children: [
                    (command.Simple
                      words: [{<echo>} {(SQ <'./hack/make.sh must be run before release_binaries'>)}]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                )
              ]
            )
            (command.ForEach
              iter_name: d
              iter_words: [
                {<'bundles/'> ($ Id.VSub_DollarName '$VERSION') <'/cross/'> <Id.Lit_Star '*'> <'/'> 
                  <Id.Lit_Star '*'>
                }
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:GOARCH)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ 
                                (command_sub
                                  left_token: <Id.Left_DollarParen '$('>
                                  child: (C {<basename>} {(DQ ($ Id.VSub_DollarName '$d'))})
                                )
                              )
                            }
                          spids: [1605]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:GOOS)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ 
                                (command_sub
                                  left_token: <Id.Left_DollarParen '$('>
                                  child: 
                                    (C {<basename>} 
                                      {
                                        (DQ 
                                          (command_sub
                                            left_token: <Id.Left_DollarParen '$('>
                                            child: (C {<dirname>} {(DQ ($ Id.VSub_DollarName '$d'))})
                                          )
                                        )
                                      }
                                    )
                                )
                              )
                            }
                          spids: [1617]
                        )
                      ]
                    )
                    (C {<release_build>} {(DQ ($ Id.VSub_DollarName '$GOOS'))} 
                      {(DQ ($ Id.VSub_DollarName '$GOARCH'))}
                    )
                  ]
                )
            )
            (command.Pipeline
              children: [
                (command.Simple
                  words: [{<cat>}]
                  redirects: [
                    (redir
                      op: <Id.Redir_DLess '<<'>
                      loc: (redir_loc.Fd fd:0)
                      arg: 
                        (redir_param.HereDoc
                          here_begin: {<EOF>}
                          here_end_span_id: 1684
                          stdin_parts: [
                            <'# To install, run the following commands as root:\n'>
                            <'curl -fsSLO '>
                            (command_sub
                              left_token: <Id.Left_DollarParen '$('>
                              child: (C {<s3_url>})
                            )
                            <'/builds/Linux/x86_64/docker-'>
                            ($ Id.VSub_DollarName '$VERSION')
                            <'.tgz && tar --strip-components=1 -xvzf docker-'>
                            ($ Id.VSub_DollarName '$VERSION')
                            <'.tgz -C /usr/local/bin\n'>
                            <'\n'>
                            <'# Then start docker in daemon mode:\n'>
                            <'/usr/local/bin/dockerd\n'>
                          ]
                        )
                    )
                  ]
                  do_fork: T
                )
                (C {<write_to_s3>} 
                  {<s3> <Id.Lit_Colon ':'> <'//'> ($ Id.VSub_DollarName '$BUCKET_PATH') 
                    <'/builds/index'>
                  }
                )
              ]
              negated: F
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [(C {<rm>} {<-rf>} {<'/tmp/emptyfile'>}) (C {<touch>} {<'/tmp/emptyfile'>})]
            )
            (C {($ Id.VSub_DollarName '$AWS_CLI')} {<s3>} {<cp>} {<--acl>} {<public-read>} 
              {<--website-redirect>} {(SQ <'/builds/'>)} {<--content-type> <Id.Lit_Equals '='> (SQ <'text/plain'>)} {<'/tmp/emptyfile'>} 
              {(DQ <'s3://'> ($ Id.VSub_DollarName '$BUCKET_PATH') <'/builds/info'>)}
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$NOLATEST'))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <'Advertising '> ($ Id.VSub_DollarName '$VERSION') <' on '> 
                          ($ Id.VSub_DollarName '$BUCKET_PATH') <' as most recent version'>
                        )
                      }
                    )
                    (command.Pipeline
                      children: [
                        (C {<echo>} {(DQ ($ Id.VSub_DollarName '$VERSION'))})
                        (C {<write_to_s3>} 
                          {(DQ <'s3://'> ($ Id.VSub_DollarName '$BUCKET_PATH') <'/latest'>)}
                        )
                      ]
                      negated: F
                    )
                  ]
                  spids: [1736 1749]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: main
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$SKIP_RELEASE_BUILD'))} 
                  {<Id.Lit_Equals '='>} {(SQ <1>)} {<Id.Lit_RBracket ']'>}
                )
                (C {<build_all>})
              ]
            )
            (C {<setup_s3>})
            (C {<release_binaries>})
          ]
        )
    )
    (C {<main>})
    (C {<echo>})
    (C {<echo>})
    (C {<echo>} 
      {
        (DQ <'Release complete; see '> 
          (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<s3_url>}))
        )
      }
    )
    (C {<echo>} {(DQ <'Use the following text to announce the release:'>)})
    (C {<echo>})
    (C {<echo>} 
      {
        (DQ <'We have just pushed '> ($ Id.VSub_DollarName '$VERSION') <' to '> 
          (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<s3_url>})) <'. You can download it with the following:'>
        )
      }
    )
    (C {<echo>})
    (C {<echo>} 
      {
        (DQ <'Linux 64bit tgz: '> 
          (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<s3_url>})) <'/builds/Linux/x86_64/docker-'> ($ Id.VSub_DollarName '$VERSION') <.tgz>
        )
      }
    )
    (C {<echo>} 
      {
        (DQ <'Darwin/OSX 64bit client tgz: '> 
          (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<s3_url>})) <'/builds/Darwin/x86_64/docker-'> ($ Id.VSub_DollarName '$VERSION') <.tgz>
        )
      }
    )
    (C {<echo>} 
      {
        (DQ <'Windows 64bit zip: '> 
          (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<s3_url>})) <'/builds/Windows/x86_64/docker-'> ($ Id.VSub_DollarName '$VERSION') <.zip>
        )
      }
    )
    (C {<echo>} 
      {
        (DQ <'Windows 32bit client zip: '> 
          (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<s3_url>})) <'/builds/Windows/i386/docker-'> ($ Id.VSub_DollarName '$VERSION') <.zip>
        )
      }
    )
    (C {<echo>})
  ]
)