// File: /workspace/github_cpp_makefile_star2_O3/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 0x7338
leaq 0x48cf(%rip), %rsi      # 0x8030
movq %rax, %rdi
movl $0x186a0, %edx          # imm = 0x186A0
callq 0x74c6
leaq 0x48c7(%rip), %rdi      # 0x803c
callq 0x3b4a
cmpl $0x4, %ebx
jg 0x3797
leaq 0x4dd2(%rip), %rdi      # 0x8558
callq 0x33a0
leaq 0x48e3(%rip), %rdi      # 0x8075
callq 0x3d06
movq 0x8(%r12), %r14
movq 0x10(%r12), %rsi
leaq -0x170(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x3ec2
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 0x3a91
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x3a9d
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x3a9d
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 0x3ec2
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 0x3aa9
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rcx
cmpq %rdx, %rcx
jb 0x3ab5
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x3ab5
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 0x3ec2
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 0x3ac1
movq %rax, %r12
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x3acd
movl (%rbx), %eax
cmpl $0x22, %eax
je 0x3acd
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 0x437c
leaq 0x8214(%rip), %rax      # 0xbb98
movq %rax, (%r15)
movl %r12d, 0x120(%r15)
movq %r15, %rdi
callq 0x3f00
xorl %eax, %eax
testl %ebx, %ebx
cmoveq %rax, %r14
movzwl -0x40(%rbp), %edx
leaq -0x170(%rbp), %rdi
movq %r14, %rsi
callq 0x3fae
leaq -0x170(%rbp), %rdi
movl $0x2710, %esi           # imm = 0x2710
callq 0x4030
leaq -0x170(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x5450
leaq -0x270(%rbp), %rbx
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3190
leaq 0x471b(%rip), %rdi      # 0x810a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x32e0
movl $0x74697865, %r12d      # imm = 0x74697865
movl (%rbx), %eax
xorl %r12d, %eax
movzbl 0x4(%rbx), %ecx
orl %eax, %ecx
je 0x3a59
leaq 0x4683(%rip), %rbx      # 0x8096
leaq -0x270(%rbp), %r14
leaq 0x46e9(%rip), %r15      # 0x810a
movq %rbx, %rdi
callq 0x410c
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x3190
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x32e0
movl -0x270(%rbp), %eax
xorl %r12d, %eax
movzbl -0x26c(%rbp), %ecx
orl %eax, %ecx
jne 0x3a21
leaq -0x170(%rbp), %rdi
callq 0x4074
leaq 0x4638(%rip), %rdi      # 0x80a4
callq 0x3b4a
leaq -0x170(%rbp), %rdi
callq 0x42c8
xorl %eax, %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4646(%rip), %rdi      # 0x80de
callq 0x31b0
leaq 0x463a(%rip), %rdi      # 0x80de
callq 0x3360
leaq 0x462e(%rip), %rdi      # 0x80de
callq 0x31b0
leaq 0x4622(%rip), %rdi      # 0x80de
callq 0x3360
leaq 0x4616(%rip), %rdi      # 0x80de
callq 0x31b0
leaq 0x460a(%rip), %rdi      # 0x80de
callq 0x3360
jmp 0x3b33
jmp 0x3adf
jmp 0x3adf
movq %rax, %r14
jmp 0x3b42
jmp 0x3ae6
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x3af3
movl -0x30(%rbp), %eax
movl %eax, (%rbx)
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
jmp 0x3b1b
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x3b10
movl -0x38(%rbp), %eax
movl %eax, (%rbx)
leaq -0x160(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b42
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x32a0
jmp 0x3b42
jmp 0x3b33
movq %rax, %r14
leaq -0x170(%rbp), %rdi
callq 0x42c8
movq %r14, %rdi
callq 0x33f0