// File: /workspace/github_cpp_makefile_star2_O1/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 $0x248, %rsp            # imm = 0x248
movq %rsi, %r12
movl %edi, %ebx
callq 0x7358
leaq 0x48cf(%rip), %rsi      # 0x8030
movq %rax, %rdi
movl $0x186a0, %edx          # imm = 0x186A0
callq 0x74e4
leaq 0x48c7(%rip), %rdi      # 0x803c
callq 0x3b22
cmpl $0x4, %ebx
jg 0x3797
leaq 0x4dd2(%rip), %rdi      # 0x8558
callq 0x33a0
leaq 0x48e3(%rip), %rdi      # 0x8075
callq 0x3cde
movq 0x8(%r12), %r14
movq 0x10(%r12), %rsi
leaq -0x170(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x3e9a
movq -0x170(%rbp), %r13
callq 0x3040
movq %rax, %rbx
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movl $0x0, (%rbx)
leaq -0x270(%rbp), %r15
movq %r13, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x3350
cmpq %r13, (%r15)
je 0x3a6b
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x3a77
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x3a77
movq %rax, -0x40(%rbp)
testl %ecx, %ecx
jne 0x380f
movl -0x38(%rbp), %eax
movl %eax, (%rbx)
leaq -0x160(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x382e
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x32a0
movq 0x18(%r12), %rsi
leaq -0x170(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x3e9a
movq -0x170(%rbp), %r15
movl (%rbx), %eax
movl %eax, -0x30(%rbp)
movl $0x0, (%rbx)
leaq -0x270(%rbp), %r13
movq %r15, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x3350
cmpq %r15, (%r13)
je 0x3a83
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rcx
cmpq %rdx, %rcx
jb 0x3a8f
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x3a8f
movq %rax, -0x38(%rbp)
testl %ecx, %ecx
jne 0x38a8
movl -0x30(%rbp), %eax
movl %eax, (%rbx)
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0x38ca
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x32a0
movq 0x20(%r12), %rsi
leaq -0x170(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x3e9a
movq -0x170(%rbp), %r15
movl (%rbx), %eax
movl %eax, -0x30(%rbp)
movl $0x0, (%rbx)
movq %r15, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x3350
cmpq %r15, (%r13)
je 0x3a9b
movq %rax, %r12
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x3aa7
movl (%rbx), %eax
cmpl $0x22, %eax
je 0x3aa7
testl %eax, %eax
jne 0x393b
movl -0x30(%rbp), %eax
movl %eax, (%rbx)
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0x395d
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x32a0
leaq 0x4729(%rip), %rsi      # 0x808d
movq %r14, %rdi
callq 0x3330
movl %eax, %ebx
leaq -0x170(%rbp), %r15
movq %r15, %rdi
callq 0x4362
leaq 0x8214(%rip), %rax      # 0xbb98
movq %rax, (%r15)
movl %r12d, 0x120(%r15)
movq %r15, %rdi
callq 0x3ed8
xorl %eax, %eax
testl %ebx, %ebx
cmoveq %rax, %r14
movzwl -0x40(%rbp), %edx
leaq -0x170(%rbp), %rdi
movq %r14, %rsi
callq 0x3f98
leaq -0x170(%rbp), %rdi
movl $0x2710, %esi           # imm = 0x2710
callq 0x401a
leaq -0x170(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x5440
leaq -0x270(%rbp), %rbx
leaq 0x472a(%rip), %r14      # 0x810a
movl $0x74697865, %r13d      # imm = 0x74697865
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3190
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x32e0
movl -0x270(%rbp), %eax
xorl %r13d, %eax
movzbl -0x26c(%rbp), %ecx
xorl %r15d, %r15d
orl %eax, %ecx
setne %r12b
je 0x3a2b
leaq 0x4672(%rip), %rdi      # 0x8096
callq 0x40f2
jmp 0x3a37
leaq -0x170(%rbp), %rdi
callq 0x405e
movb %r12b, %r15b
testl %r15d, %r15d
jne 0x39e6
leaq 0x465e(%rip), %rdi      # 0x80a4
callq 0x3b22
leaq -0x170(%rbp), %rdi
callq 0x42ae
xorl %eax, %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x466c(%rip), %rdi      # 0x80de
callq 0x31b0
leaq 0x4660(%rip), %rdi      # 0x80de
callq 0x3360
leaq 0x4654(%rip), %rdi      # 0x80de
callq 0x31b0
leaq 0x4648(%rip), %rdi      # 0x80de
callq 0x3360
leaq 0x463c(%rip), %rdi      # 0x80de
callq 0x31b0
leaq 0x4630(%rip), %rdi      # 0x80de
callq 0x3360
jmp 0x3ab7
jmp 0x3ab7
movq %rax, %r14
jmp 0x3b1a
jmp 0x3abe
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x3acb
movl -0x30(%rbp), %eax
movl %eax, (%rbx)
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
jmp 0x3af3
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x3ae8
movl -0x38(%rbp), %eax
movl %eax, (%rbx)
leaq -0x160(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b1a
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x32a0
jmp 0x3b1a
jmp 0x3b0b
movq %rax, %r14
leaq -0x170(%rbp), %rdi
callq 0x42ae
movq %r14, %rdi
callq 0x33f0