// File: /workspace/github_cpp_makefile_star2_O1/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 0x77cd
movq %rsi, %r15
movq 0x8(%rsi), %rdi
leaq 0x15af4(%rip), %rsi     # 0x1d0a8
callq 0x72d0
testl %eax, %eax
jne 0x77cd
movq 0x18(%r15), %rdi
leaq 0x15ae0(%rip), %rsi     # 0x1d0ac
callq 0x72d0
testl %eax, %eax
jne 0x77cd
movq 0x10(%r15), %rdi
leaq 0x15bb2(%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, %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 0x72f0
cmpq %r13, (%rbx)
je 0x77f7
movq %rax, %r12
movslq %r12d, %rax
cmpq %r12, %rax
jne 0x7803
movl (%r14), %eax
cmpl $0x22, %eax
je 0x7803
testl %eax, %eax
jne 0x7664
movl -0x30(%rbp), %eax
movl %eax, (%r14)
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7676
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 0x72f0
cmpq %rbx, (%r13)
je 0x780f
movq %rax, %r15
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%r15), %rcx
cmpq %rax, %rcx
jb 0x781b
movl (%r14), %eax
cmpl $0x22, %eax
je 0x781b
testl %eax, %eax
jne 0x76e9
movl -0x30(%rbp), %eax
movl %eax, (%r14)
movslq %r12d, %r14
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x76fe
callq 0x7200
movq 0x228cb(%rip), %rbx     # 0x29fd0
leaq 0x159df(%rip), %rsi     # 0x1d0eb
movl $0x9, %edx
movq %rbx, %rdi
callq 0x7290
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7170
leaq 0x159be(%rip), %rsi     # 0x1d0e9
movl $0x1, %edx
movq %rax, %rdi
callq 0x7290
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 0x20a6e(%rip), %rcx     # 0x281d8
movq %rcx, (%r12)
movq $0x1, 0x18(%r12)
movq %rax, 0x20(%r12)
movslq %r15d, %rbx
leaq 0x1596f(%rip), %r8      # 0x1d0f5
movl $0xbb8, %r9d            # imm = 0xBB8
movq %r12, %rdi
movq %rbx, %rsi
movq -0x58(%rbp), %rdx
movq %r14, %rcx
callq 0x7878
movl $0x38, %edi
callq 0x7230
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x7b74
movq 0x10(%r14), %rdi
callq 0x1444a
movq (%r14), %rax
movq %r14, %rdi
callq *0x40(%rax)
jmp 0x77cb
movq 0x22804(%rip), %rax     # 0x29fd8
movq (%rax), %rcx
leaq 0x158d3(%rip), %rdi     # 0x1d0b1
movl $0x39, %esi
movl $0x1, %edx
callq 0x73f0
movl $0x1, %edi
callq 0x7360
leaq 0x15901(%rip), %rdi     # 0x1d0ff
callq 0x7140
leaq 0x158f5(%rip), %rdi     # 0x1d0ff
callq 0x7310
leaq 0x158e9(%rip), %rdi     # 0x1d0ff
callq 0x7140
leaq 0x158dd(%rip), %rdi     # 0x1d0ff
callq 0x7310
movq %rax, %rbx
movq %r14, %rdi
jmp 0x786b
jmp 0x7831
movq %rax, %rbx
jmp 0x7870
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x7845
movl -0x30(%rbp), %eax
movl %eax, (%r14)
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
jmp 0x7866
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x785e
movl -0x30(%rbp), %eax
movl %eax, (%r14)
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7870
callq 0x7200
movq %rbx, %rdi
callq 0x73b0