user: Translate the below assembly code into C programming language:

```asm
<rt_modbus_preset_multiple_registers>:
  endbr64
  push   %r14
  lea    0x8(%rdi),%rsi
  mov    $0x2,%edx
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    0x18(%rdi),%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rbp
  mov    %rbp,%rdi
  call   <memcpy@plt>
  mov    %rbp,%rdi
  lea    0x10(%rsp),%rbp
  call   <swap16@plt>
  lea    0x10(%r14),%rsi
  mov    $0x2,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
  mov    %rbp,%rdi
  call   <swap16@plt>
  mov    0x10(%rsp),%edx
  mov    0xc(%rsp),%esi
  xor    %eax,%eax
  lea    D36(%rip),%rdi
  call   <printf@plt>
  mov    0x10(%rsp),%eax
  mov    %ebx,%esi
  lea    D32(%rip),%rdi
  lea    (%rax,%rax,1),%edx
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x10(%rsp),%eax
  add    %eax,%eax
  cmp    %ebx,%eax
  je     L23
  lea    D21(%rip),%rdi
  call   <puts@plt>
L12:
  mov    0x10(%rsp),%eax
  test   %eax,%eax
  jle    L31
  lea    0x1c(%r14),%rbp
  xor    %ebx,%ebx
  lea    0x14(%rsp),%r12
  lea    D45(%rip),%r13
  nopl   0x0(%rax,%rax,1)
L20:
  mov    %rbp,%rsi
  mov    $0x2,%edx
  mov    %r12,%rdi
  add    $0x8,%rbp
  call   <memcpy@plt>
  mov    %r12,%rdi
  call   <swap16@plt>
  mov    0xc(%rsp),%ecx
  mov    0x14(%rsp),%edx
  mov    %ebx,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    %ebx,%ecx
  call   <printf@plt>
  mov    0xc(%rsp),%edi
  mov    0x14(%rsp),%esi
  add    %ebx,%edi
  add    $0x1,%ebx
  call   <write_register@plt>
  cmp    %ebx,0x10(%rsp)
  jg     L20
L31:
  mov    $0xffff,%edx
  mov    $0x8,%esi
  mov    %r14,%rdi
  call   <add_CRC@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L28
  add    $0x20,%rsp
  mov    $0x8,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  cs nopw 0x0(%rax,%rax,1)
L23:
  lea    D40(%rip),%rdi
  call   <puts@plt>
  jmp    L12
L28:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D36
type_guessed: string
name: parse_data
arguments: data_label: D32
type_guessed: string
name: parse_data
arguments: data_label: D21
type_guessed: string
name: parse_data
arguments: data_label: D45
type_guessed: string
name: parse_data
arguments: data_label: D40
type_guessed: string

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


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


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

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


tool: D40: 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;
}
```