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

```asm
<affect_bit_name>:
  endbr64
  push   %rbp
  lea    D240(%rip),%rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x8,%rsp
  and    $0x1,%edi
  movb   $0x0,D240(%rip)
  jne    L500
  test   $0x2,%bl
  jne    L157
L209:
  test   $0x4,%bl
  jne    L107
L218:
  test   $0x40,%bl
  jne    L133
L202:
  test   $0x8,%bl
  jne    L215
L35:
  test   $0x10,%bl
  jne    L253
L375:
  test   $0x20,%bl
  jne    L310
L153:
  test   $0x80,%bl
  jne    L176
L104:
  test   $0x1,%bh
  jne    L74
L485:
  test   $0x2,%bh
  jne    L108
L221:
  test   $0x4,%bh
  jne    L112
L366:
  test   $0x10,%bh
  jne    L426
L309:
  test   $0x20,%bh
  jne    L207
L246:
  test   $0x40,%bh
  jne    L36
L267:
  test   $0x20000,%ebx
  jne    L264
L93:
  test   $0x80,%bh
  jne    L512
L135:
  test   $0x10000,%ebx
  jne    L18
L451:
  test   $0x40000,%ebx
  jne    L382
L87:
  test   $0x80000,%ebx
  jne    L25
L368:
  test   $0x100000,%ebx
  jne    L34
L466:
  test   $0x4000000,%ebx
  jne    L169
L143:
  test   $0x400000,%ebx
  jne    L240
L481:
  test   $0x200000,%ebx
  jne    L245
L56:
  test   $0x20000000,%ebx
  jne    L399
L43:
  test   $0x800000,%ebx
  jne    L3
L212:
  and    $0x2000000,%ebx
  jne    L224
L395:
  cmpb   $0x0,D240(%rip)
  lea    D70(%rip),%rax
  lea    D6(%rip),%rdx
  cmove  %rdx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L500:
  lea    D35(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x2,%bl
  je     L209
L157:
  lea    D173(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x4,%bl
  je     L218
L107:
  lea    D85(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x40,%bl
  je     L202
L133:
  lea    D30(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x8,%bl
  je     L35
L215:
  lea    D59(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x10,%bl
  je     L375
L253:
  lea    D151(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x20,%bl
  je     L153
L310:
  lea    D259(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x80,%bl
  je     L104
L176:
  lea    D216(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x1,%bh
  je     L485
L74:
  lea    D44(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x2,%bh
  je     L221
L108:
  lea    D307(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x4,%bh
  je     L366
L112:
  lea    D308(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x10,%bh
  je     L309
L426:
  lea    D235(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x20,%bh
  je     L246
L207:
  lea    D52(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x40,%bh
  je     L267
L36:
  lea    D279(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x20000,%ebx
  je     L93
L264:
  lea    D145(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x80,%bh
  je     L135
L512:
  lea    D164(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x10000,%ebx
  je     L451
L18:
  lea    D187(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x40000,%ebx
  je     L87
L382:
  lea    D107(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x80000,%ebx
  je     L368
L25:
  lea    D138(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x100000,%ebx
  je     L466
L34:
  lea    D252(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x4000000,%ebx
  je     L143
L169:
  lea    D120(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x400000,%ebx
  je     L481
L240:
  lea    D183(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x200000,%ebx
  je     L56
L245:
  lea    D262(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x20000000,%ebx
  je     L43
L399:
  lea    D50(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x800000,%ebx
  je     L212
L3:
  lea    D266(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  and    $0x2000000,%ebx
  je     L395
L224:
  lea    D37(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L395
```

