// File: /workspace/github_cpp_makefile_star2_O3/jBlinden[P]private-codis/ProtocolClient.cpp
// Function: StartClient(char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void StartClient(const char *address, int port, string pArgsFile, string clientDataDir)
{
  CSocket *socket = new CSocket();

  if (Connect(socket, address, port))
  {
    ClientLog("successfully connected to server");
  }
  else
  {
    stringstream ss;
    ss << "unable to connect to port " << port << " on address " << address;
    ClientLog(ss.str());
    return;
  }

  auto t_start = chrono::high_resolution_clock::now();

  RunClientProtocol(socket, pArgsFile, clientDataDir);

  auto t_end = chrono::high_resolution_clock::now();
  chrono::duration<float> duration = t_end - t_start;

  ClientLog("protocol execution completed");

  cout << "protocol execution time: " << duration.count() << " seconds" << endl;
  cout << "total bytes sent: " << socket->GetBytesSent() << endl;
  cout << "total bytes received: " << socket->GetBytesReceived() << endl;
  cout << "total bytes communicated (received + sent): " << socket->GetBytesSent() + socket->GetBytesReceived() << endl;


  socket->Close();

  delete socket;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, %r14
movl $0x20, %edi
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebp
callq 0x2250
vxorps %xmm0, %xmm0, %xmm0
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq %rax, %rbx
movq $0x0, 0x18(%rax)
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
vmovups %xmm0, 0x8(%rax)
callq 0x3aa0
testb %al, %al
je 0x350c
leaq 0x80(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x300a(%rip), %rsi      # 0x62c7
leaq 0x3023(%rip), %rdx      # 0x62e7
leaq 0x70(%rsp), %rdi
callq 0x3940
leaq 0x70(%rsp), %rdi
callq 0x317c
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x32e7
callq 0x2210
callq 0x2060
leaq 0x40(%rsp), %rbp
leaq 0x30(%rsp), %rdi
movq %rax, %r14
movq %rbp, -0x10(%rbp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
callq 0x38aa
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x38aa
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x25ec
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x334d
callq 0x2210
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x335c
callq 0x2210
callq 0x2060
leaq 0x70(%rsp), %rdi
movq %rax, %r15
movq %r13, (%rdi)
leaq 0x2f9d(%rip), %rsi      # 0x6310
leaq 0x2fb2(%rip), %rdx      # 0x632c
callq 0x3940
leaq 0x70(%rsp), %rdi
callq 0x317c
subq %r14, %r15
movq 0x70(%rsp), %rdi
vcvtsi2ss %r15, %xmm1, %xmm0
vdivss 0x2ee2(%rip), %xmm0, %xmm0 # 0x6280
vmovss %xmm0, 0xc(%rsp)
cmpq %r13, %rdi
je 0x33ae
callq 0x2210
movq 0x5c23(%rip), %r14      # 0x8fd8
leaq 0x2f71(%rip), %rsi      # 0x632d
movl $0x19, %edx
movq %r14, %rdi
callq 0x22c0
vcvtss2sd 0xc(%rsp), %xmm1, %xmm0
movq %r14, %rdi
callq 0x23a0
leaq 0x2f69(%rip), %rsi      # 0x6347
movl $0x8, %edx
movq %rax, %rdi
movq %rax, %r15
callq 0x22c0
movq (%r15), %rax
movl $0xa, %esi
movq -0x18(%rax), %rdi
addq %r15, %rdi
callq 0x2230
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0x2f34(%rip), %rsi      # 0x6350
movl $0x12, %edx
movq %r14, %rdi
callq 0x22c0
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x2160
movq %rax, %r15
movq (%rax), %rax
movl $0xa, %esi
movq -0x18(%rax), %rdi
addq %r15, %rdi
callq 0x2230
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0x2efd(%rip), %rsi      # 0x6363
movl $0x16, %edx
movq %r14, %rdi
callq 0x22c0
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x2160
movq %rax, %r15
movq (%rax), %rax
movl $0xa, %esi
movq -0x18(%rax), %rdi
addq %r15, %rdi
callq 0x2230
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0x2eca(%rip), %rsi      # 0x637a
movl $0x2c, %edx
movq %r14, %rdi
callq 0x22c0
movq 0x10(%rbx), %rsi
movq %r14, %rdi
addq 0x8(%rbx), %rsi
callq 0x2160
movq %rax, %r14
movq (%rax), %rax
movl $0xa, %esi
movq -0x18(%rax), %rdi
addq %r14, %rdi
callq 0x2230
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x3818
movq %rbx, %rdi
callq 0x2210
jmp 0x35d6
leaq 0x70(%rsp), %rdi
callq 0x2180
leaq 0x80(%rsp), %rbx
leaq 0x2dc3(%rip), %rsi      # 0x62e8
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x22c0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x23e0
leaq 0x2dc0(%rip), %rsi      # 0x6303
movl $0xc, %edx
movq %rax, %rdi
movq %rax, %rbx
callq 0x22c0
testq %r14, %r14
je 0x3570
movq %r14, %rdi
callq 0x2110
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x22c0
jmp 0x3589
movq (%rbx), %rax
movq %rbx, %rdi
movq -0x18(%rax), %rax
movl 0x20(%rbx,%rax), %esi
addq %rax, %rdi
orl $0x1, %esi
callq 0x23c0
leaq 0x88(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x2380
leaq 0x50(%rsp), %rdi
callq 0x317c
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35b8
callq 0x2210
movq 0x59f1(%rip), %rsi      # 0x8fb0
leaq 0x70(%rsp), %rdi
callq 0x21a0
leaq 0xf0(%rsp), %rdi
callq 0x20e0
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x60(%rsp), %rcx
movq %rax, %rbx
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x3645
callq 0x2210
jmp 0x3645
jmp 0x3629
jmp 0x3642
jmp 0x363d
movq 0x10(%rsp), %rdi
movq %rax, %rbx
cmpq %r12, %rdi
je 0x361d
callq 0x2210
jmp 0x361d
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x3636
jmp 0x3663
movq 0x70(%rsp), %rdi
movq %rax, %rbx
cmpq %r13, %rdi
je 0x3663
callq 0x2210
jmp 0x3663
movq %rax, %rbx
jmp 0x3663
movq %rax, %rbx
movq 0x5964(%rip), %rsi      # 0x8fb0
leaq 0x70(%rsp), %rdi
callq 0x21a0
leaq 0xf0(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2400