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

```asm
<profile_list_compress>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <profile_list_normalize@plt>
  movzbl (%rbx),%edx
  test   %dl,%dl
  je     L163
  lea    0x1(%rbx),%rcx
  mov    %edx,%eax
  mov    $0x1,%esi
  cs nopw 0x0(%rax,%rax,1)
L4:
  cmp    $0x2c,%al
  sete   %al
  add    $0x1,%rcx
  movzbl %al,%eax
  add    %rax,%rsi
  movzbl -0x1(%rcx),%eax
  test   %al,%al
  jne    L4
  lea    0xf(,%rsi,8),%rax
  mov    %rsp,%rsi
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rcx
  cmp    %rsi,%rsp
  je     L269
L91:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L91
L269:
  and    $0xfff,%ecx
  sub    %rcx,%rsp
  test   %rcx,%rcx
  jne    L130
L15:
  lea    0x7(%rsp),%rsi
  mov    -0x48(%rbp),%rax
  mov    $0x1,%ecx
  mov    %rsi,%rdi
  and    $0xfffffffffffffff8,%rsi
  shr    $0x3,%rdi
  mov    %rsi,%rbx
  mov    %rax,0x0(,%rdi,8)
  nopw   0x0(%rax,%rax,1)
L258:
  add    $0x1,%rax
  cmp    $0x2c,%dl
  jne    L346
L104:
  movzbl (%rax),%edx
  movb   $0x0,-0x1(%rax)
  lea    0x1(%rcx),%r12
  mov    %rax,(%rsi,%rcx,8)
  test   %dl,%dl
  je     L194
  mov    %r12,%rcx
  add    $0x1,%rax
  cmp    $0x2c,%dl
  je     L104
L346:
  movzbl (%rax),%edx
  test   %dl,%dl
  jne    L258
  mov    %rcx,%r12
L194:
  test   %r12,%r12
  je     L110
  mov    0x0(,%rdi,8),%r14
L138:
  xor    %r15d,%r15d
  jmp    L160
L311:
  cmp    $0x2b,%al
  je     L57
  test   %al,%al
  jne    L250
L174:
  movq   $0x0,(%rbx,%r15,8)
L265:
  add    $0x1,%r15
  cmp    %r15,%r12
  jbe    L180
L235:
  mov    (%rbx,%r15,8),%r14
L160:
  mov    %r14,%rdi
  call   <assert@plt>
  movzbl (%r14),%eax
  cmp    $0x2d,%al
  je     L257
  cmp    $0x3d,%al
  jne    L311
  xor    %esi,%esi
  lea    0x1(%r14),%rax
  cmpb   $0x0,0x1(%r14)
  cmove  %rsi,%rax
  mov    %rax,(%rbx,%r15,8)
  test   %r15,%r15
  je     L265
  lea    0x0(,%r15,8),%rdx
  mov    %rbx,%rdi
  add    $0x1,%r15
  call   <memset@plt>
  cmp    %r15,%r12
  ja     L235
L180:
  mov    -0x48(%rbp),%rdx
  xor    %esi,%esi
  nopl   0x0(%rax)
L77:
  mov    (%rbx,%rsi,8),%rax
  test   %rax,%rax
  je     L182
  cmp    %rdx,-0x48(%rbp)
  jae    L38
  movb   $0x2c,(%rdx)
  add    $0x1,%rdx
  jmp    L38
L69:
  mov    %cl,(%rdx)
  add    $0x1,%rdx
  add    $0x1,%rax
L38:
  movzbl (%rax),%ecx
  test   %cl,%cl
  jne    L69
L182:
  add    $0x1,%rsi
  cmp    %rsi,%r12
  jne    L77
L159:
  movb   $0x0,(%rdx)
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L237
  mov    -0x48(%rbp),%rax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L257:
  movq   $0x0,(%rbx,%r15,8)
  add    $0x1,%r14
  xor    %r13d,%r13d
  test   %r15,%r15
  jne    L169
  jmp    L265
  nopl   0x0(%rax)
L210:
  add    $0x1,%r13
  cmp    %r15,%r13
  je     L265
L169:
  mov    (%rbx,%r13,8),%rdi
  test   %rdi,%rdi
  je     L210
  mov    %r14,%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L210
  movq   $0x0,(%rbx,%r13,8)
  jmp    L265
  nopw   0x0(%rax,%rax,1)
L57:
  movzbl 0x1(%r14),%eax
  lea    0x1(%r14),%rdx
  mov    %rdx,(%rbx,%r15,8)
  mov    %rdx,%r14
  test   %al,%al
  je     L174
L250:
  xor    %r13d,%r13d
  test   %r15,%r15
  je     L265
  nopl   0x0(%rax)
L197:
  mov    (%rbx,%r13,8),%rdi
  test   %rdi,%rdi
  je     L72
  mov    %r14,%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L174
L72:
  add    $0x1,%r13
  cmp    %r15,%r13
  jne    L197
  jmp    L265
L130:
  orq    $0x0,-0x8(%rsp,%rcx,1)
  jmp    L15
L110:
  mov    -0x48(%rbp),%rdx
  jmp    L159
L163:
  mov    -0x48(%rbp),%rax
  lea    -0x40(%rbp),%rbx
  mov    $0x1,%r12d
  mov    %rax,-0x40(%rbp)
  mov    %rax,%r14
  jmp    L138
L237:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *profile_list_compress(char *list) {
  size_t i;
  profile_list_normalize(list);
  size_t count = 1;
  for (i = 0; list[i]; ++i) {
    if (list[i] == ',')
      ++count;
  }
  char *in[count];
  count = 0;
  in[count++] = list;
  for (i = 0; list[i]; ++i) {
    if (list[i] != ',')
      continue;
    list[i] = 0;
    in[count++] = list + i + 1;
  }
  for (i = 0; i < count; ++i) {
    char *item = in[i];
    assert(item);
    size_t k;
    switch (*item) {
    case '-':
      ++item;
      in[i] = 0;
      for (k = 0; k < i; ++k) {
        if (in[k] && !strcmp(in[k], item)) {
          in[k] = 0;
          break;
        }
      }
      break;
    case '+':
      in[i] = ++item;
    default:
      if (!*item) {
        in[i] = 0;
        break;
      }
      for (k = 0; k < i; ++k) {
        if (in[k] && !strcmp(in[k], item)) {
          in[i] = 0;
          break;
        }
      }
      break;
    case '=':
      in[i] = ++item;
      if (!*item)
        in[i] = 0;
      for (k = 0; k < i; ++k)
        in[k] = 0;
      break;
    }
  }
  char *pos = list;
  for (i = 0; i < count; ++i) {
    char *item = in[i];
    if (!item)
      continue;
    if (pos > list)
      *pos++ = ',';
    while (*item)
      *pos++ = *item++;
  }
  *pos = 0;
  return list;
}
```