user: Please show me the C implementation that matches the assembly code listed below:

```asm
<wear_bit_name>:
  endbr64
  push   %rbp
  lea    D48(%rip),%rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x8,%rsp
  and    $0x1,%edi
  movb   $0x0,D48(%rip)
  jne    L118
  test   $0x2,%bl
  jne    L87
L224:
  test   $0x4,%bl
  jne    L269
L93:
  test   $0x8,%bl
  jne    L152
L65:
  test   $0x10,%bl
  jne    L20
L53:
  test   $0x20,%bl
  jne    L49
L216:
  test   $0x40,%bl
  jne    L88
L37:
  test   $0x80,%bl
  jne    L153
L2:
  test   $0x1,%bh
  jne    L90
L111:
  test   $0x2,%bh
  jne    L256
L52:
  test   $0x4,%bh
  jne    L9
L157:
  test   $0x8,%bh
  jne    L106
L325:
  test   $0x10,%bh
  jne    L268
L323:
  test   $0x20,%bh
  jne    L180
L43:
  test   $0x40,%bh
  jne    L163
L76:
  test   $0x80,%bh
  jne    L19
L300:
  and    $0x10000,%ebx
  jne    L286
L79:
  cmpb   $0x0,D48(%rip)
  lea    D133(%rip),%rax
  lea    D195(%rip),%rdx
  cmove  %rdx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L118:
  lea    D216(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x2,%bl
  je     L224
L87:
  lea    D107(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x4,%bl
  je     L93
L269:
  lea    D118(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x8,%bl
  je     L65
L152:
  lea    D82(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x10,%bl
  je     L53
L20:
  lea    D11(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x20,%bl
  je     L216
L49:
  lea    D161(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x40,%bl
  je     L37
L88:
  lea    D175(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x80,%bl
  je     L2
L153:
  lea    D209(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x1,%bh
  je     L111
L90:
  lea    D211(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x2,%bh
  je     L52
L256:
  lea    D12(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x4,%bh
  je     L157
L9:
  lea    D154(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x8,%bh
  je     L325
L106:
  lea    D153(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x10,%bh
  je     L323
L268:
  lea    D104(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x20,%bh
  je     L43
L180:
  lea    D22(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x40,%bh
  je     L76
L163:
  lea    D21(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x80,%bh
  je     L300
L19:
  lea    D178(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  and    $0x10000,%ebx
  je     L79
L286:
  lea    D99(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L79
```

tool_calls: name: disassemble_data
arguments: data_label: D195
type_guessed: string
name: disassemble_data
arguments: data_label: D216
type_guessed: string
name: disassemble_data
arguments: data_label: D107
type_guessed: string
name: disassemble_data
arguments: data_label: D118
type_guessed: string
name: disassemble_data
arguments: data_label: D82
type_guessed: string
name: disassemble_data
arguments: data_label: D11
type_guessed: string
name: disassemble_data
arguments: data_label: D161
type_guessed: string
name: disassemble_data
arguments: data_label: D175
type_guessed: string
name: disassemble_data
arguments: data_label: D209
type_guessed: string
name: disassemble_data
arguments: data_label: D211
type_guessed: string
name: disassemble_data
arguments: data_label: D12
type_guessed: string
name: disassemble_data
arguments: data_label: D154
type_guessed: string
name: disassemble_data
arguments: data_label: D153
type_guessed: string
name: disassemble_data
arguments: data_label: D104
type_guessed: string
name: disassemble_data
arguments: data_label: D22
type_guessed: string
name: disassemble_data
arguments: data_label: D21
type_guessed: string
name: disassemble_data
arguments: data_label: D178
type_guessed: string
name: disassemble_data
arguments: data_label: D99
type_guessed: string

tool: D195: none

tool: D216:  take

tool: D107:  finger

tool: D118:  neck

tool: D82:  torso

tool: D11:  head

tool: D161:  legs

tool: D175:  feet

tool: D209:  hands

tool: D211:  arms

tool: D12:  shield

tool: D154:  body

tool: D153:  waist

tool: D104:  wrist

tool: D22:  wield

tool: D21:  hold

tool: D178:  nosac

tool: D99:  float

assistant: ```c
char *wear_bit_name(int wear_flags) {
  static char buf[512];
  buf[0] = '\0';
  if (wear_flags & (1))
    strcat(buf, " take");
  if (wear_flags & (2))
    strcat(buf, " finger");
  if (wear_flags & (4))
    strcat(buf, " neck");
  if (wear_flags & (8))
    strcat(buf, " torso");
  if (wear_flags & (16))
    strcat(buf, " head");
  if (wear_flags & (32))
    strcat(buf, " legs");
  if (wear_flags & (64))
    strcat(buf, " feet");
  if (wear_flags & (128))
    strcat(buf, " hands");
  if (wear_flags & (256))
    strcat(buf, " arms");
  if (wear_flags & (512))
    strcat(buf, " shield");
  if (wear_flags & (1024))
    strcat(buf, " body");
  if (wear_flags & (2048))
    strcat(buf, " waist");
  if (wear_flags & (4096))
    strcat(buf, " wrist");
  if (wear_flags & (8192))
    strcat(buf, " wield");
  if (wear_flags & (16384))
    strcat(buf, " hold");
  if (wear_flags & (32768))
    strcat(buf, " nosac");
  if (wear_flags & (65536))
    strcat(buf, " float");
  return (buf[0] != '\0') ? buf + 1 : "none";
}
```