// File: /workspace/github_cpp_makefile_star2_O3/king1600[P]cordpp/src/gateway.cc
// Function: cordpp::Gateway::send(cordpp::GatewayOp, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer> const&)
void Gateway::send(GatewayOp op, const Json &data) {
  Json packet = {
    {"op", static_cast<uint16_t>(op)},
    {"d", data}
  };
  const std::string dumped = packet.dump();
  std::cout << "Sending: " << packet.dump(2) << std::endl;
  if (conn->state == WebsockState::open)
    conn->send(dumped.c_str(), dumped.size(), WebsockOp::text);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x2b90c(%rip), %rax     # 0x3c63e
leaq 0x98(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x50(%rsp), %r12
movb $0x0, (%r12)
movq $0x0, 0x8(%r12)
movq %r12, %rdi
callq 0x1ba68
movq %r12, %rdi
callq 0xf13a
leaq 0x70(%rsp), %r14
movq %r12, -0x10(%r14)
movb $0x1, %r13b
movb %r13b, -0x8(%r14)
movzbl %bpl, %eax
movb $0x6, (%r14)
movq %rax, 0x8(%r14)
movq %r14, %rdi
callq 0xf13a
movq %r14, %rdi
callq 0xf13a
movq %r14, 0x10(%r14)
movb %r13b, 0x18(%r14)
leaq 0x10(%rsp), %r14
movl $0x2, %edx
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %ecx
movl $0x2, %r8d
callq 0x14110
leaq 0x10(%rsp), %rax
movq %rax, 0x10(%rax)
movb $0x1, 0x18(%rax)
leaq 0x30(%rsp), %r14
leaq 0x2bf11(%rip), %rax     # 0x3ccde
leaq 0x90(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x98(%rsp), %r12
movb $0x0, (%r12)
movq $0x0, 0x8(%r12)
movq %r12, %rdi
callq 0x1ba68
movq %r12, %rdi
callq 0xf13a
leaq 0xb8(%rsp), %r13
movq %r12, -0x10(%r13)
movb $0x1, -0x8(%r13)
xorl %ebp, %ebp
movb %bpl, (%r13)
movq %r13, %rdi
callq 0xf13a
movq %r13, %rdi
callq 0xf13a
movq %r15, 0x10(%r13)
movb %bpl, 0x18(%r13)
movl $0x2, %edx
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %ecx
movl $0x2, %r8d
callq 0x14110
leaq 0x10(%rsp), %rsi
movq %r14, 0x30(%rsi)
movb $0x1, 0x38(%rsi)
movq %rsp, %rdi
movl $0x2, %edx
movl $0x1, %ecx
movl $0x2, %r8d
callq 0x14110
movl $0x20, %r14d
leaq (%rsp,%r14), %rdi
addq $0x10, %rdi
callq 0xd47e
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x10e73
movl $0x20, %r14d
leaq (%rsp,%r14), %rdi
addq $0x98, %rdi
callq 0xd47e
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x10e90
movl $0x20, %r14d
leaq (%rsp,%r14), %rdi
addq $0x50, %rdi
callq 0xd47e
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x10eb0
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x20, %ecx
xorl %r8d, %r8d
callq 0x1426e
movq 0x450e8(%rip), %rdi     # 0x55fd0
leaq 0x2b752(%rip), %rsi     # 0x3c641
movl $0x9, %edx
callq 0xa6a0
leaq 0x50(%rsp), %rdi
movq %rsp, %rsi
movl $0x2, %edx
movl $0x20, %ecx
xorl %r8d, %r8d
callq 0x1426e
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x450ac(%rip), %rdi     # 0x55fd0
callq 0xa6a0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xa590
movsbl %al, %esi
movq %r14, %rdi
callq 0xa050
movq %rax, %rdi
callq 0xa3f0
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10f6e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0xa5d0
movq 0x30(%rbx), %rdi
cmpl $0x0, 0x398(%rdi)
jne 0x10f8f
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movl $0x1, %ecx
callq 0x39178
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10faa
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xa5d0
movq %rsp, %rdi
callq 0xd47e
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11072
movq %rax, %rbx
jmp 0x110b0
movq %rax, %rbx
movl $0x20, %r15d
leaq (%rsp,%r15), %rdi
addq $0x10, %rdi
callq 0xd47e
addq $-0x20, %r15
cmpq $-0x20, %r15
jne 0x10fda
xorl %r13d, %r13d
jmp 0x10ffc
movq %rax, %rbx
movb $0x1, %r13b
movl $0x20, %r15d
leaq (%rsp,%r15), %rdi
addq $0x98, %rdi
callq 0xd47e
addq $-0x20, %r15
cmpq $-0x20, %r15
jne 0x11002
jmp 0x11029
movq %rax, %rbx
movb $0x1, %r13b
jmp 0x11029
movq %rax, %rbx
movl $0x20, %r15d
leaq (%rsp,%r15), %rdi
addq $0x50, %rdi
callq 0xd47e
addq $-0x20, %r15
cmpq $-0x20, %r15
jne 0x1102f
leaq 0x10(%rsp), %r15
cmpq %r14, %r15
setne %al
andb %al, %r13b
cmpb $0x1, %r13b
jne 0x110b8
addq $-0x20, %r14
movq %r14, %rdi
callq 0xd47e
cmpq %r15, %r14
jne 0x1105a
jmp 0x110b8
movq %rax, %rbx
jmp 0x110b8
movq %rax, %rbx
jmp 0x11095
movq %rax, %rbx
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11095
movq 0x60(%rsp), %rsi
incq %rsi
callq 0xa5d0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x110b0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xa5d0
movq %rsp, %rdi
callq 0xd47e
movq %rbx, %rdi
callq 0xaa30