(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:curlhdr)
          op: assign_op.Equal
          rhs: {(DQ ('Accept: application/vnd.travis-ci.2+json'))}
          spids: [7]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:endpoint)
          op: assign_op.Equal
          rhs: {(DQ ('https://api.travis-ci.org/repos/') ($ Id.VSub_DollarName '$TRAVIS_REPO_SLUG'))}
          spids: [12]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$TRAVIS_PULL_REQUEST'))} 
                  {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ (false))} {(Id.Lit_RBracket ']')}
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:38)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:newestbuildforthisPR)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:44)
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (C {(curl)} {(-H)} {(DQ ($ Id.VSub_DollarName '$curlhdr'))} 
                                    {($ Id.VSub_DollarName '$endpoint') (/builds) (Id.Lit_QMark '?') 
                                      (Id.Lit_VarLike 'event_type=') (pull_request)
                                    }
                                  )
                                  (C {(jq)} 
                                    {
                                      (DQ ('.builds | map(select(.pull_request_number == ') 
                                        ($ Id.VSub_DollarName '$TRAVIS_PULL_REQUEST') ('))[0].number')
                                      )
                                    }
                                  )
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                  spids: [43]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$newestbuildforthisPR')} 
                          {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(null)} {(-a)} {($ Id.VSub_DollarName '$newestbuildforthisPR')} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} 
                          {
                            (word_part.EscapedLiteral
                              token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:91)
                            ) ($ Id.VSub_DollarName '$TRAVIS_BUILD_NUMBER') 
                            (word_part.EscapedLiteral
                              token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:93)
                            )
                          } {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:96)
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {(DQ ('There are newer queued builds for this pull request, failing early.'))}
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:108)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [73 98]
                )
              ]
            )
          ]
          spids: [22 40]
        )
      ]
      else_action: [
        (command.Case
          to_match: {($ Id.VSub_DollarName '$TRAVIS_BRANCH')}
          arms: [
            (case_arm
              pat_list: [{(master)} {(release) (Id.Lit_Star '*')}]
              spids: [129 135 138 -1]
            )
            (case_arm
              pat_list: [{(Id.Lit_Star '*')}]
              action: [
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (C {(Id.Lit_LBracket '[')} 
                              {
                                (word_part.EscapedLiteral
                                  token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:149)
                                ) ($ Id.VSub_DollarName '$TRAVIS_BUILD_NUMBER') 
                                (word_part.EscapedLiteral
                                  token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:151)
                                )
                              } {(Id.KW_Bang '!') (Id.Lit_Equals '=')} 
                              {
                                (command_sub
                                  left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:156)
                                  command_list: 
                                    (command.CommandList
                                      children: [
                                        (command.Pipeline
                                          children: [
                                            (C {(curl)} {(-H)} {(DQ ($ Id.VSub_DollarName '$curlhdr'))} 
                                              {($ Id.VSub_DollarName '$endpoint') (/branches/) 
                                                ($ Id.VSub_DollarName '$TRAVIS_BRANCH')
                                              }
                                            )
                                            (C {(jq)} {(DQ (.branch.number))})
                                          ]
                                          negated: F
                                        )
                                      ]
                                    )
                                )
                              } {(Id.Lit_RBracket ']')}
                            )
                          terminator: (Token id:Id.Op_Semi val:';' span_id:181)
                        )
                      ]
                      action: [
                        (C {(echo)} 
                          {(DQ ('There are newer queued builds for this branch, failing early.'))}
                        )
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Exit val:exit span_id:193)
                          arg_word: {(1)}
                        )
                      ]
                      spids: [145 183]
                    )
                  ]
                )
              ]
              spids: [141 142 201 -1]
            )
          ]
        )
      ]
    )
  ]
)