(command.CommandList
  children: [
    (C {(Id.KW_Set set)} {(-eu)})
    (C {(readonly)} 
      {(Id.Lit_VarLike 'ScriptDir=') 
        (command_sub
          left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:29)
          command_list: 
            (command.CommandList
              children: [
                (C {(dirname)} 
                  {
                    (DQ 
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:33)
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {(echo)} {($ Id.VSub_Number '$0')})
                                  (C {(sed)} {(-e)} 
                                    {
                                      (DQ ('s,^') (Id.Lit_Other '\\') ('([^/]') (Id.Lit_Other '\\') 
                                        ('),') 
                                        (command_sub
                                          left_token: 
                                            (Token
                                              id: Id.Left_DollarParen
                                              val: '$('
                                              span_id: 50
                                            )
                                          command_list: (command.CommandList children:[(C {(pwd)})])
                                        ) (/) (Id.Lit_Other '\\') ('1,')
                                      )
                                    }
                                  )
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    )
                  }
                )
              ]
            )
        )
      }
    )
    (C {(readonly)} {(Id.Lit_VarLike 'ProtoRootDir=') (DQ (${ Id.VSub_Name ScriptDir) (/..))})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:CHECK_ONLY)
          op: assign_op.Equal
          rhs: {(0)}
          spids: [75]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.LogicalAnd
                      left: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_ge
                          left: {($ Id.VSub_Pound '$#')}
                          right: {(1)}
                        )
                      right: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_GlobDEqual
                          left: {(DQ ($ Id.VSub_Number '$1'))}
                          right: {(DQ (--check-only))}
                        )
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:106)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:CHECK_ONLY)
                  op: assign_op.Equal
                  rhs: {(1)}
                  spids: [111]
                )
              ]
            )
            (C {(shift)})
          ]
          spids: [78 108]
        )
      ]
    )
    (command.Simple
      words: [{(pushd)} {(DQ (${ Id.VSub_Name ProtoRootDir))}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:128)
          fd: -1
          arg_word: {(/dev/null)}
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: (C {(test)} {(Id.KW_Bang '!')} {(-e)} {(src/google/protobuf/stubs/common.h)})
              terminator: (Token id:Id.Op_Semi val:';' span_id:142)
            )
          ]
          action: [
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:149)
                  fd: -1
                  arg_word: {(2)}
                )
                (redir.HereDoc
                  op: (Token id:Id.Redir_DLess val:'<<' span_id:152)
                  fd: -1
                  here_begin: {(__EOF__)}
                  here_end_span_id: 159
                  stdin_parts: [
                    (
'Could not find source code.  Make sure you are running this script from the\n'
                    )
                    ('root of the distribution tree.\n')
                  ]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:161)
              arg_word: {(1)}
            )
          ]
          spids: [133 144]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: (C {(test)} {(Id.KW_Bang '!')} {(-e)} {(src/Makefile)})
              terminator: (Token id:Id.Op_Semi val:';' span_id:177)
            )
          ]
          action: [
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:184)
                  fd: -1
                  arg_word: {(2)}
                )
                (redir.HereDoc
                  op: (Token id:Id.Redir_DLess val:'<<' span_id:187)
                  fd: -1
                  here_begin: {(__EOF__)}
                  here_end_span_id: 194
                  stdin_parts: [
                    ('Could not find src/Makefile.  You must run ./configure (and perhaps\n')
                    ('./autogen.sh) first.\n')
                  ]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:196)
              arg_word: {(1)}
            )
          ]
          spids: [168 179]
        )
      ]
    )
    (C {(cd)} {(src)})
    (C {(make)} {($ Id.VSub_At '$@')} {(protoc)})
    (C {(declare)} {(-a)} 
      {(Id.Lit_VarLike 'RUNTIME_PROTO_FILES=') 
        (sh_array_literal
          left: (Token id:Id.Op_LParen val:'(' span_id:222)
          words: [
            {(google/protobuf/any.proto)}
            {(google/protobuf/api.proto)}
            {(google/protobuf/duration.proto)}
            {(google/protobuf/empty.proto)}
            {(google/protobuf/field_mask.proto)}
            {(google/protobuf/source_context.proto)}
            {(google/protobuf/struct.proto)}
            {(google/protobuf/timestamp.proto)}
            {(google/protobuf/type.proto)}
            {(google/protobuf/wrappers.proto)}
          ]
        )
      }
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:TMP_DIR)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:270)
                command_list: (command.CommandList children:[(C {(mktemp)} {(-d)})])
              )
            }
          spids: [269]
        )
      ]
    )
    (C {(trap)} {(DQ ('rm -rf ') (${ Id.VSub_Name TMP_DIR))} {(EXIT)})
    (C {(./protoc)} {(--objc_out) (Id.Lit_Equals '=') (DQ (${ Id.VSub_Name TMP_DIR))} 
      {
        (braced_var_sub
          token: (Token id:Id.VSub_Name val:RUNTIME_PROTO_FILES span_id:298)
          bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
        )
      }
    )
    (C {(Id.KW_Set set)} {(Id.Lit_Other '+') (e)})
    (command.Simple
      words: [
        {(diff)}
        {(-r)}
        {(DQ (${ Id.VSub_Name TMP_DIR) (/google))}
        {(DQ (${ Id.VSub_Name ProtoRootDir) (/objectivec/google))}
      ]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:327)
          fd: -1
          arg_word: {(/dev/null)}
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_eq
                      left: {($ Id.VSub_QMark '$?')}
                      right: {(0)}
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:343)
            )
          ]
          action: [
            (C {(echo)} {(DQ ('Generated source for WellKnownTypes is current.'))})
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:355)
              arg_word: {(0)}
            )
          ]
          spids: [331 345]
        )
      ]
    )
    (C {(Id.KW_Set set)} {(-e)})
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobDEqual
                      left: {(DQ (${ Id.VSub_Name CHECK_ONLY))}
                      right: {(1)}
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:385)
            )
          ]
          action: [
            (C {(echo)} {(DQ ('ERROR: The WKTs need to be regenerated! Run ') ($ Id.VSub_Number '$0'))})
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:398)
              arg_word: {(1)}
            )
          ]
          spids: [369 387]
        )
      ]
    )
    (C {(echo)} {(DQ ('Copying over updated WellKnownType sources.'))})
    (C {(cp)} {(-r)} {(DQ (${ Id.VSub_Name TMP_DIR) (/google/.))} 
      {(DQ (${ Id.VSub_Name ProtoRootDir) (/objectivec/google/))}
    )
  ]
)