// File: /workspace/github_cpp_makefile_star2_O3/king1600[P]cordpp/src/ssl.cc
// Function: cordpp::SSLClient::connect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, std::function<void (boost::system::error_code const&)> const&)
void SSLClient::connect(const std::string &host,
  const int port, const BoostAction &action)
{
  // already connected
  if (connected) return;
  connect_cb = action;

  // resolve the host
  tcp::resolver::query query(host, std::to_string(port));
  service.get_resolver().async_resolve(query, 
  [this] (const Error &err, tcp::resolver::iterator it) {;
    if (err) { connect_cb(err); return; }

    // connect to the endpoint
    asio::async_connect(sock.lowest_layer(), it,
    [this] (const Error &err, tcp::resolver::iterator it) {
      if (err) { connect_cb(err); return; }

      // perform ssl handshake
      sock.async_handshake(ssl::stream_base::client, [this] (const Error &err) {
        connected = err ? false : true;
        connect_cb(err ? err : Success);
      });
    });
  });
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
cmpb $0x0, (%rdi)
jne 0x26565
movl %edx, %r15d
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
addq $0x38, %rdi
movq %rcx, %rsi
callq 0x153e2
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x262fe
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x262f5
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x262fb
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x262fe
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x262c2
addl $-0x3, %r12d
jmp 0x262fe
addl $-0x2, %r12d
jmp 0x262fe
decl %r12d
shrl $0x1f, %r15d
leal (%r12,%r15), %esi
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movl $0x2d, %edx
callq 0xa6c0
addq (%r13), %r15
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0xf8b2
leaq 0x38(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
movl $0x20, %ecx
callq 0x2da1e
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x26360
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xa5d0
movq 0x8(%rbx), %rax
movq 0x28(%rax), %r12
leaq 0x30(%rsp), %rax
movq %rbx, (%rax)
movq (%r12), %r14
movq %rax, 0x10(%rsp)
movq %fs:-0x8, %rax
testq %rax, %rax
je 0x2638d
movq 0x8(%rax), %rdi
jmp 0x2638f
xorl %edi, %edi
movl $0xf0, %esi
callq 0x146f4
movq %rax, %r15
movq %rax, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x8(%r12), %rax
movq 0x10(%r12), %rbx
testq %rbx, %rbx
je 0x263ce
movq 0x2fc08(%rip), %rcx     # 0x55fc8
cmpb $0x0, (%rcx)
je 0x263ca
incl 0xc(%rbx)
jmp 0x263ce
lock
incl 0xc(%rbx)
xorl %ecx, %ecx
movq 0x28(%r14), %rdx
movq %rdx, 0x8(%rsp)
movq $0x0, (%r15)
leaq 0x3b7f(%rip), %rdx      # 0x29f66
movq %rdx, 0x8(%r15)
movl %ecx, 0x10(%r15)
movl %ecx, 0x18(%r15)
movb $0x0, 0x1c(%r15)
leaq 0x2de21(%rip), %rcx     # 0x54220
movq %rcx, 0x20(%r15)
movq %rax, 0x28(%r15)
movq %rbx, 0x30(%r15)
testq %rbx, %rbx
je 0x26425
movq 0x2fbb1(%rip), %rax     # 0x55fc8
cmpb $0x0, (%rax)
je 0x26421
incl 0xc(%rbx)
jmp 0x26425
lock
incl 0xc(%rbx)
movups 0x38(%rsp), %xmm0
movups 0x48(%rsp), %xmm1
movups 0x58(%rsp), %xmm2
movups %xmm2, 0x58(%r15)
movups %xmm1, 0x48(%r15)
movups %xmm0, 0x38(%r15)
leaq 0x68(%r15), %r13
leaq 0x78(%r15), %rbp
movq %rbp, 0x68(%r15)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xcd6e
leaq 0x88(%r15), %rdi
leaq 0x98(%r15), %rax
movq %rax, 0x88(%r15)
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
addq %rsi, %rdx
callq 0xcd6e
addq $0x18, %r12
addq $0x28, %r14
movq 0x8(%rsp), %rax
movq %rax, 0xa8(%r15)
movq 0x30(%rsp), %rax
movq %rax, 0xb0(%r15)
movq %r15, %rdi
addq $0xb8, %rdi
movq %r12, %rsi
callq 0x14fd8
movq $0x0, 0xe8(%r15)
movq %r15, 0x20(%rsp)
testq %rbx, %rbx
je 0x26507
movq 0x2fae9(%rip), %rax     # 0x55fc8
cmpb $0x0, (%rax)
je 0x264ef
movl 0xc(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rbx)
jmp 0x264f9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rbx)
cmpl $0x1, %eax
jne 0x26507
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x35d76
leaq 0x18(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x2a4be
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2654a
movq 0x98(%rsp), %rsi
incq %rsi
callq 0xa5d0
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x26565
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5d0
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2661b
movq %rax, %r12
jmp 0x265de
movq %rax, %r12
movq (%r13), %rdi
cmpq %rbp, %rdi
je 0x2659e
movq (%rbp), %rsi
incq %rsi
callq 0xa5d0
jmp 0x2659e
movq %rax, %r12
addq $0x28, %r15
movq %r15, %rdi
callq 0x35d40
testq %rbx, %rbx
je 0x265de
movq 0x2fa12(%rip), %rax     # 0x55fc8
cmpb $0x0, (%rax)
jne 0x265c7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rbx)
jmp 0x265d0
movl 0xc(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rbx)
cmpl $0x1, %eax
jne 0x265de
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
leaq 0x10(%rsp), %rdi
callq 0x2a4be
jmp 0x265ed
movq %rax, %r12
leaq 0x38(%rsp), %rdi
callq 0x2dabc
movq %r12, %rdi
callq 0xaa30
movq %rax, %r12
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x265f7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xa5d0
jmp 0x265f7
movq %rax, %rdi
callq 0xd3a3
nop