// File: /workspace/github_cpp_makefile_star2_O1/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 0x26b07
movl %edx, %r15d
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
addq $0x38, %rdi
movq %rcx, %rsi
callq 0x156f8
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x268a0
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x26897
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2689d
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x268a0
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x26864
addl $-0x3, %r12d
jmp 0x268a0
addl $-0x2, %r12d
jmp 0x268a0
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 0xf980
leaq 0x38(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
movl $0x20, %ecx
callq 0x2e2f0
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x26902
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 0x2692f
movq 0x8(%rax), %rdi
jmp 0x26931
xorl %edi, %edi
movl $0xf0, %esi
callq 0x14990
movq %rax, %r15
movq %rax, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x8(%r12), %rax
movq 0x10(%r12), %rbx
testq %rbx, %rbx
je 0x26970
movq 0x30666(%rip), %rcx     # 0x56fc8
cmpb $0x0, (%rcx)
je 0x2696c
incl 0xc(%rbx)
jmp 0x26970
lock
incl 0xc(%rbx)
xorl %ecx, %ecx
movq 0x28(%r14), %rdx
movq %rdx, 0x8(%rsp)
movq $0x0, (%r15)
leaq 0x3d99(%rip), %rdx      # 0x2a722
movq %rdx, 0x8(%r15)
movl %ecx, 0x10(%r15)
movl %ecx, 0x18(%r15)
movb $0x0, 0x1c(%r15)
leaq 0x2e7bf(%rip), %rcx     # 0x55160
movq %rcx, 0x20(%r15)
movq %rax, 0x28(%r15)
movq %rbx, 0x30(%r15)
testq %rbx, %rbx
je 0x269c7
movq 0x3060f(%rip), %rax     # 0x56fc8
cmpb $0x0, (%rax)
je 0x269c3
incl 0xc(%rbx)
jmp 0x269c7
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 0xcd56
leaq 0x88(%r15), %rdi
leaq 0x98(%r15), %rax
movq %rax, 0x88(%r15)
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
addq %rsi, %rdx
callq 0xcd56
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 0x152d0
movq $0x0, 0xe8(%r15)
movq %r15, 0x20(%rsp)
testq %rbx, %rbx
je 0x26aa9
movq 0x30547(%rip), %rax     # 0x56fc8
cmpb $0x0, (%rax)
je 0x26a91
movl 0xc(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rbx)
jmp 0x26a9b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rbx)
cmpl $0x1, %eax
jne 0x26aa9
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x36cf2
leaq 0x18(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x2ac6a
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x26aec
movq 0x98(%rsp), %rsi
incq %rsi
callq 0xa5d0
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x26b07
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 0x26bbd
movq %rax, %r12
jmp 0x26b80
movq %rax, %r12
movq (%r13), %rdi
cmpq %rbp, %rdi
je 0x26b40
movq (%rbp), %rsi
incq %rsi
callq 0xa5d0
jmp 0x26b40
movq %rax, %r12
addq $0x28, %r15
movq %r15, %rdi
callq 0x36cbc
testq %rbx, %rbx
je 0x26b80
movq 0x30470(%rip), %rax     # 0x56fc8
cmpb $0x0, (%rax)
jne 0x26b69
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rbx)
jmp 0x26b72
movl 0xc(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rbx)
cmpl $0x1, %eax
jne 0x26b80
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
leaq 0x10(%rsp), %rdi
callq 0x2ac6a
jmp 0x26b8f
movq %rax, %r12
leaq 0x38(%rsp), %rdi
callq 0x2e38e
movq %r12, %rdi
callq 0xaa30
movq %rax, %r12
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x26b99
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xa5d0
jmp 0x26b99
movq %rax, %rdi
callq 0xd3bb
nop