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

```asm
<thread_listen>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x868,%rsp
  mov    (%rdi),%r14d
  mov    $0x8,%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x858(%rsp)
  xor    %eax,%eax
  movl   $0x4,0x40(%rsp)
  lea    0x450(%rsp),%r12
  mov    %r14d,0x1c(%rsp)
  call   <malloc@plt>
  mov    %r14d,%edi
  mov    $0x5,%esi
  lea    0x4c(%rsp),%r14
  mov    %rax,%rbx
  call   <listen@plt>
  lea    0x40(%rsp),%rax
  mov    %rax,0x28(%rsp)
  lea    0x44(%rsp),%rax
  mov    %rax,0x30(%rsp)
  lea    0x50(%rsp),%rax
  mov    %rax,0x20(%rsp)
  lea    0x250(%rsp),%rax
  mov    %rax,0x8(%rsp)
  lea    0x48(%rsp),%rax
  mov    %rax,0x38(%rsp)
  nopl   0x0(%rax)
L2:
  mov    0x28(%rsp),%rdx
  mov    0x30(%rsp),%rsi
  mov    0x1c(%rsp),%edi
  call   <accept@plt>
  mov    %r14,%rdi
  mov    %eax,%ebp
  mov    0x44(%rsp),%eax
  mov    %eax,0x14(%rsp)
  call   <time@plt>
  mov    %r14,%rdi
  call   <localtime@plt>
  mov    0x20(%rsp),%r15
  mov    $0x200,%esi
  lea    D4(%rip),%rdx
  mov    %rax,%rcx
  mov    %r15,%rdi
  call   <strftime@plt>
  mov    0x8(%rsp),%rdi
  xor    %ecx,%ecx
  mov    %r15,%rdx
  mov    $0x200,%esi
  call   <snprintf@plt>
  mov    $0x8,%edi
  call   <malloc@plt>
  xor    %esi,%esi
  mov    $0x400,%edx
  mov    %r12,%rdi
  mov    %rax,%r13
  call   <memset@plt>
  xor    %ecx,%ecx
  mov    $0x400,%edx
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <recv@plt>
  test   %eax,%eax
  js     L32
  lea    D9(%rip),%rsi
  mov    %r12,%rdi
  call   <strtok@plt>
  lea    D9(%rip),%rsi
  xor    %edi,%edi
  call   <strtok@plt>
  mov    %rax,%r13
L18:
  xor    %r15d,%r15d
  test   %r13,%r13
  jne    L20
  jmp    L2
  nopw   0x0(%rax,%rax,1)
L45:
  movzbl 0x0(%r13,%r15,1),%eax
  mov    %al,-0x1(%rbx,%r15,1)
L20:
  mov    %r13,%rdi
  add    $0x1,%r15
  call   <strlen@plt>
  cmp    %r15d,%eax
  jg     L45
  mov    0x38(%rsp),%rsi
  mov    %rbx,%rdi
  call   <stat@plt>
  mov    0x8(%rsp),%r8
  mov    0x14(%rsp),%ecx
  mov    %ebp,%edi
  test   %rax,%rax
  mov    0x18(%rsp),%eax
  cmove  0x48(%rsp),%eax
  mov    %r12,%r9
  mov    %r13,%rsi
  mov    %eax,%edx
  mov    %eax,0x18(%rsp)
  call   <insertion@plt>
  jmp    L2
  cs nopw 0x0(%rax,%rax,1)
L32:
  lea    D0(%rip),%rdi
  call   <printf@plt>
  jmp    L18
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D4
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D9
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D0
type_infered: string

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

tool: D9:  

tool: D0: recv error detected ...


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