user: Demonstrate the C code that generates the assembly output below:

```asm
<rt_modbus_read_output_table>:
  endbr64
  push   %r12
  lea    0x8(%rdi),%rsi
  mov    $0x2,%edx
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rdi
  call   <memcpy@plt>
  mov    %r12,%rdi
  lea    0x4(%rsp),%r12
  call   <swap16@plt>
  lea    0x10(%rbp),%rsi
  mov    $0x2,%edx
  mov    %r12,%rdi
  call   <memcpy@plt>
  mov    %r12,%rdi
  call   <swap16@plt>
  mov    0x4(%rsp),%esi
  cmp    $0x80,%esi
  jg     L127
  test   %esi,%esi
  lea    0x7(%rsi),%r8d
  mov    %esi,%edx
  cmovns %esi,%r8d
  sar    $0x1f,%edx
  shr    $0x1d,%edx
  lea    (%rsi,%rdx,1),%eax
  sar    $0x3,%r8d
  and    $0x7,%eax
  sub    %edx,%eax
  lea    0xc(%rbp),%rdx
  test   %eax,%eax
  setg   %al
  movzbl %al,%eax
  add    %eax,%r8d
  mov    %r8d,0x8(%rbp)
  test   %r8d,%r8d
  jle    L9
  movslq %r8d,%rax
  shl    $0x2,%rax
  cmp    $0x8,%eax
  jae    L93
  test   $0x4,%al
  jne    L0
  test   %eax,%eax
  jne    L48
L9:
  mov    $0x1,%eax
  mov    $0x1,%edi
  cmp    $0x1,%esi
  jle    L10
  nopl   (%rax)
L62:
  test   $0x1,%al
  je     L129
  mov    %eax,%edx
  mov    %eax,%ecx
  mov    %edi,%r9d
  sar    $0x3,%edx
  and    $0x7,%ecx
  add    $0x3,%edx
  shl    %cl,%r9d
  movslq %edx,%rdx
  or     %r9d,0x0(%rbp,%rdx,4)
L129:
  add    $0x1,%eax
  cmp    %eax,%esi
  jne    L62
L10:
  lea    0x5(%r8),%r12d
  mov    $0xffff,%edx
  mov    %rbp,%rdi
  mov    %r12d,%esi
  call   <add_CRC@plt>
L71:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L114
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L93:
  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    L9
  nopw   0x0(%rax,%rax,1)
L48:
  movb   $0x0,0xc(%rbp)
  jmp    L9
  nopl   0x0(%rax)
L127:
  mov    D9(%rip),%rax
  mov    $0xffff,%edx
  mov    $0x5,%esi
  mov    %rbp,%rdi
  mov    $0x5,%r12d
  mov    %rax,0x4(%rbp)
  call   <add_CRC@plt>
  jmp    L71
L0:
  mov    %eax,%eax
  movl   $0x0,0xc(%rbp)
  movl   $0x0,-0x4(%rdx,%rax,1)
  jmp    L9
L114:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D9
data_type: byte[8]

tool: {"D9": [0x81,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

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;
}
```