// File: /workspace/github_cpp_makefile_star2_O1/plasma-umass[P]simplesocket/client.cpp
// Function: main
int main (int argc, char * argv[])
{
  if (argc < 3) {
    cerr << "Usage: " << argv[0] << " <port> <id>" << endl;
    exit (-1);
  }
  int port;
  int id;
  stringstream (argv[1]) >> port;
  stringstream (argv[2]) >> id;
  clientsocket * s = new clientsocket("127.0.0.1", port);
  s->connect();
  stringstream output;
  output << "CLIENT MESSAGE FROM " << id;
  cout << "client about to send: " << output.str().c_str() << endl;
  *s << output.str();
  string result;
  *s >> result;
  cout << "Received: {" << result << "}" << endl;

  s->close();
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rsi, %rbx
cmpl $0x2, %edi
jle 0x28db
movq 0x8(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2a12
leaq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl $0x18, %edx
callq 0x2300
leaq 0x58(%rsp), %rdi
leaq 0x34(%rsp), %rsi
callq 0x2140
movq 0x3983(%rip), %rsi      # 0x5fa8
leaq 0x58(%rsp), %rdi
callq 0x2190
leaq 0xd8(%rsp), %rdi
callq 0x20b0
leaq 0x20(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x2657
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x10(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2a12
leaq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl $0x18, %edx
callq 0x2300
leaq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x2140
movq 0x3914(%rip), %rsi      # 0x5fa8
leaq 0x58(%rsp), %rdi
callq 0x2190
leaq 0xd8(%rsp), %rdi
callq 0x20b0
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x26c2
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
movl $0x1e0, %edi            # imm = 0x1E0
callq 0x2220
movq %rax, %rbx
movl 0x34(%rsp), %edx
leaq 0x193f(%rip), %rsi      # 0x4019
movq %rax, %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
callq 0x2a50
movq %rbx, %rdi
callq 0x3644
leaq 0x58(%rsp), %rdi
callq 0x2170
leaq 0x68(%rsp), %r14
leaq 0x191b(%rip), %rsi      # 0x4023
movl $0x14, %edx
movq %r14, %rdi
callq 0x2260
movl 0x30(%rsp), %esi
movq %r14, %rdi
callq 0x2330
movq 0x38a0(%rip), %r15      # 0x5fc8
leaq 0x1909(%rip), %rsi      # 0x4038
movl $0x16, %edx
movq %r15, %rdi
callq 0x2260
leaq 0x70(%rsp), %r14
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x22f0
movq 0x10(%rsp), %r12
testq %r12, %r12
je 0x2774
movq %r12, %rdi
callq 0x20e0
movq 0x3861(%rip), %rdi      # 0x5fc8
movq %r12, %rsi
movq %rax, %rdx
callq 0x2260
jmp 0x278c
movq (%r15), %rax
movq -0x18(%rax), %rax
leaq (%r15,%rax), %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0x2320
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq 0x381e(%rip), %rdi      # 0x5fc8
callq 0x2030
movq %rax, %rdi
callq 0x2160
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x27ce
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x22f0
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x2a9a
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2803
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x10(%rsp), %rsi
movq %r13, (%rsi)
movq $0x0, 0x8(%rsi)
movb $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x2b82
movq 0x37a2(%rip), %rdi      # 0x5fc8
leaq 0x1822(%rip), %rsi      # 0x404f
movl $0xb, %edx
callq 0x2260
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x3780(%rip), %rdi      # 0x5fc8
callq 0x2260
movq %rax, %r14
leaq 0x1804(%rip), %rsi      # 0x405b
movl $0x1, %edx
movq %rax, %rdi
callq 0x2260
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2160
movq %rbx, %rdi
callq 0x31b2
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x28aa
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x36f7(%rip), %rsi      # 0x5fa8
leaq 0x58(%rsp), %rdi
callq 0x2190
leaq 0xd8(%rsp), %rdi
callq 0x20b0
xorl %eax, %eax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x370e(%rip), %rdi      # 0x5ff0
leaq 0x171b(%rip), %rsi      # 0x4004
callq 0x2210
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2210
leaq 0x170c(%rip), %rsi      # 0x400c
movq %rax, %rdi
callq 0x2210
movq %rax, %rdi
callq 0x20f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2280
movq %rax, %r14
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29eb
movq 0x48(%rsp), %rsi
jmp 0x29e3
jmp 0x29cc
movq %rax, %r14
movl $0x1e0, %esi            # imm = 0x1E0
movq %rbx, %rdi
jmp 0x29be
movq %rax, %r14
movq 0x3653(%rip), %rsi      # 0x5fa8
leaq 0x58(%rsp), %rdi
callq 0x2190
leaq 0xd8(%rsp), %rdi
callq 0x20b0
jmp 0x2971
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
jne 0x29b6
jmp 0x2a09
jmp 0x29c5
movq %rax, %r14
movq 0x361c(%rip), %rsi      # 0x5fa8
leaq 0x58(%rsp), %rdi
callq 0x2190
leaq 0xd8(%rsp), %rdi
callq 0x20b0
jmp 0x29a8
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2a09
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x2a09
movq %rax, %r14
jmp 0x2a09
jmp 0x29d1
movq %rax, %r14
jmp 0x29eb
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x29eb
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x35b6(%rip), %rsi      # 0x5fa8
leaq 0x58(%rsp), %rdi
callq 0x2190
leaq 0xd8(%rsp), %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x2340
nop