// File: /workspace/github_cpp_makefile_star2_O1/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, -0x38(%rbp)
cmpl $0x0, (%rdx)
jne 0x2e88
movq %rcx, %r14
movq %rdx, %r12
movq %rdi, %rbx
cmpl $-0x1, 0x8(%rdx)
jne 0x2c93
leaq 0x43d5(%rip), %rsi      # 0x7058
movq %r14, %rdi
callq 0x20b0
testl %eax, %eax
je 0x2d5d
movslq 0xc(%r12), %rax
movq 0x138(%rbx), %rcx
movq (%rcx,%rax,8), %r15
movq 0x10(%r12), %rax
movq %rax, -0xa0(%rbp)
movups (%r12), %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 0x39fc
movq -0xa0(%rbp), %rax
movq %rax, 0x10(%rsp)
movaps -0xb0(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x6750
movq -0xd0(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d12
callq 0x2220
leaq 0x4345(%rip), %rsi      # 0x705e
movq %r14, %rdi
callq 0x20b0
testl %eax, %eax
jne 0x2e88
addq $0x150, %rbx            # imm = 0x150
leaq -0x38(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3b30
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3bb2
movq (%r14), %rax
movl 0x2020(%rax), %edi
callq 0x23e0
jmp 0x2e88
xorl %edi, %edi
callq 0x2210
movq %rax, %r15
movq 0x8(%rbx), %rax
movl (%rax), %r13d
xorl %edi, %edi
callq 0x2210
movl 0xc(%r12), %r14d
movq -0x38(%rbp), %r12
movl 0x2020(%r12), %ecx
movl %r13d, -0x2c(%rbp)
movl %r13d, -0x68(%rbp)
movq %rax, %r13
movl %r13d, -0x64(%rbp)
movq %r15, -0x70(%rbp)
movl %r15d, -0x60(%rbp)
movl %ecx, %r15d
movl %r14d, -0x5c(%rbp)
movl %ecx, -0x58(%rbp)
movl $0x5, -0x54(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x429b(%rip), %rsi      # 0x7058
leaq 0x4299(%rip), %rdx      # 0x705d
leaq -0x90(%rbp), %rdi
callq 0x3a96
movq -0x58(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x68(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
leaq -0x90(%rbp), %rsi
callq 0x6750
movslq %r14d, %r12
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x2e08
callq 0x2220
movq 0x138(%rbx), %rax
movq (%rax,%r12,8), %rbx
movl -0x2c(%rbp), %eax
movl %eax, -0x50(%rbp)
movl %r13d, -0x4c(%rbp)
movq -0x70(%rbp), %rax
movl %eax, -0x48(%rbp)
movl %r14d, -0x44(%rbp)
movl %r15d, -0x40(%rbp)
movl $0x5, -0x3c(%rbp)
leaq -0xe0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x4213(%rip), %rsi      # 0x7058
leaq 0x4211(%rip), %rdx      # 0x705d
leaq -0xf0(%rbp), %r14
movq %r14, %rdi
callq 0x3a96
movq -0x40(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x50(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6750
movq -0xf0(%rbp), %rdi
cmpq %r15, %rdi
je 0x2e88
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 0x2ecf
jmp 0x2ed4
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
jne 0x2ecf
jmp 0x2ed4
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
cmpq %r13, %rdi
je 0x2ed4
callq 0x2220
movq %rbx, %rdi
callq 0x2370