user: 请将以下的汇编代码转换成C语言代码：

```asm
<httpd_decode_url>:
  endbr64
  movzbl (%rdi),%eax
  mov    %rdi,%rdx
  test   %al,%al
  je     L296
  cmp    $0x3f,%al
  je     L296
  xor    %ecx,%ecx
  xor    %edi,%edi
  xor    %esi,%esi
  mov    $0x20,%r9d
  mov    $0xffffffff,%r10d
  jmp    L90
  xchg   %ax,%ax
L215:
  movslq %ecx,%rsi
  add    $0x1,%edi
  add    $0x1,%ecx
  cmp    $0x2b,%al
  cmove  %r9d,%eax
  mov    %al,(%rdx,%rsi,1)
L18:
  movslq %edi,%rsi
  movzbl (%rdx,%rsi,1),%eax
  test   %al,%al
  je     L246
L103:
  cmp    $0x3f,%al
  je     L246
L90:
  cmp    $0x25,%al
  jne    L215
  movzbl 0x1(%rdx,%rsi,1),%r8d
  lea    -0x30(%r8),%eax
  cmp    $0x9,%al
  ja     L287
  movsbl %al,%eax
L251:
  movzbl 0x2(%rdx,%rsi,1),%esi
  lea    -0x30(%rsi),%r8d
  cmp    $0x9,%r8b
  ja     L213
L81:
  movsbl %r8b,%r8d
L91:
  cmp    $0x1,%eax
  jg     L368
L174:
  cmp    $0x1,%eax
  ja     L18
  xor    %eax,%eax
  ret
  xchg   %ax,%ax
L287:
  lea    -0x41(%r8),%eax
  cmp    $0x5,%al
  ja     L133
  movzbl 0x2(%rdx,%rsi,1),%esi
  sub    $0x37,%r8d
  movsbl %r8b,%eax
  lea    -0x30(%rsi),%r8d
  cmp    $0x9,%r8b
  jbe    L81
L213:
  lea    -0x41(%rsi),%r8d
  cmp    $0x5,%r8b
  ja     L326
  sub    $0x37,%esi
  movsbl %sil,%r8d
  cmp    $0x1,%eax
  jle    L174
L368:
  shl    $0x4,%eax
  movslq %ecx,%rsi
  add    $0x3,%edi
  add    $0x1,%ecx
  add    %r8d,%eax
  mov    %al,(%rdx,%rsi,1)
  movslq %edi,%rsi
  movzbl (%rdx,%rsi,1),%eax
  test   %al,%al
  jne    L103
  xchg   %ax,%ax
L246:
  movslq %ecx,%rcx
  add    %rdx,%rcx
L105:
  movb   $0x0,(%rcx)
  movzbl (%rdx),%eax
  test   %al,%al
  je     L374
  cmp    $0x3f,%al
  je     L374
  push   %r13
  xor    %esi,%esi
  xor    %edi,%edi
  xor    %ecx,%ecx
  push   %r12
  push   %rbp
  push   %rbx
  jmp    L62
  nopw   0x0(%rax,%rax,1)
L104:
  cmp    $0x5c,%r8d
  je     L325
L332:
  movslq %esi,%rcx
  add    $0x1,%edi
  add    $0x1,%esi
  mov    %al,(%rdx,%rcx,1)
L388:
  movslq %edi,%rcx
  movzbl (%rdx,%rcx,1),%eax
  test   %al,%al
  je     L319
  cmp    $0x3f,%al
  je     L319
L62:
  cmp    $0x7c,%al
  lea    0x1(%rdx,%rcx,1),%r9
  lea    0x2(%rdx,%rcx,1),%r10
  movsbl %al,%r8d
  lea    0x3(%rdx,%rcx,1),%r11
  sete   %cl
  cmp    $0x2a,%al
  movsbl (%r9),%ebx
  sete   %bpl
  movzbl (%r10),%r12d
  movzbl (%r11),%r13d
  or     %bpl,%cl
  jne    L412
  mov    %eax,%ecx
  and    $0xfffffffd,%ecx
  cmp    $0x3c,%cl
  je     L412
  cmp    $0x2f,%r8d
  jne    L104
  cmp    $0x2f,%ebx
  je     L421
  cmp    $0x5c,%ebx
  je     L421
L325:
  cmp    $0x2e,%ebx
  jne    L332
  movsbl %r12b,%ecx
  cmp    $0x2f,%r12b
  je     L360
  cmp    $0x5c,%ecx
  je     L360
  cmp    $0x2e,%ecx
  jne    L332
  movsbl %r13b,%ecx
  cmp    $0x2f,%r13b
  je     L301
  cmp    $0x5c,%ecx
  jne    L332
L301:
  test   %esi,%esi
  je     L412
  lea    -0x1(%rsi),%eax
  cltq
  nopl   0x0(%rax,%rax,1)
L270:
  cmpb   $0x2f,(%rdx,%rax,1)
  mov    %eax,%esi
  je     L118
  sub    $0x1,%rax
  cmp    $0xffffffff,%eax
  jne    L270
L412:
  xor    %eax,%eax
L25:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L133:
  lea    -0x61(%r8),%eax
  sub    $0x57,%r8d
  movsbl %r8b,%r8d
  cmp    $0x6,%al
  mov    %r8d,%eax
  cmovae %r10d,%eax
  jmp    L251
  nopw   0x0(%rax,%rax,1)
L326:
  lea    -0x61(%rsi),%r8d
  cmp    $0x5,%r8b
  ja     L174
  sub    $0x57,%esi
  movsbl %sil,%r8d
  jmp    L91
  nopw   0x0(%rax,%rax,1)
L421:
  movb   $0x2f,(%r9)
  add    $0x1,%edi
  jmp    L388
  nopl   0x0(%rax)
L360:
  movb   $0x2f,(%r10)
  add    $0x2,%edi
  jmp    L388
  nopl   0x0(%rax)
L118:
  movb   $0x2f,(%r11)
  add    $0x3,%edi
  jmp    L388
  nopl   0x0(%rax)
L319:
  movslq %esi,%rsi
  mov    $0x1,%eax
  add    %rsi,%rdx
  movb   $0x0,(%rdx)
  jmp    L25
L296:
  mov    %rdx,%rcx
  jmp    L105
L374:
  movb   $0x0,(%rdx)
  mov    $0x1,%eax
  ret
```

