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

```asm
<parseaddr_route>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,(%rsp)
  mov    (%rdi),%rbx
  movsbl (%rbx),%edi
  test   %edi,%edi
  jne    L190
L178:
  mov    (%rsp),%rax
  mov    %rbx,(%rax)
  mov    %rbx,%r12
  movabs $0x2800000100003,%r15
  jmp    L99
L31:
  cmpb   $0x0,0x1(%rax)
  je     L130
  add    $0x2,%rax
  jmp    L401
L356:
  add    $0x1,%ecx
  mov    %rsi,%rax
L401:
  test   %ecx,%ecx
  je     L391
L183:
  movsbl (%rax),%edx
  test   %edx,%edx
  je     L391
  lea    0x1(%rax),%rsi
  cmp    $0x5c,%edx
  je     L31
  cmp    $0x28,%edx
  je     L356
  mov    %rsi,%rax
  cmp    $0x29,%edx
  jne    L401
  sub    $0x1,%ecx
  jmp    L401
L130:
  mov    %rsi,%rax
  jmp    L401
L391:
  sub    $0x1,%rax
L184:
  lea    0x1(%rax),%rbx
  movsbl 0x1(%rax),%edi
  test   %edi,%edi
  je     L178
L190:
  lea    0x1(%rbx),%rax
  mov    $0x1,%ecx
  cmp    $0x28,%edi
  je     L183
  call   <isspace@plt>
  test   %rax,%rax
  je     L178
  mov    %rbx,%rax
  jmp    L184
L55:
  mov    %bpl,(%r12)
  lea    0x1(%r12),%r12
  mov    %r14,%rbx
L99:
  lea    0x1(%rbx),%r14
  movzbl (%rbx),%ebp
  movzbl %bpl,%r13d
  mov    %r13d,%edi
  call   <isalnum@plt>
  test   %rax,%rax
  jne    L55
  lea    -0x2c(%rbp),%ecx
  cmp    $0x31,%cl
  ja     L59
  mov    $0x1,%eax
  shl    %cl,%rax
  test   %r15,%rax
  jne    L55
  cmp    $0x2,%cl
  je     L129
L59:
  mov    %r13d,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L0
  cmp    $0x28,%bpl
  jne    L235
L0:
  movsbl (%rbx),%edi
  test   %edi,%edi
  jne    L144
  jmp    L99
L129:
  mov    %r14,%rbx
  mov    (%rsp),%rax
  cmp    %r12,(%rax)
  jae    L99
  cmpb   $0x2e,-0x1(%r12)
  je     L99
  movb   $0x2e,(%r12)
  lea    0x1(%r12),%r12
  jmp    L99
L235:
  mov    (%rsp),%rax
  mov    (%rax),%rcx
  cmp    %rcx,%r12
  ja     L370
  mov    %r12,%rcx
  jmp    L211
L202:
  cmpb   $0x0,0x1(%rax)
  je     L420
  add    $0x2,%rax
  jmp    L57
L216:
  add    $0x1,%ecx
  mov    %rsi,%rax
L57:
  test   %ecx,%ecx
  je     L113
L224:
  movsbl (%rax),%edx
  test   %edx,%edx
  je     L113
  lea    0x1(%rax),%rsi
  cmp    $0x5c,%edx
  je     L202
  cmp    $0x28,%edx
  je     L216
  mov    %rsi,%rax
  cmp    $0x29,%edx
  jne    L57
  sub    $0x1,%ecx
  jmp    L57
L420:
  mov    %rsi,%rax
  jmp    L57
L113:
  sub    $0x1,%rax
L263:
  lea    0x1(%rax),%rbx
  movsbl 0x1(%rax),%edi
  test   %edi,%edi
  je     L99
L144:
  lea    0x1(%rbx),%rax
  mov    $0x1,%ecx
  cmp    $0x28,%edi
  je     L224
  call   <isspace@plt>
  test   %rax,%rax
  je     L99
  mov    %rbx,%rax
  jmp    L263
L171:
  sub    $0x1,%r12
  cmp    %rcx,%r12
  je     L211
L370:
  movzbl -0x1(%r12),%eax
  mov    %eax,%edx
  and    $0xfffffffd,%edx
  cmp    $0x2c,%dl
  je     L171
  cmp    $0x40,%al
  je     L171
  mov    %r12,%rcx
L211:
  movb   $0x0,(%rcx)
  mov    0x8(%rsp),%rax
  mov    %r14,(%rax)
  movsbl %bpl,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int parseaddr_route(char **inp, char **routep) {
  char c;
  char *src = *inp;
  char *dst;
  {
    int _c, _comment = 0;
    while ((_c = *(src))) {
      if (_c == '(') {
        _comment = 1;
        (src)++;
        while ((_comment && (_c = *(src)))) {
          (src)++;
          if (_c == '\\' && *(src))
            (src)++;
          else if (_c == '(')
            _comment++;
          else if (_c == ')')
            _comment--;
        }
        (src)--;
      } else if (!isspace(_c))
        break;
      (src)++;
    }
  };
  *routep = dst = src;
  for (;;) {
    c = *src++;
    if (isalnum((int)(unsigned char)c) || c == '-' || c == '[' || c == ']' || c == ',' || c == '@') {
      *dst++ = c;
    } else if (c == '.') {
      if (dst > *routep && dst[-1] != '.')
        *dst++ = c;
    } else if (isspace((int)(unsigned char)c) || c == '(') {
      src--;
      {
        int _c, _comment = 0;
        while ((_c = *(src))) {
          if (_c == '(') {
            _comment = 1;
            (src)++;
            while ((_comment && (_c = *(src)))) {
              (src)++;
              if (_c == '\\' && *(src))
                (src)++;
              else if (_c == '(')
                _comment++;
              else if (_c == ')')
                _comment--;
            }
            (src)--;
          } else if (!isspace(_c))
            break;
          (src)++;
        }
      };
    } else {
      while (dst > *routep && (dst[-1] == '.' || dst[-1] == ',' || dst[-1] == '@'))
        dst--;
      *dst = '\0';
      *inp = src;
      return c;
    }
  }
}
```