// File: /workspace/github_cpp_makefile_star2_O1/fieryzig[P]GameServer/GateServer/GateServer.cpp
// Function: fieryzig::GateServer::acceptConnect()
void GateServer::acceptConnect()
{
    socklen_t clilen;
    connfd = accept(listenfd, (sockaddr*)&clientaddr, &clilen);
    Client *client = new Client(connfd);
    string ip = inet_ntoa(clientaddr.sin_addr);
    int port = clientaddr.sin_port;
    if (find(logic_ip.begin(), logic_ip.end(), make_pair(ip,port)) == logic_ip.end()) {
        Clients.insert(client);
        cout << "A Client has connected!" << endl;
    }
    else {
        cout << "Logic connected,";
        Logics.push_back(client);
        cout << "now Logic servers " << Logics.size() << endl; 
    }
    ev.data.ptr = client;
    ev.events = EPOLLIN | EPOLLERR;
    epoll_ctl(epfd, EPOLL_CTL_ADD, connfd, &ev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movl 0x14(%rdi), %edi
leaq 0x118(%rbx), %rsi
leaq -0x34(%rbp), %rdx
callq 0x20d0
movl %eax, %r14d
movl %eax, 0x18(%rbx)
movl $0x2024, %edi           # imm = 0x2024
callq 0x2250
xorl %ecx, %ecx
movq %rcx, 0x1004(%rax)
movl %ecx, 0x100c(%rax)
movq %rcx, 0x2014(%rax)
movl %ecx, 0x201c(%rax)
movl %r14d, 0x2020(%rax)
movq %rax, -0x30(%rbp)
movl 0x11c(%rbx), %edi
callq 0x2130
leaq -0x80(%rbp), %r12
leaq -0x60(%rbp), %rdx
movq %r12, %rdi
movq %rax, %rsi
callq 0x2100
movzwl 0x11a(%rbx), %r13d
movq 0x180(%rbx), %r14
movq 0x188(%rbx), %r15
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x60(%rbp), %rdi
callq 0x39fc
leaq -0x60(%rbp), %rdx
movl %r13d, 0x20(%rdx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x5f0c
movq %rax, %r14
movq 0x188(%rbx), %r15
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x36be
callq 0x2220
cmpq %r15, %r14
je 0x36fc
movq 0x990e(%rip), %rdi      # 0xcfd8
leaq 0x3a2f(%rip), %rsi      # 0x7100
movl $0x10, %edx
callq 0x2290
movq 0x140(%rbx), %rsi
cmpq 0x148(%rbx), %rsi
je 0x373d
movq -0x30(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0x140(%rbx)
jmp 0x374d
leaq 0x150(%rbx), %rdi
leaq -0x30(%rbp), %rsi
callq 0x6074
movq 0x98c5(%rip), %r14      # 0xcfd8
leaq 0x39ce(%rip), %rsi      # 0x70e8
movl $0x17, %edx
movq %r14, %rdi
callq 0x2290
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2230
jmp 0x379a
leaq 0x138(%rbx), %rdi
leaq -0x30(%rbp), %rdx
callq 0x61a0
movq 0x9884(%rip), %rdi      # 0xcfd8
leaq 0x39b6(%rip), %rsi      # 0x7111
movl $0x12, %edx
callq 0x2290
movq 0x140(%rbx), %rsi
subq 0x138(%rbx), %rsi
sarq $0x3, %rsi
movq 0x985a(%rip), %rdi      # 0xcfd8
callq 0x21a0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x21b0
movq -0x30(%rbp), %rax
leaq 0x1c(%rbx), %rcx
movq %rax, 0x20(%rbx)
movl $0x9, 0x1c(%rbx)
movl 0x10(%rbx), %edi
movl 0x18(%rbx), %edx
movl $0x1, %esi
callq 0x22e0
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x37e2
callq 0x2220
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x380d
callq 0x2220
jmp 0x380d
jmp 0x380a
movq %rax, %rbx
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x381f
callq 0x2220
movq %rbx, %rdi
callq 0x2370
nop