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

```asm
<normalizePath>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rdi,%r14
  test   %esi,%esi
  je     L112
  mov    %rdi,%r13
  mov    %esi,%r12d
  mov    %edx,%ebp
  cmp    $0x2,%edx
  jle    L155
  lea    0x1(%rsi),%edi
  call   <malloc@plt>
  mov    %rax,%r14
  movl   $0x0,0x4(%rsp)
  mov    %ebp,%edx
  mov    %r13,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  add    %ebp,0x4(%rsp)
L134:
  cmp    %r12d,%ebp
  jl     L111
  jmp    L136
L117:
  cmp    %ebx,%r12d
  jle    L100
  movslq %ebx,%rbp
  add    %r13,%rbp
L20:
  movsbl 0x0(%rbp),%edi
  call   <isSlash@plt>
  test   %rax,%rax
  je     L100
  add    $0x1,%ebx
  add    $0x1,%rbp
  cmp    %ebx,%r12d
  jne    L20
L169:
  mov    0x4(%rsp),%eax
  cmp    $0x2,%eax
  je     L62
  test   %eax,%eax
  jne    L57
  movl   $0x1,0x4(%rsp)
  movb   $0x5c,(%r14)
L136:
  movslq 0x4(%rsp),%rax
  movb   $0x0,(%r14,%rax,1)
L112:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L151
  mov    %r14,%rax
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L100:
  cmp    %ebx,%r12d
  je     L169
  mov    0x4(%rsp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,0x4(%rsp)
  cltq
  movb   $0x5c,(%r14,%rax,1)
  mov    %ebx,%ebp
L79:
  cmp    %ebp,%r12d
  jle    L136
L111:
  lea    0x1(%rbp),%ebx
  movslq %ebp,%rbp
  movzbl 0x0(%r13,%rbp,1),%ebp
  movsbl %bpl,%edi
  call   <isSlash@plt>
  test   %rax,%rax
  jne    L117
  mov    0x4(%rsp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,0x4(%rsp)
  cltq
  mov    %bpl,(%r14,%rax,1)
  mov    %ebx,%ebp
  jmp    L79
L62:
  cmpb   $0x3a,0x1(%r14)
  jne    L136
  movl   $0x3,0x4(%rsp)
  movb   $0x5c,0x2(%r14)
  jmp    L136
L57:
  cmp    $0x1,%eax
  jne    L136
  movsbl (%r14),%edi
  call   <isSlash@plt>
  test   %rax,%rax
  je     L136
  mov    0x4(%rsp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,0x4(%rsp)
  cltq
  movb   $0x5c,(%r14,%rax,1)
  jmp    L136
L155:
  lea    0x1(%rsi),%edi
  call   <malloc@plt>
  mov    %rax,%r14
  movl   $0x0,0x4(%rsp)
  lea    0x4(%rsp),%rcx
  mov    %rax,%rdx
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <normalizePrefix@plt>
  mov    %eax,%ebp
  jmp    L134
L151:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *normalizePath(const char *path, int len, int off) {
  int src;
  char *sb;
  int sbLen;
  if (len == 0)
    return (char *)path;
  if (off < 3)
    off = 0;
  sb = (char *)malloc(len + 1);
  sbLen = 0;
  if (off == 0) {
    src = normalizePrefix(path, len, sb, &sbLen);
  } else {
    src = off;
    memcpy(sb + sbLen, path, off);
    sbLen += off;
  }
  while (src < len) {
    char c = path[src++];
    if (isSlash(c)) {
      while ((src < len) && isSlash(path[src]))
        src++;
      if (src == len) {
        if ((sbLen == 2) && (sb[1] == ':')) {
          sb[sbLen++] = '\\';
          break;
        }
        if (sbLen == 0) {
          sb[sbLen++] = '\\';
          break;
        }
        if ((sbLen == 1) && (isSlash(sb[0]))) {
          sb[sbLen++] = '\\';
          break;
        }
        break;
      } else {
        sb[sbLen++] = '\\';
      }
    } else {
      sb[sbLen++] = c;
    }
  }
  sb[sbLen] = '\0';
  return sb;
}
```