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

```asm
<str2fmt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  lea    D105(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L176
  mov    -0x18(%rbp),%rax
  lea    D35(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L176
  mov    -0x18(%rbp),%rax
  lea    D49(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L126
  mov    -0x18(%rbp),%rax
  lea    D28(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L220
L126:
  orl    $0x1,-0x4(%rbp)
  jmp    L57
L220:
  orl    $0x1,-0x4(%rbp)
  jmp    L57
L176:
  nop
L57:
  mov    -0x18(%rbp),%rax
  lea    D132(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L17
  mov    -0x18(%rbp),%rax
  lea    D23(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L130
L17:
  orl    $0x8,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  jmp    L132
L130:
  mov    -0x18(%rbp),%rax
  lea    D117(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L225
  mov    -0x18(%rbp),%rax
  lea    D168(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L185
L225:
  orl    $0x10,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  jmp    L132
L185:
  mov    -0x18(%rbp),%rax
  lea    D160(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L222
  mov    -0x18(%rbp),%rax
  lea    D53(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L227
L222:
  orl    $0x20,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  jmp    L132
L227:
  mov    -0x18(%rbp),%rax
  lea    D63(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L134
  mov    -0x18(%rbp),%rax
  lea    D143(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L18
L134:
  orl    $0x18,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  jmp    L132
L18:
  mov    -0x18(%rbp),%rax
  lea    D146(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L122
  mov    -0x18(%rbp),%rax
  lea    D119(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L171
L122:
  orl    $0x1,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  jmp    L132
L171:
  mov    -0x18(%rbp),%rax
  lea    D156(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L68
  mov    -0x18(%rbp),%rax
  lea    D96(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L62
L68:
  orl    $0x4,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  jmp    L132
L62:
  mov    -0x18(%rbp),%rax
  lea    D2(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L244
  mov    -0x18(%rbp),%rax
  lea    D173(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L204
L244:
  orl    $0x2,-0x4(%rbp)
L204:
  mov    -0x4(%rbp),%eax
L132:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D105
type: string
name: disassemble_data
arguments: data_tag: D35
type: string
name: disassemble_data
arguments: data_tag: D49
type: string
name: disassemble_data
arguments: data_tag: D28
type: string
name: disassemble_data
arguments: data_tag: D132
type: string
name: disassemble_data
arguments: data_tag: D23
type: string
name: disassemble_data
arguments: data_tag: D117
type: string
name: disassemble_data
arguments: data_tag: D168
type: string
name: disassemble_data
arguments: data_tag: D160
type: string
name: disassemble_data
arguments: data_tag: D53
type: string
name: disassemble_data
arguments: data_tag: D63
type: string
name: disassemble_data
arguments: data_tag: D143
type: string
name: disassemble_data
arguments: data_tag: D146
type: string
name: disassemble_data
arguments: data_tag: D119
type: string
name: disassemble_data
arguments: data_tag: D156
type: string
name: disassemble_data
arguments: data_tag: D96
type: string
name: disassemble_data
arguments: data_tag: D2
type: string
name: disassemble_data
arguments: data_tag: D173
type: string

tool: D105: be

tool: D35: BE

tool: D49: le

tool: D28: LE

tool: D132: mulaw

tool: D23: MULAW

tool: D117: alaw

tool: D168: ALAW

tool: D160: ac3

tool: D53: AC3

tool: D63: mpeg2

tool: D143: MPEG2

tool: D146: imaadpcm

tool: D119: IMAADPCM

tool: D156: float

tool: D96: FLOAT

tool: D2: unsigned

tool: D173: UNSIGNED

assistant: ```c
int str2fmt(char *str) {
  int format = 0;
  if (strstr(str, "be") || strstr(str, "BE"))
    format |= (0 << 0);
  else if (strstr(str, "le") || strstr(str, "LE"))
    format |= (1 << 0);
  else
    format |= (1 << 0);
  if (strstr(str, "mulaw") || strstr(str, "MULAW")) {
    format |= (1 << 3);
    return format;
  }
  if (strstr(str, "alaw") || strstr(str, "ALAW")) {
    format |= (2 << 3);
    return format;
  }
  if (strstr(str, "ac3") || strstr(str, "AC3")) {
    format |= (4 << 3);
    return format;
  }
  if (strstr(str, "mpeg2") || strstr(str, "MPEG2")) {
    format |= (3 << 3);
    return format;
  }
  if (strstr(str, "imaadpcm") || strstr(str, "IMAADPCM")) {
    format |= (1 << 0) | (0 << 1);
    return format;
  }
  if (strstr(str, "float") || strstr(str, "FLOAT")) {
    format |= (1 << 2);
    return format;
  } else
    format |= (0 << 2);
  if (strstr(str, "unsigned") || strstr(str, "UNSIGNED"))
    format |= (1 << 1);
  else
    format |= (0 << 1);
  return format;
}
```