// File: halfflat[P]tinyopt/test/googletest/googletest/src/gtest-death-test.cc
// Function: testing::internal::ExecDeathTestChildMain(void*)
static int ExecDeathTestChildMain(void* child_arg) {
  ExecDeathTestArgs* const args = static_cast<ExecDeathTestArgs*>(child_arg);
  GTEST_DEATH_TEST_CHECK_SYSCALL_(close(args->close_fd));

  // We need to execute the test program in the same environment where
  // it was originally invoked.  Therefore we change to the original
  // working directory first.
  const char* const original_dir =
      UnitTest::GetInstance()->original_working_dir();
  // We can safely call chdir() as it's a direct system call.
  if (chdir(original_dir) != 0) {
    DeathTestAbort(std::string("chdir(\"") + original_dir +
                   "\") failed: " + GetLastErrnoDescription());
    return EXIT_FAILURE;
  }

  // We can safely call execv() as it's almost a direct system call. We
  // cannot use execvp() as it's a libc function and thus potentially
  // unsafe.  Since execv() doesn't search the PATH, the user must
  // invoke the test program via a valid path that contains at least
  // one path separator.
  execv(args->argv[0], args->argv);
  DeathTestAbort(std::string("execv(") + args->argv[0] + ", ...) in " +
                 original_dir + " failed: " + GetLastErrnoDescription());
  return EXIT_FAILURE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x9d539
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x10f60
movl %eax, -0x14(%rbp)
xorl %eax, %eax
cmpl $-0x1, -0x14(%rbp)
movb %al, -0x2d1(%rbp)
jne 0x9d567
callq 0x10080
cmpl $0x4, (%rax)
sete %al
movb %al, -0x2d1(%rbp)
movb -0x2d1(%rbp), %al
testb $0x1, %al
jne 0x9d539
cmpl $-0x1, -0x14(%rbp)
jne 0x9d793
leaq -0xf9(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x10e10
movq -0x2e0(%rbp), %rdx
leaq 0x30490(%rip), %rsi     # 0xcda2c
leaq -0xf8(%rbp), %rdi
callq 0x1d070
jmp 0x9d5aa
leaq 0x303a5(%rip), %rdx     # 0xcd956
leaq -0xd8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0xa2b40
jmp 0x9d5c6
leaq 0x30473(%rip), %rdx     # 0xcda40
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0xa2b40
jmp 0x9d5e2
movl $0x4a3, -0x134(%rbp)    # imm = 0x4A3
leaq -0x130(%rbp), %rdi
leaq -0x134(%rbp), %rsi
callq 0xa2c60
jmp 0x9d601
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0x130(%rbp), %rdx
callq 0xa2b90
jmp 0x9d61d
leaq 0x31a5a(%rip), %rdx     # 0xcf07e
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xa2b40
jmp 0x9d636
leaq 0x32186(%rip), %rdx     # 0xcf7c3
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0xa2b40
jmp 0x9d64c
leaq 0x3060a(%rip), %rdx     # 0xcdc5d
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xa2b40
jmp 0x9d662
leaq -0x38(%rbp), %rdi
callq 0x76110
jmp 0x9d66d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9d782
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9d776
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9d76a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9d75e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9d752
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9d746
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9d73d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9d734
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x10fc8
leaq -0x58(%rbp), %rdi
callq 0x10fc8
leaq -0x78(%rbp), %rdi
callq 0x10fc8
leaq -0x98(%rbp), %rdi
callq 0x10fc8
leaq -0x130(%rbp), %rdi
callq 0x10fc8
leaq -0xb8(%rbp), %rdi
callq 0x10fc8
leaq -0xd8(%rbp), %rdi
callq 0x10fc8
leaq -0xf8(%rbp), %rdi
callq 0x10fc8
leaq -0xf9(%rbp), %rdi
callq 0x10810
jmp 0x9db20
jmp 0x9d795
callq 0xa2ce0
testb $0x1, %al
jne 0x9d537
callq 0x80640
movq %rax, %rdi
callq 0x826b0
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rdi
callq 0x10c20
cmpl $0x0, %eax
je 0x9d930
leaq -0x1c1(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x10e10
movq -0x2e8(%rbp), %rdx
leaq 0x31fed(%rip), %rsi     # 0xcf7d9
leaq -0x1c0(%rbp), %rdi
callq 0x1d070
jmp 0x9d7fa
movq -0x140(%rbp), %rdx
leaq -0x1a0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xa2b40
jmp 0x9d816
leaq 0x31fc4(%rip), %rdx     # 0xcf7e1
leaq -0x180(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0xa2b40
jmp 0x9d832
leaq -0x1e8(%rbp), %rdi
callq 0x75fc0
jmp 0x9d840
leaq -0x160(%rbp), %rdi
leaq -0x180(%rbp), %rsi
leaq -0x1e8(%rbp), %rdx
callq 0xa2b90
jmp 0x9d85c
leaq -0x160(%rbp), %rdi
callq 0x76110
jmp 0x9d86a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9d91f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9d913
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9d907
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9d8fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9d8ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x10fc8
leaq -0x1e8(%rbp), %rdi
callq 0x10fc8
leaq -0x180(%rbp), %rdi
callq 0x10fc8
leaq -0x1a0(%rbp), %rdi
callq 0x10fc8
leaq -0x1c0(%rbp), %rdi
callq 0x10fc8
leaq -0x1c1(%rbp), %rdi
callq 0x10810
jmp 0x9db20
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq (%rsi), %rdi
callq 0x106c0
leaq -0x2a9(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x10e10
movq -0x2f0(%rbp), %rdx
leaq 0x31e8d(%rip), %rsi     # 0xcf7ed
leaq -0x2a8(%rbp), %rdi
callq 0x1d070
jmp 0x9d96e
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdx
leaq -0x288(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0xa2b40
jmp 0x9d98d
leaq 0x31e60(%rip), %rdx     # 0xcf7f4
leaq -0x268(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0xa2b40
jmp 0x9d9a9
movq -0x140(%rbp), %rdx
leaq -0x248(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0xa2b40
jmp 0x9d9c5
leaq 0x31e17(%rip), %rdx     # 0xcf7e3
leaq -0x228(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0xa2b40
jmp 0x9d9e1
leaq -0x2d0(%rbp), %rdi
callq 0x75fc0
jmp 0x9d9ef
leaq -0x208(%rbp), %rdi
leaq -0x228(%rbp), %rsi
leaq -0x2d0(%rbp), %rdx
callq 0xa2b90
jmp 0x9da0b
leaq -0x208(%rbp), %rdi
callq 0x76110
jmp 0x9da19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9db14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9db08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9dafc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9daf0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9dae4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9dad8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x9dacc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x10fc8
leaq -0x2d0(%rbp), %rdi
callq 0x10fc8
leaq -0x228(%rbp), %rdi
callq 0x10fc8
leaq -0x248(%rbp), %rdi
callq 0x10fc8
leaq -0x268(%rbp), %rdi
callq 0x10fc8
leaq -0x288(%rbp), %rdi
callq 0x10fc8
leaq -0x2a8(%rbp), %rdi
callq 0x10fc8
leaq -0x2a9(%rbp), %rdi
callq 0x10810
movq -0x108(%rbp), %rdi
callq 0x10e00
nopl (%rax)