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

```asm
<set_io_record>:
  endbr64
  push   %rbx
  mov    %rsi,%rdi
  xor    %eax,%eax
  mov    %rdx,%rsi
  nopl   (%rax)
L249:
  mov    (%rcx,%rax,1),%rdx
  cmp    (%rsi,%rax,1),%rdx
  jae    L136
  mov    %rdx,(%rsi,%rax,1)
L136:
  add    $0x8,%rax
  cmp    $0x58,%rax
  jne    L249
  mov    (%rcx),%rdx
  sub    (%rsi),%rdx
  mov    0x20(%rcx),%rax
  mov    %rdx,%r11
  sub    0x20(%rsi),%rax
  mov    0x10(%rcx),%r9
  mov    0x30(%rcx),%r10
  sub    0x10(%rsi),%r9
  sub    0x30(%rsi),%r10
  add    %rax,%r11
  js     L240
  pxor   %xmm9,%xmm9
  cvtsi2sd %r11,%xmm9
L107:
  pxor   %xmm0,%xmm0
  mov    0x8(%rcx),%r11
  cvtsi2sd %r8d,%xmm0
  sub    0x8(%rsi),%r11
  js     L222
  pxor   %xmm8,%xmm8
  cvtsi2sd %r11,%xmm8
L37:
  divsd  %xmm0,%xmm8
  mov    0x28(%rcx),%r11
  sub    0x28(%rsi),%r11
  js     L56
  pxor   %xmm7,%xmm7
  cvtsi2sd %r11,%xmm7
L80:
  divsd  %xmm0,%xmm7
  test   %rdx,%rdx
  js     L245
  pxor   %xmm6,%xmm6
  cvtsi2sd %rdx,%xmm6
L214:
  divsd  %xmm0,%xmm6
  test   %rax,%rax
  js     L142
  pxor   %xmm5,%xmm5
  cvtsi2sd %rax,%xmm5
L132:
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  divsd  %xmm0,%xmm5
  test   %r9,%r9
  js     L201
  pxor   %xmm4,%xmm4
  cvtsi2sd %r9,%xmm4
L29:
  divsd  %xmm1,%xmm4
  test   %r10,%r10
  js     L164
  pxor   %xmm3,%xmm3
  cvtsi2sd %r10,%xmm3
L134:
  mov    0x40(%rcx),%rax
  divsd  %xmm1,%xmm3
  sub    0x40(%rsi),%rax
  js     L181
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
L116:
  imul   $0x3e8,%r8d,%r8d
  mov    0x48(%rcx),%rax
  xor    %edx,%edx
  sub    0x48(%rsi),%rax
  movslq %r8d,%r8
  div    %r8
  test   %rax,%rax
  js     L35
  pxor   %xmm11,%xmm11
  cvtsi2sd %rax,%xmm11
L173:
  pxor   %xmm2,%xmm2
  ucomisd %xmm2,%xmm9
  jp     L112
  jne    L112
  pxor   %xmm2,%xmm2
  movapd %xmm2,%xmm10
  movapd %xmm2,%xmm12
L23:
  mulsd  D13(%rip),%xmm0
  movsd  %xmm8,(%rdi)
  pop    %rbx
  movsd  %xmm7,0x8(%rdi)
  movsd  %xmm6,0x10(%rdi)
  movsd  %xmm5,0x18(%rdi)
  movsd  %xmm4,0x20(%rdi)
  divsd  %xmm0,%xmm1
  movsd  D0(%rip),%xmm0
  movsd  %xmm3,0x28(%rdi)
  movsd  %xmm2,0x30(%rdi)
  movsd  %xmm11,0x38(%rdi)
  movsd  %xmm10,0x40(%rdi)
  movsd  %xmm12,0x48(%rdi)
  minsd  %xmm1,%xmm0
  movsd  %xmm0,0x50(%rdi)
  ret
  nopl   (%rax)
L112:
  add    %r10,%r9
  pxor   %xmm2,%xmm2
  mov    0x38(%rcx),%rax
  add    0x18(%rcx),%rax
  shr    %r9
  sub    0x18(%rsi),%rax
  cvtsi2sd %r9,%xmm2
  divsd  %xmm9,%xmm2
  sub    0x38(%rsi),%rax
  js     L234
  pxor   %xmm10,%xmm10
  cvtsi2sd %rax,%xmm10
L189:
  movapd %xmm1,%xmm12
  divsd  %xmm9,%xmm10
  divsd  %xmm9,%xmm12
  jmp    L23
  nopl   0x0(%rax)
L234:
  mov    %rax,%rdx
  and    $0x1,%eax
  pxor   %xmm10,%xmm10
  shr    %rdx
  or     %rax,%rdx
  cvtsi2sd %rdx,%xmm10
  addsd  %xmm10,%xmm10
  jmp    L189
  nopl   (%rax)
L35:
  mov    %rax,%rdx
  and    $0x1,%eax
  pxor   %xmm11,%xmm11
  shr    %rdx
  or     %rax,%rdx
  cvtsi2sd %rdx,%xmm11
  addsd  %xmm11,%xmm11
  jmp    L173
  nopl   0x0(%rax,%rax,1)
L181:
  mov    %rax,%rdx
  and    $0x1,%eax
  pxor   %xmm1,%xmm1
  shr    %rdx
  or     %rax,%rdx
  cvtsi2sd %rdx,%xmm1
  addsd  %xmm1,%xmm1
  jmp    L116
  xchg   %ax,%ax
L164:
  mov    %r10,%rax
  mov    %r10,%rdx
  pxor   %xmm3,%xmm3
  shr    %rax
  and    $0x1,%edx
  or     %rdx,%rax
  cvtsi2sd %rax,%xmm3
  addsd  %xmm3,%xmm3
  jmp    L134
  nopl   0x0(%rax)
L201:
  mov    %r9,%rax
  mov    %r9,%rdx
  pxor   %xmm4,%xmm4
  shr    %rax
  and    $0x1,%edx
  or     %rdx,%rax
  cvtsi2sd %rax,%xmm4
  addsd  %xmm4,%xmm4
  jmp    L29
  nopl   0x0(%rax)
L142:
  mov    %rax,%rdx
  and    $0x1,%eax
  pxor   %xmm5,%xmm5
  shr    %rdx
  or     %rax,%rdx
  cvtsi2sd %rdx,%xmm5
  addsd  %xmm5,%xmm5
  jmp    L132
  xchg   %ax,%ax
L245:
  mov    %rdx,%r11
  and    $0x1,%edx
  pxor   %xmm6,%xmm6
  shr    %r11
  or     %rdx,%r11
  cvtsi2sd %r11,%xmm6
  addsd  %xmm6,%xmm6
  jmp    L214
  xchg   %ax,%ax
L56:
  mov    %r11,%rbx
  and    $0x1,%r11d
  pxor   %xmm7,%xmm7
  shr    %rbx
  or     %r11,%rbx
  cvtsi2sd %rbx,%xmm7
  addsd  %xmm7,%xmm7
  jmp    L80
  nop
L222:
  mov    %r11,%rbx
  and    $0x1,%r11d
  pxor   %xmm8,%xmm8
  shr    %rbx
  or     %r11,%rbx
  cvtsi2sd %rbx,%xmm8
  addsd  %xmm8,%xmm8
  jmp    L37
  nopl   0x0(%rax)
L240:
  mov    %r11,%rbx
  and    $0x1,%r11d
  pxor   %xmm9,%xmm9
  shr    %rbx
  or     %r11,%rbx
  cvtsi2sd %rbx,%xmm9
  addsd  %xmm9,%xmm9
  jmp    L107
```