tool_calls: name: retrieve_data
arguments: data_tag: D6
type: string
name: retrieve_data
arguments: data_tag: D35
type: string
name: retrieve_data
arguments: data_tag: D173
type: string
name: retrieve_data
arguments: data_tag: D85
type: string
name: retrieve_data
arguments: data_tag: D30
type: string
name: retrieve_data
arguments: data_tag: D59
type: string
name: retrieve_data
arguments: data_tag: D151
type: string
name: retrieve_data
arguments: data_tag: D259
type: string
name: retrieve_data
arguments: data_tag: D216
type: string
name: retrieve_data
arguments: data_tag: D44
type: string
name: retrieve_data
arguments: data_tag: D307
type: string
name: retrieve_data
arguments: data_tag: D308
type: string
name: retrieve_data
arguments: data_tag: D235
type: string
name: retrieve_data
arguments: data_tag: D52
type: string
name: retrieve_data
arguments: data_tag: D279
type: string
name: retrieve_data
arguments: data_tag: D145
type: string
name: retrieve_data
arguments: data_tag: D164
type: string
name: retrieve_data
arguments: data_tag: D187
type: string
name: retrieve_data
arguments: data_tag: D107
type: string
name: retrieve_data
arguments: data_tag: D138
type: string
name: retrieve_data
arguments: data_tag: D252
type: string
name: retrieve_data
arguments: data_tag: D120
type: string
name: retrieve_data
arguments: data_tag: D183
type: string
name: retrieve_data
arguments: data_tag: D262
type: string
name: retrieve_data
arguments: data_tag: D50
type: string
name: retrieve_data
arguments: data_tag: D266
type: string
name: retrieve_data
arguments: data_tag: D37
type: string

tool: D6: none

tool: D35:  blind

tool: D173:  invisible

tool: D85:  detect_evil

tool: D30:  detect_good

tool: D59:  detect_invis

tool: D151:  detect_magic

tool: D259:  detect_hidden

tool: D216:  sanctuary

tool: D44:  faerie_fire

tool: D307:  infrared

tool: D308:  curse

tool: D235:  poison

tool: D52:  prot_evil

tool: D279:  prot_good

tool: D145:  sleep

tool: D164:  sneak

tool: D187:  hide

tool: D107:  charm

tool: D138:  flying

tool: D252:  pass_door

tool: D120:  berserk

tool: D183:  calm

tool: D262:  haste

tool: D50:  slow

tool: D266:  plague

tool: D37:  dark_vision

assistant: ```c
char *affect_bit_name(int vector) {
  static char buf[512];
  buf[0] = '\0';
  if (vector & (1))
    strcat(buf, " blind");
  if (vector & (2))
    strcat(buf, " invisible");
  if (vector & (4))
    strcat(buf, " detect_evil");
  if (vector & (64))
    strcat(buf, " detect_good");
  if (vector & (8))
    strcat(buf, " detect_invis");
  if (vector & (16))
    strcat(buf, " detect_magic");
  if (vector & (32))
    strcat(buf, " detect_hidden");
  if (vector & (128))
    strcat(buf, " sanctuary");
  if (vector & (256))
    strcat(buf, " faerie_fire");
  if (vector & (512))
    strcat(buf, " infrared");
  if (vector & (1024))
    strcat(buf, " curse");
  if (vector & (4096))
    strcat(buf, " poison");
  if (vector & (8192))
    strcat(buf, " prot_evil");
  if (vector & (16384))
    strcat(buf, " prot_good");
  if (vector & (131072))
    strcat(buf, " sleep");
  if (vector & (32768))
    strcat(buf, " sneak");
  if (vector & (65536))
    strcat(buf, " hide");
  if (vector & (262144))
    strcat(buf, " charm");
  if (vector & (524288))
    strcat(buf, " flying");
  if (vector & (1048576))
    strcat(buf, " pass_door");
  if (vector & (67108864))
    strcat(buf, " berserk");
  if (vector & (4194304))
    strcat(buf, " calm");
  if (vector & (2097152))
    strcat(buf, " haste");
  if (vector & (536870912))
    strcat(buf, " slow");
  if (vector & (8388608))
    strcat(buf, " plague");
  if (vector & (33554432))
    strcat(buf, " dark_vision");
  return (buf[0] != '\0') ? buf + 1 : "none";
}
```