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

```asm
<norm>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x818,%rsp
  mov    %rdi,%rbp
  mov    %esi,%r12d
  mov    %rdx,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x808(%rsp)
  xor    %eax,%eax
  mov    %rdx,%rdi
  call   <strlen@plt>
  cmp    %r12d,%eax
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    %rbp,%rsi
  mov    $0x0,%eax
  mov    $0x0,%r8d
  lea    D14(%rip),%r9
  mov    $0x1,%r10d
  mov    $0x4,%r11d
  mov    $0x3,%r13d
  mov    $0x2,%r12d
  lea    D5(%rip),%rdi
  jmp    L12
  test   %edx,%edx
  jne    L218
  add    $0x1,%rbx
  mov    %cl,(%rsi)
  lea    0x1(%rsi),%rsi
  mov    %r10d,%eax
  jmp    L12
L218:
  movb   $0x0,0x0(%rbp)
  mov    $0xffffffff,%eax
L257:
  mov    0x808(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L165
  add    $0x818,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  mov    %eax,%edx
  cmp    $0x1,%edx
  je     L141
  cmp    $0x2,%edx
  je     L221
  mov    %r10d,%eax
  test   %edx,%edx
  jne    L12
  add    $0x1,%rbx
  jmp    L12
L141:
  movslq %r8d,%rax
  mov    %rsi,(%rsp,%rax,8)
  add    $0x1,%rbx
  mov    %cl,(%rsi)
  lea    0x1(%r8),%r8d
  lea    0x1(%rsi),%rsi
  mov    %r12d,%eax
  jmp    L12
L221:
  movslq %r8d,%rax
  mov    %rsi,(%rsp,%rax,8)
  add    $0x1,%rbx
  mov    %cl,(%rsi)
  lea    0x1(%r8),%r8d
  lea    0x1(%rsi),%rsi
  mov    %r11d,%eax
  jmp    L12
  mov    %r10d,%edx
  cmp    $0x1,%edx
  je     L194
  cmp    $0x2,%edx
  je     L93
  mov    %r12d,%eax
  test   %edx,%edx
  jne    L12
  test   %r8d,%r8d
  je     L276
  sub    $0x1,%r8d
  movslq %r8d,%rax
  mov    (%rsp,%rax,8),%rsi
  mov    %r10d,%eax
  jmp    L12
L276:
  movb   $0x0,0x0(%rbp)
  mov    $0xffffffff,%eax
  jmp    L257
L194:
  add    $0x1,%rbx
  mov    %cl,(%rsi)
  lea    0x1(%rsi),%rsi
  mov    %r13d,%eax
  jmp    L12
L93:
  add    $0x1,%rbx
  mov    %cl,(%rsi)
  lea    0x1(%rsi),%rsi
  mov    %r11d,%eax
  jmp    L12
  mov    %r10d,%edx
  test   %edx,%edx
  je     L75
  add    $0x1,%rbx
  mov    %cl,(%rsi)
  lea    0x1(%rsi),%rsi
  mov    %r11d,%eax
L12:
  movzbl (%rbx),%ecx
L56:
  test   %cl,%cl
  je     L170
  cmp    $0x2e,%cl
  je     L223
  cmp    $0x2f,%cl
  setne  %dl
  movzbl %dl,%edx
  add    %edx,%edx
  cmp    $0x4,%eax
  ja     L56
  mov    %eax,%eax
  movslq (%rdi,%rax,4),%rax
  add    %rdi,%rax
  notrack jmp *%rax
L75:
  test   %r8d,%r8d
  je     L29
  cmp    $0x1,%r8d
  je     L130
  sub    $0x2,%r8d
  movslq %r8d,%rax
  mov    (%rsp,%rax,8),%rsi
  mov    %r10d,%eax
  jmp    L12
L29:
  movb   $0x0,0x0(%rbp)
  mov    $0xffffffff,%eax
  jmp    L257
L130:
  movb   $0x0,0x0(%rbp)
  mov    $0xffffffff,%eax
  jmp    L257
  mov    %r10d,%edx
  test   %edx,%edx
  je     L304
  add    $0x1,%rbx
  mov    %cl,(%rsi)
  lea    0x1(%rsi),%rsi
  mov    %r11d,%eax
  jmp    L12
L304:
  add    $0x1,%rbx
  mov    %cl,(%rsi)
  lea    0x1(%rsi),%rsi
  mov    %r10d,%eax
  jmp    L12
L170:
  movb   $0x0,(%rsi)
  mov    $0x0,%eax
  jmp    L257
L223:
  cmp    $0x4,%eax
  ja     L56
  mov    %eax,%edx
  movslq (%r9,%rdx,4),%rdx
  add    %r9,%rdx
  notrack jmp *%rdx
L165:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int norm(char *dest, int len, const char *src) {
  const char *s = src;
  char *d = dest;
  char *stk[256];
  int top = 0;
  enum { L0, L1, L2, L3, L4 } state = L0;
  assert(strlen(src) <= len);
  while (*s) {
    char c = *s;
    enum { slash, dot, other } cls;
    switch (c) {
    case '/': {
      cls = slash;
      break;
    }
    case '.': {
      cls = dot;
      break;
    }
    default: {
      cls = other;
    }
    }
    switch (state) {
    case L0: {
      switch (cls) {
      case slash: {
        do {
          *d++ = *s++;
        } while (0);
        state = L1;
        break;
      }
      case dot:
      case other: {
        dest[0] = '\0';
        return -1;
      }
      }
      break;
    }
    case L1: {
      switch (cls) {
      case slash: {
        do {
          s++;
        } while (0);
        break;
      }
      case dot: {
        do {
          do {
            stk[top++] = d;
          } while (0);
        } while (0);
        do {
          *d++ = *s++;
        } while (0);
        state = L2;
        break;
      }
      case other: {
        do {
          do {
            stk[top++] = d;
          } while (0);
        } while (0);
        do {
          *d++ = *s++;
        } while (0);
        state = L4;
        break;
      }
      }
      break;
    }
    case L2: {
      switch (cls) {
      case slash: {
        do {
          do {
            if (top == 0) {
              dest[0] = '\0';
              return -1;
            }
            d = stk[--top];
          } while (0);
        } while (0);
        state = L1;
        break;
      }
      case dot: {
        do {
          *d++ = *s++;
        } while (0);
        state = L3;
        break;
      }
      case other: {
        do {
          *d++ = *s++;
        } while (0);
        state = L4;
        break;
      }
      }
      break;
    }
    case L3: {
      switch (cls) {
      case slash: {
        do {
          do {
            if (top == 0) {
              dest[0] = '\0';
              return -1;
            }
            d = stk[--top];
          } while (0);
          do {
            if (top == 0) {
              dest[0] = '\0';
              return -1;
            }
            d = stk[--top];
          } while (0);
        } while (0);
        state = L1;
        break;
      }
      case dot:
      case other: {
        do {
          *d++ = *s++;
        } while (0);
        state = L4;
        break;
      }
      }
      break;
    }
    case L4: {
      switch (cls) {
      case slash: {
        do {
          *d++ = *s++;
        } while (0);
        state = L1;
        break;
      }
      case dot:
      case other: {
        do {
          *d++ = *s++;
        } while (0);
        break;
      }
      }
      break;
    }
    }
  }
  *d = '\0';
  return 0;
}
```