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

```asm
<set_filter_flags>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsp)
  test   %rdi,%rdi
  je     L153
  mov    %rdi,%r12
  call   <strlen@plt>
  cmp    $0x1,%eax
  jle    L153
  mov    %rsp,%rbp
  lea    D272(%rip),%rbx
  mov    %r12,%rdi
  xor    %r12d,%r12d
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  call   <strtok_r@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L538
  lea    D108(%rip),%r13
  lea    D72(%rip),%r14
  jmp    L512
  nopw   0x0(%rax,%rax,1)
L524:
  or     $0x1,%r12d
L173:
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  xor    %edi,%edi
  call   <strtok_r@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L538
L512:
  cmpq   $0x0,(%rsp)
  je     L381
  movb   $0x2c,-0x1(%r15)
L381:
  mov    %r13,%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L524
  mov    %r14,%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L596
  or     $0x2,%r12d
  jmp    L173
L153:
  mov    $0xffffffff,%r12d
  nopl   0x0(%rax)
L538:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L353
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L596:
  lea    D250(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L352
  or     $0x4,%r12d
  jmp    L173
  nopl   (%rax)
L352:
  lea    D276(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L272
  or     $0x8,%r12d
  jmp    L173
  nopl   (%rax)
L272:
  lea    D160(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L489
  or     $0x10,%r12d
  jmp    L173
L489:
  lea    D266(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L193
  or     $0x20,%r12d
  jmp    L173
L193:
  lea    D37(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L372
  or     $0x2000,%r12d
  jmp    L173
L372:
  lea    D94(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L536
  or     $0x4000,%r12d
  jmp    L173
L536:
  lea    D296(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L289
  or     $0xc000,%r12d
  jmp    L173
L353:
  call   <__stack_chk_fail@plt>
L289:
  lea    D56(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L603
  or     $0x10000,%r12d
  jmp    L173
L603:
  lea    D155(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L276
  or     $0x20000,%r12d
  jmp    L173
L276:
  lea    D136(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L106
  or     $0x40000,%r12d
  jmp    L173
L106:
  lea    D302(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L138
  or     $0x80000,%r12d
  jmp    L173
L138:
  lea    D187(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L297
  or     $0x40,%r12d
  jmp    L173
L297:
  lea    D145(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L407
L346:
  or     $0xc0,%r12b
  jmp    L173
L407:
  lea    D24(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L346
  lea    D63(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L595
  test   $0x40,%r12b
  jne    L346
L595:
  lea    D129(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L545
L574:
  or     $0x140,%r12d
  jmp    L173
L545:
  lea    D18(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L574
  lea    D162(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L462
  test   $0x40,%r12b
  jne    L574
L462:
  lea    D158(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L120
L237:
  or     $0x240,%r12d
  jmp    L173
L120:
  lea    D198(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L237
  lea    D292(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L395
  test   $0x40,%r12b
  jne    L237
L395:
  lea    D126(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L585
L370:
  or     $0x440,%r12d
  jmp    L173
L585:
  lea    D321(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L370
  lea    D3(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L162
  test   $0x40,%r12b
  jne    L370
L162:
  lea    D274(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L322
L168:
  or     $0x840,%r12d
  jmp    L173
L322:
  lea    D199(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L168
  lea    D152(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L236
  test   $0x40,%r12b
  jne    L168
L236:
  lea    D242(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L638
L253:
  or     $0x1040,%r12d
  jmp    L173
L638:
  lea    D315(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L253
  lea    D261(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L253
  jmp    L173
```

tool_calls: name: retrieve_data
arguments: tag: D272
type: string
name: retrieve_data
arguments: tag: D108
type: string
name: retrieve_data
arguments: tag: D72
type: string
name: retrieve_data
arguments: tag: D250
type: string
name: retrieve_data
arguments: tag: D276
type: string
name: retrieve_data
arguments: tag: D160
type: string
name: retrieve_data
arguments: tag: D266
type: string
name: retrieve_data
arguments: tag: D37
type: string
name: retrieve_data
arguments: tag: D94
type: string
name: retrieve_data
arguments: tag: D296
type: string
name: retrieve_data
arguments: tag: D56
type: string
name: retrieve_data
arguments: tag: D155
type: string
name: retrieve_data
arguments: tag: D136
type: string
name: retrieve_data
arguments: tag: D302
type: string
name: retrieve_data
arguments: tag: D187
type: string
name: retrieve_data
arguments: tag: D145
type: string
name: retrieve_data
arguments: tag: D24
type: string
name: retrieve_data
arguments: tag: D63
type: string
name: retrieve_data
arguments: tag: D129
type: string
name: retrieve_data
arguments: tag: D18
type: string
name: retrieve_data
arguments: tag: D162
type: string
name: retrieve_data
arguments: tag: D158
type: string
name: retrieve_data
arguments: tag: D198
type: string
name: retrieve_data
arguments: tag: D292
type: string
name: retrieve_data
arguments: tag: D126
type: string
name: retrieve_data
arguments: tag: D321
type: string
name: retrieve_data
arguments: tag: D3
type: string
name: retrieve_data
arguments: tag: D274
type: string
name: retrieve_data
arguments: tag: D199
type: string
name: retrieve_data
arguments: tag: D152
type: string
name: retrieve_data
arguments: tag: D242
type: string
name: retrieve_data
arguments: tag: D315
type: string
name: retrieve_data
arguments: tag: D261
type: string

