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

```asm
<rt_modbus_read_input_table>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  lea    D37(%rip),%rdi
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  call   <printf@plt>
  lea    0x8(%rbp),%rsi
  mov    $0x2,%edx
  mov    %r12,%rdi
  call   <memcpy@plt>
  mov    %r12,%rdi
  lea    0x4(%rsp),%r12
  call   <swap16@plt>
  mov    $0x2,%edx
  lea    0x10(%rbp),%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  mov    %r12,%rdi
  call   <swap16@plt>
  mov    0x4(%rsp),%edx
  cmp    $0x80,%edx
  jg     L25
  test   %edx,%edx
  lea    0x7(%rdx),%r12d
  lea    D3(%rip),%rdi
  mov    %edx,%ecx
  cmovns %edx,%r12d
  sar    $0x1f,%ecx
  shr    $0x1d,%ecx
  lea    (%rdx,%rcx,1),%eax
  sar    $0x3,%r12d
  and    $0x7,%eax
  sub    %ecx,%eax
  test   %eax,%eax
  setg   %al
  movzbl %al,%eax
  add    %eax,%r12d
  xor    %eax,%eax
  mov    %r12d,0x8(%rbp)
  mov    %r12d,%esi
  call   <printf@plt>
  lea    0xc(%rbp),%rdx
  test   %r12d,%r12d
  jle    L128
  movslq %r12d,%rax
  shl    $0x2,%rax
  cmp    $0x8,%eax
  jae    L89
  test   $0x4,%al
  jne    L145
  test   %eax,%eax
  jne    L70
L128:
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  jle    L21
  xor    %ebx,%ebx
  mov    $0x1,%r13d
  xchg   %ax,%ax
L9:
  mov    (%rsp),%edi
  add    %ebx,%edi
  call   <read_di@plt>
  test   %eax,%eax
  je     L40
  mov    %ebx,%eax
  mov    %ebx,%ecx
  mov    %r13d,%edx
  add    $0x1,%ebx
  sar    $0x3,%eax
  and    $0x7,%ecx
  add    $0x3,%eax
  shl    %cl,%edx
  cltq
  or     %edx,0x0(%rbp,%rax,4)
  cmp    0x4(%rsp),%ebx
  jl     L9
L21:
  add    $0x5,%r12d
  mov    $0xffff,%edx
  mov    %rbp,%rdi
  mov    %r12d,%esi
  call   <add_CRC@plt>
L119:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L130
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L40:
  add    $0x1,%ebx
  cmp    %ebx,0x4(%rsp)
  jg     L9
  jmp    L21
  nopl   0x0(%rax,%rax,1)
L89:
  lea    0x14(%rbp),%rdi
  mov    %eax,%ecx
  movq   $0x0,0xc(%rbp)
  movq   $0x0,-0x8(%rdx,%rcx,1)
  and    $0xfffffffffffffff8,%rdi
  sub    %rdi,%rdx
  lea    (%rax,%rdx,1),%ecx
  mov    %ecx,%eax
  shr    $0x3,%eax
  mov    %eax,%ecx
  xor    %eax,%eax
  rep stos %rax,%es:(%rdi)
  jmp    L128
  nopw   0x0(%rax,%rax,1)
L70:
  movb   $0x0,0xc(%rbp)
  jmp    L128
  nopl   0x0(%rax)
L25:
  lea    D12(%rip),%rdi
  mov    $0x5,%r12d
  call   <puts@plt>
  mov    0x4(%rsp),%edx
  mov    (%rsp),%esi
  xor    %eax,%eax
  lea    D49(%rip),%rdi
  call   <printf@plt>
  mov    D2(%rip),%rax
  mov    $0xffff,%edx
  mov    %rbp,%rdi
  mov    $0x5,%esi
  mov    %rax,0x4(%rbp)
  call   <add_CRC@plt>
  jmp    L119
L145:
  mov    %eax,%eax
  movl   $0x0,0xc(%rbp)
  movl   $0x0,-0x4(%rdx,%rax,1)
  jmp    L128
L130:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D37
type: string
name: disassemble_data
arguments: data_label: D3
type: string
name: disassemble_data
arguments: data_label: D12
type: string
name: disassemble_data
arguments: data_label: D49
type: string
name: disassemble_data
arguments: data_label: D2
type: byte[8]

tool: D37: In Read Input Table, n = %d


tool: D3: In Read Input Table, byte count = %d, num_points = %d


tool: D12: *** Too many points specified!

tool: D49: Start %u, Num %u


tool: {"D2": [0x82,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

assistant: ```c
int rt_modbus_read_input_table(uint8_t *buf, int n) {
  uint16_t start_point;
  uint16_t num_points;
  int byte_count;
  uint8_t *p;
  int i;
  uint8_t val;
  int byte, bit;
  uint8_t mask;
  printf("In Read Input Table, n = %d\n", n);
  memcpy(&start_point, buf + 2, 2);
  swap16(&start_point);
  memcpy(&num_points, buf + 4, 2);
  swap16(&num_points);
  if (num_points > 128) {
    printf("*** Too many points specified!\n");
    printf("Start %u, Num %u\n", start_point, num_points);
    buf[1] = 128 + (0x02);
    buf[2] = 4;
    add_CRC(buf, 5, 0xffff);
    return 5;
  }
  byte_count = num_points / 8;
  if ((num_points % 8) > 0) {
    byte_count++;
  }
  buf[2] = byte_count;
  printf("In Read Input Table, byte count = %d, num_points = %d\n", byte_count, num_points);
  p = buf + 3;
  for (i = 0; i < byte_count; i++) {
    *(p++) = 0x00;
  }
  for (i = 0; i < num_points; i++) {
    val = read_di(i + start_point);
    if (val) {
      byte = i / 8;
      bit = i % 8;
      mask = 1 << bit;
      buf[byte + 3] |= mask;
    }
  }
  add_CRC(buf, 5 + byte_count, 0xffff);
  return (5 + byte_count);
}
```