// File: WeihuaZhu[P]hpc_prog2/./gtest/gtest-all.cc
// Function: testing::internal::DeathTestImpl::ReadAndInterpretStatusByte()
void DeathTestImpl::ReadAndInterpretStatusByte() {
  char flag;
  int bytes_read;

  // The read() here blocks until data is available (signifying the
  // failure of the death test) or until the pipe is closed (signifying
  // its success), so it's okay to call this in the parent before
  // the child process has exited.
  do {
    bytes_read = posix::Read(read_fd(), &flag, 1);
  } while (bytes_read == -1 && errno == EINTR);

  if (bytes_read == 0) {
    set_outcome(DIED);
  } else if (bytes_read == 1) {
    switch (flag) {
      case kDeathTestReturned:
        set_outcome(RETURNED);
        break;
      case kDeathTestThrew:
        set_outcome(THREW);
        break;
      case kDeathTestLived:
        set_outcome(LIVED);
        break;
      case kDeathTestInternalError:
        FailFromInternalError(read_fd());  // Does not return.
        break;
      default:
        GTEST_LOG_(FATAL) << "Death test child process reported "
                          << "unexpected status byte ("
                          << static_cast<unsigned int>(flag) << ")";
    }
  } else {
    GTEST_LOG_(FATAL) << "Read from death test child process failed: "
                      << GetLastErrnoDescription();
  }
  GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Close(read_fd()));
  set_read_fd(-1);
}

