// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x3ee8(%rip), %r15      # 0x152ba
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0xb270
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0xb270
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x3eaf(%rip), %rdx      # 0x152ba
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0xb270
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0xb660
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x11440
callq 0xb730
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x1144f
callq 0xb730
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x1145e
callq 0xb730
movl $0x0, 0x4(%rsp)
cmpq $0x0, 0x70(%rbx)
je 0x11606
leaq 0x4(%rsp), %rdx
leaq 0x68(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbc90
testb %al, %al
je 0x11606
leaq 0x88(%rsp), %rcx
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbc90
testb %al, %al
je 0x11606
leaq 0xa8(%rsp), %rcx
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbc90
testb %al, %al
je 0x11606
movq 0x8(%r14), %r14
movl 0x4(%rsp), %eax
movl (%r14,%rax), %r15d
movl %r15d, 0xc8(%rsp)
leal 0x4(%rax), %ebp
movl %ebp, 0x4(%rsp)
addl %r15d, %eax
addl $0x4, %eax
addq $0x6, %rax
movl (%rbx), %ecx
cmpq %rcx, %rax
ja 0x11606
movq %r15, %rdi
callq 0xb030
movq %rax, %r12
movl %ebp, %eax
addq %rax, %r14
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xb670
movq %r12, 0xd0(%rsp)
leaq 0xe8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0xd8(%rsp), %rdi
callq 0xb2b0
leaq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
addq %rsi, %rdx
callq 0xb2b0
leaq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
addq %rsi, %rdx
callq 0xb2b0
leaq 0xc8(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x138(%rsp)
cmpq $0x0, 0x70(%rbx)
je 0x11657
leaq 0x60(%rbx), %rdi
leaq 0xd8(%rsp), %rsi
callq *0x78(%rbx)
movq 0x118(%rsp), %rdi
cmpq %r12, %rdi
je 0x115e2
callq 0xb730
movq 0xf8(%rsp), %rdi
cmpq %r15, %rdi
je 0x115f4
callq 0xb730
movq 0xd8(%rsp), %rdi
cmpq %r14, %rdi
je 0x11606
callq 0xb730
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1161c
callq 0xb730
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11632
callq 0xb730
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11645
callq 0xb730
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xb230
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
cmpq %r15, %rdi
je 0x11676
callq 0xb730
jmp 0x11676
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
cmpq %r14, %rdi
je 0x116db
callq 0xb730
jmp 0x116db
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0xb0f0
jmp 0x116db
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x116b3
callq 0xb730
jmp 0x116b3
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x116c7
callq 0xb730
jmp 0x116c7
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x116e5
callq 0xb730
jmp 0x116e5
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xb0f0
movq %rbx, %rdi
callq 0xbce0
nop