// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0xc(%rbp), %ecx
movl %ecx, (%rax)
movl -0xc(%rbp), %edi
callq 0xec90
movq -0x58(%rbp), %rdi
movl %eax, 0x4(%rdi)
addq $0x8, %rdi
movq %rdi, -0x50(%rbp)
callq 0xeb70
movups 0x539fd(%rip), %xmm0    # 0x8c62c
movups %xmm0, -0x24(%rbp)
movaps 0x539e6(%rip), %xmm0    # 0x8c620
movaps %xmm0, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xe1e0
movl %eax, -0x48(%rbp)
jmp 0x38c4c
movq -0x58(%rbp), %rdi
movl -0x48(%rbp), %eax
movl %eax, -0x34(%rbp)
addq $0x8, %rdi
leaq -0x30(%rbp), %rsi
callq 0xeb50
jmp 0x38c65
xorl %eax, %eax
movl %eax, %edi
callq 0xe970
jmp 0x38c70
movq -0x58(%rbp), %rax
movl -0x34(%rbp), %edi
movl (%rax), %esi
callq 0xe6e0
movl -0x34(%rbp), %edi
callq 0xf020
jmp 0x38c88
addq $0x60, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0xf058
movq -0x40(%rbp), %rdi
callq 0xee80
nopl (%rax)