user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x98,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%edi
  jle    L50
L83:
  mov    0x8(%rbx),%rdi
  call   <atoi@plt>
  lea    D9(%rip),%rdi
  mov    %eax,%esi
  call   <tcpsock_connect@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  js     L37
L29:
  mov    %rsp,%rbx
  xor    %esi,%esi
  mov    $0x80,%edx
  mov    %rbx,%rdi
  call   <memset@plt>
  xor    %ecx,%ecx
  mov    %ebp,%edi
  mov    $0x80,%edx
  mov    %rbx,%rsi
  call   <recv@plt>
  mov    %rbx,%rdi
  call   <atoi@plt>
  cmp    $0xffffffff,%eax
  je     L13
L25:
  mov    %rbx,%rsi
  lea    D2(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D62(%rip),%r13
  lea    D29(%rip),%r12
  jmp    L85
  cs nopw 0x0(%rax,%rax,1)
L81:
  mov    %rbx,%rdi
  call   <strlen@plt>
  xor    %ecx,%ecx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  mov    %eax,%edx
  call   <send@plt>
L85:
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %esi,%esi
  mov    $0x80,%edx
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    %r12,%rdi
  mov    %rbx,%rsi
  call   <scanf@plt>
  mov    %rbx,%rdi
  call   <atoi@plt>
  cmp    $0xffffffff,%eax
  jne    L81
  xor    %ecx,%ecx
  mov    $0x2,%edx
  lea    D35(%rip),%rsi
  mov    %ebp,%edi
  call   <send@plt>
  mov    %ebp,%edi
  call   <close@plt>
  lea    D72(%rip),%rdi
  call   <puts@plt>
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L68
  add    $0x98,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L50:
  lea    D59(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L83
L37:
  lea    D66(%rip),%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L29
L13:
  mov    %ebp,%edi
  call   <close@plt>
  lea    D83(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L25
L68:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D9
type_guessed: string
name: retrieve_data
arguments: tag: D2
type_guessed: string
name: retrieve_data
arguments: tag: D62
type_guessed: string
name: retrieve_data
arguments: tag: D29
type_guessed: string
name: retrieve_data
arguments: tag: D35
type_guessed: string
name: retrieve_data
arguments: tag: D72
type_guessed: string
name: retrieve_data
arguments: tag: D59
type_guessed: string
name: retrieve_data
arguments: tag: D66
type_guessed: string
name: retrieve_data
arguments: tag: D83
type_guessed: string

tool: D9: 127.0.0.1

tool: D2: Got %s


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

tool: D29: %s

tool: D35: -1

tool: D72: Train Leaved Platform

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

tool: D66: tcp_connect() 

tool: D83: Platform Busy !!

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;
}
```