user: Translate the below assembly code into C programming language:

```asm
<WavpackNativeToLittleEndian>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  movsbl (%rsi),%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %dil,%dil
  je     L67
  mov    %rsi,%rbp
  lea    0x10(%rsp),%rbx
  jmp    L31
  nopl   0x0(%rax)
L94:
  cmp    $0x44,%dil
  je     L48
  call   <isdigit@plt>
  test   %eax,%eax
  je     L35
  movsbq 0x0(%rbp),%rax
  lea    -0x30(%r12,%rax,1),%r12
  nopl   (%rax)
L35:
  movsbl 0x1(%rbp),%edi
  add    $0x1,%rbp
  test   %dil,%dil
  je     L67
L31:
  cmp    $0x4c,%dil
  je     L13
  cmp    $0x53,%dil
  jne    L94
  lea    0x14(%rsp),%rdi
  mov    %r12,%rsi
  mov    $0x4,%edx
  add    $0x1,%rbp
  call   <memcpy@plt>
  movzwl 0x14(%rsp),%eax
  add    $0x2,%r12
  mov    %ax,-0x2(%r12)
  movsbl 0x0(%rbp),%edi
  test   %dil,%dil
  jne    L31
L67:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L21
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L48:
  mov    %r12,%rsi
  lea    0xc(%rsp),%rdi
  mov    $0x4,%edx
  add    $0x8,%r12
  call   <memcpy@plt>
  mov    0xc(%rsp),%edx
  mov    %edx,%ecx
  mov    %edx,%r8d
  mov    %edx,%r9d
  mov    %edx,%r10d
  sar    $0x8,%ecx
  mov    %edx,%eax
  mov    %edx,%edi
  mov    %edx,%esi
  sar    $0x18,%edi
  mov    %ecx,%r11d
  mov    $0x20,%ecx
  sar    $0x10,%esi
  sar    %cl,%r8d
  mov    $0x28,%ecx
  movzbl %dil,%edi
  movzbl %sil,%esi
  sar    %cl,%r9d
  mov    $0x30,%ecx
  movzbl %r8b,%r8d
  movzbl %dl,%edx
  sar    %cl,%r10d
  mov    $0x38,%ecx
  movzbl %r9b,%r9d
  sar    %cl,%eax
  movzbl %r10b,%r10d
  movzbl %r11b,%ecx
  movzbl %al,%eax
  shl    $0x8,%rax
  or     %r10,%rax
  shl    $0x8,%rax
  or     %r9,%rax
  shl    $0x8,%rax
  or     %r8,%rax
  shl    $0x8,%rax
  or     %rdi,%rax
  shl    $0x8,%rax
  or     %rsi,%rax
  shl    $0x8,%rax
  or     %rcx,%rax
  shl    $0x8,%rax
  or     %rdx,%rax
  mov    %rax,-0x8(%r12)
  jmp    L35
  nop
L13:
  mov    %r12,%rsi
  mov    $0x4,%edx
  mov    %rbx,%rdi
  add    $0x4,%r12
  call   <memcpy@plt>
  mov    0x10(%rsp),%eax
  mov    %eax,-0x4(%r12)
  jmp    L35
L21:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void WavpackNativeToLittleEndian(void *data, char *format) {
  unsigned char *cp = (unsigned char *)data;
  int64_t temp64;
  int32_t temp32;
  int16_t temp16;
  while (*format) {
    switch (*format) {
    case 'D':
      memcpy(&temp64, cp, sizeof(temp64));
      *cp++ = (unsigned char)temp64;
      *cp++ = (unsigned char)(temp64 >> 8);
      *cp++ = (unsigned char)(temp64 >> 16);
      *cp++ = (unsigned char)(temp64 >> 24);
      *cp++ = (unsigned char)(temp64 >> 32);
      *cp++ = (unsigned char)(temp64 >> 40);
      *cp++ = (unsigned char)(temp64 >> 48);
      *cp++ = (unsigned char)(temp64 >> 56);
      break;
    case 'L':
      memcpy(&temp32, cp, sizeof(temp32));
      *cp++ = (unsigned char)temp32;
      *cp++ = (unsigned char)(temp32 >> 8);
      *cp++ = (unsigned char)(temp32 >> 16);
      *cp++ = (unsigned char)(temp32 >> 24);
      break;
    case 'S':
      memcpy(&temp16, cp, sizeof(temp16));
      *cp++ = (unsigned char)temp16;
      *cp++ = (unsigned char)(temp16 >> 8);
      break;
    default:
      if (isdigit(*format))
        cp += *format - '0';
      break;
    }
    format++;
  }
}
```