// Assembly:
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, 0x1c0(%rsp)
movq 0x1c0(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rdi
callq 0x39e70
movl %eax, %edi
leaq 0x1bf(%rsp), %rsi
movl $0x1, %edx
callq 0x39e40
movl %eax, 0x1b8(%rsp)
xorl %eax, %eax
cmpl $-0x1, 0x1b8(%rsp)
movb %al, 0x5f(%rsp)
jne 0x29720
callq 0xe080
cmpl $0x4, (%rax)
sete %al
movb %al, 0x5f(%rsp)
movb 0x5f(%rsp), %al
testb $0x1, %al
jne 0x296dc
cmpl $0x0, 0x1b8(%rsp)
jne 0x29746
movq 0x60(%rsp), %rdi
movl $0x1, %esi
callq 0x39e80
jmp 0x29970
cmpl $0x1, 0x1b8(%rsp)
jne 0x2989a
movsbl 0x1bf(%rsp), %eax
addl $-0x49, %eax
movl %eax, %ecx
movq %rcx, 0x50(%rsp)
subl $0xb, %eax
ja 0x297d2
movq 0x50(%rsp), %rax
leaq 0x21d4d(%rip), %rcx     # 0x4b4c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%rsp), %rdi
movl $0x3, %esi
callq 0x39e80
jmp 0x2986f
movq 0x60(%rsp), %rdi
movl $0x4, %esi
callq 0x39e80
jmp 0x2986f
movq 0x60(%rsp), %rdi
movl $0x2, %esi
callq 0x39e80
jmp 0x2986f
movq 0x60(%rsp), %rdi
callq 0x39e70
movl %eax, %edi
callq 0x29cc0
jmp 0x2986f
leaq 0x23126(%rip), %rdx     # 0x4c8ff
leaq 0x1b4(%rsp), %rdi
movq %rdi, 0x40(%rsp)
movl $0x3, %esi
movl $0x1b24, %ecx           # imm = 0x1B24
callq 0x2fd30
movq 0x40(%rsp), %rdi
callq 0x32a40
movq %rax, 0x48(%rsp)
jmp 0x29806
movq 0x48(%rsp), %rdi
leaq 0x23faa(%rip), %rsi     # 0x4d7bc
callq 0xea00
movq %rax, 0x38(%rsp)
jmp 0x2981e
movq 0x38(%rsp), %rdi
leaq 0x23fb5(%rip), %rsi     # 0x4d7df
callq 0xea00
movq %rax, 0x30(%rsp)
jmp 0x29836
movq 0x30(%rsp), %rdi
movsbl 0x1bf(%rsp), %esi
callq 0xef10
movq %rax, 0x28(%rsp)
jmp 0x2984f
movq 0x28(%rsp), %rdi
leaq 0x2374d(%rip), %rsi     # 0x4cfa8
callq 0xea00
jmp 0x29862
leaq 0x1b4(%rsp), %rdi
callq 0x2fea0
jmp 0x2996e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
leaq 0x1b4(%rsp), %rdi
callq 0x2fea0
jmp 0x29caa
leaq 0x2305e(%rip), %rdx     # 0x4c8ff
leaq 0x1a0(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movl $0x3, %esi
movl $0x1b29, %ecx           # imm = 0x1B29
callq 0x2fd30
movq 0x18(%rsp), %rdi
callq 0x32a40
movq %rax, 0x20(%rsp)
jmp 0x298ce
movq 0x20(%rsp), %rdi
leaq 0x23f1e(%rip), %rsi     # 0x4d7f8
callq 0xea00
movq %rax, 0x10(%rsp)
jmp 0x298e6
leaq 0x180(%rsp), %rdi
callq 0x294c0
jmp 0x298f5
movq 0x10(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0xe900
jmp 0x29909
leaq 0x180(%rsp), %rdi
callq 0xf698
leaq 0x1a0(%rsp), %rdi
callq 0x2fea0
jmp 0x2996e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x2995c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
leaq 0x180(%rsp), %rdi
callq 0xf698
leaq 0x1a0(%rsp), %rdi
callq 0x2fea0
jmp 0x29caa
jmp 0x29970
jmp 0x29972
jmp 0x29974
movq 0x60(%rsp), %rdi
callq 0x39e70
movl %eax, %edi
callq 0x39ea0
movl %eax, 0x17c(%rsp)
xorl %eax, %eax
cmpl $-0x1, 0x17c(%rsp)
movb %al, 0xf(%rsp)
jne 0x299ab
callq 0xe080
cmpl $0x4, (%rax)
sete %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x29974
cmpl $-0x1, 0x17c(%rsp)
jne 0x29c84
leaq 0x97(%rsp), %rdi
movq %rdi, (%rsp)
callq 0xf420
movq (%rsp), %rdx
leaq 0x23e47(%rip), %rsi     # 0x4d824
leaq 0x98(%rsp), %rdi
callq 0x32980
jmp 0x299ec
leaq 0x22f0c(%rip), %rdx     # 0x4c8ff
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x32c70
jmp 0x29a0a
leaq 0x23e27(%rip), %rdx     # 0x4d838
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x32c70
jmp 0x29a28
movl $0x1b2c, 0x6c(%rsp)     # imm = 0x1B2C
leaq 0x70(%rsp), %rdi
leaq 0x6c(%rsp), %rsi
callq 0x370b0
jmp 0x29a41
leaq 0xf8(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x36fc0
jmp 0x29a5d
leaq 0x23117(%rip), %rdx     # 0x4cb7b
leaq 0x118(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x32c70
jmp 0x29a7b
leaq 0x23dbe(%rip), %rdx     # 0x4d840
leaq 0x138(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x32c70
jmp 0x29a99
leaq 0x23fb5(%rip), %rdx     # 0x4da55
leaq 0x158(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x32c70
jmp 0x29ab7
leaq 0x158(%rsp), %rdi
callq 0x293e0
jmp 0x29ac6
leaq 0x158(%rsp), %rdi
callq 0xf698
leaq 0x138(%rsp), %rdi
callq 0xf698
leaq 0x118(%rsp), %rdi
callq 0xf698
leaq 0xf8(%rsp), %rdi
callq 0xf698
leaq 0x70(%rsp), %rdi
callq 0xf698
leaq 0xd8(%rsp), %rdi
callq 0xf698
leaq 0xb8(%rsp), %rdi
callq 0xf698
leaq 0x98(%rsp), %rdi
callq 0xf698
leaq 0x97(%rsp), %rdi
callq 0xeb40
jmp 0x29c84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x29c75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x29c68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x29c5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x29c4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x29c44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x29c37
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x29c2a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x29c1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
leaq 0x158(%rsp), %rdi
callq 0xf698
leaq 0x138(%rsp), %rdi
callq 0xf698
leaq 0x118(%rsp), %rdi
callq 0xf698
leaq 0xf8(%rsp), %rdi
callq 0xf698
leaq 0x70(%rsp), %rdi
callq 0xf698
leaq 0xd8(%rsp), %rdi
callq 0xf698
leaq 0xb8(%rsp), %rdi
callq 0xf698
leaq 0x98(%rsp), %rdi
callq 0xf698
leaq 0x97(%rsp), %rdi
callq 0xeb40
jmp 0x29caa
jmp 0x29c86
callq 0x39eb0
testb $0x1, %al
jne 0x29972
movq 0x60(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x39ec0
addq $0x1c8, %rsp            # imm = 0x1C8
retq
movq 0x1a8(%rsp), %rdi
callq 0xf410
nopw (%rax,%rax)