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

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

	std::cout<< "port is: "<<port << "\n";
	NetworkIP* client_ = new NetworkIP();

	client_->client_init(node_idx, ip, port, SERVER_IP, PORT);
	Demo* demo = new Demo(node_idx, 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 0x77b0
movq %rsi, %r12
movq 0x8(%rsi), %rdi
leaq 0x15b04(%rip), %rsi     # 0x1d0a8
callq 0x72d0
testl %eax, %eax
jne 0x77b0
movq 0x18(%r12), %rdi
leaq 0x15aef(%rip), %rsi     # 0x1d0ac
callq 0x72d0
testl %eax, %eax
jne 0x77b0
movq 0x10(%r12), %rdi
leaq 0x15bc0(%rip), %r14     # 0x1d196
movq %r14, %rsi
callq 0x7350
movq %rax, -0x58(%rbp)
xorl %edi, %edi
movq %r14, %rsi
callq 0x7350
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
movq %rax, %rsi
callq 0x70e0
movq -0x50(%rbp), %r13
callq 0x7040
movq %rax, %r15
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movl $0x0, (%r15)
leaq -0x60(%rbp), %rbx
movq %r13, %rdi
movq %rbx, %rsi
movl $0xa, %edx
callq 0x72f0
cmpq %r13, (%rbx)
je 0x77da
movq %rax, %r14
movslq %r14d, %rax
cmpq %r14, %rax
jne 0x77e6
movl (%r15), %eax
cmpl $0x22, %eax
je 0x77e6
testl %eax, %eax
jne 0x7656
movl -0x30(%rbp), %eax
movl %eax, (%r15)
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7668
callq 0x7200
movq 0x20(%r12), %rsi
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x70e0
movq -0x50(%rbp), %rbx
movl (%r15), %eax
movl %eax, -0x30(%rbp)
movl $0x0, (%r15)
leaq -0x60(%rbp), %r13
movq %rbx, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x72f0
cmpq %rbx, (%r13)
je 0x77f2
movq %rax, %r12
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%r12), %rcx
cmpq %rax, %rcx
jb 0x77fe
movl (%r15), %eax
cmpl $0x22, %eax
je 0x77fe
testl %eax, %eax
jne 0x76dd
movl -0x30(%rbp), %eax
movl %eax, (%r15)
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x76ef
callq 0x7200
movq 0x218da(%rip), %rbx     # 0x28fd0
leaq 0x159ee(%rip), %rsi     # 0x1d0eb
movl $0x9, %edx
movq %rbx, %rdi
callq 0x7290
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7170
leaq 0x159cd(%rip), %rsi     # 0x1d0e9
movl $0x1, %edx
movq %rax, %rdi
callq 0x7290
movl $0x48, %edi
callq 0x7230
movq %rax, %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
leaq 0x1fb11(%rip), %rax     # 0x27260
movq %rax, (%r15)
movq $0x1, 0x18(%r15)
movq $0x0, 0x40(%r15)
leaq 0x1598c(%rip), %r8      # 0x1d0f5
movl $0xbb8, %r9d            # imm = 0xBB8
movq %r15, %rdi
movq %r12, %rsi
movq -0x58(%rbp), %rdx
movq %r14, %rcx
callq 0x785c
movl $0x38, %edi
callq 0x7230
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x7b68
movq 0x10(%r14), %rdi
callq 0x14004
movq (%r14), %rax
movq %r14, %rdi
callq *0x40(%rax)
jmp 0x77ae
movq 0x21821(%rip), %rax     # 0x28fd8
movq (%rax), %rcx
leaq 0x158f0(%rip), %rdi     # 0x1d0b1
movl $0x39, %esi
movl $0x1, %edx
callq 0x73f0
movl $0x1, %edi
callq 0x7360
leaq 0x1591e(%rip), %rdi     # 0x1d0ff
callq 0x7140
leaq 0x15912(%rip), %rdi     # 0x1d0ff
callq 0x7310
leaq 0x15906(%rip), %rdi     # 0x1d0ff
callq 0x7140
leaq 0x158fa(%rip), %rdi     # 0x1d0ff
callq 0x7310
movq %rax, %rbx
movq %r14, %rdi
jmp 0x784e
jmp 0x7814
movq %rax, %rbx
jmp 0x7853
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x7828
movl -0x30(%rbp), %eax
movl %eax, (%r15)
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
jmp 0x7849
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x7841
movl -0x30(%rbp), %eax
movl %eax, (%r15)
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7853
callq 0x7200
movq %rbx, %rdi
callq 0x73b0
nop