// File: /workspace/github_cpp_makefile_star2_O3/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, -0x78(%rbp)
cmpl $0x0, (%rdx)
jne 0x337b
movq %rcx, %r14
movq %rdx, %r13
movq %rdi, %rbx
cmpl $-0x1, 0x8(%rdx)
jne 0x3186
movq %rsi, %r15
leaq 0x3ee2(%rip), %rsi      # 0x7058
movq %r14, %rdi
callq 0x20b0
testl %eax, %eax
je 0x324e
movslq 0xc(%r13), %rax
movq 0x138(%rbx), %rcx
movq (%rcx,%rax,8), %r15
movq 0x10(%r13), %rax
movq %rax, -0xa0(%rbp)
movups (%r13), %xmm0
movaps %xmm0, -0xb0(%rbp)
leaq -0xc0(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0xd0(%rbp), %r12
movq %r12, %rdi
callq 0x3eda
movq -0xa0(%rbp), %rax
movq %rax, 0x10(%rsp)
movaps -0xb0(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x6512
movq -0xd0(%rbp), %rdi
cmpq %r13, %rdi
je 0x3203
callq 0x2220
leaq 0x3e54(%rip), %rsi      # 0x705e
movq %r14, %rdi
callq 0x20b0
testl %eax, %eax
jne 0x337b
addq $0x150, %rbx            # imm = 0x150
leaq -0x78(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4016
movq %rbx, %rdi
movq %rax, %rsi
callq 0x409e
movq (%r14), %rax
movl 0x2020(%rax), %edi
callq 0x23e0
jmp 0x337b
xorl %edi, %edi
callq 0x2210
movq %rax, %r12
movq 0x8(%rbx), %rax
movl (%rax), %r14d
xorl %edi, %edi
callq 0x2210
movl 0xc(%r13), %r13d
movl 0x2020(%r15), %ecx
movl %r14d, -0x2c(%rbp)
movl %r14d, -0x60(%rbp)
movl %ecx, %r14d
movq %rax, -0x68(%rbp)
movl %eax, -0x5c(%rbp)
movq %r12, -0x70(%rbp)
movl %r12d, -0x58(%rbp)
movl %r13d, -0x54(%rbp)
movl %ecx, -0x50(%rbp)
movl $0x5, -0x4c(%rbp)
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x3dad(%rip), %rsi      # 0x7058
leaq 0x3dab(%rip), %rdx      # 0x705d
leaq -0x98(%rbp), %r12
movq %r12, %rdi
callq 0x3f78
movq -0x50(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x60(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x6512
movslq %r13d, %r15
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x32f8
callq 0x2220
movq 0x138(%rbx), %rax
movq (%rax,%r15,8), %rbx
movl -0x2c(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x68(%rbp), %rax
movl %eax, -0x44(%rbp)
movq -0x70(%rbp), %rax
movl %eax, -0x40(%rbp)
movl %r13d, -0x3c(%rbp)
movl %r14d, -0x38(%rbp)
movl $0x5, -0x34(%rbp)
leaq -0xe0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x3d20(%rip), %rsi      # 0x7058
leaq 0x3d1e(%rip), %rdx      # 0x705d
leaq -0xf0(%rbp), %r14
movq %r14, %rdi
callq 0x3f78
movq -0x38(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x48(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6512
movq -0xf0(%rbp), %rdi
cmpq %r15, %rdi
je 0x337b
callq 0x2220
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r15, %rdi
jne 0x33c5
jmp 0x33ca
movq %rax, %rbx
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
jne 0x33c5
jmp 0x33ca
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
cmpq %r13, %rdi
je 0x33ca
callq 0x2220
movq %rbx, %rdi
callq 0x2370