// File: /workspace/github_cpp_makefile_star2_O3/halfflat[P]tinyopt/test/googletest/googletest/src/gtest.cc
// Function: testing::internal::UnitTestImpl::FilterTests(testing::internal::UnitTestImpl::ReactionToSharding)
int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
  const int32_t total_shards = shard_tests == HONOR_SHARDING_PROTOCOL
                                   ? Int32FromEnvOrDie(kTestTotalShards, -1)
                                   : -1;
  const int32_t shard_index = shard_tests == HONOR_SHARDING_PROTOCOL
                                  ? Int32FromEnvOrDie(kTestShardIndex, -1)
                                  : -1;

  const PositiveAndNegativeUnitTestFilter gtest_flag_filter(
      GTEST_FLAG_GET(filter));
  const UnitTestFilter disable_test_filter(kDisableTestFilter);
  // num_runnable_tests are the number of tests that will
  // run across all shards (i.e., match filter and are not disabled).
  // num_selected_tests are the number of tests to be run on
  // this shard.
  int num_runnable_tests = 0;
  int num_selected_tests = 0;
  for (auto* test_suite : test_suites_) {
    const std::string& test_suite_name = test_suite->name();
    test_suite->set_should_run(false);

    for (size_t j = 0; j < test_suite->test_info_list().size(); j++) {
      TestInfo* const test_info = test_suite->test_info_list()[j];
      const std::string test_name(test_info->name());
      // A test is disabled if test suite name or test name matches
      // kDisableTestFilter.
      const bool is_disabled =
          disable_test_filter.MatchesName(test_suite_name) ||
          disable_test_filter.MatchesName(test_name);
      test_info->is_disabled_ = is_disabled;

      const bool matches_filter =
          gtest_flag_filter.MatchesTest(test_suite_name, test_name);
      test_info->matches_filter_ = matches_filter;

      const bool is_runnable =
          (GTEST_FLAG_GET(also_run_disabled_tests) || !is_disabled) &&
          matches_filter;

      const bool is_in_another_shard =
          shard_tests != IGNORE_SHARDING_PROTOCOL &&
          !ShouldRunTestOnShard(total_shards, shard_index, num_runnable_tests);
      test_info->is_in_another_shard_ = is_in_another_shard;
      const bool is_selected = is_runnable && !is_in_another_shard;

      num_runnable_tests += is_runnable;
      num_selected_tests += is_selected;

      test_info->should_run_ = is_selected;
      test_suite->set_should_run(test_suite->should_run() || is_selected);
    }
  }
  return num_selected_tests;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdi, %r14
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x10(%rsp) # imm = 0xFFFFFFFF
movl %esi, 0x40(%rsp)
testl %esi, %esi
jne 0x5e2d6
leaq 0x11afd(%rip), %rdi     # 0x6fdb0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x52657
movl %eax, 0x14(%rsp)
leaq 0x11b08(%rip), %rdi     # 0x6fdd0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x52657
movl %eax, 0x10(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x4b848
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x11b3d(%rip), %rsi     # 0x6fe30
leaq 0x11b4d(%rip), %rdx     # 0x6fe47
leaq 0x18(%rsp), %rdi
callq 0x1558a
leaq 0x78(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x4b554
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x5e32f
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xd530
movq 0xb8(%r14), %rbx
movq 0xc0(%r14), %rax
movq %rax, 0x68(%rsp)
cmpq %rax, %rbx
je 0x5e4cb
movq $0x0, 0x38(%rsp)
xorl %r15d, %r15d
movq (%rbx), %r12
movq 0x8(%r12), %rsi
leaq 0x18(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x2008e
movq %rbx, 0x70(%rsp)
movb $0x0, 0x70(%r12)
movq 0x30(%r12), %rax
cmpq %rax, 0x38(%r12)
je 0x5e499
xorl %ebp, %ebp
leaq 0x48(%rsp), %rbx
movq (%rax,%rbp,8), %r14
movq 0x20(%r14), %rsi
movq %rbx, %rdi
leaq 0xf(%rsp), %rdx
callq 0x2008e
leaq 0x78(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x4b662
movb $0x1, %r13b
testb %al, %al
jne 0x5e3cb
leaq 0x78(%rsp), %rdi
movq %rbx, %rsi
callq 0x4b662
movl %eax, %r13d
movb %r13b, 0x81(%r14)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0xc8(%rsp), %rdi
movq %rbx, %rcx
callq 0x4bca0
movl %eax, %ebx
movl %r15d, 0x44(%rsp)
movb %al, 0x82(%r14)
xorb $0x1, %r13b
orb 0x364ae(%rip), %r13b    # 0x948b3
cmpl $0x1, 0x40(%rsp)
jne 0x5e411
xorl %r15d, %r15d
jmp 0x5e423
movq 0x38(%rsp), %rax
cltd
idivl 0x14(%rsp)
cmpl 0x10(%rsp), %edx
setne %r15b
andb %r13b, %bl
movb %r15b, 0x83(%r14)
xorb $0x1, %r15b
andb %bl, %r15b
movb %r15b, 0x80(%r14)
orb %r15b, 0x70(%r12)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x5e45c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xd530
movzbl %bl, %eax
movq 0x38(%rsp), %rcx
addl %eax, %ecx
movq %rcx, 0x38(%rsp)
movzbl %r15b, %eax
movl 0x44(%rsp), %r15d
addl %eax, %r15d
incq %rbp
movq 0x30(%r12), %rax
movq 0x38(%r12), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %rbp
leaq 0x48(%rsp), %rbx
jb 0x5e390
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x5e4b5
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xd530
movq 0x70(%rsp), %rbx
addq $0x8, %rbx
cmpq 0x68(%rsp), %rbx
jne 0x5e357
jmp 0x5e4ce
xorl %r15d, %r15d
leaq 0x90(%rsp), %rdi
callq 0x667ae
leaq 0x78(%rsp), %rdi
callq 0x20770
leaq 0x118(%rsp), %rbx
leaq 0x130(%rsp), %rdi
callq 0x667ae
movq %rbx, %rdi
callq 0x20770
leaq 0xe0(%rsp), %rdi
callq 0x667ae
leaq 0xc8(%rsp), %rdi
callq 0x20770
movl %r15d, %eax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x5e5b5
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x5e5b5
movq %rax, %rbx
jmp 0x5e5b5
movq %rax, %rbx
jmp 0x5e59e
jmp 0x5e563
movq %rax, %rbx
jmp 0x5e582
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x5e582
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xd530
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x5e59e
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xd530
leaq 0x90(%rsp), %rdi
callq 0x667ae
leaq 0x78(%rsp), %rdi
callq 0x20770
leaq 0xc8(%rsp), %rdi
callq 0x4bdd8
movq %rbx, %rdi
callq 0xda70