tool_calls: name: unpack_data
arguments: tag: D13
data_type: f64
name: unpack_data
arguments: tag: D0
data_type: f64

tool: D13: 10

tool: D0: 100

assistant: ```c
void set_io_record(struct module *mod, double st_array[], unsigned long long pre_array[], unsigned long long cur_array[], int inter) {
  int i;
  for (i = 0; i < 11; i++) {
    if (cur_array[i] < pre_array[i]) {
      pre_array[i] = cur_array[i];
    }
  }
  unsigned long long rd_ios = cur_array[0] - pre_array[0];
  unsigned long long rd_merges = cur_array[1] - pre_array[1];
  unsigned long long rd_sectors = cur_array[2] - pre_array[2];
  unsigned long long rd_ticks = cur_array[3] - pre_array[3];
  ;
  unsigned long long wr_ios = cur_array[4] - pre_array[4];
  unsigned long long wr_merges = cur_array[5] - pre_array[5];
  unsigned long long wr_sectors = cur_array[6] - pre_array[6];
  unsigned long long wr_ticks = cur_array[7] - pre_array[7];
  unsigned long long ticks = cur_array[8] - pre_array[8];
  unsigned long long aveq = cur_array[9] - pre_array[9];
  double n_ios = rd_ios + wr_ios;
  double n_ticks = rd_ticks + wr_ticks;
  double n_kbytes = (rd_sectors + wr_sectors) / 2;
  st_array[0] = rd_merges / (inter * 1.0);
  st_array[1] = wr_merges / (inter * 1.0);
  st_array[2] = rd_ios / (inter * 1.0);
  st_array[3] = wr_ios / (inter * 1.0);
  st_array[4] = rd_sectors / (inter * 2.0);
  st_array[5] = wr_sectors / (inter * 2.0);
  st_array[6] = n_ios ? n_kbytes / n_ios : 0.0;
  st_array[7] = aveq / (inter * 1000);
  st_array[8] = n_ios ? n_ticks / n_ios : 0.0;
  st_array[9] = n_ios ? ticks / n_ios : 0.0;
  st_array[10] = ticks / (inter * 10.0);
  if (st_array[10] > 100.0)
    st_array[10] = 100.0;
}
```