user: 下面的汇编指令对应的C源代码是什么：

```asm
<main_loop>:
  endbr64
  push   %r15
  lea    D31(%rip),%r15
  push   %r14
  push   %r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    $0x478,%rsp
  mov    %edi,0x3c(%rsp)
  lea    0x48(%rsp),%rbx
  lea    0x60(%rsp),%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x468(%rsp)
  xor    %eax,%eax
  lea    0x4c(%rsp),%rax
  movl   $0x0,0x4c(%rsp)
  mov    %rax,0x28(%rsp)
  lea    0x58(%rsp),%rax
  mov    %rax,0x10(%rsp)
  lea    0x50(%rsp),%rax
  mov    %rax,0x20(%rsp)
  lea    0x5c(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    0x54(%rsp),%rax
  mov    %rax,(%rsp)
  lea    0x3c(%rsp),%rax
  movl   $0x0,0x50(%rsp)
  movl   $0x0,0x54(%rsp)
  movl   $0xffffffff,0x58(%rsp)
  movl   $0xffffffff,0x5c(%rsp)
  mov    %rax,0x8(%rsp)
  nopl   (%rax)
L6:
  mov    %rbx,%rdi
  call   <FD_ZERO@plt>
  mov    0x58(%rsp),%edi
  mov    %rbx,%rsi
  test   %edi,%edi
  cmovs  %r12d,%edi
  call   <FD_SET@plt>
  mov    0x5c(%rsp),%edi
  mov    %rbx,%rsi
  test   %edi,%edi
  cmovs  %ebp,%edi
  call   <FD_SET@plt>
  mov    0x3c(%rsp),%edi
  mov    %rbx,%rsi
  call   <FD_SET@plt>
  mov    0x5c(%rsp),%eax
  mov    0x58(%rsp),%edi
  mov    %rbx,%rsi
  cmp    %eax,%edi
  cmovl  %eax,%edi
  mov    0x3c(%rsp),%eax
  cmp    %eax,%edi
  cmovl  %eax,%edi
  cmp    %ebp,%edi
  cmovl  %ebp,%edi
  cmp    %r12d,%edi
  cmovl  %r12d,%edi
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  xor    %edx,%edx
  add    $0x1,%edi
  call   <select@plt>
  test   %rax,%rax
  jns    L12
  mov    %r15,%rdi
  call   <perror@plt>
  jmp    L6
  nopw   0x0(%rax,%rax,1)
L12:
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  jne    L84
L108:
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  jne    L149
L237:
  mov    0x4c(%rsp),%ecx
  test   %ecx,%ecx
  jne    L269
  mov    0x58(%rsp),%edi
  test   %edi,%edi
  jns    L97
L13:
  mov    0x50(%rsp),%edx
  test   %edx,%edx
  jne    L103
L36:
  mov    0x5c(%rsp),%edi
  test   %edi,%edi
  jns    L34
L143:
  mov    0x54(%rsp),%eax
  test   %eax,%eax
  jne    L159
  mov    0x3c(%rsp),%edi
  mov    %rbx,%rsi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L6
L159:
  mov    (%rsp),%rcx
  mov    0x8(%rsp),%rdi
  mov    $0x400,%edx
  mov    %r14,%rsi
  call   <receive_data@plt>
  test   %rax,%rax
  je     L6
  add    %r14,%rax
  mov    %rbx,0x30(%rsp)
  mov    %r14,%rbx
  mov    %rax,%r13
  jmp    L85
  nopl   0x0(%rax,%rax,1)
L30:
  mov    0x58(%rsp),%edi
  test   %edi,%edi
  jns    L208
L43:
  add    $0x1,%rbx
  cmp    %r13,%rbx
  je     L104
L85:
  movzbl (%rbx),%eax
  test   %al,%al
  jns    L30
  mov    0x5c(%rsp),%edi
  test   %edi,%edi
  js     L43
  and    $0x7f,%eax
  mov    $0x1,%edx
  mov    %rbx,%rsi
  mov    %al,(%rbx)
  call   <write@plt>
  test   %rax,%rax
  jns    L43
  lea    D1(%rip),%rdi
  add    $0x1,%rbx
  call   <perror@plt>
  mov    0x18(%rsp),%rdi
  call   <close_conn@plt>
  movl   $0x0,0x50(%rsp)
  cmp    %r13,%rbx
  jne    L85
  nopw   0x0(%rax,%rax,1)
L104:
  mov    0x30(%rsp),%rbx
  jmp    L6
  nopw   0x0(%rax,%rax,1)
L97:
  mov    %rbx,%rsi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L13
L269:
  mov    0x28(%rsp),%rcx
  mov    0x10(%rsp),%rdi
  mov    $0x400,%edx
  mov    %r14,%rsi
  call   <receive_data@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L13
  mov    %rax,%rsi
  mov    %r14,%rdi
  call   <clear_high_bit@plt>
  mov    0x3c(%rsp),%edi
  mov    %r13d,%edx
  mov    %r14,%rsi
  call   <write@plt>
  test   %rax,%rax
  jns    L13
  lea    D1(%rip),%rdi
  call   <perror@plt>
  mov    0x50(%rsp),%edx
  test   %edx,%edx
  je     L36
  nopw   0x0(%rax,%rax,1)
L103:
  mov    0x20(%rsp),%rcx
  mov    0x18(%rsp),%rdi
  mov    $0x400,%edx
  mov    %r14,%rsi
  call   <receive_data@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L143
  mov    %rax,%rsi
  mov    %r14,%rdi
  call   <set_high_bit@plt>
  mov    0x3c(%rsp),%edi
  mov    %r13d,%edx
  mov    %r14,%rsi
  call   <write@plt>
  test   %rax,%rax
  jns    L143
  lea    D1(%rip),%rdi
  call   <perror@plt>
  jmp    L143
  nopw   0x0(%rax,%rax,1)
L208:
  mov    $0x1,%edx
  mov    %rbx,%rsi
  call   <write@plt>
  test   %rax,%rax
  jns    L43
  lea    D1(%rip),%rdi
  call   <perror@plt>
  mov    0x10(%rsp),%rdi
  call   <close_conn@plt>
  movl   $0x0,0x4c(%rsp)
  jmp    L43
  nopl   0x0(%rax)
L149:
  mov    0x5c(%rsp),%edi
  shr    $0x1f,%edi
  call   <assert@plt>
  mov    %ebp,%edi
  call   <accept_conn@plt>
  mov    %eax,0x5c(%rsp)
  jmp    L237
  nopl   0x0(%rax)
L84:
  mov    0x58(%rsp),%edi
  shr    $0x1f,%edi
  call   <assert@plt>
  mov    %r12d,%edi
  call   <accept_conn@plt>
  mov    %eax,0x58(%rsp)
  jmp    L108
  nopl   (%rax)
L34:
  mov    %rbx,%rsi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  jne    L103
  jmp    L143
```

