// File: /workspace/github_cpp_makefile_star2_O1/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 %rcx, %r15
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r14
movl $0x20, %edi
callq 0x2250
movq %rax, %rbx
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
vxorps %xmm0, %xmm0, %xmm0
vmovups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3977
testb %al, %al
je 0x33f4
leaq 0x80(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x2ea6(%rip), %rsi      # 0x604b
leaq 0x2ebf(%rip), %rdx      # 0x606b
leaq 0x70(%rsp), %rdi
callq 0x3822
leaq 0x70(%rsp), %rdi
callq 0x3064
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x31cf
callq 0x2210
callq 0x2060
movq %rax, %r14
leaq 0x40(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x3792
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x3792
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x25ec
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x3235
callq 0x2210
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3244
callq 0x2210
callq 0x2060
movq %rax, %r15
leaq 0x70(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x2e39(%rip), %rsi      # 0x6094
leaq 0x2e4e(%rip), %rdx      # 0x60b0
callq 0x3822
leaq 0x70(%rsp), %rdi
callq 0x3064
subq %r14, %r15
vcvtsi2ss %r15, %xmm1, %xmm0
vdivss 0x2d83(%rip), %xmm0, %xmm0 # 0x6004
vmovss %xmm0, 0xc(%rsp)
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x3296
callq 0x2210
movq 0x5d3b(%rip), %r14      # 0x8fd8
leaq 0x2e0d(%rip), %rsi      # 0x60b1
movl $0x19, %edx
movq %r14, %rdi
callq 0x22c0
vcvtss2sd 0xc(%rsp), %xmm1, %xmm0
movq %r14, %rdi
callq 0x23a0
movq %rax, %r15
leaq 0x2e02(%rip), %rsi      # 0x60cb
movl $0x8, %edx
movq %rax, %rdi
callq 0x22c0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0x2dd0(%rip), %rsi      # 0x60d4
movl $0x12, %edx
movq %r14, %rdi
callq 0x22c0
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x2160
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0x2d99(%rip), %rsi      # 0x60e7
movl $0x16, %edx
movq %r14, %rdi
callq 0x22c0
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x2160
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0x2d66(%rip), %rsi      # 0x60fe
movl $0x2c, %edx
movq %r14, %rdi
callq 0x22c0
movq 0x10(%rbx), %rsi
addq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x2160
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x3700
movq %rbx, %rdi
callq 0x2210
jmp 0x34be
leaq 0x70(%rsp), %rdi
callq 0x2180
leaq 0x80(%rsp), %rbx
leaq 0x2c5f(%rip), %rsi      # 0x606c
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x22c0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x23e0
movq %rax, %rbx
leaq 0x2c59(%rip), %rsi      # 0x6087
movl $0xc, %edx
movq %rax, %rdi
callq 0x22c0
testq %r14, %r14
je 0x3458
movq %r14, %rdi
callq 0x2110
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x22c0
jmp 0x3471
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %rbx, %rdi
addq %rax, %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x23c0
leaq 0x88(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x2380
leaq 0x50(%rsp), %rdi
callq 0x3064
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x34a0
callq 0x2210
movq 0x5b09(%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
movq %rax, %rbx
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x352d
callq 0x2210
jmp 0x352d
jmp 0x3511
jmp 0x352a
jmp 0x3525
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x3505
callq 0x2210
jmp 0x3505
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x351e
jmp 0x354b
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x354b
callq 0x2210
jmp 0x354b
movq %rax, %rbx
jmp 0x354b
movq %rax, %rbx
movq 0x5a7c(%rip), %rsi      # 0x8fb0
leaq 0x70(%rsp), %rdi
callq 0x21a0
leaq 0xf0(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2400