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

```asm
<url_decode>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  test   %esi,%esi
  jle    L40
  cmp    $0x1,%ecx
  jle    L103
  lea    -0x2(%rcx),%edx
  mov    %rdi,%r9
  mov    $0x1,%ebx
  xor    %ebp,%ebp
  add    $0x2,%rdx
  jmp    L1
  nopl   0x0(%rax)
L140:
  test   %r8d,%r8d
  je     L39
  cmp    $0x2b,%al
  je     L86
L39:
  mov    %al,-0x1(%r14,%rbx,1)
L72:
  add    $0x1,%ebp
  movslq %ebx,%rax
  cmp    %ebp,%esi
  jle    L61
L56:
  add    $0x1,%rbx
  cmp    %rbx,%rdx
  je     L50
L1:
  movslq %ebp,%r12
  lea    (%r9,%r12,1),%r13
  movzbl 0x0(%r13),%eax
  cmp    $0x25,%al
  jne    L140
  lea    0x1(%r9,%r12,1),%r15
  mov    %r8d,0x1c(%rsp)
  movzbl (%r15),%edi
  mov    %esi,0x18(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %r9,0x8(%rsp)
  call   <isxdigit@plt>
  mov    0x8(%rsp),%r9
  mov    0x10(%rsp),%rdx
  test   %rax,%rax
  mov    0x18(%rsp),%esi
  mov    0x1c(%rsp),%r8d
  jne    L147
L22:
  movzbl 0x0(%r13),%eax
  jmp    L140
  nopl   (%rax)
L86:
  add    $0x1,%ebp
  movb   $0x20,-0x1(%r14,%rbx,1)
  movslq %ebx,%rax
  cmp    %ebp,%esi
  jg     L56
  nopl   0x0(%rax,%rax,1)
L61:
  movslq %eax,%rdx
  add    %rdx,%r14
L101:
  movb   $0x0,(%r14)
L58:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L147:
  lea    0x2(%r9,%r12,1),%r12
  mov    %r8d,0x1c(%rsp)
  movzbl (%r12),%edi
  mov    %esi,0x18(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %r9,0x8(%rsp)
  call   <isxdigit@plt>
  mov    0x8(%rsp),%r9
  mov    0x10(%rsp),%rdx
  test   %rax,%rax
  mov    0x18(%rsp),%esi
  mov    0x1c(%rsp),%r8d
  je     L22
  movzbl (%r15),%edi
  mov    %r8d,0x1c(%rsp)
  mov    %esi,0x18(%rsp)
  mov    %r9,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  call   <tolower@plt>
  movzbl (%r12),%edi
  mov    %eax,%r15d
  call   <tolower@plt>
  mov    %r15d,%edi
  mov    %eax,%r13d
  call   <isdigit@plt>
  mov    %r15d,%ecx
  sub    $0x57,%r15d
  mov    %r13d,%edi
  shl    $0x4,%ecx
  shl    $0x4,%r15d
  test   %rax,%rax
  cmove  %r15d,%ecx
  mov    %ecx,%r12d
  call   <isdigit@plt>
  mov    0x8(%rsp),%rdx
  mov    0x10(%rsp),%r9
  mov    %rax,%r10
  lea    -0x30(%r13),%eax
  sub    $0x57,%r13d
  mov    0x18(%rsp),%esi
  test   %r10,%r10
  mov    0x1c(%rsp),%r8d
  cmovne %eax,%r13d
  add    $0x2,%ebp
  or     %r13d,%r12d
  mov    %r12b,-0x1(%r14,%rbx,1)
  jmp    L72
  nopl   0x0(%rax,%rax,1)
L50:
  add    %rax,%r14
L103:
  movb   $0x0,(%r14)
  mov    $0xffffffff,%eax
  jmp    L58
L40:
  xor    %eax,%eax
  jmp    L101
```

assistant: ```c
int url_decode(const char *src, int src_len, char *dst, int dst_len, int is_form_url_encoded) {
  int i, j, a, b;
  for (i = j = 0; i < src_len && j < dst_len - 1; i++, j++) {
    if (src[i] == '%' && isxdigit(*(const unsigned char *)(src + i + 1)) && isxdigit(*(const unsigned char *)(src + i + 2))) {
      a = tolower(*(const unsigned char *)(src + i + 1));
      b = tolower(*(const unsigned char *)(src + i + 2));
      dst[j] = (char)(((isdigit(a) ? a - '0' : a - 'W') << 4) | (isdigit(b) ? b - '0' : b - 'W'));
      i += 2;
    } else if (is_form_url_encoded && src[i] == '+') {
      dst[j] = ' ';
    } else {
      dst[j] = src[i];
    }
  }
  dst[j] = '\0';
  return i >= src_len ? j : -1;
}
```