user: 下面的汇编指令对应的C源代码是什么:

```asm
<HTS_set_duration>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r12
  mov    %rsi,%r13
  mov    %rdx,%r14
  mov    %ecx,0x24(%rsp)
  ucomisd D66(%rip),%xmm0
  jp     L124
  je     L152
L124:
  addsd  D7(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,0x20(%rsp)
  mov    0x24(%rsp),%edi
  cmp    %edi,%eax
  jle    L28
  test   %edi,%edi
  jle    L232
  mov    0x24(%rsp),%eax
  lea    -0x1(%rax),%ecx
  mov    $0x0,%eax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rsp)
L226:
  movsd  (%rsp),%xmm3
  addsd  0x0(%r13,%rax,8),%xmm3
  movsd  %xmm3,(%rsp)
  addsd  (%r14,%rax,8),%xmm0
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rdx,%rcx
  jne    L226
  pxor   %xmm5,%xmm5
  cvtsi2sdl 0x20(%rsp),%xmm5
  movsd  %xmm5,0x28(%rsp)
  movapd %xmm5,%xmm1
  subsd  (%rsp),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rsp)
  mov    $0x0,%eax
  mov    $0x0,%r15d
  movsd  D7(%rip),%xmm1
L100:
  movsd  0x8(%rsp),%xmm0
  mulsd  (%r14,%rax,8),%xmm0
  addsd  0x0(%r13,%rax,8),%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edx
  test   %edx,%edx
  mov    $0x1,%esi
  cmovle %esi,%edx
  mov    %edx,(%r12,%rax,4)
  add    %edx,%r15d
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rdx,%rcx
  jne    L100
L111:
  cmp    %r15d,0x20(%rsp)
  jne    L18
  jmp    L132
L152:
  test   %ecx,%ecx
  jle    L238
  mov    %ecx,%edi
  mov    $0x0,%edx
  mov    $0x0,%ecx
  movsd  D7(%rip),%xmm1
L149:
  movapd %xmm1,%xmm0
  addsd  0x0(%r13,%rdx,8),%xmm0
  cvttsd2si %xmm0,%eax
  test   %eax,%eax
  mov    $0x1,%esi
  cmovle %esi,%eax
  mov    %eax,(%r12,%rdx,4)
  add    %eax,%ecx
  add    $0x1,%rdx
  cmp    %rdx,%rdi
  jne    L149
L237:
  pxor   %xmm7,%xmm7
  cvtsi2sd %ecx,%xmm7
  movsd  %xmm7,0x28(%rsp)
L132:
  movsd  0x28(%rsp),%xmm0
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L238:
  mov    $0x0,%ecx
  jmp    L237
L28:
  mov    0x24(%rsp),%edi
  cmp    %edi,0x20(%rsp)
  jl     L174
L190:
  mov    0x24(%rsp),%edi
  test   %edi,%edi
  jle    L139
  mov    %r12,%rax
  lea    -0x1(%rdi),%edx
  lea    0x4(%r12,%rdx,4),%rdx
L187:
  movl   $0x1,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L187
L139:
  pxor   %xmm7,%xmm7
  cvtsi2sdl 0x24(%rsp),%xmm7
  movsd  %xmm7,0x28(%rsp)
  jmp    L132
L174:
  lea    D34(%rip),%rsi
  mov    $0xffffffff,%edi
  call   <HTS_error@plt>
  jmp    L190
L47:
  mov    0x24(%rsp),%eax
  cmp    $0x1,%eax
  jle    L42
  lea    -0x2(%rax),%eax
  add    $0x2,%rax
  mov    %rax,0x18(%rsp)
  mov    $0x1,%ebx
  mov    $0xffffffff,%ebp
  jmp    L218
L10:
  movsd  (%rsp),%xmm2
  comisd %xmm2,%xmm0
  maxsd  %xmm2,%xmm0
  movsd  %xmm0,(%rsp)
  cmova  0x14(%rsp),%ebp
L216:
  add    $0x1,%rbx
  cmp    %rbx,0x18(%rsp)
  je     L83
L218:
  mov    %ebx,0x14(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl (%r12,%rbx,4),%xmm0
  addsd  D12(%rip),%xmm0
  subsd  0x0(%r13,%rbx,8),%xmm0
  divsd  (%r14,%rbx,8),%xmm0
  movsd  0x8(%rsp),%xmm1
  subsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  call   <abs@plt>
  test   %ebp,%ebp
  jns    L10
  movsd  %xmm0,(%rsp)
  mov    %ebx,%ebp
  jmp    L216
L42:
  mov    $0xffffffff,%ebp
L83:
  add    $0x1,%r15d
  movslq %ebp,%rbp
  addl   $0x1,(%r12,%rbp,4)
L128:
  cmp    0x20(%rsp),%r15d
  je     L132
L18:
  cmp    %r15d,0x20(%rsp)
  jg     L47
  mov    $0xffffffff,%ebp
  cmpl   $0x1,0x24(%rsp)
  jle    L73
  mov    0x24(%rsp),%eax
  lea    -0x2(%rax),%eax
  add    $0x2,%rax
  mov    %rax,0x18(%rsp)
  mov    $0x1,%ebx
  mov    $0xffffffff,%ebp
  jmp    L55
L1:
  movsd  %xmm0,(%rsp)
  mov    0x14(%rsp),%ebp
L258:
  add    $0x1,%rbx
  cmp    %rbx,0x18(%rsp)
  je     L73
L55:
  mov    %ebx,0x14(%rsp)
  mov    (%r12,%rbx,4),%eax
  cmp    $0x1,%eax
  jle    L258
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  subsd  D12(%rip),%xmm0
  subsd  0x0(%r13,%rbx,8),%xmm0
  divsd  (%r14,%rbx,8),%xmm0
  movsd  0x8(%rsp),%xmm1
  subsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  call   <abs@plt>
  test   %ebp,%ebp
  js     L1
  movsd  (%rsp),%xmm4
  comisd %xmm4,%xmm0
  maxsd  %xmm4,%xmm0
  movsd  %xmm0,(%rsp)
  cmova  0x14(%rsp),%ebp
  jmp    L258
L73:
  sub    $0x1,%r15d
  movslq %ebp,%rbp
  subl   $0x1,(%r12,%rbp,4)
  jmp    L128
L232:
  pxor   %xmm6,%xmm6
  cvtsi2sdl 0x20(%rsp),%xmm6
  movsd  %xmm6,0x28(%rsp)
  pxor   %xmm0,%xmm0
  divsd  %xmm0,%xmm6
  movsd  %xmm6,0x8(%rsp)
  movsd  %xmm0,(%rsp)
  mov    $0x0,%r15d
  jmp    L111
```

