// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/unittest/googletest/googletest/src/gtest.cc
// Function: testing::internal::StreamingListener::SocketWriter::MakeConnection()
void StreamingListener::SocketWriter::MakeConnection() {
  GTEST_CHECK_(sockfd_ == -1)
      << "MakeConnection() can't be called when there is already a connection.";

  addrinfo hints;
  memset(&hints, 0, sizeof(hints));
  hints.ai_family = AF_UNSPEC;    // To allow both IPv4 and IPv6 addresses.
  hints.ai_socktype = SOCK_STREAM;
  addrinfo* servinfo = NULL;

  // Use the getaddrinfo() to get a linked list of IP addresses for
  // the given host name.
  const int error_num = getaddrinfo(
      host_name_.c_str(), port_num_.c_str(), &hints, &servinfo);
  if (error_num != 0) {
    GTEST_LOG_(WARNING) << "stream_result_to: getaddrinfo() failed: "
                        << gai_strerror(error_num);
  }

  // Loop through all the results and connect to the first we can.
  for (addrinfo* cur_addr = servinfo; sockfd_ == -1 && cur_addr != NULL;
       cur_addr = cur_addr->ai_next) {
    sockfd_ = socket(
        cur_addr->ai_family, cur_addr->ai_socktype, cur_addr->ai_protocol);
    if (sockfd_ != -1) {
      // Connect the client socket to the server socket.
      if (connect(sockfd_, cur_addr->ai_addr, cur_addr->ai_addrlen) == -1) {
        close(sockfd_);
        sockfd_ = -1;
      }
    }
  }

  freeaddrinfo(servinfo);  // all done with this structure

  if (sockfd_ == -1) {
    GTEST_LOG_(WARNING) << "stream_result_to: failed to connect to "
                        << host_name_ << ":" << port_num_;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
cmpl $-0x1, 0x8(%rdi)
je 0x19024
leaq 0x2afeb(%rip), %rdx     # 0x43fd1
leaq 0x10(%rsp), %rdi
pushq $0x3
popq %rsi
movl $0xed9, %ecx            # imm = 0xED9
callq 0x1e178
movq 0x4ffe9(%rip), %rdi     # 0x68fe8
leaq 0x2baf5(%rip), %rsi     # 0x44afb
callq 0xd5e0
leaq 0x2bb0a(%rip), %rsi     # 0x44b1c
movq %rax, %rdi
callq 0xd5e0
leaq 0x10(%rsp), %rdi
callq 0x1e23c
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x20(%rdx)
leaq 0x8(%rsp), %r14
andq $0x0, (%r14)
movaps %xmm0, 0x10(%rdx)
movl $0x1, 0x8(%rdx)
movq 0x10(%rbx), %rdi
movq 0x30(%rbx), %rsi
movq %r14, %rcx
callq 0xd850
testl %eax, %eax
je 0x190a8
movl %eax, %ebp
leaq 0x2af6d(%rip), %rdx     # 0x43fd1
leaq 0x4(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xee7, %ecx            # imm = 0xEE7
callq 0x1e178
movq 0x4ff6b(%rip), %rdi     # 0x68fe8
leaq 0x2badd(%rip), %rsi     # 0x44b61
callq 0xd5e0
movq %rax, %r15
movl %ebp, %edi
callq 0xd930
movq %r15, %rdi
movq %rax, %rsi
callq 0xd5e0
leaq 0x4(%rsp), %rdi
callq 0x1e23c
leaq 0x10(%rbx), %r12
leaq 0x30(%rbx), %r15
cmpl $-0x1, 0x8(%rbx)
jne 0x190fd
movq (%r14), %r14
testq %r14, %r14
je 0x190fd
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
callq 0xd130
movl %eax, 0x8(%rbx)
cmpl $-0x1, %eax
je 0x190f7
movq 0x18(%r14), %rsi
movl 0x10(%r14), %edx
movl %eax, %edi
callq 0xd4d0
cmpl $-0x1, %eax
jne 0x190f7
movl 0x8(%rbx), %edi
callq 0xdd40
orl $-0x1, 0x8(%rbx)
addq $0x28, %r14
jmp 0x190b0
movq 0x8(%rsp), %rdi
callq 0xd8a0
cmpl $-0x1, 0x8(%rbx)
jne 0x19168
leaq 0x2aebd(%rip), %rdx     # 0x43fd1
leaq 0x4(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xefc, %ecx            # imm = 0xEFC
callq 0x1e178
movq 0x4febb(%rip), %rdi     # 0x68fe8
leaq 0x2ba56(%rip), %rsi     # 0x44b8a
callq 0xd5e0
movq %rax, %rdi
movq %r12, %rsi
callq 0xd520
leaq 0x2ba91(%rip), %rsi     # 0x44bdc
movq %rax, %rdi
callq 0xd5e0
movq %rax, %rdi
movq %r15, %rsi
callq 0xd520
leaq 0x4(%rsp), %rdi
callq 0x1e23c
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x19181
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x19189
movq %rax, %rbx
leaq 0x4(%rsp), %rdi
callq 0x1e23c
movq %rbx, %rdi
callq 0xdbf0