// File: /workspace/github_cpp_makefile_star2_O1/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
movl %esi, %r15d
movq %rdi, %r14
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x10(%rsp) # imm = 0xFFFFFFFF
testl %esi, %esi
jne 0x5fc8e
leaq 0x12150(%rip), %rdi     # 0x71dd0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x53fb9
movl %eax, 0x10(%rsp)
testl %r15d, %r15d
jne 0x5fca8
leaq 0x12156(%rip), %rdi     # 0x71df0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x53fb9
movl %eax, 0x14(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x4d034
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1218b(%rip), %rsi     # 0x71e50
leaq 0x1219b(%rip), %rdx     # 0x71e67
leaq 0x18(%rsp), %rdi
callq 0x15892
leaq 0x78(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x4cd8e
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x5fd01
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xd530
movq 0xb8(%r14), %rbx
movq 0xc0(%r14), %rax
movq %rax, 0x68(%rsp)
cmpq %rax, %rbx
je 0x5fea1
movq $0x0, 0x38(%rsp)
xorl %r14d, %r14d
movl %r15d, 0x40(%rsp)
movq (%rbx), %r12
movq 0x8(%r12), %rsi
leaq 0x18(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x208e8
movq %rbx, 0x70(%rsp)
movb $0x0, 0x70(%r12)
movq 0x30(%r12), %rax
cmpq %rax, 0x38(%r12)
je 0x5fe6f
xorl %ebp, %ebp
leaq 0x48(%rsp), %rbx
movl %r14d, 0x44(%rsp)
movq (%rax,%rbp,8), %r13
movq 0x20(%r13), %rsi
movq %rbx, %rdi
leaq 0xf(%rsp), %rdx
callq 0x208e8
leaq 0x78(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x4ce9c
movb $0x1, %r14b
testb %al, %al
jne 0x5fda7
leaq 0x78(%rsp), %rdi
movq %rbx, %rsi
callq 0x4ce9c
movl %eax, %r14d
movb %r14b, 0x81(%r13)
leaq 0xc8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
movq %rbx, %rdx
callq 0x4d4e8
movl %eax, %ebx
movb %al, 0x82(%r13)
xorb $0x1, %r14b
orb 0x36adc(%rip), %r14b    # 0x968b3
cmpl $0x1, %r15d
jne 0x5fde2
xorl %r15d, %r15d
jmp 0x5fdf4
movq 0x38(%rsp), %rax
cltd
idivl 0x10(%rsp)
cmpl 0x14(%rsp), %edx
setne %r15b
andb %r14b, %bl
movb %r15b, 0x83(%r13)
xorb $0x1, %r15b
andb %bl, %r15b
movb %r15b, 0x80(%r13)
orb %r15b, 0x70(%r12)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x5fe2d
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), %r14d
addl %eax, %r14d
incq %rbp
movq 0x30(%r12), %rax
movq 0x38(%r12), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %rbp
movl 0x40(%rsp), %r15d
leaq 0x48(%rsp), %rbx
jb 0x5fd67
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x5fe8b
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xd530
movq 0x70(%rsp), %rbx
addq $0x8, %rbx
cmpq 0x68(%rsp), %rbx
jne 0x5fd2e
jmp 0x5fea4
xorl %r14d, %r14d
leaq 0x90(%rsp), %rdi
callq 0x6802e
leaq 0x78(%rsp), %rdi
callq 0x20fca
leaq 0x118(%rsp), %rbx
leaq 0x130(%rsp), %rdi
callq 0x6802e
movq %rbx, %rdi
callq 0x20fca
leaq 0xe0(%rsp), %rdi
callq 0x6802e
leaq 0xc8(%rsp), %rdi
callq 0x20fca
movl %r14d, %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 0x5ff8b
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x5ff8b
movq %rax, %rbx
jmp 0x5ff8b
movq %rax, %rbx
jmp 0x5ff74
jmp 0x5ff39
movq %rax, %rbx
jmp 0x5ff58
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x5ff58
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xd530
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x5ff74
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xd530
leaq 0x90(%rsp), %rdi
callq 0x6802e
leaq 0x78(%rsp), %rdi
callq 0x20fca
leaq 0xc8(%rsp), %rdi
callq 0x4d62a
movq %rbx, %rdi
callq 0xda70