tool_calls: name: read_data
arguments: data_label: D31
type_guessed: string
name: read_data
arguments: data_label: D1
type_guessed: string

tool: D31: select

tool: D1: write

assistant: ```c
void main_loop(int serial_fd, int low_listener, int high_listener) {
  fd_set rdfds;
  int low_poll = 0, high_poll = 0, serial_poll = 0;
  int low_fd = -1, high_fd = -1;
  while (1) {
    char buf[1024];
    ssize_t bytes;
    int max;
    FD_ZERO(&rdfds);
    FD_SET(low_fd < 0 ? low_listener : low_fd, &rdfds);
    FD_SET(high_fd < 0 ? high_listener : high_fd, &rdfds);
    FD_SET(serial_fd, &rdfds);
    max = ((low_fd) < (low_listener) ? (low_listener) : (low_fd));
    max = ((max) < (high_fd) ? (high_fd) : (max));
    max = ((max) < (high_listener) ? (high_listener) : (max));
    max = ((max) < (serial_fd) ? (serial_fd) : (max));
    if (select(max + 1, &rdfds, NULL, NULL, NULL) < 0) {
      perror("select");
      continue;
    }
    if (FD_ISSET(low_listener, &rdfds)) {
      assert(low_fd < 0);
      low_fd = accept_conn(low_listener);
    }
    if (FD_ISSET(high_listener, &rdfds)) {
      assert(high_fd < 0);
      high_fd = accept_conn(high_listener);
    }
    if (low_poll || (low_fd >= 0 && FD_ISSET(low_fd, &rdfds))) {
      if ((bytes = receive_data(&low_fd, &buf[0], sizeof(buf), &low_poll)) > 0) {
        clear_high_bit(&buf[0], bytes);
        if (write(serial_fd, &buf[0], bytes) < 0)
          perror("write");
      }
    }
    if (high_poll || (high_fd >= 0 && FD_ISSET(high_fd, &rdfds))) {
      if ((bytes = receive_data(&high_fd, &buf[0], sizeof(buf), &high_poll)) > 0) {
        set_high_bit(&buf[0], bytes);
        if (write(serial_fd, &buf[0], bytes) < 0)
          perror("write");
      }
    }
    if (serial_poll || FD_ISSET(serial_fd, &rdfds)) {
      if ((bytes = receive_data(&serial_fd, &buf[0], sizeof(buf), &serial_poll)) > 0) {
        ssize_t i;
        for (i = 0; i < bytes; ++i) {
          if (buf[i] & 0x80) {
            if (high_fd >= 0) {
              buf[i] &= 0x7f;
              if ((write(high_fd, &buf[i], 1)) < 0) {
                perror("write");
                close_conn(&high_fd);
                high_poll = 0;
              }
            }
          } else {
            if (low_fd >= 0) {
              if ((write(low_fd, &buf[i], 1)) < 0) {
                perror("write");
                close_conn(&low_fd);
                low_poll = 0;
              }
            }
          }
        }
      }
    }
  }
}
```