// File: /workspace/github_cpp_makefile_star2_O1/WeihuaZhu[P]hpc_prog2/./gtest/gtest-all.cc
// Function: testing::internal::UnitTestImpl::FilterTests(testing::internal::UnitTestImpl::ReactionToSharding)
int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
  const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ?
      Int32FromEnvOrDie(kTestTotalShards, -1) : -1;
  const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ?
      Int32FromEnvOrDie(kTestShardIndex, -1) : -1;

  // 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 (size_t i = 0; i < test_cases_.size(); i++) {
    TestCase* const test_case = test_cases_[i];
    const std::string &test_case_name = test_case->name();
    test_case->set_should_run(false);

    for (size_t j = 0; j < test_case->test_info_list().size(); j++) {
      TestInfo* const test_info = test_case->test_info_list()[j];
      const std::string test_name(test_info->name());
      // A test is disabled if test case name or test name matches
      // kDisableTestFilter.
      const bool is_disabled =
          internal::UnitTestOptions::MatchesFilter(test_case_name,
                                                   kDisableTestFilter) ||
          internal::UnitTestOptions::MatchesFilter(test_name,
                                                   kDisableTestFilter);
      test_info->is_disabled_ = is_disabled;

      const bool matches_filter =
          internal::UnitTestOptions::FilterMatchesTest(test_case_name,
                                                       test_name);
      test_info->matches_filter_ = matches_filter;

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

      const bool is_selected = is_runnable &&
          (shard_tests == IGNORE_SHARDING_PROTOCOL ||
           ShouldRunTestOnShard(total_shards, shard_index,
                                num_runnable_tests));

      num_runnable_tests += is_runnable;
      num_selected_tests += is_selected;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %esi, %ebx
movq %rdi, 0x18(%rsp)
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
testl %esi, %esi
jne 0x1480c
leaq 0x12cc2(%rip), %rdi     # 0x274c0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf1f2
movl %eax, 0x8(%rsp)
testl %ebx, %ebx
jne 0x14825
leaq 0x12cc9(%rip), %rdi     # 0x274e0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf1f2
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rcx
movq 0xb8(%rcx), %rax
cmpq %rax, 0xc0(%rcx)
je 0x149a6
movl %ebx, 0x10(%rsp)
xorl %r12d, %r12d
leaq 0x48(%rsp), %rbx
xorl %r15d, %r15d
xorl %edx, %edx
movq %rdx, 0x40(%rsp)
movq (%rax,%rdx,8), %rbp
movq 0x8(%rbp), %rsi
movq %rbx, %rdi
leaq 0x20(%rsp), %rdx
callq 0x1e0be
movb $0x0, 0x70(%rbp)
movq 0x30(%rbp), %rax
cmpq %rax, 0x38(%rbp)
je 0x1495d
xorl %r13d, %r13d
movq (%rax,%r13,8), %r14
movq 0x20(%r14), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x1e0be
movl %r15d, 0x14(%rsp)
movq %rbx, %rdi
leaq 0x12c9c(%rip), %rsi     # 0x27540
callq 0x8ede
movb $0x1, %r15b
testb %al, %al
jne 0x148c4
leaq 0x20(%rsp), %rdi
leaq 0x12c84(%rip), %rsi     # 0x27540
callq 0x8ede
movl %eax, %r15d
movb %r15b, 0x59(%r14)
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
callq 0x8f3e
movb %al, 0x5a(%r14)
xorb $0x1, %r15b
orb 0x22c5e(%rip), %r15b    # 0x37542
andb %al, %r15b
movl %r15d, %ebx
cmpl $0x1, 0x10(%rsp)
je 0x14908
movl %r15d, %ebx
testb %r15b, %r15b
je 0x14908
movl %r12d, %eax
cltd
idivl 0x8(%rsp)
cmpl 0xc(%rsp), %edx
sete %bl
movb %bl, 0x58(%r14)
orb %bl, 0x70(%rbp)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x1492b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6430
movzbl %r15b, %eax
addl %eax, %r12d
movzbl %bl, %eax
movl 0x14(%rsp), %r15d
addl %eax, %r15d
incq %r13
movq 0x30(%rbp), %rax
movq 0x38(%rbp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r13
leaq 0x48(%rsp), %rbx
jb 0x1487e
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x14979
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6430
movq 0x40(%rsp), %rdx
incq %rdx
movq 0x18(%rsp), %rcx
movq 0xb8(%rcx), %rax
movq 0xc0(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %rdx
jb 0x1484f
jmp 0x149a9
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x149df
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x149df
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6430
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x149fb
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6430
movq %rbx, %rdi
callq 0x68e0
nop