// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/unittest/googletest/googletest/src/gtest-port.cc
// Function: testing::internal::CapturedStream::CapturedStream(int)
explicit CapturedStream(int fd) : fd_(fd), uncaptured_fd_(dup(fd)) {
# if GTEST_OS_WINDOWS
    char temp_dir_path[MAX_PATH + 1] = { '\0' };  // NOLINT
    char temp_file_path[MAX_PATH + 1] = { '\0' };  // NOLINT

    ::GetTempPathA(sizeof(temp_dir_path), temp_dir_path);
    const UINT success = ::GetTempFileNameA(temp_dir_path,
                                            "gtest_redir",
                                            0,  // Generate unique file name.
                                            temp_file_path);
    GTEST_CHECK_(success != 0)
        << "Unable to create a temporary file in " << temp_dir_path;
    const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE);
    GTEST_CHECK_(captured_fd != -1) << "Unable to open temporary file "
                                    << temp_file_path;
    filename_ = temp_file_path;
# else
    // There's no guarantee that a test has write access to the current
    // directory, so we create the temporary file in the /tmp directory
    // instead. We use /tmp on most systems, and /sdcard on Android.
    // That's because Android doesn't have /tmp.
#  if GTEST_OS_LINUX_ANDROID
    // Note: Android applications are expected to call the framework's
    // Context.getExternalStorageDirectory() method through JNI to get
    // the location of the world-writable SD Card directory. However,
    // this requires a Context handle, which cannot be retrieved
    // globally from native code. Doing so also precludes running the
    // code as part of a regular standalone executable, which doesn't
    // run in a Dalvik process (e.g. when running it through 'adb shell').
    //
    // The location /sdcard is directly accessible from native code
    // and is the only location (unofficially) supported by the Android
    // team. It's generally a symlink to the real SD Card mount point
    // which can be /mnt/sdcard, /mnt/sdcard0, /system/media/sdcard, or
    // other OEM-customized locations. Never rely on these, and always
    // use /sdcard.
    char name_template[] = "/sdcard/gtest_captured_stream.XXXXXX";
#  else
    char name_template[] = "/tmp/captured_stream.XXXXXX";
#  endif  // GTEST_OS_LINUX_ANDROID
    const int captured_fd = mkstemp(name_template);
    filename_ = name_template;
# endif  // GTEST_OS_WINDOWS
    fflush(NULL);
    dup2(captured_fd, fd_);
    close(captured_fd);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movl %esi, (%rdi)
movl %esi, %edi
callq 0xca00
movl %eax, 0x4(%r14)
leaq 0x8(%r14), %rbx
leaq 0x18(%r14), %r13
movq %r13, 0x8(%r14)
movq $0x0, 0x10(%r14)
movb $0x0, 0x18(%r14)
movups 0x29210(%rip), %xmm0    # 0x5508c
movq %rsp, %rdi
movups %xmm0, 0xc(%rdi)
movaps 0x291f6(%rip), %xmm0    # 0x55080
movaps %xmm0, (%rdi)
callq 0xc1a0
movl %eax, %ebp
movq 0x10(%r14), %r15
movq %rsp, %r12
movq %r12, %rdi
callq 0xc260
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0xca50
xorl %edi, %edi
callq 0xc740
movl (%r14), %esi
movl %ebp, %edi
callq 0xc570
movl %ebp, %edi
callq 0xccf0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x2bef4
movq (%r13), %rsi
incq %rsi
callq 0xc600
movq %r14, %rdi
callq 0xcbb0