// File: /workspace/github_cpp_makefile_star2_O3/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 0x2a812(%rip), %rsi     # 0x49858
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x2a44c
movq (%r14), %r13
movq 0x8(%r14), %rbp
movq %r14, %rdi
callq 0x2a3ee
movb $0x1, %r14b
cmpb $0x0, 0x2a6e5(%rip)     # 0x49751
jne 0x1f40d
movq %rbx, %rdi
callq 0x1fe9c
callq 0x20176
movq 0x1d0(%rbx), %r12
xorl %edx, %edx
testq %r12, %r12
setne %dl
leaq 0x15d2b(%rip), %rdi     # 0x34dc0
leaq 0x15d44(%rip), %rsi     # 0x34de0
callq 0x16e86
xorb $0x1, %al
movzbl %al, %esi
movq %rbx, %rdi
callq 0x201e0
movl %eax, 0xc(%rsp)
cmpb $0x1, 0x2a6e0(%rip)     # 0x49799
jne 0x1f0c8
movq %rbx, %rdi
callq 0x20432
jmp 0x1f40d
xorl %edx, %edx
cmpb $0x1, 0x2a6fc(%rip)     # 0x497cd
jne 0x1f129
movl 0x2a6eb(%rip), %edx     # 0x497c4
testl %edx, %edx
jne 0x1f110
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
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 0x1f18f
movl 0x2a639(%rip), %edx     # 0x497c8
testl %edx, %edx
je 0x1f3e5
movq %rbp, 0x30(%rsp)
movq %r13, 0x38(%rsp)
xorl %r12d, %r12d
xorl %r14d, %r14d
movl %edx, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq 0xb8(%rbx), %r14
movq 0xc0(%rbx), %r13
cmpq %r13, %r14
je 0x1f1d1
movq (%r14), %rdi
callq 0x168d0
addq $0x8, %r14
jmp 0x1f1be
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x78b0
movabsq $-0x20c49ba5e353f7cf, %rax # imm = 0xDF3B645A1CAC0831
imulq 0x20(%rsp)
movq %rdx, %rbp
movq 0x18(%rsp), %r13
cmpl $0x0, 0xc(%rsp)
jle 0x1f310
movq %r13, 0x40(%rsp)
cmpb $0x1, 0x2a5c2(%rip)     # 0x497cd
jne 0x1f221
movl 0x1b4(%rbx), %eax
movl %eax, 0x1b8(%rbx)
movq %rbx, %rdi
callq 0x20886
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 0x1f261
movq (%r13), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
addq $0x8, %r13
jmp 0x1f24c
movq 0x8(%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x28(%rax)
callq 0x157d0
testb %al, %al
jne 0x1f2c7
movq 0xb8(%rbx), %rax
movq 0xc0(%rbx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
testl %ecx, %ecx
jle 0x1f2c7
xorl %r13d, %r13d
movq 0xd0(%rbx), %rcx
movl (%rcx,%r13,4), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x16710
incq %r13
movq 0xb8(%rbx), %rax
movq 0xc0(%rbx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r13
jl 0x1f293
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 0x1f2f7
movq -0x8(%r14), %rdi
addq $-0x8, %r14
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x1f2e2
movq 0x8(%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x60(%rax)
movq 0x10(%rsp), %r14
movq 0x40(%rsp), %r13
jmp 0x1f325
movq 0x8(%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
movl %r12d, %edx
callq *0x18(%rax)
movq 0x10(%rsp), %r14
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 %r13, %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 0x2c06e
movl %eax, %ebp
movq %rbx, %rdi
callq 0x2092a
cmpb $0x1, 0x2a42c(%rip)     # 0x497cd
jne 0x1f3b4
movl 0x1b4(%rbx), %edi
callq 0x2c958
movl %eax, 0x1b4(%rbx)
xorb $0x1, %bpl
orb %bpl, %r14b
movl 0x8(%rsp), %edx
testl %edx, %edx
sets %al
incl %r12d
cmpl %edx, %r12d
setne %cl
orb %al, %cl
jne 0x1f1ab
xorb $0x1, %r14b
movq 0x38(%rsp), %r13
movq 0x30(%rsp), %rbp
jmp 0x1f3e8
movb $0x1, %r14b
movq 0x8(%rbx), %rsi
movq (%r15), %rax
movq %r15, %rdi
callq *0x70(%rax)
cmpq %r13, %rbp
jne 0x1f40d
leaq 0x174e9(%rip), %rsi     # 0x368ea
movl $0x1, %edi
xorl %eax, %eax
callq 0x16d9a
andb $0x1, %r14b
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop