// File: 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
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0xc0(%rbp)
movl 0x14(%rsi), %edi
addq $0x118, %rsi            # imm = 0x118
leaq -0xc(%rbp), %rdx
callq 0x20d0
movl %eax, %ecx
movq -0xc0(%rbp), %rax
movl %ecx, 0x18(%rax)
movl $0x2024, %edi           # imm = 0x2024
callq 0x2250
movq %rax, %rdi
movq -0xc0(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0xb8(%rbp)
movl 0x18(%rax), %esi
callq 0x4190
jmp 0x36d1
movq -0xc0(%rbp), %rax
movq -0xb8(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movl 0x11c(%rax), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %edi
callq 0x2130
movq %rax, -0xd0(%rbp)
leaq -0x4d(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x23e0
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x2320
jmp 0x3724
leaq -0x4d(%rbp), %rdi
callq 0x2290
movq -0xc0(%rbp), %rdi
movzwl 0x11a(%rdi), %eax
movl %eax, -0x54(%rbp)
addq $0x180, %rdi            # imm = 0x180
movq %rdi, -0xd8(%rbp)
callq 0x4260
movq -0xd8(%rbp), %rdi
movq %rax, -0x68(%rbp)
callq 0x4290
movq %rax, -0x70(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x54(%rbp), %rdx
callq 0x40a0
jmp 0x377b
movq -0x68(%rbp), %rdi
movq -0x70(%rbp), %rsi
leaq -0x98(%rbp), %rdx
callq 0x4210
movq %rax, -0xe0(%rbp)
jmp 0x3798
movq -0xc0(%rbp), %rdi
movq -0xe0(%rbp), %rax
movq %rax, -0x60(%rbp)
addq $0x180, %rdi            # imm = 0x180
callq 0x4290
movq %rax, -0xa0(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x41d0
movb %al, -0xe1(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x40e0
movb -0xe1(%rbp), %al
testb $0x1, %al
jne 0x37ee
jmp 0x38c9
movq -0xc0(%rbp), %rdi
addq $0x150, %rdi            # imm = 0x150
leaq -0x18(%rbp), %rsi
callq 0x42c0
movb %dl, -0xf1(%rbp)
movq %rax, -0xf0(%rbp)
jmp 0x3814
movb -0xf1(%rbp), %al
movq -0xf0(%rbp), %rcx
movq %rcx, -0xb0(%rbp)
movb %al, -0xa8(%rbp)
movq 0x137a3(%rip), %rdi     # 0x16fd8
leaq 0xa8a4(%rip), %rsi      # 0xe0e0
callq 0x2240
movq %rax, -0x100(%rbp)
jmp 0x384a
movq -0x100(%rbp), %rdi
movq 0x13770(%rip), %rsi     # 0x16fc8
callq 0x2270
jmp 0x385f
jmp 0x3955
movq -0xb8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x2230
jmp 0x399a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x4d(%rbp), %rdi
callq 0x2290
jmp 0x399a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x3991
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x40e0
jmp 0x3991
movq 0x13708(%rip), %rdi     # 0x16fd8
leaq 0xa821(%rip), %rsi      # 0xe0f8
callq 0x2240
jmp 0x38de
movq -0xc0(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
leaq -0x18(%rbp), %rsi
callq 0x4310
jmp 0x38f7
movq 0x136da(%rip), %rdi     # 0x16fd8
leaq 0xa804(%rip), %rsi      # 0xe109
callq 0x2240
movq %rax, -0x108(%rbp)
jmp 0x3913
movq -0xc0(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
callq 0x4380
movq -0x108(%rbp), %rdi
movq %rax, %rsi
callq 0x2080
movq %rax, -0x110(%rbp)
jmp 0x393e
movq -0x110(%rbp), %rdi
movq 0x1367c(%rip), %rsi     # 0x16fc8
callq 0x2270
jmp 0x3953
jmp 0x3955
movq -0xc0(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rax, 0x20(%rcx)
movl $0x9, 0x1c(%rcx)
movl 0x10(%rcx), %edi
movl 0x18(%rcx), %edx
addq $0x1c, %rcx
movl $0x1, %esi
callq 0x2330
leaq -0x48(%rbp), %rdi
callq 0x21a0
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x21a0
movq -0x20(%rbp), %rdi
callq 0x23d0
nopw %cs:(%rax,%rax)
nopl (%rax)