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

```asm
<rt_modbus_preset_multiple_registers>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    0x18(%rdi),%ebx
  lea    0x8(%rdi),%rsi
  lea    0xc(%rsp),%rbp
  mov    $0x2,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
  mov    %rbp,%rdi
  call   <swap16@plt>
  lea    0x10(%r14),%rsi
  lea    0x10(%rsp),%rbp
  mov    $0x2,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
  mov    %rbp,%rdi
  call   <swap16@plt>
  mov    0x10(%rsp),%edx
  mov    0xc(%rsp),%esi
  lea    D36(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x10(%rsp),%eax
  lea    (%rax,%rax,1),%edx
  mov    %ebx,%esi
  lea    D3(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x10(%rsp),%eax
  add    %eax,%eax
  cmp    %ebx,%eax
  je     L47
  lea    D44(%rip),%rdi
  call   <puts@plt>
L11:
  lea    0x1c(%r14),%rbp
  mov    $0x0,%ebx
  lea    D25(%rip),%r13
  cmpl   $0x0,0x10(%rsp)
  jle    L28
L32:
  lea    0x14(%rsp),%r12
  mov    $0x2,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  mov    %r12,%rdi
  call   <swap16@plt>
  mov    %ebx,%ecx
  add    0xc(%rsp),%ecx
  mov    0x14(%rsp),%edx
  mov    %ebx,%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebx,%edi
  add    0xc(%rsp),%edi
  mov    0x14(%rsp),%esi
  call   <write_register@plt>
  add    $0x1,%ebx
  add    $0x8,%rbp
  cmp    %ebx,0x10(%rsp)
  jg     L32
L28:
  mov    $0xffff,%edx
  mov    $0x8,%esi
  mov    %r14,%rdi
  call   <add_CRC@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L26
  mov    $0x8,%eax
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L47:
  lea    D18(%rip),%rdi
  call   <puts@plt>
  jmp    L11
L26:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D36
type_guessed: string
name: parse_data
arguments: tag: D3
type_guessed: string
name: parse_data
arguments: tag: D44
type_guessed: string
name: parse_data
arguments: tag: D25
type_guessed: string
name: parse_data
arguments: tag: D18
type_guessed: string

tool: D36: start = %hu, num = %hu


tool: D3: data bytes = %hu, calculated size = %d


tool: D44: *** Data error size does NOT match

tool: D25: value %d: %04hx, addr: %d


tool: D18: Size matches

assistant: ```c
int rt_modbus_preset_multiple_registers(uint8_t *buf, int sz) {
  int data_bytes;
  int size;
  uint16_t start_point;
  uint16_t num_points;
  uint16_t tmp;
  int i;
  data_bytes = buf[6];
  size = 9 + data_bytes;
  memcpy(&start_point, buf + 2, 2);
  swap16(&start_point);
  memcpy(&num_points, buf + 4, 2);
  swap16(&num_points);
  printf("start = %hu, num = %hu\n", start_point, num_points);
  printf("data bytes = %hu, calculated size = %d\n", data_bytes, num_points * 2);
  if ((num_points * 2) == data_bytes) {
    printf("Size matches\n");
  } else {
    printf("*** Data error size does NOT match\n");
  }
  for (i = 0; i < num_points; i++) {
    memcpy(&tmp, buf + (i * 2) + 7, 2);
    swap16(&tmp);
    printf("value %d: %04hx, addr: %d\n", i, tmp, start_point + i);
    write_register(start_point + i, tmp);
  }
  add_CRC(buf, 8, 0xffff);
  return 8;
}
```