user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<pcm_S8_to_int>:
  endbr64
  mov    %edi,%r8d
  mov    %rsi,%rcx
  mov    %rdx,%r9
  test   %edi,%edi
  je     L188
  mov    %r8d,%r10d
  lea    -0x1(%rdi),%edi
  lea    (%rdx,%r10,4),%rax
  lea    (%rsi,%r10,1),%rdx
  cmp    %rax,%rsi
  setae  %al
  cmp    %rdx,%r9
  setae  %dl
  or     %dl,%al
  je     L123
  cmp    $0xe,%edi
  jbe    L123
  mov    %rsi,%rdx
  mov    %r8d,%esi
  pxor   %xmm6,%xmm6
  mov    %r9,%rax
  shr    $0x4,%esi
  movdqa D1(%rip),%xmm7
  pxor   %xmm4,%xmm4
  sub    $0x1,%esi
  shl    $0x4,%rsi
  lea    0x10(%rcx,%rsi,1),%rsi
  nopl   0x0(%rax,%rax,1)
L166:
  movdqu (%rdx),%xmm1
  movdqa %xmm6,%xmm0
  movdqa %xmm6,%xmm3
  add    $0x10,%rdx
  movdqa %xmm4,%xmm10
  movdqa %xmm7,%xmm9
  add    $0x40,%rax
  pcmpgtb %xmm1,%xmm0
  movdqa %xmm1,%xmm2
  movdqa %xmm1,%xmm5
  punpcklbw %xmm6,%xmm2
  punpckhbw %xmm6,%xmm5
  movdqa %xmm2,%xmm11
  punpckhwd %xmm4,%xmm2
  movdqa %xmm5,%xmm8
  pcmpgtb %xmm0,%xmm3
  movdqa %xmm0,%xmm1
  punpcklwd %xmm4,%xmm11
  paddd  %xmm11,%xmm9
  punpcklwd %xmm4,%xmm8
  punpckhwd %xmm4,%xmm5
  punpcklbw %xmm3,%xmm1
  punpckhbw %xmm3,%xmm0
  pcmpgtw %xmm1,%xmm10
  movdqa %xmm1,%xmm3
  punpcklwd %xmm10,%xmm3
  punpckhwd %xmm10,%xmm1
  movdqa %xmm4,%xmm10
  pand   %xmm3,%xmm9
  pcmpgtw %xmm0,%xmm10
  pandn  %xmm11,%xmm3
  por    %xmm9,%xmm3
  movdqa %xmm7,%xmm9
  paddd  %xmm2,%xmm9
  movups %xmm3,-0x40(%rax)
  pand   %xmm1,%xmm9
  pandn  %xmm2,%xmm1
  movdqa %xmm0,%xmm2
  por    %xmm9,%xmm1
  movdqa %xmm7,%xmm9
  punpcklwd %xmm10,%xmm2
  paddd  %xmm8,%xmm9
  punpckhwd %xmm10,%xmm0
  movups %xmm1,-0x30(%rax)
  pand   %xmm2,%xmm9
  pandn  %xmm8,%xmm2
  movdqa %xmm7,%xmm8
  paddd  %xmm5,%xmm8
  por    %xmm9,%xmm2
  pand   %xmm0,%xmm8
  pandn  %xmm5,%xmm0
  movups %xmm2,-0x20(%rax)
  por    %xmm8,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rsi,%rdx
  jne    L166
  mov    %r8d,%esi
  and    $0xfffffff0,%esi
  mov    %esi,%eax
  lea    (%rcx,%rax,1),%rdx
  lea    (%r9,%rax,4),%rax
  cmp    %esi,%r8d
  je     L188
  movzbl (%rdx),%ecx
  mov    %ecx,%r9d
  or     $0xffffff00,%r9d
  test   %cl,%cl
  cmovs  %r9d,%ecx
  mov    %ecx,(%rax)
  mov    %edi,%ecx
  sub    %esi,%ecx
  je     L188
  movzbl 0x1(%rdx),%esi
  mov    %esi,%r8d
  or     $0xffffff00,%r8d
  test   %sil,%sil
  cmovs  %r8d,%esi
  mov    %esi,0x4(%rax)
  cmp    $0x1,%ecx
  je     L188
  movzbl 0x2(%rdx),%esi
  mov    %esi,%r8d
  or     $0xffffff00,%r8d
  test   %sil,%sil
  cmovs  %r8d,%esi
  mov    %esi,0x8(%rax)
  cmp    $0x2,%ecx
  je     L188
  movzbl 0x3(%rdx),%esi
  mov    %esi,%r8d
  or     $0xffffff00,%r8d
  test   %sil,%sil
  cmovs  %r8d,%esi
  mov    %esi,0xc(%rax)
  cmp    $0x3,%ecx
  je     L188
  movzbl 0x4(%rdx),%esi
  mov    %esi,%r8d
  or     $0xffffff00,%r8d
  test   %sil,%sil
  cmovs  %r8d,%esi
  mov    %esi,0x10(%rax)
  cmp    $0x4,%ecx
  je     L188
  movzbl 0x5(%rdx),%esi
  mov    %esi,%r8d
  or     $0xffffff00,%r8d
  test   %sil,%sil
  cmovs  %r8d,%esi
  mov    %esi,0x14(%rax)
  cmp    $0x5,%ecx
  je     L188
  movzbl 0x6(%rdx),%esi
  mov    %esi,%r8d
  or     $0xffffff00,%r8d
  test   %sil,%sil
  cmovs  %r8d,%esi
  mov    %esi,0x18(%rax)
  cmp    $0x6,%ecx
  je     L188
  movzbl 0x7(%rdx),%esi
  mov    %esi,%r8d
  or     $0xffffff00,%r8d
  test   %sil,%sil
  cmovs  %r8d,%esi
  mov    %esi,0x1c(%rax)
  cmp    $0x7,%ecx
  je     L188
  movzbl 0x8(%rdx),%esi
  mov    %esi,%r8d
  or     $0xffffff00,%r8d
  test   %sil,%sil
  cmovs  %r8d,%esi
  mov    %esi,0x20(%rax)
  cmp    $0x8,%ecx
  je     L188
  movzbl 0x9(%rdx),%esi
  mov    %esi,%r8d
  or     $0xffffff00,%r8d
  test   %sil,%sil
  cmovs  %r8d,%esi
  mov    %esi,0x24(%rax)
  cmp    $0x9,%ecx
  je     L188
  movzbl 0xa(%rdx),%esi
  mov    %esi,%r8d
  or     $0xffffff00,%r8d
  test   %sil,%sil
  cmovs  %r8d,%esi
  mov    %esi,0x28(%rax)
  cmp    $0xa,%ecx
  je     L188
  movzbl 0xb(%rdx),%esi
  mov    %esi,%r8d
  or     $0xffffff00,%r8d
  test   %sil,%sil
  cmovs  %r8d,%esi
  mov    %esi,0x2c(%rax)
  cmp    $0xb,%ecx
  je     L188
  movzbl 0xc(%rdx),%esi
  mov    %esi,%r8d
  or     $0xffffff00,%r8d
  test   %sil,%sil
  cmovs  %r8d,%esi
  mov    %esi,0x30(%rax)
  cmp    $0xc,%ecx
  je     L188
  movzbl 0xd(%rdx),%esi
  mov    %esi,%r8d
  or     $0xffffff00,%r8d
  test   %sil,%sil
  cmovs  %r8d,%esi
  mov    %esi,0x34(%rax)
  cmp    $0xd,%ecx
  je     L188
  movzbl 0xe(%rdx),%edx
  mov    %edx,%esi
  or     $0xffffff00,%esi
  test   %dl,%dl
  cmovs  %esi,%edx
  mov    %edx,0x38(%rax)
  ret
  nopl   (%rax)
L123:
  xor    %eax,%eax
L38:
  movzbl (%rcx,%rax,1),%edx
  mov    %edx,%edi
  or     $0xffffff00,%edi
  test   %dl,%dl
  cmovs  %edi,%edx
  mov    %edx,(%r9,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%r10
  jne    L38
L188:
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D1
type_infered: byte[16]

tool: {"D1": [0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff]}

assistant: ```c
void pcm_S8_to_int(unsigned total_samples, const unsigned char pcm_samples[], int int_samples[]) {
  for (; total_samples; total_samples--) {
    if (pcm_samples[0] & 0x80) {
      int_samples[0] = -(int)(0x100 - pcm_samples[0]);
    } else {
      int_samples[0] = (int)pcm_samples[0];
    }
    pcm_samples += 1;
    int_samples += 1;
  }
}
```