user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%rbp
  cmp    $0x1,%edi
  jle    L72
  mov    %edi,%ebx
  mov    0x8(%rsi),%rdi
  call   <atoi@plt>
  mov    %eax,%r12d
  mov    $0x186a0,%r14d
  cmp    $0x3,%ebx
  je     L94
L35:
  lea    0x0(,%r14,4),%edi
  call   <malloc@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L117
  mov    %r12d,%esi
  lea    D55(%rip),%rdi
  call   <x_create_tcp_server@plt>
  mov    %eax,%r13d
  cmp    $0xffffffff,%eax
  je     L22
  mov    %r15,%rbx
  mov    %r15,%r12
  mov    $0x0,%ebp
L12:
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %r13d,%edi
  call   <x_accept@plt>
  mov    %eax,(%r12)
  cmp    $0xffffffff,%eax
  je     L54
  add    $0x1,%ebp
  add    $0x4,%r12
  cmp    %ebp,%r14d
  jg     L12
  jmp    L109
L72:
  mov    (%rsi),%rsi
  lea    D20(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%r13d
  jmp    L91
L94:
  mov    0x10(%rbp),%rdi
  call   <atoi@plt>
  mov    %eax,%r14d
  jmp    L35
L117:
  lea    D2(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%r13d
  jmp    L91
L22:
  lea    D36(%rip),%rdi
  call   <perror@plt>
  jmp    L91
L54:
  lea    D18(%rip),%rdi
  call   <perror@plt>
L109:
  test   %ebp,%ebp
  jle    L38
  lea    -0x1(%rbp),%eax
  lea    0x4(%r15,%rax,4),%r12
L45:
  mov    (%rbx),%edi
  call   <x_close@plt>
  add    $0x4,%rbx
  cmp    %r12,%rbx
  jne    L45
L38:
  lea    0x1(%rbp),%esi
  lea    D48(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    $0x0,%r13d
L91:
  mov    %r13d,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D55
type_infered: string
name: retrieve_data
arguments: data_tag: D20
type_infered: string
name: retrieve_data
arguments: data_tag: D2
type_infered: string
name: retrieve_data
arguments: data_tag: D36
type_infered: string
name: retrieve_data
arguments: data_tag: D18
type_infered: string
name: retrieve_data
arguments: data_tag: D48
type_infered: string

tool: D55: 0.0.0.0

tool: D20: usage: %s <port> [max_connect]


tool: D2: malloc failed

tool: D36: create tcp server error

tool: D18: accept error

tool: D48: accept %d connect


assistant: ```c
int main(int argc, char *argv[]) {
  int max_conns = 100000;
  int i = 0;
  int port = -1;
  int *conns = NULL;
  int fd = -1;
  int j = 0;
  if (argc < 2) {
    printf("usage: %s <port> [max_connect]\n", argv[0]);
    return -1;
  }
  port = atoi(argv[1]);
  if (argc == 3) {
    max_conns = atoi(argv[2]);
  }
  conns = (int *)malloc(sizeof(int) * max_conns);
  if (conns == NULL) {
    printf("malloc failed");
    return -1;
  }
  fd = x_create_tcp_server("0.0.0.0", port);
  if (fd == -1) {
    perror("create tcp server error");
    return -1;
  }
  i = 0;
  while (1) {
    conns[i] = x_accept(fd, NULL, NULL);
    if (conns[i] == -1) {
      perror("accept error");
      break;
    }
    i++;
    if (i >= max_conns) {
      break;
    }
  }
  for (j = 0; j < i; j++) {
    x_close(conns[j]);
  }
  printf("accept %d connect\n", i + 1);
  free(conns);
  return 0;
}
```