tool_calls: name: read_data
arguments: data_tag: D66
type: f64
name: read_data
arguments: data_tag: D7
type: f64
name: read_data
arguments: data_tag: D34
type: string
name: read_data
arguments: data_tag: D12
type: byte[8]

tool: D66: 0

tool: D7: 0.5

tool: D34: HTS_set_duration: Specified frame length is too short.


tool: {"D12": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
double HTS_set_duration(int *duration, double *mean, double *vari, int size, double frame_length) {
  int i, j;
  double temp1, temp2;
  double rho = 0.0;
  int sum = 0;
  int target_length;
  if (frame_length == 0.0) {
    for (i = 0; i < size; i++) {
      duration[i] = (int)(mean[i] + 0.5);
      if (duration[i] < 1)
        duration[i] = 1;
      sum += duration[i];
    }
    return (double)sum;
  }
  target_length = (int)(frame_length + 0.5);
  if (target_length <= size) {
    if (target_length < size)
      HTS_error(-1, "HTS_set_duration: Specified frame length is too short.\n");
    for (i = 0; i < size; i++)
      duration[i] = 1;
    return (double)size;
  }
  temp1 = 0.0;
  temp2 = 0.0;
  for (i = 0; i < size; i++) {
    temp1 += mean[i];
    temp2 += vari[i];
  }
  rho = ((double)target_length - temp1) / temp2;
  for (i = 0; i < size; i++) {
    duration[i] = (int)(mean[i] + rho * vari[i] + 0.5);
    if (duration[i] < 1)
      duration[i] = 1;
    sum += duration[i];
  }
  while (target_length != sum) {
    if (target_length > sum) {
      j = -1;
      for (i = 1; i < size; i++) {
        temp2 = abs(rho - ((double)duration[i] + 1 - mean[i]) / vari[i]);
        if (j < 0 || temp1 < temp2) {
          j = i;
          temp1 = temp2;
        }
      }
      sum++;
      duration[j]++;
    } else {
      j = -1;
      for (i = 1; i < size; i++) {
        if (duration[i] > 1) {
          temp2 = abs(rho - ((double)duration[i] - 1 - mean[i]) / vari[i]);
          if (j < 0 || temp1 < temp2) {
            j = i;
            temp1 = temp2;
          }
        }
      }
      sum--;
      duration[j]--;
    }
  }
  return (double)target_length;
}
```