// File: /workspace/github_cpp_makefile_star2_O2/fieryzig[P]GameServer/GateServer/GateServer.cpp
// Function: fieryzig::GateServer::Dispatch(fieryzig::Client*, fieryzig::PacketInfo*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void GateServer::Dispatch(Client* cli, PacketInfo *ppi, string content) {
	switch(ppi->srcType) {
		case ServerType::CLIENT:
        {
		    PacketInfo pi;
		    if (ppi->uid == -1 && content == "Login") {

		        int uid = Login();
		        pi.srcType = config->type;
		        pi.time = time(NULL);
		        pi.uid = uid;
		        pi.svrid = ppi->svrid;
		        pi.clifd = cli->fd;
		        pi.contentLen = 5;
		        
                cli->Send(pi,"Login");
                Logics[pi.svrid]->Send(pi,"Login");
		    }
		    else {
                Logics[ppi->svrid]->Send(*ppi,content);
                if (content == "Logout") {
                    Clients.erase(cli);
                    close(cli->fd);
                }
		    }
		    break;
        }
		case ServerType::GATEWAY:
        {
		    break;
        }
		case ServerType::LOGIC:
        {
		    break;
        }
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, -0x70(%rbp)
cmpl $0x0, (%rdx)
je 0x27e9
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, %r15
movq %rdx, %r13
movq %rdi, %rbx
cmpl $-0x1, 0x8(%rdx)
jne 0x291a
movq %rsi, %r14
leaq 0x4852(%rip), %rsi      # 0x7058
movq %r15, %rdi
callq 0x3006
testb %al, %al
je 0x291a
xorl %edi, %edi
callq 0x21f0
movq %rax, %r15
movq 0x8(%rbx), %rax
movl (%rax), %r12d
xorl %edi, %edi
callq 0x21f0
movl 0xc(%r13), %r13d
movl 0x2020(%r14), %ecx
movl %r12d, -0x30(%rbp)
movl %r12d, -0x60(%rbp)
movq %rax, %r12
movl %r12d, -0x5c(%rbp)
movq %r15, -0x68(%rbp)
movl %r15d, -0x58(%rbp)
movl %ecx, %r15d
movl %r13d, -0x54(%rbp)
movl %ecx, -0x50(%rbp)
movl $0x5, -0x4c(%rbp)
leaq 0x47f0(%rip), %rsi      # 0x7058
leaq -0xd0(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x20f0
movq -0x50(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x60(%rbp), %xmm0
movups %xmm0, (%rsp)
leaq -0xd0(%rbp), %rsi
movq %r14, %rdi
callq 0x60ae
movslq %r13d, %r14
leaq -0xd0(%rbp), %rdi
callq 0x2130
movq 0x138(%rbx), %rax
movq (%rax,%r14,8), %rbx
movl -0x30(%rbp), %eax
movl %eax, -0x48(%rbp)
movl %r12d, -0x44(%rbp)
movq -0x68(%rbp), %rax
movl %eax, -0x40(%rbp)
movl %r13d, -0x3c(%rbp)
movl %r15d, -0x38(%rbp)
movl $0x5, -0x34(%rbp)
leaq 0x477f(%rip), %rsi      # 0x7058
leaq -0xb0(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x20f0
movq -0x38(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x48(%rbp), %xmm0
movups %xmm0, (%rsp)
leaq -0xb0(%rbp), %rsi
movq %rbx, %rdi
callq 0x60ae
leaq -0xb0(%rbp), %rdi
callq 0x2130
jmp 0x27d7
movslq 0xc(%r13), %rax
movq 0x138(%rbx), %rcx
movq (%rcx,%rax,8), %r14
movq 0x10(%r13), %rax
movq %rax, -0x80(%rbp)
movups (%r13), %xmm0
movaps %xmm0, -0x90(%rbp)
leaq -0xf0(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x22c0
movq -0x80(%rbp), %rax
movq %rax, 0x10(%rsp)
movaps -0x90(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x60ae
leaq -0xf0(%rbp), %rdi
callq 0x2130
leaq 0x46dd(%rip), %rsi      # 0x705e
movq %r15, %rdi
callq 0x3006
testb %al, %al
je 0x27d7
addq $0x150, %rbx            # imm = 0x150
leaq -0x70(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3292
movq (%r14), %rax
movl 0x2020(%rax), %edi
callq 0x23a0
jmp 0x27d7
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
jmp 0x29e3
jmp 0x29d4
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
jmp 0x29e3
movq %rax, %rbx
jmp 0x29e8
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x2340