// File: /workspace/github_cpp_makefile_star2_O1/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 0x2c87a(%rip), %rax     # 0x3d636
leaq 0x98(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x50(%rsp), %r12
movb $0x0, (%r12)
movq $0x0, 0x8(%r12)
movq %r12, %rdi
callq 0x1bf4b
movq %r12, %rdi
callq 0xf20e
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 0xf20e
movq %r14, %rdi
callq 0xf20e
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 0x143ac
leaq 0x10(%rsp), %rax
movq %rax, 0x10(%rax)
movb $0x1, 0x18(%rax)
leaq 0x30(%rsp), %r14
leaq 0x2ce99(%rip), %rax     # 0x3dcf0
leaq 0x90(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x98(%rsp), %r12
movb $0x0, (%r12)
movq $0x0, 0x8(%r12)
movq %r12, %rdi
callq 0x1bf4b
movq %r12, %rdi
callq 0xf20e
leaq 0xb8(%rsp), %r13
movq %r12, -0x10(%r13)
movb $0x1, -0x8(%r13)
xorl %ebp, %ebp
movb %bpl, (%r13)
movq %r13, %rdi
callq 0xf20e
movq %r13, %rdi
callq 0xf20e
movq %r15, 0x10(%r13)
movb %bpl, 0x18(%r13)
movl $0x2, %edx
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %ecx
movl $0x2, %r8d
callq 0x143ac
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 0x143ac
movl $0x20, %r14d
leaq (%rsp,%r14), %rdi
addq $0x10, %rdi
callq 0xd48e
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x10efd
movl $0x20, %r14d
leaq (%rsp,%r14), %rdi
addq $0x98, %rdi
callq 0xd48e
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x10f1a
movl $0x20, %r14d
leaq (%rsp,%r14), %rdi
addq $0x50, %rdi
callq 0xd48e
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x10f3a
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x20, %ecx
xorl %r8d, %r8d
callq 0x14514
movq 0x4605e(%rip), %rdi     # 0x56fd0
leaq 0x2c6c0(%rip), %rsi     # 0x3d639
movl $0x9, %edx
callq 0xa6a0
leaq 0x50(%rsp), %rdi
movq %rsp, %rsi
movl $0x2, %edx
movl $0x20, %ecx
xorl %r8d, %r8d
callq 0x14514
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x46022(%rip), %rdi     # 0x56fd0
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 0x10ff8
movq 0x60(%rsp), %rsi
incq %rsi
callq 0xa5d0
movq 0x30(%rbx), %rdi
cmpl $0x0, 0x398(%rdi)
jne 0x11019
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movl $0x1, %ecx
callq 0x3a24a
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11034
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xa5d0
movq %rsp, %rdi
callq 0xd48e
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11102
movq %rax, %rbx
jmp 0x11140
movq %rax, %rbx
movl $0x20, %r15d
leaq (%rsp,%r15), %rdi
addq $0x10, %rdi
callq 0xd48e
addq $-0x20, %r15
cmpq $-0x20, %r15
jne 0x11064
xorl %r13d, %r13d
jmp 0x11086
movq %rax, %rbx
movb $0x1, %r13b
movl $0x20, %r15d
leaq (%rsp,%r15), %rdi
addq $0x98, %rdi
callq 0xd48e
addq $-0x20, %r15
cmpq $-0x20, %r15
jne 0x1108c
jmp 0x110b3
movq %rax, %rbx
movb $0x1, %r13b
jmp 0x110b3
movq %rax, %rbx
movl $0x20, %r15d
leaq (%rsp,%r15), %rdi
addq $0x50, %rdi
callq 0xd48e
addq $-0x20, %r15
cmpq $-0x20, %r15
jne 0x110b9
jmp 0x110dd
movq %rax, %rbx
movb $0x1, %r13b
leaq 0x10(%rsp), %r14
leaq 0x10(%rsp), %r15
cmpq %r14, %r15
setne %al
andb %r13b, %al
cmpb $0x1, %al
jne 0x11148
addq $-0x20, %r14
movq %r14, %rdi
callq 0xd48e
cmpq %r15, %r14
jne 0x110ef
jmp 0x11148
movq %rax, %rbx
jmp 0x11125
movq %rax, %rbx
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11125
movq 0x60(%rsp), %rsi
incq %rsi
callq 0xa5d0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11140
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xa5d0
movq %rsp, %rdi
callq 0xd48e
movq %rbx, %rdi
callq 0xaa30