// File: pxzwxx[P]SynBS/./serverFile/server.cpp
// Function: main
int main(int argc, char* args[]) {

	Log::GetLogInstance()->init("./serverLog",100000);
	Log::INFO("--------------------server is start--------------------\n");
	if (argc < 5) {
		printf("main parameters error \n");
		Log::ERROR("main parameters error \n");
	}
		
	const char* strIP = args[1];
	uint16_t nPort = (uint16_t)std::stoi(args[2]);
	int nThread = std::stoi(args[3]);
	int nClient = std::stoi(args[4]);
	
	if (0 == strcmp(strIP, "any")) strIP = nullptr; //代表监控主机所有ip
	EasyEpollServer server;
	server.setMaxClient(nClient);
	server.InitSocket();
	server.Bind(strIP, nPort);
	server.Listen(10000);
	server.Start(nThread);

	//在主线程中等待用户输入命令
	
	while (true) {
		char cmdBuf[256] = {};
		scanf("%s", cmdBuf);
		if (0 == strcmp(cmdBuf, "exit")) {
			server.Close();
			break;
		}
		else {
			Log::WARN("undefine cmd\n");
		}
	}

	Log::INFO("--------------------server is finish--------------------\n");

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x340, %rsp            # imm = 0x340
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0xdbc0
movq %rax, %rdi
leaq 0xb8d4(%rip), %rsi      # 0xf05c
movl $0x186a0, %edx          # imm = 0x186A0
callq 0xdd90
leaq 0xb8cf(%rip), %rdi      # 0xf068
callq 0x3c20
cmpl $0x5, -0x8(%rbp)
jge 0x37be
leaq 0xb8f6(%rip), %rdi      # 0xf0a1
movb $0x0, %al
callq 0x3050
leaq 0xb8e8(%rip), %rdi      # 0xf0a1
callq 0x3e20
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x2f0(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x34d0
movq -0x2f0(%rbp), %rsi
movq -0x2e8(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0x4060
jmp 0x3802
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
movl $0xa, %edx
callq 0x4020
movl %eax, -0x2f4(%rbp)
jmp 0x381c
movl -0x2f4(%rbp), %eax
movw %ax, -0x30a(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3220
leaq -0x41(%rbp), %rdi
callq 0x3370
movw -0x30a(%rbp), %ax
movw %ax, -0x1a(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x308(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0x34d0
movq -0x308(%rbp), %rsi
movq -0x300(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x4060
jmp 0x387e
xorl %eax, %eax
movl %eax, %esi
leaq -0x78(%rbp), %rdi
movl $0xa, %edx
callq 0x4020
movl %eax, -0x310(%rbp)
jmp 0x3898
leaq -0x78(%rbp), %rdi
callq 0x3220
leaq -0x79(%rbp), %rdi
callq 0x3370
movl -0x310(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x320(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x34d0
movq -0x320(%rbp), %rsi
movq -0x318(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x4060
jmp 0x38f1
xorl %eax, %eax
movl %eax, %esi
leaq -0xa0(%rbp), %rdi
movl $0xa, %edx
callq 0x4020
movl %eax, -0x324(%rbp)
jmp 0x390e
leaq -0xa0(%rbp), %rdi
callq 0x3220
leaq -0xa1(%rbp), %rdi
callq 0x3370
movl -0x324(%rbp), %eax
movl %eax, -0x80(%rbp)
movq -0x18(%rbp), %rdi
leaq 0xb77f(%rip), %rsi      # 0xf0b9
callq 0x3420
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x39f1
movq $0x0, -0x18(%rbp)
jmp 0x39f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x397b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3220
leaq -0x41(%rbp), %rdi
callq 0x3370
jmp 0x3b79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x39ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3220
leaq -0x79(%rbp), %rdi
callq 0x3370
jmp 0x3b79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x39e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3220
leaq -0xa1(%rbp), %rdi
callq 0x3370
jmp 0x3b79
leaq -0x1d8(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x4110
movq -0x330(%rbp), %rdi
movl -0x80(%rbp), %esi
callq 0x4150
jmp 0x3a15
leaq -0x1d8(%rbp), %rdi
callq 0x4170
jmp 0x3a23
movq -0x18(%rbp), %rsi
movzwl -0x1a(%rbp), %edx
leaq -0x1d8(%rbp), %rdi
callq 0x4270
jmp 0x3a39
leaq -0x1d8(%rbp), %rdi
movl $0x2710, %esi           # imm = 0x2710
callq 0x4320
jmp 0x3a4c
movl -0x58(%rbp), %esi
leaq -0x1d8(%rbp), %rdi
callq 0x4390
jmp 0x3a5d
jmp 0x3a5f
jmp 0x3a61
xorps %xmm0, %xmm0
movaps %xmm0, -0x340(%rbp)
movaps %xmm0, -0x1f0(%rbp)
movaps %xmm0, -0x200(%rbp)
movaps %xmm0, -0x210(%rbp)
movaps %xmm0, -0x220(%rbp)
movaps %xmm0, -0x230(%rbp)
movaps %xmm0, -0x240(%rbp)
movaps %xmm0, -0x250(%rbp)
movaps %xmm0, -0x260(%rbp)
movaps %xmm0, -0x270(%rbp)
movaps %xmm0, -0x280(%rbp)
movaps %xmm0, -0x290(%rbp)
movaps %xmm0, -0x2a0(%rbp)
movaps %xmm0, -0x2b0(%rbp)
movaps %xmm0, -0x2c0(%rbp)
movaps %xmm0, -0x2d0(%rbp)
movaps %xmm0, -0x2e0(%rbp)
leaq 0xb654(%rip), %rdi      # 0xf136
xorl %eax, %eax
leaq -0x2e0(%rbp), %rsi
callq 0x33c0
jmp 0x3af2
leaq -0x2e0(%rbp), %rdi
leaq 0xb5bd(%rip), %rsi      # 0xf0bd
callq 0x3420
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x3b37
leaq -0x1d8(%rbp), %rdi
callq 0x43c0
jmp 0x3b1b
jmp 0x3b4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x46b0
jmp 0x3b79
leaq 0xb584(%rip), %rdi      # 0xf0c2
callq 0x44b0
jmp 0x3b45
jmp 0x3b47
jmp 0x3a5f
leaq 0xb57d(%rip), %rdi      # 0xf0d0
callq 0x3c20
jmp 0x3b5a
movl $0x0, -0x4(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x46b0
movl -0x4(%rbp), %eax
addq $0x340, %rsp            # imm = 0x340
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x34c0
nopw %cs:(%rax,%rax)