// File: WeihuaZhu[P]hpc_prog2/./gtest/gtest-all.cc
// Function: testing::internal::ShouldShard(char const*, char const*, bool)
bool ShouldShard(const char* total_shards_env,
                 const char* shard_index_env,
                 bool in_subprocess_for_death_test) {
  if (in_subprocess_for_death_test) {
    return false;
  }

  const Int32 total_shards = Int32FromEnvOrDie(total_shards_env, -1);
  const Int32 shard_index = Int32FromEnvOrDie(shard_index_env, -1);

  if (total_shards == -1 && shard_index == -1) {
    return false;
  } else if (total_shards == -1 && shard_index != -1) {
    const Message msg = Message()
      << "Invalid environment variables: you have "
      << kTestShardIndex << " = " << shard_index
      << ", but have left " << kTestTotalShards << " unset.\n";
    ColoredPrintf(COLOR_RED, msg.GetString().c_str());
    fflush(stdout);
    exit(EXIT_FAILURE);
  } else if (total_shards != -1 && shard_index == -1) {
    const Message msg = Message()
      << "Invalid environment variables: you have "
      << kTestTotalShards << " = " << total_shards
      << ", but have left " << kTestShardIndex << " unset.\n";
    ColoredPrintf(COLOR_RED, msg.GetString().c_str());
    fflush(stdout);
    exit(EXIT_FAILURE);
  } else if (shard_index < 0 || shard_index >= total_shards) {
    const Message msg = Message()
      << "Invalid environment variables: we require 0 <= "
      << kTestShardIndex << " < " << kTestTotalShards
      << ", but you have " << kTestShardIndex << "=" << shard_index
      << ", " << kTestTotalShards << "=" << total_shards << ".\n";
    ColoredPrintf(COLOR_RED, msg.GetString().c_str());
    fflush(stdout);
    exit(EXIT_FAILURE);
  }

  return total_shards > 1;
}

