user: What would the C source look like for the assembly code provided here?

```asm
<dotunneling>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x1c(%rbp)
  mov    $0x0,%eax
  call   <get_port_foo@plt>
  mov    $0x5,%edx
  mov    %eax,%esi
  mov    $0x0,%edi
  call   <bind_addr@plt>
  mov    %eax,-0x18(%rbp)
  cmpl   $0xffffffff,-0x18(%rbp)
  jne    L48
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  jmp    L35
L48:
  movq   $0x4,-0x10(%rbp)
  lea    -0x10(%rbp),%rdx
  lea    -0x28(%rbp),%rcx
  mov    -0x18(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <accept@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0xffffffff,-0x14(%rbp)
  jne    L54
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  jmp    L35
L54:
  mov    -0x28(%rbp),%eax
  mov    %eax,%edi
  call   <inet_ntoa@plt>
  mov    %rax,%rsi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0x24(%rbp),%rax
  mov    %rax,%rdi
  call   <FD_ZERO@plt>
  lea    -0x24(%rbp),%rdx
  mov    -0x18(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_SET@plt>
  lea    -0x24(%rbp),%rdx
  mov    -0x34(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_SET@plt>
  mov    -0x34(%rbp),%edx
  mov    -0x18(%rbp),%eax
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    %eax,-0x1c(%rbp)
L85:
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x1c(%rbp),%eax
  lea    0x1(%rax),%edi
  lea    -0x20(%rbp),%rax
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    %rax,%rsi
  call   <select@plt>
  cmp    $0xffffffff,%eax
  jne    L27
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L27:
  lea    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L7
  mov    -0x34(%rbp),%edx
  mov    -0x18(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <gotdata@plt>
L7:
  lea    -0x20(%rbp),%rdx
  mov    -0x34(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L85
  mov    -0x18(%rbp),%edx
  mov    -0x34(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <gotdata@plt>
  jmp    L85
L35:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L84
  call   <__stack_chk_fail@plt>
L84:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D1
data_type: string
name: disassemble_data
arguments: data_tag: D9
data_type: string
name: disassemble_data
arguments: data_tag: D24
data_type: string
name: disassemble_data
arguments: data_tag: D17
data_type: string

tool: D1: bind_addr

tool: D9: accept

tool: D24: commserver: got connection from %s


tool: D17: select

assistant: ```c
void dotunneling(int clientsock) {
  int serversock;
  struct hostent *he;
  struct sockaddr_in remote_addr;
  int maxfd = 0;
  size_t sin_size;
  int new_fd;
  fd_set read_fds;
  if ((serversock = bind_addr(NULL, get_port_foo(), 5)) == -1) {
    perror("bind_addr");
    return;
  }
  sin_size = sizeof(struct sockaddr_in);
  if ((new_fd = accept(serversock, (struct sockaddr *)&remote_addr, &sin_size)) == -1) {
    perror("accept");
    return;
  }
  printf("commserver: got connection from %s\n", inet_ntoa(remote_addr.sin_addr));
  FD_ZERO(&read_fds);
  FD_SET(serversock, &read_fds);
  FD_SET(clientsock, &read_fds);
  maxfd = serversock > clientsock ? serversock : clientsock;
  for (;;) {
    fd_set tmpread_fds = read_fds;
    if (select(maxfd + 1, &tmpread_fds, NULL, NULL, NULL) == -1) {
      perror("select");
      exit(1);
    }
    if (FD_ISSET(serversock, &tmpread_fds)) {
      gotdata(serversock, clientsock);
    }
    if (FD_ISSET(clientsock, &tmpread_fds)) {
      gotdata(clientsock, serversock);
    }
  }
}
```