// File: /workspace/github_cpp_makefile_star2_O1/ambersun1234[P]AVL_Tree/./googletest/googletest/src/gtest.cc
// Function: testing::internal::UnitTestImpl::RunAllTests()
bool UnitTestImpl::RunAllTests() {
  // True iff Google Test is initialized before RUN_ALL_TESTS() is called.
  const bool gtest_is_initialized_before_run_all_tests = GTestIsInitialized();

  // Do not run any test if the --help flag was specified.
  if (g_help_flag)
    return true;

  // Repeats the call to the post-flag parsing initialization in case the
  // user didn't call InitGoogleTest.
  PostFlagParsingInit();

  // Even if sharding is not on, test runners may want to use the
  // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding
  // protocol.
  internal::WriteToShardStatusFileIfNeeded();

  // True iff we are in a subprocess for running a thread-safe-style
  // death test.
  bool in_subprocess_for_death_test = false;

#if GTEST_HAS_DEATH_TEST
  in_subprocess_for_death_test = (internal_run_death_test_flag_.get() != NULL);
# if defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
  if (in_subprocess_for_death_test) {
    GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_();
  }
# endif  // defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
#endif  // GTEST_HAS_DEATH_TEST

  const bool should_shard = ShouldShard(kTestTotalShards, kTestShardIndex,
                                        in_subprocess_for_death_test);

  // Compares the full test names with the filter to decide which
  // tests to run.
  const bool has_tests_to_run = FilterTests(should_shard
                                              ? HONOR_SHARDING_PROTOCOL
                                              : IGNORE_SHARDING_PROTOCOL) > 0;

  // Lists the tests and exits if the --gtest_list_tests flag was specified.
  if (GTEST_FLAG(list_tests)) {
    // This must be called *after* FilterTests() has been called.
    ListTestsMatchingFilter();
    return true;
  }

  random_seed_ = GTEST_FLAG(shuffle) ?
      GetRandomSeedFromFlag(GTEST_FLAG(random_seed)) : 0;

  // True iff at least one test has failed.
  bool failed = false;

  TestEventListener* repeater = listeners()->repeater();

  start_timestamp_ = GetTimeInMillis();
  repeater->OnTestProgramStart(*parent_);

  // How many times to repeat the tests?  We don't want to repeat them
  // when we are inside the subprocess of a death test.
  const int repeat = in_subprocess_for_death_test ? 1 : GTEST_FLAG(repeat);
  // Repeats forever if the repeat count is negative.
  const bool forever = repeat < 0;
  for (int i = 0; forever || i != repeat; i++) {
    // We want to preserve failures generated by ad-hoc test
    // assertions executed before RUN_ALL_TESTS().
    ClearNonAdHocTestResult();

    const TimeInMillis start = GetTimeInMillis();

    // Shuffles test cases and tests if requested.
    if (has_tests_to_run && GTEST_FLAG(shuffle)) {
      random()->Reseed(random_seed_);
      // This should be done before calling OnTestIterationStart(),
      // such that a test event listener can see the actual test order
      // in the event.
      ShuffleTests();
    }

    // Tells the unit test event listeners that the tests are about to start.
    repeater->OnTestIterationStart(*parent_, i);

    // Runs each test case if there is at least one test to run.
    if (has_tests_to_run) {
      // Sets up all environments beforehand.
      repeater->OnEnvironmentsSetUpStart(*parent_);
      ForEach(environments_, SetUpEnvironment);
      repeater->OnEnvironmentsSetUpEnd(*parent_);

      // Runs the tests only if there was no fatal failure during global
      // set-up.
      if (!Test::HasFatalFailure()) {
        for (int test_index = 0; test_index < total_test_case_count();
             test_index++) {
          GetMutableTestCase(test_index)->Run();
        }
      }

      // Tears down all environments in reverse order afterwards.
      repeater->OnEnvironmentsTearDownStart(*parent_);
      std::for_each(environments_.rbegin(), environments_.rend(),
                    TearDownEnvironment);
      repeater->OnEnvironmentsTearDownEnd(*parent_);
    }

    elapsed_time_ = GetTimeInMillis() - start;

    // Tells the unit test event listener that the tests have just finished.
    repeater->OnTestIterationEnd(*parent_, i);

    // Gets the result and clears it.
    if (!Passed()) {
      failed = true;
    }

    // Restores the original test order after the iteration.  This
    // allows the user to quickly repro a failure that happens in the
    // N-th iteration without repeating the first (N - 1) iterations.
    // This is not enclosed in "if (GTEST_FLAG(shuffle)) { ... }", in
    // case the user somehow changes the value of the flag somewhere
    // (it's always safe to unshuffle the tests).
    UnshuffleTests();

    if (GTEST_FLAG(shuffle)) {
      // Picks a new random seed for each iteration.
      random_seed_ = GetNextRandomSeed(random_seed_);
    }
  }

  repeater->OnTestProgramEnd(*parent_);

  if (!gtest_is_initialized_before_run_all_tests) {
    ColoredPrintf(
        COLOR_RED,
        "\nIMPORTANT NOTICE - DO NOT IGNORE:\n"
        "This test program did NOT call " GTEST_INIT_GOOGLE_TEST_NAME_
        "() before calling RUN_ALL_TESTS(). This is INVALID. Soon " GTEST_NAME_
        " will start to enforce the valid usage. "
        "Please fix it ASAP, or IT WILL START TO FAIL.\n");  // NOLINT
#if GTEST_FOR_GOOGLE_
    ColoredPrintf(COLOR_RED,
                  "For more details, see http://wiki/Main/ValidGUnitMain.\n");
#endif  // GTEST_FOR_GOOGLE_
  }

  return !failed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x2a2dc(%rip), %rsi     # 0x49858
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x2aa90
movq (%r14), %r15
movq 0x8(%r14), %r12
movq %r14, %rdi
callq 0x2aa34
movb $0x1, %bpl
cmpb $0x0, 0x2a1af(%rip)     # 0x49751
jne 0x1f95a
movq %r12, 0x38(%rsp)
movq %rbx, %rdi
callq 0x203d6
callq 0x206b1
movq 0x1d0(%rbx), %r12
xorl %edx, %edx
testq %r12, %r12
setne %dl
leaq 0x157c0(%rip), %rdi     # 0x34d90
leaq 0x157d9(%rip), %rsi     # 0x34db0
callq 0x172c5
xorb $0x1, %al
movzbl %al, %esi
movq %rbx, %rdi
callq 0x2071c
movl %eax, 0x10(%rsp)
cmpb $0x1, 0x2a1a5(%rip)     # 0x49799
jne 0x1f603
movq %rbx, %rdi
callq 0x2097c
jmp 0x1f95a
xorl %edx, %edx
cmpb $0x1, 0x2a1c1(%rip)     # 0x497cd
jne 0x1f664
movl 0x2a1b0(%rip), %edx     # 0x497c4
testl %edx, %edx
jne 0x1f64b
leaq 0x18(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x78b0
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%r14)
imull $0x3e8, (%r14), %eax    # imm = 0x3E8
movq %rdx, %rcx
shrq $0x3f, %rcx
shrq $0x7, %rdx
addl %ecx, %edx
addl %eax, %edx
decl %edx
movl $0xa7c61a3b, %eax       # imm = 0xA7C61A3B
imulq %rdx, %rax
shrq $0x30, %rax
imull $0x1869f, %eax, %eax    # imm = 0x1869F
subl %eax, %edx
incl %edx
movq %r15, 0x30(%rsp)
movl %edx, 0x1b4(%rbx)
movq 0x190(%rbx), %r15
leaq 0x18(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x78b0
imulq $0x3e8, (%r14), %rcx    # imm = 0x3E8
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%r14)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
addq %rcx, %rdx
movq %rdx, 0x1c0(%rbx)
movq 0x8(%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movl $0x1, %edx
testq %r12, %r12
jne 0x1f6cf
movl 0x2a0f9(%rip), %edx     # 0x497c8
testl %edx, %edx
je 0x1f92b
xorl %r12d, %r12d
xorl %ebp, %ebp
movl %edx, 0xc(%rsp)
movl %ebp, 0x14(%rsp)
movq 0xb8(%rbx), %r14
movq 0xc0(%rbx), %r13
cmpq %r13, %r14
je 0x1f705
movq (%r14), %rdi
callq 0x16cda
addq $0x8, %r14
jmp 0x1f6f2
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x78b0
movabsq $-0x20c49ba5e353f7cf, %rax # imm = 0xDF3B645A1CAC0831
imulq 0x20(%rsp)
movq %rdx, %rbp
movq 0x18(%rsp), %r14
cmpl $0x0, 0x10(%rsp)
jle 0x1f85c
movq %r14, 0x40(%rsp)
cmpb $0x1, 0x2a08e(%rip)     # 0x497cd
jne 0x1f755
movl 0x1b4(%rbx), %eax
movl %eax, 0x1b8(%rbx)
movq %rbx, %rdi
callq 0x20dc8
movq 0x8(%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
movl %r12d, %edx
callq *0x18(%rax)
movq 0x8(%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x20(%rax)
movq 0xa0(%rbx), %r13
movq 0xa8(%rbx), %r14
cmpq %r14, %r13
je 0x1f795
movq (%r13), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
addq $0x8, %r13
jmp 0x1f780
movq 0x8(%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x28(%rax)
callq 0x15ba0
testb %al, %al
jne 0x1f818
movq 0xb8(%rbx), %rax
movq 0xc0(%rbx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
testl %ecx, %ecx
jle 0x1f818
xorl %r13d, %r13d
movq 0xd0(%rbx), %rcx
movq 0xd8(%rbx), %rdx
subq %rcx, %rdx
shrq $0x2, %rdx
movslq %edx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %rsi, %r13
jge 0x1f7ed
movl (%rcx,%r13,4), %edx
movl %edx, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x16b00
incq %r13
movq 0xb8(%rbx), %rax
movq 0xc0(%rbx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r13
jl 0x1f7c7
movq 0x8(%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x58(%rax)
movq 0xa0(%rbx), %r13
movq 0xa8(%rbx), %r14
cmpq %r13, %r14
je 0x1f848
movq -0x8(%r14), %rdi
addq $-0x8, %r14
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x1f833
movq 0x8(%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x60(%rax)
movq 0x40(%rsp), %r14
jmp 0x1f86c
movq 0x8(%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
movl %r12d, %edx
callq *0x18(%rax)
movq %rbp, %rax
shrq $0x3f, %rax
sarq $0x7, %rbp
addq %rax, %rbp
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x78b0
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x20(%rsp)
movq 0x18(%rsp), %rax
subq %r14, %rax
movq %rdx, %rcx
shrq $0x3f, %rcx
sarq $0x7, %rdx
addq %rcx, %rdx
addq %rbp, %rdx
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
addq %rdx, %rax
movq %rax, 0x1c8(%rbx)
movq 0x8(%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
movl %r12d, %edx
callq *0x68(%rax)
movq %rbx, %rdi
callq 0x2c7a6
movl 0x14(%rsp), %ebp
movzbl %bpl, %ebp
testb %al, %al
movl $0x1, %eax
cmovel %eax, %ebp
movq %rbx, %rdi
callq 0x20e6c
cmpb $0x1, 0x29ed5(%rip)     # 0x497cd
jne 0x1f90b
movl 0x1b4(%rbx), %edi
callq 0x2d0a6
movl %eax, 0x1b4(%rbx)
movl 0xc(%rsp), %edx
testl %edx, %edx
sets %al
incl %r12d
cmpl %edx, %r12d
setne %cl
orb %al, %cl
jne 0x1f6e0
xorb $0x1, %bpl
jmp 0x1f92e
movb $0x1, %bpl
movq 0x8(%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x70(%rax)
movq 0x38(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x1f95a
leaq 0x16f6c(%rip), %rsi     # 0x368ba
movl $0x1, %edi
xorl %eax, %eax
callq 0x171d9
andb $0x1, %bpl
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop