user: Translate the below assembly code into C programming language:

```asm
<dn_expand>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%r10
  mov    %rcx,%r11
  movslq %r8d,%r8
  lea    (%rcx,%r8,4),%r12
  lea    0x4(%rdx),%rax
  mov    (%rdx),%r8d
  test   %r8d,%r8d
  je     L63
  mov    %rdi,%rbx
  mov    %rsi,%r9
  mov    %rsi,%r13
  sub    %rdi,%r13
  sar    $0x2,%r13
  mov    $0x0,%r14d
  mov    $0xffffffff,%ebp
L239:
  mov    %r8d,%esi
  and    $0xc0,%esi
  je     L194
  cmp    $0xc0,%esi
  je     L185
  mov    $0xffffffff,%ebp
L256:
  mov    %ebp,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L194:
  cmp    %rcx,%r11
  je     L64
  cmp    %rcx,%r12
  jbe    L277
  lea    0x4(%rcx),%rsi
  movl   $0x2e,(%rcx)
L266:
  movslq %r8d,%rdx
  shl    $0x2,%rdx
  lea    (%rsi,%rdx,1),%rcx
  cmp    %rcx,%r12
  jbe    L45
  mov    %r8d,%ecx
  lea    0x8(%rax,%rdx,1),%r15
  jmp    L164
L64:
  mov    %rcx,%rsi
  jmp    L266
L274:
  lea    0x4(%rsi),%rdx
  movl   $0x5c,(%rsi)
L28:
  lea    0x4(%rdx),%rsi
  mov    %edi,(%rdx)
  cmp    %rax,%r9
  jbe    L181
L164:
  sub    $0x1,%ecx
  js     L153
  add    $0x4,%rax
  mov    -0x4(%rax),%edi
  mov    %rsi,%rdx
  cmp    $0x2e,%edi
  jne    L28
  mov    %r15,%rdx
  sub    %rax,%rdx
  add    %rsi,%rdx
  cmp    %rdx,%r12
  ja     L274
  mov    $0xffffffff,%ebp
  jmp    L256
L153:
  lea    0x1(%r14,%r8,1),%r14d
  mov    %rsi,%rcx
  mov    %rax,%rdx
  jmp    L131
L185:
  test   %ebp,%ebp
  js     L253
L242:
  mov    %r8d,%eax
  shl    $0x8,%eax
  and    $0x3f00,%eax
  movzbl 0x4(%rdx),%edx
  or     %edx,%eax
  cltq
  lea    (%rbx,%rax,4),%rdx
  cmp    %rdx,%rbx
  ja     L154
  cmp    %r9,%rdx
  jae    L154
  add    $0x2,%r14d
  movslq %r14d,%rax
  cmp    %r13,%rax
  jge    L167
L131:
  lea    0x4(%rdx),%rax
  mov    (%rdx),%r8d
  test   %r8d,%r8d
  jne    L239
  movl   $0x0,(%rcx)
  test   %ebp,%ebp
  jns    L256
  jmp    L145
L253:
  sub    %r10,%rax
  mov    %rax,%rbp
  sar    $0x2,%rbp
  add    $0x1,%ebp
  jmp    L242
L277:
  mov    $0xffffffff,%ebp
  jmp    L256
L45:
  mov    $0xffffffff,%ebp
  jmp    L256
L181:
  mov    $0xffffffff,%ebp
  jmp    L256
L154:
  mov    $0xffffffff,%ebp
  jmp    L256
L167:
  mov    $0xffffffff,%ebp
  jmp    L256
L63:
  movl   $0x0,(%rcx)
L145:
  sub    %r10,%rax
  mov    %rax,%rbp
  sar    $0x2,%rbp
  jmp    L256
```

assistant: ```c
int dn_expand(u_char *msg, u_char *eomorig, u_char *comp_dn, u_char *exp_dn, int length) {
  u_char *cp, *dn;
  int n, c;
  u_char *eom;
  int len = -1, checked = 0;
  dn = exp_dn;
  cp = comp_dn;
  eom = exp_dn + length;
  while (n = *cp++) {
    switch (n & 0xc0) {
    case 0:
      if (dn != exp_dn) {
        if (dn >= eom)
          return (-1);
        *dn++ = '.';
      }
      if (dn + n >= eom)
        return (-1);
      checked += n + 1;
      while (--n >= 0) {
        if ((c = *cp++) == '.') {
          if (dn + n + 2 >= eom)
            return (-1);
          *dn++ = '\\';
        }
        *dn++ = c;
        if (cp >= eomorig)
          return (-1);
      }
      break;
    case 0xc0:
      if (len < 0)
        len = cp - comp_dn + 1;
      cp = msg + (((n & 0x3f) << 8) | (*cp & 0xff));
      if (cp < msg || cp >= eomorig)
        return (-1);
      checked += 2;
      if (checked >= eomorig - msg)
        return (-1);
      break;
    default:
      return (-1);
    }
  }
  *dn = '\0';
  if (len < 0)
    len = cp - comp_dn;
  return (len);
}
```