user: 请从给定的汇编指令推导出C源代码：

```asm
<sock_ready>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  movss  %xmm0,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x3c(%rbp)
  movq   $0x0,-0x38(%rbp)
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x28(%rbp)
  cmpq   $0x0,-0x60(%rbp)
  je     L49
  lea    -0x44(%rbp),%rax
  mov    %rax,%rdi
  call   <FD_ZERO@plt>
  lea    -0x44(%rbp),%rdx
  mov    -0x54(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_SET@plt>
  lea    -0x44(%rbp),%rax
  mov    %rax,-0x30(%rbp)
L49:
  cmpq   $0x0,-0x68(%rbp)
  je     L6
  lea    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <FD_ZERO@plt>
  lea    -0x40(%rbp),%rdx
  mov    -0x54(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_SET@plt>
  lea    -0x40(%rbp),%rax
  mov    %rax,-0x28(%rbp)
L6:
  movss  -0x58(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comiss %xmm1,%xmm0
  jb     L14
  movss  -0x58(%rbp),%xmm0
  cvttss2si %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  pxor   %xmm1,%xmm1
  cvtsi2ss %rax,%xmm1
  movss  -0x58(%rbp),%xmm0
  subss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D3(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  lea    -0x20(%rbp),%rax
  mov    %rax,-0x38(%rbp)
L14:
  mov    -0x54(%rbp),%eax
  lea    0x1(%rax),%edi
  mov    -0x38(%rbp),%rcx
  mov    -0x28(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rcx,%r8
  mov    $0x0,%ecx
  mov    %rax,%rsi
  call   <select@plt>
  mov    %eax,-0x3c(%rbp)
  cmpl   $0x0,-0x3c(%rbp)
  jns    L37
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0xffffffff,%eax
  jmp    L94
L37:
  cmpl   $0x0,-0x3c(%rbp)
  jne    L86
  mov    $0x0,%eax
  jmp    L94
L86:
  cmpq   $0x0,-0x60(%rbp)
  je     L72
  lea    -0x44(%rbp),%rdx
  mov    -0x54(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L72
  mov    -0x60(%rbp),%rax
  movl   $0x1,(%rax)
  movl   $0x1,-0x3c(%rbp)
L72:
  cmpq   $0x0,-0x68(%rbp)
  je     L80
  lea    -0x40(%rbp),%rdx
  mov    -0x54(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L80
  mov    -0x68(%rbp),%rax
  movl   $0x1,(%rax)
  movl   $0x1,-0x3c(%rbp)
L80:
  mov    -0x3c(%rbp),%eax
L94:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L113
  call   <__stack_chk_fail@plt>
L113:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D3
type_guessed: f64
name: parse_data
arguments: label: D2
type_guessed: string

tool: D3: 1000000

tool: D2: sock_ready: (err) select

assistant: ```c
int sock_ready(int fd, int *to_read, int *to_write, float timeout) {
  int ret = 0;
  struct timeval *tmoutp = NULL;
  struct timeval tmout;
  fd_set *rdsp = NULL;
  fd_set readset;
  fd_set *wrsp = NULL;
  fd_set writeset;
  if (to_read) {
    FD_ZERO(&readset);
    FD_SET(fd, &readset);
    rdsp = &readset;
  }
  if (to_write) {
    FD_ZERO(&writeset);
    FD_SET(fd, &writeset);
    wrsp = &writeset;
  }
  if (timeout >= 0.0) {
    tmout.tv_sec = (long)timeout;
    tmout.tv_usec = (long)((timeout - (float)tmout.tv_sec) * 1e6);
    tmoutp = &tmout;
  }
  ret = select(fd + 1, rdsp, wrsp, NULL, tmoutp);
  if (ret < 0) {
    perror("sock_ready: (err) select");
    return -1;
  }
  if (!ret)
    return 0;
  if (to_read && FD_ISSET(fd, &readset)) {
    *to_read = 1;
    ret = 1;
  }
  if (to_write && FD_ISSET(fd, &writeset)) {
    *to_write = 1;
    ret = 1;
  }
  return ret;
}
```