// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x48, %rsp
movq %rdi, %rbx
cmpl $-0x1, 0x8(%rdi)
je 0x1d168
leaq 0x34ee7(%rip), %rdx     # 0x52001
leaq 0x10(%rsp), %rdi
movl $0x3, %esi
movl $0xed9, %ecx            # imm = 0xED9
callq 0x268b2
movq 0x54ebb(%rip), %rdi     # 0x71ff0
leaq 0x359ef(%rip), %rsi     # 0x52b2b
movl $0x20, %edx
callq 0xc700
movq 0x54ea3(%rip), %rdi     # 0x71ff0
leaq 0x359f8(%rip), %rsi     # 0x52b4c
movl $0x44, %edx
callq 0xc700
leaq 0x10(%rsp), %rdi
callq 0x269f4
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movl $0x1, 0x8(%rdx)
leaq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
movq 0x10(%rbx), %rdi
movq 0x30(%rbx), %rsi
callq 0xc820
testl %eax, %eax
je 0x1d228
movl %eax, %ebp
leaq 0x34e55(%rip), %rdx     # 0x52001
leaq 0x4(%rsp), %rdi
movl $0x1, %esi
movl $0xee7, %ecx            # imm = 0xEE7
callq 0x268b2
movq 0x54e29(%rip), %r14     # 0x71ff0
leaq 0x359c3(%rip), %rsi     # 0x52b91
movl $0x28, %edx
movq %r14, %rdi
callq 0xc700
movl %ebp, %edi
callq 0xc8e0
testq %rax, %rax
je 0x1d206
movq %rax, %r15
movq %rax, %rdi
callq 0xc260
movq 0x54df7(%rip), %rdi     # 0x71ff0
movq %r15, %rsi
movq %rax, %rdx
callq 0xc700
jmp 0x1d21e
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0xcb40
leaq 0x4(%rsp), %rdi
callq 0x269f4
movq 0x8(%rsp), %r14
cmpl $-0x1, 0x8(%rbx)
sete %al
testq %r14, %r14
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1d299
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
callq 0xc130
movl %eax, 0x8(%rbx)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x1d286
movq 0x18(%r14), %rsi
movl 0x10(%r14), %edx
movl %eax, %edi
callq 0xc4c0
movl 0x8(%rbx), %edi
cmpl $-0x1, %eax
je 0x1d27a
movl %edi, %ebp
jmp 0x1d286
callq 0xccf0
movl $0xffffffff, 0x8(%rbx)  # imm = 0xFFFFFFFF
cmpl $-0x1, %ebp
jne 0x1d294
movq 0x28(%r14), %r14
testq %r14, %r14
jne 0x1d241
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xc860
cmpl $-0x1, 0x8(%rbx)
jne 0x1d31f
leaq 0x34d53(%rip), %rdx     # 0x52001
leaq 0x4(%rsp), %rdi
movl $0x1, %esi
movl $0xefc, %ecx            # imm = 0xEFC
callq 0x268b2
movq 0x54d27(%rip), %rdi     # 0x71ff0
leaq 0x358ea(%rip), %rsi     # 0x52bba
movl $0x27, %edx
callq 0xc700
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
movq 0x54d07(%rip), %rdi     # 0x71ff0
callq 0xc700
movq %rax, %r14
leaq 0x35914(%rip), %rsi     # 0x52c0c
movl $0x1, %edx
movq %rax, %rdi
callq 0xc700
movq 0x30(%rbx), %rsi
movq 0x38(%rbx), %rdx
movq %r14, %rdi
callq 0xc700
leaq 0x4(%rsp), %rdi
callq 0x269f4
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1d336
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x1d33e
movq %rax, %rbx
leaq 0x4(%rsp), %rdi
callq 0x269f4
movq %rbx, %rdi
callq 0xcbb0
nop