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

```asm
<material_flags_name>:
  endbr64
  push   %rbp
  lea    D99(%rip),%rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x8,%rsp
  and    $0x1,%edi
  movb   $0x0,D99(%rip)
  jne    L39
  test   $0x2,%bl
  jne    L10
L106:
  test   $0x4,%bl
  jne    L197
L161:
  test   $0x8,%bl
  jne    L222
L96:
  test   $0x10,%bl
  jne    L62
L67:
  test   $0x20,%bl
  jne    L46
L275:
  test   $0x40,%bl
  jne    L147
L271:
  test   $0x80,%bl
  jne    L261
L182:
  test   $0x1,%bh
  jne    L155
L43:
  test   $0x2,%bh
  jne    L208
L101:
  test   $0x4,%bh
  jne    L212
L154:
  test   $0x8,%bh
  jne    L168
L215:
  test   $0x10,%bh
  jne    L270
L1:
  and    $0x20,%bh
  jne    L95
L239:
  cmpb   $0x0,D99(%rip)
  lea    D48(%rip),%rax
  lea    D52(%rip),%rdx
  cmove  %rdx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L39:
  lea    D138(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x2,%bl
  je     L106
L10:
  lea    D165(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x4,%bl
  je     L161
L197:
  lea    D185(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x8,%bl
  je     L96
L222:
  lea    D171(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x10,%bl
  je     L67
L62:
  lea    D21(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x20,%bl
  je     L275
L46:
  lea    D22(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x40,%bl
  je     L271
L147:
  lea    D149(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x80,%bl
  je     L182
L261:
  lea    D31(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x1,%bh
  je     L43
L155:
  lea    D157(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x2,%bh
  je     L101
L208:
  lea    D73(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x4,%bh
  je     L154
L212:
  lea    D128(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x8,%bh
  je     L215
L168:
  lea    D180(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x10,%bh
  je     L1
L270:
  lea    D10(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  and    $0x20,%bh
  je     L239
L95:
  lea    D83(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L239
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D52
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D138
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D165
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D185
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D171
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D21
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D22
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D149
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D31
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D157
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D73
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D128
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D180
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D10
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D83
type_infered: string

tool: D52: none

tool: D138:  legend

tool: D165:  metal

tool: D185:  mineral

tool: D171:  organic

tool: D21:  gemstone

tool: D22:  wood

tool: D149:  precious

tool: D31:  semi_prec

tool: D157:  brittle

tool: D73:  flammable

tool: D128:  element

tool: D180:  spark

tool: D10:  powder

tool: D83:  liquid

assistant: ```c
char *material_flags_name(int matl_flags) {
  static char buf[512];
  buf[0] = '\0';
  if (matl_flags & 1)
    strcat(buf, " legend");
  if (matl_flags & 2)
    strcat(buf, " metal");
  if (matl_flags & 4)
    strcat(buf, " mineral");
  if (matl_flags & 8)
    strcat(buf, " organic");
  if (matl_flags & 16)
    strcat(buf, " gemstone");
  if (matl_flags & 32)
    strcat(buf, " wood");
  if (matl_flags & 64)
    strcat(buf, " precious");
  if (matl_flags & 128)
    strcat(buf, " semi_prec");
  if (matl_flags & 256)
    strcat(buf, " brittle");
  if (matl_flags & 512)
    strcat(buf, " flammable");
  if (matl_flags & 1024)
    strcat(buf, " element");
  if (matl_flags & 2048)
    strcat(buf, " spark");
  if (matl_flags & 4096)
    strcat(buf, " powder");
  if (matl_flags & 8192)
    strcat(buf, " liquid");
  return (buf[0] != '\0') ? buf + 1 : "none";
}
```