// Assembly:
subq $0x1b8, %rsp            # imm = 0x1B8
movb %dl, %al
movq %rdi, 0x1a8(%rsp)
movq %rsi, 0x1a0(%rsp)
andb $0x1, %al
movb %al, 0x19f(%rsp)
testb $0x1, 0x19f(%rsp)
je 0x20179
movb $0x0, 0x1b7(%rsp)
jmp 0x20811
movq 0x1a8(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x20830
movl %eax, 0x198(%rsp)
movq 0x1a0(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x20830
movl %eax, 0x194(%rsp)
cmpl $-0x1, 0x198(%rsp)
jne 0x201cc
cmpl $-0x1, 0x194(%rsp)
jne 0x201cc
movb $0x0, 0x1b7(%rsp)
jmp 0x20811
cmpl $-0x1, 0x198(%rsp)
jne 0x203c0
cmpl $-0x1, 0x194(%rsp)
je 0x203c0
leaq 0x180(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
callq 0x192e0
movq 0xe0(%rsp), %rdi
leaq 0x2d469(%rip), %rsi     # 0x4d675
callq 0x38b90
movq %rax, 0xe8(%rsp)
jmp 0x2021b
movq 0xe8(%rsp), %rdi
leaq 0x2b7a6(%rip), %rsi     # 0x4b9d0
callq 0x34f80
movq %rax, 0xd8(%rsp)
jmp 0x20239
movq 0xd8(%rsp), %rdi
leaq 0x2d4e1(%rip), %rsi     # 0x4d729
callq 0x36f10
movq %rax, 0xd0(%rsp)
jmp 0x20257
movq 0xd0(%rsp), %rdi
leaq 0x194(%rsp), %rsi
callq 0x10540
movq %rax, 0xc8(%rsp)
jmp 0x20276
movq 0xc8(%rsp), %rdi
leaq 0x2d419(%rip), %rsi     # 0x4d69e
callq 0x33600
movq %rax, 0xc0(%rsp)
jmp 0x20294
movq 0xc0(%rsp), %rdi
leaq 0x2b70d(%rip), %rsi     # 0x4b9b0
callq 0x38bd0
movq %rax, 0xb8(%rsp)
jmp 0x202b2
movq 0xb8(%rsp), %rdi
leaq 0x2d3ee(%rip), %rsi     # 0x4d6af
callq 0x38c10
movq %rax, 0xb0(%rsp)
jmp 0x202d0
movq 0xb0(%rsp), %rsi
leaq 0x188(%rsp), %rdi
callq 0x38c50
jmp 0x202e7
leaq 0x180(%rsp), %rdi
callq 0x105d0
leaq 0x150(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x196c0
jmp 0x2030b
leaq 0x150(%rsp), %rdi
callq 0xe370
movq %rax, %rsi
xorl %eax, %eax
movl $0x1, %edi
callq 0x1fcc0
jmp 0x20329
leaq 0x150(%rsp), %rdi
callq 0xf698
movq 0x44c43(%rip), %rax     # 0x64f80
movq (%rax), %rdi
callq 0xecc0
jmp 0x20347
movl $0x1, %edi
callq 0xed40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x180(%rsp), %rdi
callq 0x105d0
jmp 0x20822
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
jmp 0x203ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x150(%rsp), %rdi
callq 0xf698
leaq 0x188(%rsp), %rdi
callq 0x105d0
jmp 0x20822
cmpl $-0x1, 0x198(%rsp)
je 0x205a8
cmpl $-0x1, 0x194(%rsp)
jne 0x205a8
leaq 0x140(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0x192e0
movq 0xa0(%rsp), %rdi
leaq 0x2d275(%rip), %rsi     # 0x4d675
callq 0x38b90
movq %rax, 0xa8(%rsp)
jmp 0x2040f
movq 0xa8(%rsp), %rdi
leaq 0x2b592(%rip), %rsi     # 0x4b9b0
callq 0x38bd0
movq %rax, 0x98(%rsp)
jmp 0x2042d
movq 0x98(%rsp), %rdi
leaq 0x2d2ed(%rip), %rsi     # 0x4d729
callq 0x36f10
movq %rax, 0x90(%rsp)
jmp 0x2044b
movq 0x90(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0x10540
movq %rax, 0x88(%rsp)
jmp 0x2046a
movq 0x88(%rsp), %rdi
leaq 0x2d225(%rip), %rsi     # 0x4d69e
callq 0x33600
movq %rax, 0x80(%rsp)
jmp 0x20488
movq 0x80(%rsp), %rdi
leaq 0x2b539(%rip), %rsi     # 0x4b9d0
callq 0x34f80
movq %rax, 0x78(%rsp)
jmp 0x204a3
movq 0x78(%rsp), %rdi
leaq 0x2d200(%rip), %rsi     # 0x4d6af
callq 0x38c10
movq %rax, 0x70(%rsp)
jmp 0x204bb
movq 0x70(%rsp), %rsi
leaq 0x148(%rsp), %rdi
callq 0x38c50
jmp 0x204cf
leaq 0x140(%rsp), %rdi
callq 0x105d0
leaq 0x120(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x196c0
jmp 0x204f3
leaq 0x120(%rsp), %rdi
callq 0xe370
movq %rax, %rsi
xorl %eax, %eax
movl $0x1, %edi
callq 0x1fcc0
jmp 0x20511
leaq 0x120(%rsp), %rdi
callq 0xf698
movq 0x44a5b(%rip), %rax     # 0x64f80
movq (%rax), %rdi
callq 0xecc0
jmp 0x2052f
movl $0x1, %edi
callq 0xed40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x105d0
jmp 0x20822
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
jmp 0x20596
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x120(%rsp), %rdi
callq 0xf698
leaq 0x148(%rsp), %rdi
callq 0x105d0
jmp 0x20822
cmpl $0x0, 0x194(%rsp)
jl 0x205c6
movl 0x194(%rsp), %eax
cmpl 0x198(%rsp), %eax
jl 0x207f7
leaq 0x110(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x192e0
movq 0x60(%rsp), %rdi
leaq 0x2d0d4(%rip), %rsi     # 0x4d6b8
callq 0x38d50
movq %rax, 0x68(%rsp)
jmp 0x205f0
movq 0x68(%rsp), %rdi
leaq 0x2b3d4(%rip), %rsi     # 0x4b9d0
callq 0x34f80
movq %rax, 0x58(%rsp)
jmp 0x20608
movq 0x58(%rsp), %rdi
leaq 0x2d0d4(%rip), %rsi     # 0x4d6e8
callq 0x36f10
movq %rax, 0x50(%rsp)
jmp 0x20620
movq 0x50(%rsp), %rdi
leaq 0x2b384(%rip), %rsi     # 0x4b9b0
callq 0x38bd0
movq %rax, 0x48(%rsp)
jmp 0x20638
movq 0x48(%rsp), %rdi
leaq 0x2d0a8(%rip), %rsi     # 0x4d6ec
callq 0x38d90
movq %rax, 0x40(%rsp)
jmp 0x20650
movq 0x40(%rsp), %rdi
leaq 0x2b374(%rip), %rsi     # 0x4b9d0
callq 0x34f80
movq %rax, 0x38(%rsp)
jmp 0x20668
movq 0x38(%rsp), %rdi
leaq 0x2da68(%rip), %rsi     # 0x4e0dc
callq 0x32e50
movq %rax, 0x30(%rsp)
jmp 0x20680
movq 0x30(%rsp), %rdi
leaq 0x194(%rsp), %rsi
callq 0x10540
movq %rax, 0x28(%rsp)
jmp 0x20699
movq 0x28(%rsp), %rdi
leaq 0x2dee6(%rip), %rsi     # 0x4e58b
callq 0x33640
movq %rax, 0x20(%rsp)
jmp 0x206b1
movq 0x20(%rsp), %rdi
leaq 0x2b2f3(%rip), %rsi     # 0x4b9b0
callq 0x38bd0
movq %rax, 0x18(%rsp)
jmp 0x206c9
movq 0x18(%rsp), %rdi
leaq 0x2da07(%rip), %rsi     # 0x4e0dc
callq 0x32e50
movq %rax, 0x10(%rsp)
jmp 0x206e1
movq 0x10(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0x10540
movq %rax, 0x8(%rsp)
jmp 0x206fa
movq 0x8(%rsp), %rdi
leaq 0x2c9b1(%rip), %rsi     # 0x4d0b7
callq 0x33640
movq %rax, (%rsp)
jmp 0x20711
movq (%rsp), %rsi
leaq 0x118(%rsp), %rdi
callq 0x38c50
jmp 0x20724
leaq 0x110(%rsp), %rdi
callq 0x105d0
leaq 0xf0(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x196c0
jmp 0x20748
leaq 0xf0(%rsp), %rdi
callq 0xe370
movq %rax, %rsi
xorl %eax, %eax
movl $0x1, %edi
callq 0x1fcc0
jmp 0x20766
leaq 0xf0(%rsp), %rdi
callq 0xf698
movq 0x44806(%rip), %rax     # 0x64f80
movq (%rax), %rdi
callq 0xecc0
jmp 0x20784
movl $0x1, %edi
callq 0xed40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x105d0
jmp 0x20822
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
jmp 0x207e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xf698
leaq 0x118(%rsp), %rdi
callq 0x105d0
jmp 0x20822
jmp 0x207f9
jmp 0x207fb
jmp 0x207fd
cmpl $0x1, 0x198(%rsp)
setg %al
andb $0x1, %al
movb %al, 0x1b7(%rsp)
movb 0x1b7(%rsp), %al
andb $0x1, %al
addq $0x1b8, %rsp            # imm = 0x1B8
retq
movq 0x178(%rsp), %rdi
callq 0xf410
nop