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

```asm
<decode_8_half>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  xor    %esi,%esi
  push   %rbp
  mov    %r12,%rdi
  mov    %r8,%rbp
  push   %rbx
  mov    %edx,%ebx
  mov    $0x10,%edx
  lea    0x2(%rbx),%r14d
  sub    $0x38,%rsp
  mov    %rcx,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <memset@plt>
  movzbl 0x0(%r13),%esi
  mov    %ebx,%ecx
  mov    %r14d,%edi
  shr    $0x6,%sil
  movzbl %sil,%esi
  shl    %cl,%esi
  movswl %si,%esi
  call   <sfx_sign_extend@plt>
  movzbl 0x0(%r13),%esi
  mov    %ebx,%ecx
  mov    %r14d,%edi
  mov    %eax,%edx
  mov    %ax,0x10(%rsp)
  sar    $0x4,%esi
  mov    %edx,0xc(%rsp)
  and    $0x3,%esi
  shl    %cl,%esi
  movswl %si,%esi
  call   <sfx_sign_extend@plt>
  movzbl 0x0(%r13),%esi
  mov    %ebx,%ecx
  mov    %r14d,%edi
  mov    %eax,%r15d
  mov    %ax,0x12(%rsp)
  sar    $0x2,%esi
  and    $0x3,%esi
  shl    %cl,%esi
  movswl %si,%esi
  call   <sfx_sign_extend@plt>
  movzbl 0x0(%r13),%esi
  mov    %ebx,%ecx
  mov    %r14d,%edi
  mov    %ax,0x14(%rsp)
  and    $0x3,%esi
  shl    %cl,%esi
  movswl %si,%esi
  call   <sfx_sign_extend@plt>
  movzbl 0x1(%r13),%esi
  mov    %ebx,%ecx
  mov    %r14d,%edi
  mov    %ax,0x16(%rsp)
  shr    $0x6,%sil
  movzbl %sil,%esi
  shl    %cl,%esi
  movswl %si,%esi
  call   <sfx_sign_extend@plt>
  movzbl 0x1(%r13),%esi
  mov    %ebx,%ecx
  mov    %r14d,%edi
  mov    %ax,0x18(%rsp)
  sar    $0x4,%esi
  and    $0x3,%esi
  shl    %cl,%esi
  movswl %si,%esi
  call   <sfx_sign_extend@plt>
  movzbl 0x1(%r13),%esi
  mov    %ebx,%ecx
  mov    %r14d,%edi
  mov    %ax,0x1a(%rsp)
  sar    $0x2,%esi
  and    $0x3,%esi
  shl    %cl,%esi
  movswl %si,%esi
  call   <sfx_sign_extend@plt>
  movzbl 0x1(%r13),%esi
  mov    %ebx,%ecx
  mov    %r14d,%edi
  mov    %ax,0x1c(%rsp)
  and    $0x3,%esi
  shl    %cl,%esi
  movswl %si,%esi
  call   <sfx_sign_extend@plt>
  mov    0xc(%rsp),%edx
  movswl %r15w,%edi
  xor    %esi,%esi
  mov    %ax,0x1e(%rsp)
  mov    (%rsp),%rcx
  mov    $0xfffffffa,%r10d
  mov    $0xfffffffb,%r9d
  movswl %dx,%eax
  mov    %edi,(%rsp)
  movss  D26(%rip),%xmm1
  mov    $0xfffffffc,%r8d
  mov    %eax,%r14d
  mov    $0xfffffffd,%edi
  mov    $0xfffffff9,%r11d
  jmp    L44
  nopl   0x0(%rax)
L36:
  add    %rax,%r13
  pxor   %xmm0,%xmm0
  sar    $0xb,%r13
  cvtsi2ss %r13,%xmm0
  comiss D23(%rip),%xmm0
  jbe    L107
  mov    $0x7fff,%eax
  mov    %ax,(%r12)
L98:
  movswl 0x12(%rsp,%rsi,2),%eax
  add    $0x2,%rcx
  add    $0x1,%rsi
  add    $0x1,%edi
  add    $0x1,%r11d
  add    $0x1,%r8d
  add    $0x1,%r9d
  add    $0x1,%r10d
L44:
  movswl 0xc(%rbp),%ebx
  movswl (%rcx),%edx
  shl    $0xb,%eax
  movswl 0x10(%rcx),%r13d
  cltq
  imul   %ebx,%edx
  movswl 0xe(%rbp),%ebx
  imul   %ebx,%r13d
  movslq %edx,%rdx
  movslq %r13d,%r13
  add    %rdx,%r13
  test   %rsi,%rsi
  je     L36
  movswl 0xe(%rcx),%edx
  lea    -0x1(%rsi),%ebx
  imul   %r14d,%edx
  movslq %edx,%rdx
  add    %r13,%rdx
  cmp    $0x1,%rsi
  je     L102
  movswl 0xc(%rcx),%r13d
  imul   (%rsp),%r13d
  movslq %r13d,%r13
  add    %r13,%rdx
  cmp    $0xffffffff,%edi
  je     L102
  mov    %ebx,%r13d
  movswl 0xa(%rcx),%r15d
  sub    %edi,%r13d
  movslq %r13d,%r13
  movswl 0x10(%rsp,%r13,2),%r13d
  imul   %r15d,%r13d
  movslq %r13d,%r13
  add    %r13,%rdx
  cmp    $0xffffffff,%r8d
  je     L102
  mov    %ebx,%r13d
  movswl 0x8(%rcx),%r15d
  sub    %r8d,%r13d
  movslq %r13d,%r13
  movswl 0x10(%rsp,%r13,2),%r13d
  imul   %r15d,%r13d
  movslq %r13d,%r13
  add    %r13,%rdx
  cmp    $0xffffffff,%r9d
  je     L102
  mov    %ebx,%r13d
  movswl 0x6(%rcx),%r15d
  sub    %r9d,%r13d
  movslq %r13d,%r13
  movswl 0x10(%rsp,%r13,2),%r13d
  imul   %r15d,%r13d
  movslq %r13d,%r13
  add    %r13,%rdx
  cmp    $0xffffffff,%r10d
  je     L102
  mov    %ebx,%r13d
  movswl 0x4(%rcx),%r15d
  sub    %r10d,%r13d
  movslq %r13d,%r13
  movswl 0x10(%rsp,%r13,2),%r13d
  imul   %r15d,%r13d
  movslq %r13d,%r13
  add    %r13,%rdx
  cmp    $0xffffffff,%r11d
  je     L102
  sub    %r11d,%ebx
  movswl 0x2(%rcx),%r13d
  movslq %ebx,%rbx
  movswl 0x10(%rsp,%rbx,2),%ebx
  imul   %r13d,%ebx
  movslq %ebx,%rbx
  add    %rbx,%rdx
L102:
  add    %rax,%rdx
  pxor   %xmm0,%xmm0
  mov    $0x7fff,%eax
  sar    $0xb,%rdx
  cvtsi2ss %rdx,%xmm0
  comiss D23(%rip),%xmm0
  ja     L96
L107:
  comiss %xmm0,%xmm1
  mov    $0xffff8000,%eax
  ja     L96
  cvttss2si %xmm0,%eax
L96:
  mov    %ax,(%r12,%rsi,2)
  cmp    $0x7,%rsi
  jne    L98
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L103
  add    $0x38,%rsp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x10,%edx
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10a0 <memcpy@plt>
L103:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D26
type: byte[4]
name: parse_data
arguments: tag: D23
type: byte[4]

tool: {"D26": [0x00,0x00,0x00,0xc7]}

tool: {"D23": [0x00,0xfe,0xff,0x46]}

assistant: ```c
void decode_8_half(unsigned char *in, signed short *out, int index, signed short *pred1, signed short lastsmp[8]) {
  int i;
  signed short tmp[8];
  signed long total = 0;
  signed short sample = 0;
  memset(out, 0, sizeof(signed short) * 8);
  signed short *pred2 = (pred1 + 8);
  tmp[0] = (((((*in) & 0xC0) >> 6) & 0x3)) << (index);
  tmp[0] = sfx_sign_extend(index + 2, tmp[0]);
  tmp[1] = (((((*in) & 0x30) >> 4) & 0x3)) << (index);
  tmp[1] = sfx_sign_extend(index + 2, tmp[1]);
  tmp[2] = (((((*in) & 0x0C) >> 2) & 0x3)) << (index);
  tmp[2] = sfx_sign_extend(index + 2, tmp[2]);
  tmp[3] = ((((*in++) & 0x03) & 0x3)) << (index);
  tmp[3] = sfx_sign_extend(index + 2, tmp[3]);
  tmp[4] = (((((*in) & 0xC0) >> 6) & 0x3)) << (index);
  tmp[4] = sfx_sign_extend(index + 2, tmp[4]);
  tmp[5] = (((((*in) & 0x30) >> 4) & 0x3)) << (index);
  tmp[5] = sfx_sign_extend(index + 2, tmp[5]);
  tmp[6] = (((((*in) & 0x0C) >> 2) & 0x3)) << (index);
  tmp[6] = sfx_sign_extend(index + 2, tmp[6]);
  tmp[7] = ((((*in++) & 0x03) & 0x3)) << (index);
  tmp[7] = sfx_sign_extend(index + 2, tmp[7]);
  for (i = 0; i < 8; i++) {
    total = (pred1[i] * lastsmp[6]);
    total += (pred2[i] * lastsmp[7]);
    if (i > 0) {
      for (int x = i - 1; x > -1; x--) {
        total += (tmp[((i - 1) - x)] * pred2[x]);
      }
    }
    float result = ((tmp[i] << 0xb) + total) >> 0xb;
    if (result > 32767)
      sample = 32767;
    else if (result < -32768)
      sample = -32768;
    else
      sample = (signed short)result;
    out[i] = sample;
  }
  memcpy(lastsmp, out, sizeof(signed short) * 8);
}
```