// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rsi, %r15
movl %edi, %ebx
callq 0x6d50
leaq 0x498f(%rip), %rsi      # 0x8020
movq %rax, %rdi
movl $0x186a0, %edx          # imm = 0x186A0
callq 0x6e82
leaq 0x4987(%rip), %rdi      # 0x802c
callq 0x38ac
cmpl $0x4, %ebx
jg 0x36c7
leaq 0x4e92(%rip), %rdi      # 0x8548
callq 0x33e0
leaq 0x49a3(%rip), %rdi      # 0x8065
callq 0x39d6
movq 0x8(%r15), %rbx
movq 0x10(%r15), %rsi
leaq -0x160(%rbp), %rdi
leaq -0x260(%rbp), %rdx
callq 0x3b22
leaq -0x160(%rbp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x3b00
movl %eax, %r14d
leaq -0x160(%rbp), %rdi
callq 0x3150
movq 0x18(%r15), %rsi
leaq -0x160(%rbp), %rdi
leaq -0x260(%rbp), %rdx
callq 0x3b22
leaq -0x160(%rbp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x3b00
movl %eax, %r12d
leaq -0x160(%rbp), %rdi
callq 0x3150
movq 0x20(%r15), %rsi
leaq -0x160(%rbp), %rdi
leaq -0x260(%rbp), %rdx
callq 0x3b22
movl %r12d, -0x2c(%rbp)
movl %r14d, %r12d
leaq -0x160(%rbp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x3b00
movl %eax, %r15d
leaq -0x160(%rbp), %rdi
callq 0x3150
leaq 0x48ff(%rip), %rsi      # 0x807d
movq %rbx, %rdi
callq 0x3380
movl %eax, %r13d
leaq -0x160(%rbp), %r14
movq %r14, %rdi
callq 0x3b5e
movl %r15d, 0x120(%r14)
movq %r14, %rdi
callq 0x3b7e
xorl %eax, %eax
testl %r13d, %r13d
cmoveq %rax, %rbx
movzwl %r12w, %edx
leaq -0x160(%rbp), %rdi
movq %rbx, %rsi
callq 0x3c1e
leaq -0x160(%rbp), %rdi
movl $0x2710, %esi           # imm = 0x2710
callq 0x3c9c
leaq -0x160(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x4fe8
leaq -0x260(%rbp), %rbx
leaq 0x4909(%rip), %r14      # 0x80fa
leaq 0x4889(%rip), %r15      # 0x8081
pushq $0x5
popq %r12
leaq 0x4883(%rip), %r13      # 0x8086
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x31b0
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3310
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x32d0
testl %eax, %eax
je 0x383b
movq %r13, %rdi
callq 0x3d72
jmp 0x3803
leaq -0x160(%rbp), %rdi
callq 0x3ce0
leaq 0x4846(%rip), %rdi      # 0x8094
callq 0x38ac
leaq -0x160(%rbp), %rdi
callq 0x3e9c
xorl %eax, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3895
jmp 0x387d
jmp 0x388e
jmp 0x387d
jmp 0x388e
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x3150
jmp 0x38a4
movq %rax, %rbx
jmp 0x38a4
jmp 0x3895
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x3e9c
movq %rbx, %rdi
callq 0x3430