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

```asm
<httpd_decode_url>:
  endbr64
  movzbl (%rdi),%eax
  mov    %rdi,%rdx
  test   %al,%al
  je     L132
  cmp    $0x3f,%al
  je     L132
  xor    %ecx,%ecx
  xor    %edi,%edi
  xor    %esi,%esi
  mov    $0x20,%r9d
  mov    $0xffffffff,%r10d
  jmp    L406
  xchg   %ax,%ax
L315:
  movslq %ecx,%rsi
  add    $0x1,%edi
  add    $0x1,%ecx
  cmp    $0x2b,%al
  cmove  %r9d,%eax
  mov    %al,(%rdx,%rsi,1)
L49:
  movslq %edi,%rsi
  movzbl (%rdx,%rsi,1),%eax
  test   %al,%al
  je     L191
L272:
  cmp    $0x3f,%al
  je     L191
L406:
  cmp    $0x25,%al
  jne    L315
  movzbl 0x1(%rdx,%rsi,1),%r8d
  lea    -0x30(%r8),%eax
  cmp    $0x9,%al
  ja     L52
  movsbl %al,%eax
L113:
  movzbl 0x2(%rdx,%rsi,1),%esi
  lea    -0x30(%rsi),%r8d
  cmp    $0x9,%r8b
  ja     L108
L266:
  movsbl %r8b,%r8d
L1:
  cmp    $0x1,%eax
  jg     L144
L169:
  cmp    $0x1,%eax
  ja     L49
  xor    %eax,%eax
  ret
  xchg   %ax,%ax
L52:
  lea    -0x41(%r8),%eax
  cmp    $0x5,%al
  ja     L293
  movzbl 0x2(%rdx,%rsi,1),%esi
  sub    $0x37,%r8d
  movsbl %r8b,%eax
  lea    -0x30(%rsi),%r8d
  cmp    $0x9,%r8b
  jbe    L266
L108:
  lea    -0x41(%rsi),%r8d
  cmp    $0x5,%r8b
  ja     L88
  sub    $0x37,%esi
  movsbl %sil,%r8d
  cmp    $0x1,%eax
  jle    L169
L144:
  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    L272
  xchg   %ax,%ax
L191:
  movslq %ecx,%rcx
  add    %rdx,%rcx
L78:
  movb   $0x0,(%rcx)
  movzbl (%rdx),%eax
  test   %al,%al
  je     L369
  cmp    $0x3f,%al
  je     L369
  push   %r13
  xor    %esi,%esi
  xor    %edi,%edi
  xor    %ecx,%ecx
  push   %r12
  push   %rbp
  push   %rbx
  jmp    L348
  nopw   0x0(%rax,%rax,1)
L346:
  cmp    $0x5c,%r8d
  je     L41
L74:
  movslq %esi,%rcx
  add    $0x1,%edi
  add    $0x1,%esi
  mov    %al,(%rdx,%rcx,1)
L351:
  movslq %edi,%rcx
  movzbl (%rdx,%rcx,1),%eax
  test   %al,%al
  je     L265
  cmp    $0x3f,%al
  je     L265
L348:
  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    L287
  mov    %eax,%ecx
  and    $0xfffffffd,%ecx
  cmp    $0x3c,%cl
  je     L287
  cmp    $0x2f,%r8d
  jne    L346
  cmp    $0x2f,%ebx
  je     L38
  cmp    $0x5c,%ebx
  je     L38
L41:
  cmp    $0x2e,%ebx
  jne    L74
  movsbl %r12b,%ecx
  cmp    $0x2f,%r12b
  je     L90
  cmp    $0x5c,%ecx
  je     L90
  cmp    $0x2e,%ecx
  jne    L74
  movsbl %r13b,%ecx
  cmp    $0x2f,%r13b
  je     L165
  cmp    $0x5c,%ecx
  jne    L74
L165:
  test   %esi,%esi
  je     L287
  lea    -0x1(%rsi),%eax
  cltq
  nopl   0x0(%rax,%rax,1)
L26:
  cmpb   $0x2f,(%rdx,%rax,1)
  mov    %eax,%esi
  je     L164
  sub    $0x1,%rax
  cmp    $0xffffffff,%eax
  jne    L26
L287:
  xor    %eax,%eax
L99:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L293:
  lea    -0x61(%r8),%eax
  sub    $0x57,%r8d
  movsbl %r8b,%r8d
  cmp    $0x6,%al
  mov    %r8d,%eax
  cmovae %r10d,%eax
  jmp    L113
  nopw   0x0(%rax,%rax,1)
L88:
  lea    -0x61(%rsi),%r8d
  cmp    $0x5,%r8b
  ja     L169
  sub    $0x57,%esi
  movsbl %sil,%r8d
  jmp    L1
  nopw   0x0(%rax,%rax,1)
L38:
  movb   $0x2f,(%r9)
  add    $0x1,%edi
  jmp    L351
  nopl   0x0(%rax)
L90:
  movb   $0x2f,(%r10)
  add    $0x2,%edi
  jmp    L351
  nopl   0x0(%rax)
L164:
  movb   $0x2f,(%r11)
  add    $0x3,%edi
  jmp    L351
  nopl   0x0(%rax)
L265:
  movslq %esi,%rsi
  mov    $0x1,%eax
  add    %rsi,%rdx
  movb   $0x0,(%rdx)
  jmp    L99
L132:
  mov    %rdx,%rcx
  jmp    L78
L369:
  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;
}
```