// File: halfflat[P]tinyopt/test/googletest/googletest/src/gtest-death-test.cc
// Function: testing::internal::ParseInternalRunDeathTestFlag()
InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag() {
  if (GTEST_FLAG_GET(internal_run_death_test).empty()) return nullptr;

  // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we
  // can use it here.
  int line = -1;
  int index = -1;
  ::std::vector< ::std::string> fields;
  SplitString(GTEST_FLAG_GET(internal_run_death_test), '|', &fields);
  int write_fd = -1;

#ifdef GTEST_OS_WINDOWS

  unsigned int parent_process_id = 0;
  size_t write_handle_as_size_t = 0;
  size_t event_handle_as_size_t = 0;

  if (fields.size() != 6 || !ParseNaturalNumber(fields[1], &line) ||
      !ParseNaturalNumber(fields[2], &index) ||
      !ParseNaturalNumber(fields[3], &parent_process_id) ||
      !ParseNaturalNumber(fields[4], &write_handle_as_size_t) ||
      !ParseNaturalNumber(fields[5], &event_handle_as_size_t)) {
    DeathTestAbort("Bad --gtest_internal_run_death_test flag: " +
                   GTEST_FLAG_GET(internal_run_death_test));
  }
  write_fd = GetStatusFileDescriptor(parent_process_id, write_handle_as_size_t,
                                     event_handle_as_size_t);

#elif defined(GTEST_OS_FUCHSIA)

  if (fields.size() != 3 || !ParseNaturalNumber(fields[1], &line) ||
      !ParseNaturalNumber(fields[2], &index)) {
    DeathTestAbort("Bad --gtest_internal_run_death_test flag: " +
                   GTEST_FLAG_GET(internal_run_death_test));
  }

#else

  if (fields.size() != 4 || !ParseNaturalNumber(fields[1], &line) ||
      !ParseNaturalNumber(fields[2], &index) ||
      !ParseNaturalNumber(fields[3], &write_fd)) {
    DeathTestAbort("Bad --gtest_internal_run_death_test flag: " +
                   GTEST_FLAG_GET(internal_run_death_test));
  }

#endif  // GTEST_OS_WINDOWS

  return new InternalRunDeathTestFlag(fields[0], line, index, write_fd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
leaq 0x9ccf1(%rip), %rdi     # 0x117a70
callq 0x10d70
testb $0x1, %al
jne 0x7ad8a
jmp 0x7ad97
movq $0x0, -0x8(%rbp)
jmp 0x7af0d
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x10(%rbp) # imm = 0xFFFFFFFF
leaq -0x28(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0x39120
movq -0x60(%rbp), %rdx
leaq 0x9ccb3(%rip), %rdi     # 0x117a70
movl $0x7c, %esi
callq 0x7af20
jmp 0x7adc9
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
leaq -0x28(%rbp), %rdi
callq 0x3bb30
cmpq $0x4, %rax
jne 0x7ae57
leaq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0xa37a0
movq %rax, %rdi
leaq -0xc(%rbp), %rsi
callq 0xa3660
movb %al, -0x61(%rbp)
jmp 0x7adfe
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x7ae07
jmp 0x7ae57
leaq -0x28(%rbp), %rdi
movl $0x2, %esi
callq 0xa37a0
movq %rax, %rdi
leaq -0x10(%rbp), %rsi
callq 0xa3660
movb %al, -0x62(%rbp)
jmp 0x7ae26
movb -0x62(%rbp), %al
testb $0x1, %al
jne 0x7ae2f
jmp 0x7ae57
leaq -0x28(%rbp), %rdi
movl $0x3, %esi
callq 0xa37a0
movq %rax, %rdi
leaq -0x38(%rbp), %rsi
callq 0xa3660
movb %al, -0x63(%rbp)
jmp 0x7ae4e
movb -0x63(%rbp), %al
testb $0x1, %al
jne 0x7aea0
jmp 0x7ae57
leaq 0x52e92(%rip), %rsi     # 0xcdcf0
leaq 0x9cc0b(%rip), %rdx     # 0x117a70
leaq -0x58(%rbp), %rdi
callq 0x39dc0
jmp 0x7ae70
leaq -0x58(%rbp), %rdi
callq 0x76110
jmp 0x7ae7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x7af02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x10fc8
jmp 0x7af02
movl $0x30, %edi
callq 0x10740
movq %rax, -0x70(%rbp)
jmp 0x7aeb0
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0xa37a0
movq -0x70(%rbp), %rdi
movq %rax, %rsi
movl -0xc(%rbp), %edx
movl -0x10(%rbp), %ecx
movl -0x38(%rbp), %r8d
callq 0xa37c0
jmp 0x7aed5
movq -0x70(%rbp), %rax
movq %rax, -0x8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x390a0
jmp 0x7af0d
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl $0x30, %esi
callq 0x10770
leaq -0x28(%rbp), %rdi
callq 0x390a0
jmp 0x7af17
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x10e00