// File: halfflat[P]tinyopt/test/googletest/googletest/src/gtest.cc
// Function: testing::TestSuite::Run()
void TestSuite::Run() {
  if (!should_run_) return;

  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
  impl->set_current_test_suite(this);

  TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();

  // Ensure our tests are in a deterministic order.
  //
  // We do this by sorting lexicographically on (file, line number), providing
  // an order matching what the user can see in the source code.
  //
  // In the common case the line number comparison shouldn't be necessary,
  // because the registrations made by the TEST macro are executed in order
  // within a translation unit. But this is not true of the manual registration
  // API, and in more exotic scenarios a single file may be part of multiple
  // translation units.
  std::stable_sort(test_info_list_.begin(), test_info_list_.end(),
                   [](const TestInfo* const a, const TestInfo* const b) {
                     if (const int result = std::strcmp(a->file(), b->file())) {
                       return result < 0;
                     }

                     return a->line() < b->line();
                   });

  // Call both legacy and the new API
  repeater->OnTestSuiteStart(*this);
//  Legacy API is deprecated but still available
#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
  repeater->OnTestCaseStart(*this);
#endif  //  GTEST_REMOVE_LEGACY_TEST_CASEAPI_

  impl->os_stack_trace_getter()->UponLeavingGTest();
  internal::HandleExceptionsInMethodIfSupported(
      this, &TestSuite::RunSetUpTestSuite, "SetUpTestSuite()");

  const bool skip_all =
      ad_hoc_test_result().Failed() || ad_hoc_test_result().Skipped();

  start_timestamp_ = internal::GetTimeInMillis();
  internal::Timer timer;
  for (int i = 0; i < total_test_count(); i++) {
    if (skip_all) {
      GetMutableTestInfo(i)->Skip();
    } else {
      GetMutableTestInfo(i)->Run();
    }
    if (GTEST_FLAG_GET(fail_fast) &&
        GetMutableTestInfo(i)->result()->Failed()) {
      for (int j = i + 1; j < total_test_count(); j++) {
        GetMutableTestInfo(j)->Skip();
      }
      break;
    }
  }
  elapsed_time_ = timer.Elapsed();

  impl->os_stack_trace_getter()->UponLeavingGTest();
  internal::HandleExceptionsInMethodIfSupported(
      this, &TestSuite::RunTearDownTestSuite, "TearDownTestSuite()");

  // Call both legacy and the new API
  repeater->OnTestSuiteEnd(*this);
//  Legacy API is deprecated but still available
#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
  repeater->OnTestCaseEnd(*this);
#endif  //  GTEST_REMOVE_LEGACY_TEST_CASEAPI_

  impl->set_current_test_suite(nullptr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
testb $0x1, 0x70(%rax)
jne 0x8aaf2
jmp 0x8ad60
callq 0xa29e0
movq -0x70(%rbp), %rsi
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa8be0
callq 0x80640
movq %rax, %rdi
callq 0x8a520
movq %rax, %rdi
callq 0x83a90
movq -0x70(%rbp), %rdi
movq %rax, -0x18(%rbp)
addq $0x30, %rdi
movq %rdi, -0x80(%rbp)
callq 0xa8c00
movq -0x80(%rbp), %rdi
movq %rax, -0x20(%rbp)
callq 0xa8c30
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x8ad70
movq -0x70(%rbp), %rsi
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
movq 0x30(%rax), %rax
callq *%rax
movq -0x70(%rbp), %rsi
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
movq -0x10(%rbp), %rdi
callq 0x840c0
movq %rax, %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movq -0x70(%rbp), %rdi
leaq 0x1e33e(%rip), %rax     # 0xa8ed0
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq 0x43f1a(%rip), %rcx     # 0xceac7
callq 0xa8c60
movq -0x70(%rbp), %rdi
callq 0xa8f00
movq %rax, %rdi
callq 0x88de0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x71(%rbp)
jne 0x8abe3
movq -0x70(%rbp), %rdi
callq 0xa8f00
movq %rax, %rdi
callq 0x88d90
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
andb $0x1, %al
movb %al, -0x41(%rbp)
callq 0x84120
movq %rax, %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x78(%rax)
leaq -0x50(%rbp), %rdi
callq 0xa8290
movl $0x0, -0x54(%rbp)
movq -0x70(%rbp), %rdi
movl -0x54(%rbp), %eax
movl %eax, -0x84(%rbp)
callq 0x84030
movl %eax, %ecx
movl -0x84(%rbp), %eax
cmpl %ecx, %eax
jge 0x8ace0
testb $0x1, -0x41(%rbp)
je 0x8ac49
movq -0x70(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x8aa10
movq %rax, %rdi
callq 0x8a550
jmp 0x8ac5d
movq -0x70(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x8aa10
movq %rax, %rdi
callq 0x8a370
testb $0x1, 0x8ce6e(%rip)     # 0x117ad2
je 0x8acd0
movq -0x70(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x8aa10
movq %rax, %rdi
callq 0xa32e0
movq %rax, %rdi
callq 0x88de0
testb $0x1, %al
jne 0x8ac88
jmp 0x8acd0
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
movq -0x70(%rbp), %rdi
movl -0x58(%rbp), %eax
movl %eax, -0x88(%rbp)
callq 0x84030
movl %eax, %ecx
movl -0x88(%rbp), %eax
cmpl %ecx, %eax
jge 0x8acce
movq -0x70(%rbp), %rdi
movl -0x58(%rbp), %esi
callq 0x8aa10
movq %rax, %rdi
callq 0x8a550
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x8ac91
jmp 0x8ace0
jmp 0x8acd2
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x8ac0b
leaq -0x50(%rbp), %rdi
callq 0xa85a0
movq %rax, %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x10(%rbp), %rdi
callq 0x840c0
movq %rax, %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movq -0x70(%rbp), %rdi
leaq 0x1e209(%rip), %rax     # 0xa8f20
movq %rax, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq 0x43da6(%rip), %rcx     # 0xcead8
callq 0xa8c60
movq -0x70(%rbp), %rsi
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
movq -0x70(%rbp), %rsi
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa8be0
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)