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

```asm
<material_flags_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  movb   $0x0,D37(%rip)
  mov    -0x4(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L28
  lea    D149(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L28:
  mov    -0x4(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L12
  lea    D309(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L12:
  mov    -0x4(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L82
  lea    D210(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L82:
  mov    -0x4(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L139
  lea    D18(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L139:
  mov    -0x4(%rbp),%eax
  and    $0x10,%eax
  test   %eax,%eax
  je     L14
  lea    D268(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L14:
  mov    -0x4(%rbp),%eax
  and    $0x20,%eax
  test   %eax,%eax
  je     L40
  lea    D150(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L40:
  mov    -0x4(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L45
  lea    D152(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L45:
  mov    -0x4(%rbp),%eax
  and    $0x80,%eax
  test   %eax,%eax
  je     L84
  lea    D162(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L84:
  mov    -0x4(%rbp),%eax
  and    $0x100,%eax
  test   %eax,%eax
  je     L113
  lea    D114(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L113:
  mov    -0x4(%rbp),%eax
  and    $0x200,%eax
  test   %eax,%eax
  je     L60
  lea    D315(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L60:
  mov    -0x4(%rbp),%eax
  and    $0x400,%eax
  test   %eax,%eax
  je     L52
  lea    D200(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L52:
  mov    -0x4(%rbp),%eax
  and    $0x800,%eax
  test   %eax,%eax
  je     L10
  lea    D91(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L10:
  mov    -0x4(%rbp),%eax
  and    $0x1000,%eax
  test   %eax,%eax
  je     L31
  lea    D189(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L31:
  mov    -0x4(%rbp),%eax
  and    $0x2000,%eax
  test   %eax,%eax
  je     L76
  lea    D258(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <strcat@plt>
L76:
  movzbl D37(%rip),%eax
  test   %al,%al
  je     L41
  lea    D41(%rip),%rax
  jmp    L92
L41:
  lea    D117(%rip),%rax
L92:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D149
datatype: string
name: read_data
arguments: tag: D309
datatype: string
name: read_data
arguments: tag: D210
datatype: string
name: read_data
arguments: tag: D18
datatype: string
name: read_data
arguments: tag: D268
datatype: string
name: read_data
arguments: tag: D150
datatype: string
name: read_data
arguments: tag: D152
datatype: string
name: read_data
arguments: tag: D162
datatype: string
name: read_data
arguments: tag: D114
datatype: string
name: read_data
arguments: tag: D315
datatype: string
name: read_data
arguments: tag: D200
datatype: string
name: read_data
arguments: tag: D91
datatype: string
name: read_data
arguments: tag: D189
datatype: string
name: read_data
arguments: tag: D258
datatype: string
name: read_data
arguments: tag: D117
datatype: string

tool: D149:  legend

tool: D309:  metal

tool: D210:  mineral

tool: D18:  organic

tool: D268:  gemstone

tool: D150:  wood

tool: D152:  precious

tool: D162:  semi_prec

tool: D114:  brittle

tool: D315:  flammable

tool: D200:  element

tool: D91:  spark

tool: D189:  powder

tool: D258:  liquid

tool: D117: none

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";
}
```