user: Please show me the C implementation that matches the assembly code listed below:

```asm
<set_tcp_record>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8d,-0x34(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L120
L22:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jb     L18
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rdx
  sub    %rdx,%rax
  test   %rax,%rax
  js     L111
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L55
L111:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L55:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x34(%rbp),%xmm1
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
L18:
  addl   $0x1,-0x4(%rbp)
L120:
  cmpl   $0x5,-0x4(%rbp)
  jle    L22
  mov    -0x30(%rbp),%rax
  add    $0x30,%rax
  mov    (%rax),%rax
  mov    -0x20(%rbp),%rdx
  lea    0x30(%rdx),%rcx
  test   %rax,%rax
  js     L95
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L149
L95:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L149:
  movsd  %xmm0,(%rcx)
  mov    -0x30(%rbp),%rax
  add    $0x38,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    $0x38,%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jb     L144
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jbe    L144
  mov    -0x30(%rbp),%rax
  add    $0x38,%rax
  mov    (%rax),%rax
  mov    -0x28(%rbp),%rdx
  add    $0x38,%rdx
  mov    (%rdx),%rdx
  sub    %rdx,%rax
  test   %rax,%rax
  js     L125
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L32
L125:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L32:
  movsd  D26(%rip),%xmm1
  mulsd  %xmm0,%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  mov    -0x28(%rbp),%rdx
  add    $0x18,%rdx
  mov    (%rdx),%rdx
  sub    %rdx,%rax
  test   %rax,%rax
  js     L50
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L26
L50:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L26:
  mov    -0x20(%rbp),%rax
  add    $0x38,%rax
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
L144:
  mov    -0x20(%rbp),%rax
  add    $0x38,%rax
  movsd  (%rax),%xmm0
  comisd D26(%rip),%xmm0
  ja     L64
  jmp    L34
L64:
  mov    -0x20(%rbp),%rax
  add    $0x38,%rax
  movsd  D26(%rip),%xmm0
  movsd  %xmm0,(%rax)
L34:
  nop
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D26
data_type: f64

tool: D26: 100

assistant: ```c
void set_tcp_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 < 6; i++) {
    if (cur_array[i] >= pre_array[i]) {
      st_array[i] = (cur_array[i] - pre_array[i]) * 1.0 / inter;
    }
  }
  st_array[6] = cur_array[6];
  if ((cur_array[7] >= pre_array[7]) && (cur_array[3] > pre_array[3])) {
    st_array[7] = (cur_array[7] - pre_array[7]) * 100.0 / (cur_array[3] - pre_array[3]);
  }
  if (st_array[7] > 100.0) {
    st_array[7] = 100.0;
  }
}
```