user: Converte this assembly snippet into its equivalent C code:

```asm
<FileExtensionToUpnpClass>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  jne    L163
L2:
  cmpb   $0x2e,0x0(%rbp)
  je     L108
  mov    %rbp,%rsi
  lea    0x4(%rsp),%rbx
  lea    0x5(%rsp),%rdi
  movb   $0x2e,0x4(%rsp)
  call   <strcpy@plt>
  mov    %rbx,%rbp
L108:
  lea    D138(%rip),%rsi
  mov    %rbp,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  jne    L53
L66:
  lea    D49(%rip),%rax
L161:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L97
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L163:
  lea    0xe(%rsp),%rbx
  mov    %rdi,%rsi
  xor    %r8d,%r8d
  mov    $0x1,%ecx
  mov    $0xa,%edx
  mov    %rbx,%rdi
  mov    %rbx,%rbp
  call   <strToUtf8@plt>
  jmp    L2
  nopl   (%rax)
L53:
  lea    D69(%rip),%rsi
  mov    %rbp,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  je     L66
  lea    D128(%rip),%rsi
  mov    %rbp,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  je     L66
  lea    D87(%rip),%rsi
  mov    %rbp,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  jne    L173
L198:
  lea    D27(%rip),%rax
  jmp    L161
L173:
  lea    D35(%rip),%rsi
  mov    %rbp,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  je     L198
  lea    D91(%rip),%rsi
  mov    %rbp,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  je     L198
  lea    D36(%rip),%rsi
  mov    %rbp,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  je     L198
  lea    D77(%rip),%rsi
  mov    %rbp,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  jne    L142
L120:
  lea    D133(%rip),%rax
  jmp    L161
L97:
  call   <__stack_chk_fail@plt>
L142:
  lea    D155(%rip),%rsi
  mov    %rbp,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  je     L120
  lea    D82(%rip),%rsi
  mov    %rbp,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  je     L120
  lea    D165(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmpi@plt>
  test   %rax,%rax
  jne    L157
L148:
  lea    D33(%rip),%rax
  jmp    L161
L157:
  lea    D15(%rip),%rsi
  mov    %rbp,%rdi
  call   <stricmp@plt>
  test   %rax,%rax
  je     L148
  lea    D129(%rip),%rax
  jmp    L161
```

tool_calls: name: read_data
arguments: tag: D138
datatype: string
name: read_data
arguments: tag: D49
datatype: string
name: read_data
arguments: tag: D69
datatype: string
name: read_data
arguments: tag: D128
datatype: string
name: read_data
arguments: tag: D87
datatype: string
name: read_data
arguments: tag: D27
datatype: string
name: read_data
arguments: tag: D35
datatype: string
name: read_data
arguments: tag: D91
datatype: string
name: read_data
arguments: tag: D36
datatype: string
name: read_data
arguments: tag: D77
datatype: string
name: read_data
arguments: tag: D133
datatype: string
name: read_data
arguments: tag: D155
datatype: string
name: read_data
arguments: tag: D82
datatype: string
name: read_data
arguments: tag: D165
datatype: string
name: read_data
arguments: tag: D33
datatype: string
name: read_data
arguments: tag: D15
datatype: string
name: read_data
arguments: tag: D129
datatype: string

tool: D138: .mp3

tool: D49: object.item.audioItem

tool: D69: .wma

tool: D128: .ogg

tool: D87: .asf

tool: D27: object.item.videoItem

tool: D35: .wmv

tool: D91: .mpg

tool: D36: .mov

tool: D77: .jpg

tool: D133: object.item.imageItem

tool: D155: .jpeg

tool: D82: .bmp

tool: D165: .m3u

tool: D33: object.container.playlistContainer

tool: D15: .asx

tool: D129: object.item

assistant: ```c
char *FileExtensionToUpnpClass(char *extension, int wide) {
  char tempExtension[10], temp2[10];
  char *retVal = NULL;
  if (wide) {
    strToUtf8(temp2, extension, 10, 1, NULL);
    extension = temp2;
  }
  if (extension[0] != '.') {
    tempExtension[0] = '.';
    strcpy(tempExtension + 1, extension);
    extension = tempExtension;
  }
  if (stricmp(extension, ".mp3") == 0) {
    retVal = "object.item.audioItem";
  } else if (stricmp(extension, ".wma") == 0) {
    retVal = "object.item.audioItem";
  } else if (stricmp(extension, ".ogg") == 0) {
    retVal = "object.item.audioItem";
  } else if (stricmp(extension, ".asf") == 0) {
    retVal = "object.item.videoItem";
  } else if (stricmp(extension, ".wmv") == 0) {
    retVal = "object.item.videoItem";
  } else if (stricmp(extension, ".mpg") == 0) {
    retVal = "object.item.videoItem";
  } else if (stricmp(extension, ".mov") == 0) {
    retVal = "object.item.videoItem";
  } else if (stricmp(extension, ".jpg") == 0) {
    retVal = "object.item.imageItem";
  } else if (stricmp(extension, ".jpeg") == 0) {
    retVal = "object.item.imageItem";
  } else if (stricmp(extension, ".bmp") == 0) {
    retVal = "object.item.imageItem";
  } else if (strcmpi(extension, ".m3u") == 0) {
    retVal = "object.container.playlistContainer";
  } else if (stricmp(extension, ".asx") == 0) {
    retVal = "object.container.playlistContainer";
  } else {
    retVal = "object.item";
  }
  return retVal;
}
```