tool: D272: ,

tool: D108: @childCount

tool: D72: dc:creator

tool: D250: dc:date

tool: D276: dc:description

tool: D160: dlna

tool: D266: @refID

tool: D37: upnp:album

tool: D94: upnp:albumArtURI

tool: D296: upnp:albumArtURI@dlna:profileID

tool: D56: upnp:artist

tool: D155: upnp:genre

tool: D136: upnp:originalTrackNumber

tool: D302: upnp:searchClass

tool: D187: res

tool: D145: res@bitrate

tool: D24: @bitrate

tool: D63: bitrate

tool: D129: res@duration

tool: D18: @duration

tool: D162: duration

tool: D158: res@nrAudioChannels

tool: D198: @nrAudioChannels

tool: D292: nrAudioChannels

tool: D126: res@resolution

tool: D321: @resolution

tool: D3: resolution

tool: D274: res@sampleFrequency

tool: D199: @sampleFrequency

tool: D152: sampleFrequency

tool: D242: res@size

tool: D315: @size

tool: D261: size

assistant: ```c
u_int32_t set_filter_flags(char *filter) {
  char *item, *saveptr = NULL;
  u_int32_t flags = 0;
  if (!filter || (strlen(filter) <= 1))
    return 0xFFFFFFFF;
  item = strtok_r(filter, ",", &saveptr);
  while (item != NULL) {
    if (saveptr)
      *(item - 1) = ',';
    if (strcmp(item, "@childCount") == 0) {
      flags |= 0x00000001;
    } else if (strcmp(item, "dc:creator") == 0) {
      flags |= 0x00000002;
    } else if (strcmp(item, "dc:date") == 0) {
      flags |= 0x00000004;
    } else if (strcmp(item, "dc:description") == 0) {
      flags |= 0x00000008;
    } else if (strcmp(item, "dlna") == 0) {
      flags |= 0x00000010;
    } else if (strcmp(item, "@refID") == 0) {
      flags |= 0x00000020;
    } else if (strcmp(item, "upnp:album") == 0) {
      flags |= 0x00002000;
    } else if (strcmp(item, "upnp:albumArtURI") == 0) {
      flags |= 0x00004000;
    } else if (strcmp(item, "upnp:albumArtURI@dlna:profileID") == 0) {
      flags |= 0x00004000;
      flags |= 0x00008000;
    } else if (strcmp(item, "upnp:artist") == 0) {
      flags |= 0x00010000;
    } else if (strcmp(item, "upnp:genre") == 0) {
      flags |= 0x00020000;
    } else if (strcmp(item, "upnp:originalTrackNumber") == 0) {
      flags |= 0x00040000;
    } else if (strcmp(item, "upnp:searchClass") == 0) {
      flags |= 0x00080000;
    } else if (strcmp(item, "res") == 0) {
      flags |= 0x00000040;
    } else if ((strcmp(item, "res@bitrate") == 0) || (strcmp(item, "@bitrate") == 0) || ((strcmp(item, "bitrate") == 0) && (flags & 0x00000040))) {
      flags |= 0x00000040;
      flags |= 0x00000080;
    } else if ((strcmp(item, "res@duration") == 0) || (strcmp(item, "@duration") == 0) || ((strcmp(item, "duration") == 0) && (flags & 0x00000040))) {
      flags |= 0x00000040;
      flags |= 0x00000100;
    } else if ((strcmp(item, "res@nrAudioChannels") == 0) || (strcmp(item, "@nrAudioChannels") == 0) || ((strcmp(item, "nrAudioChannels") == 0) && (flags & 0x00000040))) {
      flags |= 0x00000040;
      flags |= 0x00000200;
    } else if ((strcmp(item, "res@resolution") == 0) || (strcmp(item, "@resolution") == 0) || ((strcmp(item, "resolution") == 0) && (flags & 0x00000040))) {
      flags |= 0x00000040;
      flags |= 0x00000400;
    } else if ((strcmp(item, "res@sampleFrequency") == 0) || (strcmp(item, "@sampleFrequency") == 0) || ((strcmp(item, "sampleFrequency") == 0) && (flags & 0x00000040))) {
      flags |= 0x00000040;
      flags |= 0x00000800;
    } else if ((strcmp(item, "res@size") == 0) || (strcmp(item, "@size") == 0) || (strcmp(item, "size") == 0)) {
      flags |= 0x00000040;
      flags |= 0x00001000;
    }
    item = strtok_r(NULL, ",", &saveptr);
  }
  return flags;
}
```