assistant: ```c
int httpd_decode_url(char *url) {
  int s = 0, d = 0;
  while (url[s] != '\0' && url[s] != '?') {
    if (url[s] == '%') {
      int a1 = ((url[s + 1] >= '0' && url[s + 1] <= '9') ? url[s + 1] - '0' : (url[s + 1] >= 'A' && url[s + 1] <= 'F') ? url[s + 1] - 'A' + 10 : (url[s + 1] >= 'a' && url[s + 1] <= 'f') ? url[s + 1] - 'a' + 10 : -1), a2 = ((url[s + 2] >= '0' && url[s + 2] <= '9') ? url[s + 2] - '0' : (url[s + 2] >= 'A' && url[s + 2] <= 'F') ? url[s + 2] - 'A' + 10 : (url[s + 2] >= 'a' && url[s + 2] <= 'f') ? url[s + 2] - 'a' + 10 : -1);
      if (a1 >= 2 && a2 >= 0) {
        s += 3;
        url[d++] = (a1 << 4) + a2;
      } else if (a1 >= 0 && a1 < 2) {
        return 0;
      }
      continue;
    } else if (url[s] == '+') {
      url[d++] = ' ';
      s++;
      continue;
    }
    url[d++] = url[s++];
  }
  url[d] = '\0';
  s = d = 0;
  while (url[s] != '\0' && url[s] != '?') {
    int c0 = url[s], c1 = url[s + 1], c2 = url[s + 2], c3 = url[s + 3];
    if (url[s] == '|' || url[s] == '<' || url[s] == '>' || url[s] == '?' || url[s] == '*')
      return 0;
    if (c0 == '/' && (c1 == '/' || c1 == '\\')) {
      s++;
      url[s] = '/';
      continue;
    } else if ((c0 == '/' || c0 == '\\') && c1 == '.' && (c2 == '/' || c2 == '\\')) {
      s += 2;
      url[s] = '/';
      continue;
    } else if ((c0 == '/' || c0 == '\\') && c1 == '.' && c2 == '.' && (c3 == '/' || c3 == '\\')) {
      int r;
      if (d <= 0)
        return 0;
      for (r = d - 1; r >= 0 && url[r] != '/'; r--)
        ;
      if (r < 0)
        return 0;
      s += 3;
      d = r;
      url[s] = '/';
      continue;
    }
    url[d++] = url[s++];
  }
  url[d] = '\0';
  return 1;
}
```