user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%edi
  jle    L56
L10:
  mov    0x8(%rbx),%rdi
  call   <atoi@plt>
  mov    %eax,%esi
  lea    D18(%rip),%rdi
  call   <tcpsock_connect@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  js     L83
L14:
  mov    %rsp,%rbx
  mov    $0x80,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    $0x0,%ecx
  mov    $0x80,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <recv@plt>
  mov    %rbx,%rdi
  call   <atoi@plt>
  cmp    $0xffffffff,%eax
  je     L71
L52:
  mov    %rsp,%rsi
  lea    D56(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D82(%rip),%r13
  mov    %rsp,%rbx
  lea    D45(%rip),%r12
  jmp    L54
L56:
  lea    D49(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L10
L83:
  lea    D61(%rip),%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L14
L71:
  mov    %ebp,%edi
  call   <close@plt>
  lea    D64(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L52
L45:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    $0x0,%ecx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <send@plt>
L54:
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x80,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  mov    %rbx,%rdi
  call   <atoi@plt>
  cmp    $0xffffffff,%eax
  jne    L45
  mov    $0x0,%ecx
  mov    $0x2,%edx
  lea    D11(%rip),%rsi
  mov    %ebp,%edi
  call   <send@plt>
  mov    %ebp,%edi
  call   <close@plt>
  lea    D50(%rip),%rdi
  call   <puts@plt>
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L15
  mov    $0x0,%eax
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L15:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D18
data_type: string
name: read_data
arguments: data_tag: D56
data_type: string
name: read_data
arguments: data_tag: D82
data_type: string
name: read_data
arguments: data_tag: D45
data_type: string
name: read_data
arguments: data_tag: D49
data_type: string
name: read_data
arguments: data_tag: D61
data_type: string
name: read_data
arguments: data_tag: D64
data_type: string
name: read_data
arguments: data_tag: D11
data_type: string
name: read_data
arguments: data_tag: D50
data_type: string

tool: D18: 127.0.0.1

tool: D56: Got %s


tool: D82: Enter bogey seq (-1 to exit): 

tool: D45: %s

tool: D49: Usage: ./client <port no>

tool: D61: tcp_connect() 

tool: D64: Platform Busy !!

tool: D11: -1

tool: D50: Train Leaved Platform

assistant: ```c
int main(int argc, char const *argv[]) {
  int port, sfd;
  char buf[128];
  if (argc < 2) {
    printf("Usage: ./client <port no>\n");
    exit(1);
  }
  port = atoi(argv[1]);
  sfd = tcpsock_connect("127.0.0.1", port);
  if (sfd < 0) {
    perror("tcp_connect() ");
    exit(1);
  }
  memset(buf, 0, 128);
  recv(sfd, buf, 128, 0);
  if (atoi(buf) == -1) {
    close(sfd);
    printf("Platform Busy !!\n");
    exit(1);
  }
  printf("Got %s\n", buf);
  while (1) {
    printf("Enter bogey seq (-1 to exit): ");
    memset(buf, 0, 128);
    scanf("%s", buf);
    if (atoi(buf) == -1) {
      send(sfd, "-1", 2, 0);
      close(sfd);
      break;
    }
    send(sfd, buf, strlen(buf), 0);
  }
  printf("Train Leaved Platform\n");
  return 0;
}
```