user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<norm>:
  endbr64
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %rdi,%rbp
  mov    %rdx,%rdi
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x810,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x808(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  xor    %edi,%edi
  cmp    %r12d,%eax
  setle  %dil
  call   <assert@plt>
  movzbl (%rbx),%eax
  mov    %rbp,%rsi
  xor    %ecx,%ecx
  xor    %r8d,%r8d
  lea    D15(%rip),%rdi
  lea    D14(%rip),%r11
  lea    D10(%rip),%r10
  nopl   0x0(%rax)
L171:
  test   %al,%al
  je     L90
L242:
  cmp    $0x2e,%al
  je     L240
  cmp    $0x2f,%al
  jne    L62
L260:
  cmp    $0x4,%ecx
  ja     L260
  mov    %ecx,%ecx
  movslq (%r11,%rcx,4),%rdx
  add    %r11,%rdx
  notrack jmp *%rdx
  nopl   0x0(%rax)
L62:
  cmp    $0x4,%ecx
  ja     L242
  mov    %ecx,%edx
  movslq (%rdi,%rdx,4),%rdx
  add    %rdi,%rdx
  notrack jmp *%rdx
  nopl   0x0(%rax)
  mov    $0x2,%ecx
L263:
  lea    0x1(%rbx),%rdx
  cmp    $0x1,%ecx
  je     L164
  cmp    $0x2,%ecx
  je     L143
  movzbl 0x1(%rbx),%eax
  mov    $0x1,%ecx
  mov    %rdx,%rbx
  test   %al,%al
  jne    L242
  nopl   0x0(%rax,%rax,1)
L90:
  movb   $0x0,(%rsi)
  xor    %eax,%eax
L58:
  mov    0x808(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L70
  add    $0x810,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  mov    $0x1,%edx
L50:
  lea    0x1(%rbx),%rcx
  lea    0x1(%rsi),%r9
  mov    %al,(%rsi)
  movzbl 0x1(%rbx),%eax
  mov    %r9,%rsi
  mov    %rcx,%rbx
  mov    $0x1,%ecx
  cmp    $0x1,%edx
  ja     L171
  mov    $0x4,%ecx
  jmp    L171
  nopl   0x0(%rax)
  cmp    $0x1,%ecx
  je     L267
  cmp    $0x2,%ecx
  je     L48
  test   %r8d,%r8d
  je     L167
  sub    $0x1,%r8d
  mov    $0x1,%ecx
  movslq %r8d,%rdx
  mov    (%rsp,%rdx,8),%rsi
  jmp    L171
  nopl   0x0(%rax)
L48:
  mov    %al,(%rsi)
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  add    $0x1,%rsi
  mov    $0x4,%ecx
  jmp    L171
  nop
L143:
  movslq %r8d,%rcx
  mov    %al,(%rsi)
  add    $0x1,%r8d
  movzbl 0x1(%rbx),%eax
  mov    %rsi,(%rsp,%rcx,8)
  mov    %rdx,%rbx
  add    $0x1,%rsi
  mov    $0x4,%ecx
  jmp    L171
  nopw   0x0(%rax,%rax,1)
L164:
  movslq %r8d,%rcx
  mov    %al,(%rsi)
  add    $0x1,%r8d
  movzbl 0x1(%rbx),%eax
  mov    %rsi,(%rsp,%rcx,8)
  mov    %rdx,%rbx
  add    $0x1,%rsi
  mov    $0x2,%ecx
  jmp    L171
  nopw   0x0(%rax,%rax,1)
L267:
  mov    %al,(%rsi)
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  add    $0x1,%rsi
  mov    $0x3,%ecx
  jmp    L171
L167:
  movb   $0x0,0x0(%rbp)
  mov    $0xffffffff,%eax
  jmp    L58
  nopl   (%rax)
  mov    %al,(%rsi)
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  add    $0x1,%rsi
  mov    $0x1,%ecx
  jmp    L171
  or     $0xffffffff,%edx
  jmp    L50
L240:
  cmp    $0x4,%ecx
  ja     L240
  mov    %ecx,%edx
  movslq (%r10,%rdx,4),%rdx
  add    %r10,%rdx
  notrack jmp *%rdx
L70:
  call   <__stack_chk_fail@plt>
  xor    %edx,%edx
  jmp    L50
  cmp    $0x1,%r8d
  jbe    L167
  sub    $0x2,%r8d
  mov    $0x1,%ecx
  movslq %r8d,%rdx
  mov    (%rsp,%rdx,8),%rsi
  jmp    L260
  xor    %ecx,%ecx
  jmp    L263
```

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;
}
```