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

```asm
<d2bei_clip_array>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %ecx,-0x38(%rbp)
  cmpl   $0x0,-0x38(%rbp)
  je     L70
  movsd  D22(%rip),%xmm0
  jmp    L56
L70:
  movsd  D28(%rip),%xmm0
L56:
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x34(%rbp),%eax
  shl    $0x2,%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  jmp    L69
L31:
  subq   $0x4,-0x18(%rbp)
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x10(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  comisd D9(%rip),%xmm0
  jb     L49
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  movb   $0xff,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movb   $0xff,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movb   $0xff,(%rax)
  mov    -0x18(%rbp),%rax
  movb   $0x7f,(%rax)
  jmp    L69
L49:
  movsd  D29(%rip),%xmm0
  comisd -0x8(%rbp),%xmm0
  jb     L50
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  movb   $0x80,(%rax)
  jmp    L69
L50:
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <lrint@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  sar    $0x18,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  mov    -0x1c(%rbp),%edx
  mov    %dl,(%rax)
L69:
  subl   $0x1,-0x34(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  jns    L31
  nop
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D22
type_infered: byte[8]
name: extract_symbolic_data
arguments: data_label: D28
type_infered: f64
name: extract_symbolic_data
arguments: data_label: D9
type_infered: byte[16]
name: extract_symbolic_data
arguments: data_label: D29
type_infered: byte[8]

tool: {"D22": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x41]}

tool: D28: 1

tool: {"D9": [0x00,0x00,0xc0,0xff,0xff,0xff,0xdf,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xc1]}

tool: {"D29": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xc1]}

assistant: ```c
void d2bei_clip_array(double *src, int *dest, int count, int normalize) {
  unsigned char *ucptr;
  int value;
  double normfact, scaled_value;
  normfact = normalize ? (8.0 * 0x10000000) : 1.0;
  ucptr = ((unsigned char *)dest) + 4 * count;
  while (--count >= 0) {
    ucptr -= 4;
    scaled_value = src[count] * normfact;
    if (0 == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) {
      ucptr[3] = 0xFF;
      ucptr[2] = 0xFF;
      ucptr[1] = 0xFF;
      ucptr[0] = 0x7F;
      continue;
    };
    if (0 == 0 && scaled_value <= (-8.0 * 0x10000000)) {
      ucptr[3] = 0x00;
      ucptr[2] = 0x00;
      ucptr[1] = 0x00;
      ucptr[0] = 0x80;
      continue;
    };
    value = lrint(scaled_value);
    ucptr[0] = value >> 24;
    ucptr[1] = value >> 16;
    ucptr[2] = value >> 8;
    ucptr[3] = value;
  };
}
```