user: 请将以下的汇编代码转换成C语言代码：

```asm
<HTS_set_specified_duration>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rcx,%rbp
  addsd  D78(%rip),%xmm0
  mov    $0x1,%edi
  movsd  D12(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L313
  comisd D72(%rip),%xmm0
  jae    L269
  cvttsd2si %xmm0,%rdi
L313:
  cmp    %rbp,%rdi
  jbe    L403
  pxor   %xmm0,%xmm0
  movapd %xmm0,%xmm1
  mov    $0x0,%eax
  test   %rbp,%rbp
  je     L247
L284:
  addsd  (%rsi,%rax,8),%xmm1
  addsd  (%rdx,%rax,8),%xmm0
  mov    %rax,%r8
  add    $0x1,%rax
  cmp    %rax,%rbp
  jne    L284
  test   %rdi,%rdi
  js     L360
  pxor   %xmm8,%xmm8
  cvtsi2sd %rdi,%xmm8
L93:
  movapd %xmm8,%xmm7
  subsd  %xmm1,%xmm7
  divsd  %xmm0,%xmm7
  mov    $0x0,%ecx
  mov    $0x0,%eax
  movsd  D78(%rip),%xmm1
  movsd  D12(%rip),%xmm0
  movsd  D72(%rip),%xmm2
  movapd %xmm2,%xmm4
  movabs $0x8000000000000000,%r10
  jmp    L189
L269:
  subsd  D72(%rip),%xmm0
  cvttsd2si %xmm0,%rdi
  btc    $0x3f,%rdi
  jmp    L313
L403:
  jb     L171
L87:
  test   %rbp,%rbp
  je     L99
  mov    %rbx,%rax
  lea    (%rbx,%rbp,8),%rdx
L347:
  movq   $0x1,(%rax)
  add    $0x8,%rax
  cmp    %rax,%rdx
  jne    L347
L99:
  test   %rbp,%rbp
  js     L427
  pxor   %xmm8,%xmm8
  cvtsi2sd %rbp,%xmm8
L137:
  movapd %xmm8,%xmm0
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L171:
  lea    D28(%rip),%rsi
  mov    $0xffffffff,%edi
  call   <HTS_error@plt>
  jmp    L87
L427:
  mov    %rbp,%rax
  shr    %rax
  and    $0x1,%ebp
  or     %rbp,%rax
  pxor   %xmm8,%xmm8
  cvtsi2sd %rax,%xmm8
  addsd  %xmm8,%xmm8
  jmp    L137
L157:
  movq   $0x1,(%rbx,%rax,8)
L4:
  add    (%rbx,%rax,8),%rcx
  lea    0x1(%rax),%r9
  cmp    %rax,%r8
  je     L343
  mov    %r9,%rax
L189:
  movapd %xmm7,%xmm6
  mulsd  (%rdx,%rax,8),%xmm6
  addsd  (%rsi,%rax,8),%xmm6
  addsd  %xmm1,%xmm6
  comisd %xmm6,%xmm0
  ja     L157
  comisd %xmm2,%xmm6
  jae    L98
  cvttsd2si %xmm6,%r9
  mov    %r9,(%rbx,%rax,8)
  jmp    L4
L98:
  movapd %xmm6,%xmm3
  subsd  %xmm4,%xmm3
  cvttsd2si %xmm3,%r9
  mov    %r9,(%rbx,%rax,8)
  xor    %r10,(%rbx,%rax,8)
  jmp    L4
L18:
  test   %rbp,%rbp
  je     L359
  mov    %r8d,%r10d
  mov    $0x0,%eax
  jmp    L188
L382:
  mov    %r9,%r11
  shr    %r11
  and    $0x1,%r9d
  or     %r9,%r11
  pxor   %xmm0,%xmm0
  cvtsi2sd %r11,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L423
L337:
  mov    %eax,%r10d
  movapd %xmm1,%xmm6
L208:
  add    $0x1,%rax
  cmp    %rax,%rbp
  je     L400
L188:
  mov    (%rbx,%rax,8),%r9
  test   %r9,%r9
  js     L382
  pxor   %xmm0,%xmm0
  cvtsi2sd %r9,%xmm0
L423:
  addsd  %xmm3,%xmm0
  subsd  (%rsi,%rax,8),%xmm0
  divsd  (%rdx,%rax,8),%xmm0
  movapd %xmm7,%xmm1
  subsd  %xmm0,%xmm1
  andpd  %xmm2,%xmm1
  test   %r10d,%r10d
  js     L337
  comisd %xmm1,%xmm6
  jbe    L208
  jmp    L337
L359:
  mov    %r8d,%r10d
L400:
  add    $0x1,%rcx
  movslq %r10d,%r10
  addq   $0x1,(%rbx,%r10,8)
L416:
  cmp    %rdi,%rcx
  je     L137
L47:
  cmp    %rcx,%rdi
  ja     L18
  mov    %r8d,%r9d
  mov    $0x0,%eax
  test   %rbp,%rbp
  jne    L144
L204:
  sub    $0x1,%rcx
  movslq %r9d,%r9
  subq   $0x1,(%rbx,%r9,8)
  jmp    L416
L252:
  mov    %r10,%r11
  shr    %r11
  and    $0x1,%r10d
  or     %r10,%r11
  pxor   %xmm0,%xmm0
  cvtsi2sd %r11,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L139
L350:
  mov    %eax,%r9d
  movapd %xmm1,%xmm6
L316:
  add    $0x1,%rax
  cmp    %rax,%rbp
  je     L204
L144:
  mov    (%rbx,%rax,8),%r10
  cmp    $0x1,%r10
  jbe    L316
  test   %r10,%r10
  js     L252
  pxor   %xmm0,%xmm0
  cvtsi2sd %r10,%xmm0
L139:
  subsd  %xmm5,%xmm0
  subsd  (%rsi,%rax,8),%xmm0
  divsd  (%rdx,%rax,8),%xmm0
  movapd %xmm7,%xmm1
  subsd  %xmm0,%xmm1
  andpd  %xmm4,%xmm1
  test   %r9d,%r9d
  js     L350
  comisd %xmm1,%xmm6
  jbe    L316
  jmp    L350
L247:
  test   %rdi,%rdi
  js     L132
  pxor   %xmm8,%xmm8
  cvtsi2sd %rdi,%xmm8
L175:
  pxor   %xmm6,%xmm6
  movapd %xmm8,%xmm7
  divsd  %xmm6,%xmm7
  mov    %rbp,%rcx
L343:
  cmp    %rcx,%rdi
  je     L137
  mov    $0xffffffff,%r8d
  movsd  D12(%rip),%xmm3
  movq   D13(%rip),%xmm2
  movapd %xmm3,%xmm5
  movapd %xmm2,%xmm4
  jmp    L47
L132:
  mov    %rdi,%rax
  shr    %rax
  mov    %rdi,%rcx
  and    $0x1,%ecx
  or     %rcx,%rax
  pxor   %xmm8,%xmm8
  cvtsi2sd %rax,%xmm8
  addsd  %xmm8,%xmm8
  jmp    L175
L360:
  mov    %rdi,%rax
  shr    %rax
  mov    %rdi,%rcx
  and    $0x1,%ecx
  or     %rcx,%rax
  pxor   %xmm8,%xmm8
  cvtsi2sd %rax,%xmm8
  addsd  %xmm8,%xmm8
  jmp    L93
```

