// File: /workspace/github_cpp_makefile_star2_O1/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 0x7764
movq %rsi, %r15
movq 0x8(%rsi), %rdi
leaq 0x15b14(%rip), %rsi     # 0x1d0a8
callq 0x72c0
testl %eax, %eax
jne 0x7764
movq 0x18(%r15), %rdi
leaq 0x15b00(%rip), %rsi     # 0x1d0ac
callq 0x72c0
testl %eax, %eax
jne 0x7764
movq 0x10(%r15), %rdi
leaq 0x15b2c(%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 0x778e
movq %rax, %r12
movslq %r12d, %rax
cmpq %r12, %rax
jne 0x779a
movl (%r14), %eax
cmpl $0x22, %eax
je 0x779a
testl %eax, %eax
jne 0x7644
movl -0x30(%rbp), %eax
movl %eax, (%r14)
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7656
callq 0x7200
movq 0x20(%r15), %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 0x77a6
movq %rax, %r15
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%r15), %rcx
cmpq %rax, %rcx
jb 0x77b2
movl (%r14), %eax
cmpl $0x22, %eax
je 0x77b2
testl %eax, %eax
jne 0x76c9
movl -0x30(%rbp), %eax
movl %eax, (%r14)
movslq %r12d, %r14
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x76de
callq 0x7200
movl $0x48, %edi
callq 0x7230
movq %rax, %r12
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
xorl %eax, %eax
movq %rax, 0x40(%r12)
movq %rax, 0x8(%r12)
leaq 0x20ac8(%rip), %rcx     # 0x281d8
movq %rcx, (%r12)
movq $0x1, 0x18(%r12)
movq %rax, 0x20(%r12)
movslq %r15d, %r8
movq %r12, %rdi
xorl %esi, %esi
movq -0x58(%rbp), %rdx
movq %r14, %rcx
callq 0x7810
movl $0x38, %edi
callq 0x7230
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x7b70
movq 0x10(%r14), %rdi
callq 0x1462c
movq (%r14), %rax
movq %r14, %rdi
callq *0x40(%rax)
jmp 0x7762
movq 0x2286d(%rip), %rax     # 0x29fd8
movq (%rax), %rcx
leaq 0x1593e(%rip), %rdi     # 0x1d0b3
movl $0x3c, %esi
movl $0x1, %edx
callq 0x73d0
movl $0x1, %edi
callq 0x7350
leaq 0x1595d(%rip), %rdi     # 0x1d0f2
callq 0x7140
leaq 0x15951(%rip), %rdi     # 0x1d0f2
callq 0x7300
leaq 0x15945(%rip), %rdi     # 0x1d0f2
callq 0x7140
leaq 0x15939(%rip), %rdi     # 0x1d0f2
callq 0x7300
movq %rax, %rbx
movq %r14, %rdi
jmp 0x7802
jmp 0x77c8
movq %rax, %rbx
jmp 0x7807
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x77dc
movl -0x30(%rbp), %eax
movl %eax, (%r14)
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
jmp 0x77fd
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x77f5
movl -0x30(%rbp), %eax
movl %eax, (%r14)
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7807
callq 0x7200
movq %rbx, %rdi
callq 0x7390
nop