// File: /workspace/github_cpp_makefile_star2_O3/Unreality3D[P]Unreality3D/indie-studio/source/Network/protocol/Deserializer.cpp
// Function: IndieProtocol::Deserializer::deserializeMessage(IndieProtocol::Serialized const&)
void	Deserializer::deserializeMessage(Serialized const &to_handle)
  {
    Message	msg;
    uint32_t	pos = 0;
    void	*payload;

    if (!_OnMessage)
      return ;

    if (!deserializeString(to_handle, pos, msg.target))
      return ;
    if (!deserializeString(to_handle, pos, msg.topic))
      return ;
    if (!deserializeString(to_handle, pos, msg.event))
      return ;

    memcpy(&msg.payloadSize, to_handle.data + pos, sizeof(msg.payloadSize));
    pos += sizeof(msg.payloadSize);
    // error
    if (pos + msg.payloadSize + sizeof(Header) > _header.size)
      return ;
    payload = new char[msg.payloadSize];
    memcpy(payload, to_handle.data + pos, msg.payloadSize);

    msg.payload = payload;
    _OnMessage(msg);
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x150, %rsp            # imm = 0x150
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x60(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x3ecb(%rip), %r15      # 0x152ba
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0xb270
leaq 0x40(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0xb270
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x3e92(%rip), %rdx      # 0x152ba
leaq 0x10(%rsp), %rdi
movq %rdx, %rsi
callq 0xb270
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0xb660
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x1145d
callq 0xb730
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
je 0x1146c
callq 0xb730
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x1147b
callq 0xb730
movl $0x0, 0xc(%rsp)
cmpq $0x0, 0x70(%rbx)
je 0x11622
leaq 0xc(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbc90
testb %al, %al
je 0x11622
leaq 0x90(%rsp), %rcx
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbc90
testb %al, %al
je 0x11622
leaq 0xb0(%rsp), %rcx
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbc90
testb %al, %al
je 0x11622
movq 0x8(%r14), %r14
movl 0xc(%rsp), %r13d
movl (%r14,%r13), %r15d
movl %r15d, 0xd0(%rsp)
leal (%r15,%r13), %eax
addl $0x4, %eax
addq $0x6, %rax
movl (%rbx), %ecx
cmpq %rcx, %rax
ja 0x11622
movq %r15, %rdi
callq 0xb030
movq %rax, %r12
leal 0x4(%r13), %eax
movl %eax, %eax
addq %rax, %r14
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xb670
movq %r12, 0xd8(%rsp)
leaq 0xf0(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
addq %rsi, %rdx
leaq 0xe0(%rsp), %rdi
callq 0xb2b0
leaq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
addq %rsi, %rdx
callq 0xb2b0
leaq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
addq %rsi, %rdx
callq 0xb2b0
leaq 0xd0(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x140(%rsp)
cmpq $0x0, 0x70(%rbx)
je 0x11675
leaq 0x60(%rbx), %rdi
leaq 0xe0(%rsp), %rsi
callq *0x78(%rbx)
movq 0x120(%rsp), %rdi
cmpq %r12, %rdi
je 0x115fe
callq 0xb730
movq 0x100(%rsp), %rdi
cmpq %r15, %rdi
je 0x11610
callq 0xb730
movq 0xe0(%rsp), %rdi
cmpq %r14, %rdi
je 0x11622
callq 0xb730
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11638
callq 0xb730
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1164e
callq 0xb730
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11664
callq 0xb730
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0xb230
movq %rax, %rbx
movq 0x100(%rsp), %rdi
cmpq %r15, %rdi
je 0x11694
callq 0xb730
jmp 0x11694
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
cmpq %r14, %rdi
je 0x116f9
callq 0xb730
jmp 0x116f9
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0xb0f0
jmp 0x116f9
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x116d1
callq 0xb730
jmp 0x116d1
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
je 0x116e5
callq 0xb730
jmp 0x116e5
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x11703
callq 0xb730
jmp 0x11703
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0xb0f0
movq %rbx, %rdi
callq 0xbce0
nop