user: Converte this assembly snippet into its equivalent C code:

```asm
<thread_listen>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x870,%rsp
  mov    %rdi,-0x868(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x868(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x838(%rbp)
  movl   $0x4,-0x858(%rbp)
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,-0x820(%rbp)
  mov    -0x838(%rbp),%eax
  mov    $0x5,%esi
  mov    %eax,%edi
  call   <listen@plt>
L25:
  lea    -0x858(%rbp),%rdx
  lea    -0x854(%rbp),%rcx
  mov    -0x838(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <accept@plt>
  mov    %eax,-0x834(%rbp)
  mov    -0x854(%rbp),%eax
  mov    %eax,-0x830(%rbp)
  lea    -0x84c(%rbp),%rax
  mov    %rax,%rdi
  call   <time@plt>
  lea    -0x84c(%rbp),%rax
  mov    %rax,%rdi
  call   <localtime@plt>
  mov    %rax,-0x818(%rbp)
  mov    -0x818(%rbp),%rdx
  lea    -0x810(%rbp),%rax
  mov    %rdx,%rcx
  lea    D16(%rip),%rdx
  mov    $0x200,%esi
  mov    %rax,%rdi
  call   <strftime@plt>
  mov    -0x848(%rbp),%ecx
  lea    -0x810(%rbp),%rdx
  lea    -0x610(%rbp),%rax
  mov    $0x200,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,-0x828(%rbp)
  lea    -0x410(%rbp),%rax
  mov    $0x400,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x410(%rbp),%rsi
  mov    -0x834(%rbp),%eax
  mov    $0x0,%ecx
  mov    $0x400,%edx
  mov    %eax,%edi
  call   <recv@plt>
  mov    %eax,-0x82c(%rbp)
  cmpl   $0x0,-0x82c(%rbp)
  jns    L67
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L18
L67:
  lea    -0x410(%rbp),%rax
  lea    D3(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  lea    D3(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,-0x828(%rbp)
L18:
  cmpq   $0x0,-0x828(%rbp)
  je     L25
  movl   $0x1,-0x840(%rbp)
  movl   $0x0,-0x83c(%rbp)
  jmp    L32
L23:
  mov    -0x840(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x828(%rbp),%rax
  add    %rdx,%rax
  mov    -0x83c(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x820(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x840(%rbp)
  addl   $0x1,-0x83c(%rbp)
L32:
  mov    -0x828(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x840(%rbp)
  jl     L23
  lea    -0x850(%rbp),%rdx
  mov    -0x820(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %rax,%rax
  jne    L62
  mov    -0x850(%rbp),%eax
  mov    %eax,-0x844(%rbp)
L62:
  lea    -0x410(%rbp),%r8
  lea    -0x610(%rbp),%rdi
  mov    -0x830(%rbp),%ecx
  mov    -0x844(%rbp),%edx
  mov    -0x828(%rbp),%rsi
  mov    -0x834(%rbp),%eax
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <insertion@plt>
  jmp    L25
```

tool_calls: name: parse_data
arguments: data_label: D16
type_infered: string
name: parse_data
arguments: data_label: D25
type_infered: string
name: parse_data
arguments: data_label: D3
type_infered: string

tool: D16: [%d/%b/%Y : %H:%M:%S %z]

tool: D25: recv error detected ...


tool: D3:  

assistant: ```c
void *thread_listen(void *arg) {
  unsigned int sockfd = *((unsigned int *)arg);
  int i, size;
  unsigned int acceptfd, ids2;
  socklen_t clilen;
  int newsockfd[10], c;
  int n;
  char buffer[256];
  pthread_t t_serve[10];
  struct sockaddr_in cli_addr;
  clilen = sizeof(cli_addr);
  unsigned int retval;
  char request_buffer[1024];
  int retcode;
  off_t file_size;
  char in_buf[1024];
  char *fname = malloc(sizeof(char *));
  struct stat st;
  int k, j;
  int l;
  listen(sockfd, 5);
  while (1) {
    acceptfd = accept(sockfd, (struct sockaddr *)&cli_addr, &clilen);
    if (acceptfd < 0)
      perror("error in accepting");
    unsigned int ip = cli_addr.sin_addr.s_addr;
    time_t now;
    time(&now);
    struct tm *ct = localtime(&now);
    int ch[128], time_arrival[128];
    struct timeval tv;
    strftime(ch, sizeof ch, "[%d/%b/%Y : %H:%M:%S %z]", ct);
    snprintf(time_arrival, sizeof time_arrival, ch, tv.tv_usec);
    char *file_name = malloc(sizeof(char *));
    memset(in_buf, 0, sizeof(in_buf));
    retcode = recv(acceptfd, in_buf, 1024, 0);
    if (retcode < 0) {
      printf("recv error detected ...\n");
    } else {
      strtok(in_buf, " ");
      file_name = strtok(NULL, " ");
    }
    if (file_name != NULL) {
      k = 1, j = 0;
      while (k < strlen(file_name)) {
        fname[j] = file_name[k];
        k++;
        j++;
      }
      if (stat(fname, &st) == 0)
        file_size = st.st_size;
      insertion(acceptfd, file_name, file_size, ip, time_arrival, in_buf);
    } else {
      continue;
    }
  }
}
```