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

```asm
<tm_select2>:
  endbr64
  push   %r15
  lea    D3(%rip),%r15
  push   %r14
  push   %r13
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x18(%rsp),%rbx
  lea    0x20(%rsp),%r13
  mov    %rbx,%rdi
  call   <FD_ZERO@plt>
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <FD_SET@plt>
  mov    %r12d,%esi
  lea    D20(%rip),%rdi
  call   <printf@plt>
  cmp    $0xffffffff,%r12d
  je     L73
  lea    0x1c(%rsp),%rax
  lea    0x1(%r12),%r14d
  mov    %rax,0x8(%rsp)
  lea    0x14(%rsp),%rax
  mov    %rax,(%rsp)
  nopw   0x0(%rax,%rax,1)
L63:
  pxor   %xmm0,%xmm0
  mov    %rbx,%rdi
  movl   $0x4,0x1c(%rsp)
  movaps %xmm0,0x20(%rsp)
  call   <FD_ZERO@plt>
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <FD_SET@plt>
  mov    %rbx,%rsi
  mov    %r13,%r8
  xor    %ecx,%ecx
  xor    %edx,%edx
  mov    %r14d,%edi
  call   <select@plt>
  mov    %eax,%esi
  test   %eax,%eax
  jle    L63
  mov    %r15,%rdi
  call   <printf@plt>
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  jne    L18
L37:
  mov    %rbx,%rsi
  mov    %ebp,%edi
  lea    0x1(%rbp),%r14d
  call   <FD_CLR@plt>
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <FD_CLR@plt>
  mov    %ebp,%edi
  call   <close@plt>
  jmp    L63
  nopw   0x0(%rax,%rax,1)
L38:
  mov    %r15,%rdi
  xor    %ebp,%ebp
  call   <printf@plt>
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <FD_CLR@plt>
  mov    $0xffffffff,%edi
  mov    %rbx,%rsi
  call   <FD_CLR@plt>
  mov    %ebp,%edi
  call   <close@plt>
L73:
  pxor   %xmm1,%xmm1
  mov    %rbx,%rdi
  movl   $0x4,0x1c(%rsp)
  movaps %xmm1,0x20(%rsp)
  call   <FD_ZERO@plt>
  mov    %rbx,%rsi
  mov    $0xffffffff,%edi
  call   <FD_SET@plt>
  mov    %rbx,%rsi
  mov    %r13,%r8
  xor    %ecx,%ecx
  xor    %edx,%edx
  xor    %edi,%edi
  call   <select@plt>
  mov    %eax,%esi
  test   %eax,%eax
  jle    L73
  jmp    L38
  nopw   0x0(%rax,%rax,1)
L18:
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%rsi
  mov    %r12d,%edi
  call   <accept@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  jns    L37
  lea    D6(%rip),%rdi
  call   <perror@plt>
  jmp    L63
```

tool_calls: name: extract_symbolic_data
arguments: tag: D3
type_infered: string
name: extract_symbolic_data
arguments: tag: D20
type_infered: string
name: extract_symbolic_data
arguments: tag: D6
type_infered: string

tool: D3: select result: %d


tool: D20: server sock:%d


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