user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  movl   $0x186a0,-0x2c(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0xffffffff,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movl   $0xffffffff,-0x1c(%rbp)
  movl   $0x0,-0x24(%rbp)
  cmpl   $0x1,-0x34(%rbp)
  jg     L35
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D54(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L54
L35:
  mov    -0x40(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x20(%rbp)
  cmpl   $0x3,-0x34(%rbp)
  jne    L11
  mov    -0x40(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x2c(%rbp)
L11:
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L68
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L54
L68:
  mov    -0x20(%rbp),%eax
  mov    %eax,%esi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <x_create_tcp_server@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0xffffffff,-0x1c(%rbp)
  jne    L121
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0xffffffff,%eax
  jmp    L54
L121:
  movl   $0x0,-0x28(%rbp)
L63:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x1c(%rbp),%eax
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <x_accept@plt>
  mov    %eax,(%rbx)
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0xffffffff,%eax
  jne    L78
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  jmp    L51
L78:
  addl   $0x1,-0x28(%rbp)
  mov    -0x28(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jge    L111
  jmp    L63
L111:
  nop
L51:
  movl   $0x0,-0x24(%rbp)
  jmp    L47
L75:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <x_close@plt>
  addl   $0x1,-0x24(%rbp)
L47:
  mov    -0x24(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L75
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%esi
  lea    D56(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
L54:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D54
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D25
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D6
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D23
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D20
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D56
type_guessed: string

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


tool: D25: malloc failed

tool: D6: 0.0.0.0

tool: D23: create tcp server error

tool: D20: accept error

tool: D56: 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;
}
```