user: What is the c source code of the assembly code below?

```asm
<rt_modbus_read_output_table>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x38(%rbp),%rax
  lea    0x8(%rax),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x2,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  lea    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <swap16@plt>
  mov    -0x38(%rbp),%rax
  lea    0x10(%rax),%rcx
  lea    -0x2c(%rbp),%rax
  mov    $0x2,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  lea    -0x2c(%rbp),%rax
  mov    %rax,%rdi
  call   <swap16@plt>
  mov    -0x2c(%rbp),%eax
  cmp    $0x80,%eax
  jle    L77
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movl   $0x81,(%rax)
  mov    -0x38(%rbp),%rax
  add    $0x8,%rax
  movl   $0x4,(%rax)
  mov    -0x38(%rbp),%rax
  mov    $0xffff,%edx
  mov    $0x5,%esi
  mov    %rax,%rdi
  call   <add_CRC@plt>
  mov    $0x5,%eax
  jmp    L59
L77:
  mov    -0x2c(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x2c(%rbp),%eax
  cltd
  shr    $0x1d,%edx
  add    %edx,%eax
  and    $0x7,%eax
  sub    %edx,%eax
  test   %eax,%eax
  jle    L70
  addl   $0x1,-0x24(%rbp)
L70:
  mov    -0x38(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x24(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x38(%rbp),%rax
  add    $0xc,%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L10
L21:
  mov    -0x10(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movl   $0x0,(%rax)
  addl   $0x1,-0x28(%rbp)
L10:
  mov    -0x28(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L21
  movl   $0x0,-0x28(%rbp)
  jmp    L63
L23:
  mov    -0x28(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  setne  %al
  movzbl %al,%eax
  mov    %eax,-0x20(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  je     L5
  mov    -0x28(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x28(%rbp),%eax
  cltd
  shr    $0x1d,%edx
  add    %edx,%eax
  and    $0x7,%eax
  sub    %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  add    $0x3,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  add    $0x3,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  or     -0x14(%rbp),%eax
  mov    %eax,(%rdx)
L5:
  addl   $0x1,-0x28(%rbp)
L63:
  mov    -0x2c(%rbp),%eax
  cmp    %eax,-0x28(%rbp)
  jl     L23
  mov    -0x24(%rbp),%eax
  lea    0x5(%rax),%ecx
  mov    -0x38(%rbp),%rax
  mov    $0xffff,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <add_CRC@plt>
  mov    -0x24(%rbp),%eax
  add    $0x5,%eax
L59:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L18
  call   <__stack_chk_fail@plt>
L18:
  leave
  ret
```

assistant: ```c
int rt_modbus_read_output_table(uint8_t *buf, int n) {
  uint16_t start_point;
  uint16_t num_points;
  int i;
  uint8_t *p;
  int byte_count;
  uint8_t val;
  int byte, bit;
  uint8_t mask;
  memcpy(&start_point, buf + 2, 2);
  swap16(&start_point);
  memcpy(&num_points, buf + 4, 2);
  swap16(&num_points);
  if (num_points > 128) {
    buf[1] = 128 + (0x01);
    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;
  p = buf + 3;
  for (i = 0; i < byte_count; i++) {
    *(p++) = 0x00;
  }
  for (i = 0; i < num_points; i++) {
    val = (i % 2) != 0;
    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;
}
```