tool_calls: name: disassemble_data
arguments: data_label: D78
type_infered: f64
name: disassemble_data
arguments: data_label: D12
type_infered: f64
name: disassemble_data
arguments: data_label: D72
type_infered: f32[4]
name: disassemble_data
arguments: data_label: D28
type_infered: string
name: disassemble_data
arguments: data_label: D13
type_infered: qword

tool: D78: 0.5

tool: D12: 1

tool: {"D72": [0.0,448.0,null,null]}

tool: D28: HTS_set_specified_duration: Specified frame length is too short.


tool: D13: 9223372036854775807

assistant: ```c
double HTS_set_specified_duration(size_t *duration, double *mean, double *vari, size_t size, double frame_length) {
  size_t i;
  int j;
  double temp1, temp2;
  double rho = 0.0;
  size_t sum = 0;
  size_t target_length;
  if (frame_length + 0.5 < 1.0)
    target_length = 1;
  else
    target_length = (size_t)(frame_length + 0.5);
  if (target_length <= size) {
    if (target_length < size)
      HTS_error(-1, "HTS_set_specified_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++) {
    temp1 = mean[i] + rho * vari[i] + 0.5;
    if (temp1 < 1.0)
      duration[i] = 1;
    else
      duration[i] = (size_t)temp1;
    sum += duration[i];
  }
  while (target_length != sum) {
    if (target_length > sum) {
      j = -1;
      for (i = 0; i < size; i++) {
        temp2 = fabs(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 = 0; i < size; i++) {
        if (duration[i] > 1) {
          temp2 = fabs(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;
}
```