// File: /workspace/github_cpp_makefile_star2_O3/yasz24[P]eau2/src/network/server.cpp
// Function: main
int main(int argc , char *argv[]) {
	char *ip;
	size_t port;
	size_t num_nodes;

	if (argc != 5  || (strcmp(argv[1], "-ip") != 0) || (strcmp(argv[3], "-nodes") != 0)) {
	    fprintf(stderr,"usage: server -ip <host-ip-address>:PORT -nodes <num_nodes>\n");
	    _exit(1);
	} 
	ip = strtok(argv[2], ":");
    port = std::stoi(strtok(NULL, ":"));
    //std::cout << "port:"<< port << "\n";
	num_nodes = std::stoi(argv[4]);
    //std::cout << "nodes:"<< num_nodes << "\n";

    NetworkIP* client_ = new NetworkIP();

    client_->server_init(0, ip, port, num_nodes);
	Demo* demo = new Demo(0, client_);
	demo->start_kv();
	demo->run_();
	while (true) {

	}
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
cmpl $0x5, %edi
jne 0x774a
movq %rsi, %r12
movq 0x8(%rsi), %rdi
leaq 0x15b24(%rip), %rsi     # 0x1d0a8
callq 0x72c0
testl %eax, %eax
jne 0x774a
movq 0x18(%r12), %rdi
leaq 0x15b0f(%rip), %rsi     # 0x1d0ac
callq 0x72c0
testl %eax, %eax
jne 0x774a
movq 0x10(%r12), %rdi
leaq 0x15b3a(%rip), %r14     # 0x1d0f0
movq %r14, %rsi
callq 0x7340
movq %rax, -0x58(%rbp)
xorl %edi, %edi
movq %r14, %rsi
callq 0x7340
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
movq %rax, %rsi
callq 0x70e0
movq -0x50(%rbp), %r13
callq 0x7040
movq %rax, %r14
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movl $0x0, (%r14)
leaq -0x60(%rbp), %rbx
movq %r13, %rdi
movq %rbx, %rsi
movl $0xa, %edx
callq 0x72e0
cmpq %r13, (%rbx)
je 0x7774
movq %rax, %r15
movslq %r15d, %rax
cmpq %r15, %rax
jne 0x7780
movl (%r14), %eax
cmpl $0x22, %eax
je 0x7780
testl %eax, %eax
jne 0x7636
movl -0x30(%rbp), %eax
movl %eax, (%r14)
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7648
callq 0x7200
movq 0x20(%r12), %rsi
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x70e0
movq -0x50(%rbp), %rbx
movl (%r14), %eax
movl %eax, -0x30(%rbp)
movl $0x0, (%r14)
leaq -0x60(%rbp), %r13
movq %rbx, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x72e0
cmpq %rbx, (%r13)
je 0x778c
movq %rax, %r12
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%r12), %rcx
cmpq %rax, %rcx
jb 0x7798
movl (%r14), %eax
cmpl $0x22, %eax
je 0x7798
testl %eax, %eax
jne 0x76bd
movl -0x30(%rbp), %eax
movl %eax, (%r14)
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x76cf
callq 0x7200
movl $0x48, %edi
callq 0x7230
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
leaq 0x1fb6b(%rip), %rax     # 0x27260
movq %rax, (%r14)
movq $0x1, 0x18(%r14)
movq $0x0, 0x40(%r14)
movq %r14, %rdi
xorl %esi, %esi
movq -0x58(%rbp), %rdx
movq %r15, %rcx
movq %r12, %r8
callq 0x77f6
movl $0x38, %edi
callq 0x7230
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x7ba0
movq 0x10(%r15), %rdi
callq 0x14226
movq (%r15), %rax
movq %r15, %rdi
callq *0x40(%rax)
jmp 0x7748
movq 0x21887(%rip), %rax     # 0x28fd8
movq (%rax), %rcx
leaq 0x15958(%rip), %rdi     # 0x1d0b3
movl $0x3c, %esi
movl $0x1, %edx
callq 0x73d0
movl $0x1, %edi
callq 0x7350
leaq 0x15977(%rip), %rdi     # 0x1d0f2
callq 0x7140
leaq 0x1596b(%rip), %rdi     # 0x1d0f2
callq 0x7300
leaq 0x1595f(%rip), %rdi     # 0x1d0f2
callq 0x7140
leaq 0x15953(%rip), %rdi     # 0x1d0f2
callq 0x7300
movq %rax, %rbx
movq %r15, %rdi
jmp 0x77e8
jmp 0x77ae
movq %rax, %rbx
jmp 0x77ed
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x77c2
movl -0x30(%rbp), %eax
movl %eax, (%r14)
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
jmp 0x77e3
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x77db
movl -0x30(%rbp), %eax
movl %eax, (%r14)
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x77ed
callq 0x7200
movq %rbx, %rdi
callq 0x7390
nop