// File: 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:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x110(%rsp)
movl %esi, 0x10c(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x68(%rsp)
cmpl $0x0, 0x10c(%rsp)
jne 0x27fe4
leaq 0x239dc(%rip), %rdi     # 0x4b9b0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x20830
movl %eax, 0x64(%rsp)
jmp 0x27fef
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x64(%rsp)
jmp 0x27fef
movl 0x64(%rsp), %eax
movl %eax, 0x108(%rsp)
cmpl $0x0, 0x10c(%rsp)
jne 0x2801b
leaq 0x239c5(%rip), %rdi     # 0x4b9d0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x20830
movl %eax, 0x60(%rsp)
jmp 0x28026
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x60(%rsp)
jmp 0x28026
movl 0x60(%rsp), %eax
movl %eax, 0x104(%rsp)
movl $0x0, 0x100(%rsp)
movl $0x0, 0xfc(%rsp)
movq $0x0, 0xf0(%rsp)
movq 0x68(%rsp), %rdi
movq 0xf0(%rsp), %rax
movq %rax, 0x58(%rsp)
addq $0xb8, %rdi
callq 0x33480
movq %rax, %rcx
movq 0x58(%rsp), %rax
cmpq %rcx, %rax
jae 0x2843b
movq 0x68(%rsp), %rdi
addq $0xb8, %rdi
movq 0xf0(%rsp), %rsi
callq 0x38e10
movq (%rax), %rax
movq %rax, 0xe8(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x36950
movq %rax, 0x48(%rsp)
leaq 0xbf(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xf420
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0xc0(%rsp), %rdi
callq 0x32980
jmp 0x280e3
leaq 0xbf(%rsp), %rdi
callq 0xeb40
leaq 0xc0(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq 0xe8(%rsp), %rdi
xorl %esi, %esi
callq 0x38e30
jmp 0x28111
movq $0x0, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x38e50
movq %rax, 0x40(%rsp)
jmp 0x2813e
movq 0x40(%rsp), %rdi
callq 0x36280
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x28406
movq 0xe8(%rsp), %rdi
callq 0x38e50
movq %rax, 0x30(%rsp)
jmp 0x2816d
movq 0x30(%rsp), %rdi
movq 0xa0(%rsp), %rsi
callq 0x36430
movq (%rax), %rax
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rdi
callq 0x35510
movq %rax, 0x28(%rsp)
jmp 0x2819e
leaq 0x77(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xf420
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x78(%rsp), %rdi
callq 0x32980
jmp 0x281c3
leaq 0x77(%rsp), %rdi
callq 0xeb40
movq 0xe0(%rsp), %rdi
leaq 0x23854(%rip), %rsi     # 0x4ba30
callq 0x17c40
movb %al, 0x1f(%rsp)
jmp 0x281e7
movb 0x1f(%rsp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, 0x1e(%rsp)
jne 0x28219
jmp 0x281f8
leaq 0x23831(%rip), %rsi     # 0x4ba30
leaq 0x78(%rsp), %rdi
callq 0x17c40
movb %al, 0x1d(%rsp)
jmp 0x2820f
movb 0x1d(%rsp), %al
movb %al, 0x1e(%rsp)
jmp 0x28219
movb 0x1e(%rsp), %al
andb $0x1, %al
movb %al, 0x76(%rsp)
movb 0x76(%rsp), %cl
movq 0x98(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x59(%rax)
movq 0xe0(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x17cd0
movb %al, 0x1c(%rsp)
jmp 0x2824d
movb 0x1c(%rsp), %al
andb $0x1, %al
movb %al, 0x75(%rsp)
movb 0x75(%rsp), %cl
movq 0x98(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x5a(%rax)
testb $0x1, 0x3d92a(%rip)     # 0x65b9a
jne 0x2827f
xorl %eax, %eax
testb $0x1, 0x76(%rsp)
movb %al, 0x1b(%rsp)
jne 0x28287
movb 0x75(%rsp), %al
movb %al, 0x1b(%rsp)
movb 0x1b(%rsp), %al
andb $0x1, %al
movb %al, 0x74(%rsp)
xorl %eax, %eax
testb $0x1, 0x74(%rsp)
movb %al, 0x1a(%rsp)
je 0x282d4
movb $0x1, %al
cmpl $0x1, 0x10c(%rsp)
movb %al, 0x19(%rsp)
je 0x282cc
movl 0x108(%rsp), %edi
movl 0x104(%rsp), %esi
movl 0x100(%rsp), %edx
callq 0x28bb0
movb %al, 0x19(%rsp)
movb 0x19(%rsp), %al
movb %al, 0x1a(%rsp)
movb 0x1a(%rsp), %al
andb $0x1, %al
movb %al, 0x73(%rsp)
movzbl 0x74(%rsp), %ecx
andl $0x1, %ecx
movl 0x100(%rsp), %eax
addl %ecx, %eax
movl %eax, 0x100(%rsp)
movzbl 0x73(%rsp), %ecx
andl $0x1, %ecx
movl 0xfc(%rsp), %eax
addl %ecx, %eax
movl %eax, 0xfc(%rsp)
movb 0x73(%rsp), %cl
movq 0x98(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x58(%rax)
movq 0xe8(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x36ad0
movb %al, 0x18(%rsp)
jmp 0x28338
movb 0x18(%rsp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, 0xf(%rsp)
jne 0x28351
jmp 0x28349
movb 0x73(%rsp), %al
movb %al, 0xf(%rsp)
movq 0x10(%rsp), %rdi
movb 0xf(%rsp), %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x38e30
jmp 0x28367
leaq 0x78(%rsp), %rdi
callq 0xf698
movq 0xa0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xa0(%rsp)
jmp 0x2811d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0xbf(%rsp), %rdi
callq 0xeb40
jmp 0x2844a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
jmp 0x2842c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0x77(%rsp), %rdi
callq 0xeb40
jmp 0x2842c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0x78(%rsp), %rdi
callq 0xf698
jmp 0x2842c
leaq 0xc0(%rsp), %rdi
callq 0xf698
movq 0xf0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xf0(%rsp)
jmp 0x28053
leaq 0xc0(%rsp), %rdi
callq 0xf698
jmp 0x2844a
movl 0xfc(%rsp), %eax
addq $0x118, %rsp            # imm = 0x118
retq
movq 0xb0(%rsp), %rdi
callq 0xf410
nopw (%rax,%rax)