user: What is the c source code of the assembly code below?

```asm
<tm_select2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %esi,-0x68(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x64(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
  lea    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <FD_ZERO@plt>
  lea    -0x58(%rbp),%rdx
  mov    -0x64(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_SET@plt>
  mov    -0x64(%rbp),%eax
  mov    %eax,%esi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L40:
  mov    -0x58(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  movq   $0x0,-0x38(%rbp)
  movq   $0x0,-0x40(%rbp)
  movl   $0x4,-0x54(%rbp)
  lea    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <FD_ZERO@plt>
  lea    -0x58(%rbp),%rdx
  mov    -0x64(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_SET@plt>
  mov    -0x4c(%rbp),%eax
  lea    0x1(%rax),%edi
  lea    -0x40(%rbp),%rdx
  lea    -0x58(%rbp),%rax
  mov    %rdx,%r8
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    %rax,%rsi
  call   <select@plt>
  mov    %eax,-0x44(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  jle    L47
  mov    -0x44(%rbp),%eax
  mov    %eax,%esi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  cmpl   $0xffffffff,-0x64(%rbp)
  je     L3
  lea    -0x58(%rbp),%rdx
  mov    -0x64(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L3
  lea    -0x54(%rbp),%rdx
  lea    -0x5c(%rbp),%rcx
  mov    -0x64(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <accept@plt>
  mov    %eax,-0x50(%rbp)
  cmpl   $0x0,-0x50(%rbp)
  jns    L3
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  jmp    L18
L3:
  mov    -0x50(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
  lea    -0x58(%rbp),%rdx
  mov    -0x50(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_CLR@plt>
  lea    -0x58(%rbp),%rdx
  mov    -0x64(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_CLR@plt>
  mov    -0x50(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  jmp    L40
L47:
  nop
L18:
  jmp    L40
```

tool_calls: name: disassemble_data
arguments: label: D7
type_guessed: string
name: disassemble_data
arguments: label: D8
type_guessed: string
name: disassemble_data
arguments: label: D13
type_guessed: string

tool: D7: server sock:%d


tool: D8: select result: %d


tool: D13: accept

assistant: ```c
void tm_select2(int serversock, unsigned int max_client) {
  int clientsock;
  struct sockaddr_in client_addr;
  char currtime[32];
  fd_set readfds, optfds;
  unsigned clientlen, fd_maxsize;
  fd_maxsize = serversock;
  FD_ZERO(&readfds);
  FD_SET(serversock, &readfds);
  printf("server sock:%d\n", serversock);
  while (1) {
    int fd;
    int nread;
    int result;
    optfds = readfds;
    struct timeval timeout;
    timeout.tv_sec = 0;
    timeout.tv_usec = 0;
    clientlen = sizeof(client_addr);
    FD_ZERO(&readfds);
    FD_SET(serversock, &readfds);
    if ((result = select(fd_maxsize + 1, &readfds, (fd_set *)0, (fd_set *)0, &timeout)) <= 0) {
      continue;
    }
    printf("select result: %d\n", result);
    if (serversock != -1 && FD_ISSET(serversock, &readfds)) {
      if ((clientsock = accept(serversock, (struct sockaddr *)&client_addr, &clientlen)) < 0) {
        perror("accept");
        continue;
      }
    }
    fd_maxsize = clientsock;
    FD_CLR(clientsock, &readfds);
    FD_CLR(serversock, &readfds);
    close(clientsock);
  }
}
```