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

```asm
<__dn_expand>:
  endbr64
  mov    $0x100,%eax
  push   %r15
  cmp    %eax,%r8d
  push   %r14
  push   %r13
  cmovle %r8d,%eax
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %eax,-0xc(%rsp)
  cmp    %rsi,%rdx
  je     L261
  mov    %rcx,%rsi
  movzbl (%rdx),%ecx
  mov    %rdx,%r13
  test   %cl,%cl
  je     L261
  mov    %r12,%r14
  mov    %rdi,%rbp
  mov    %rdx,%rax
  mov    $0xffffffff,%r8d
  sub    %rdi,%r14
  jmp    L35
  nop
L184:
  lea    0x1(%rax),%rcx
  cmp    %rcx,%r12
  je     L261
  movzbl 0x1(%rax),%ecx
  shl    $0x8,%edx
  add    $0x2,%rax
  and    $0x3f00,%edx
  sub    %r13,%rax
  or     %ecx,%edx
  test   %r8d,%r8d
  movslq %edx,%rdx
  cmovs  %eax,%r8d
  cmp    %r14,%rdx
  jge    L261
  lea    0x0(%rbp,%rdx,1),%rax
L47:
  movzbl (%rax),%ecx
L35:
  movzbl %cl,%edx
  test   $0xc0,%cl
  jne    L184
  test   %cl,%cl
  je     L230
  lea    0x1(%rdx),%edi
  mov    %r12,%r9
  movslq %edi,%r10
  sub    %rax,%r9
  cmp    %r9,%r10
  jge    L261
  cmp    %edi,-0xc(%rsp)
  jl     L261
  lea    0x2(%rax),%r9
  mov    %rsi,%rdi
  lea    -0x1(%rdx),%r10d
  sub    %r9,%rdi
  cmp    $0xe,%rdi
  jbe    L8
  cmp    $0x6,%r10d
  jbe    L8
  mov    %edx,%ebx
  cmp    $0xe,%r10d
  jbe    L267
  movdqu 0x1(%rax),%xmm0
  mov    %edx,%edi
  shr    $0x4,%edi
  movups %xmm0,(%rsi)
  cmp    $0x1,%edi
  je     L175
  movdqu 0x11(%rax),%xmm1
  movups %xmm1,0x10(%rsi)
  cmp    $0x3,%edi
  jne    L175
  movdqu 0x21(%rax),%xmm2
  movups %xmm2,0x20(%rsi)
L175:
  mov    %edx,%edi
  and    $0xfffffff0,%edi
  mov    %edi,%r9d
  sub    %edi,%edx
  lea    (%rsi,%r9,1),%r11
  add    %rax,%r9
  cmp    %edi,%ebx
  je     L49
L92:
  sub    %edi,%ebx
  lea    -0x1(%rbx),%r15d
  cmp    $0x6,%r15d
  jbe    L69
  mov    0x1(%rax,%rdi,1),%r15
  mov    %r15,(%rsi,%rdi,1)
  mov    %ebx,%edi
  and    $0xfffffff8,%edi
  mov    %edi,%r15d
  sub    %edi,%edx
  add    %r15,%r11
  add    %r15,%r9
  cmp    %edi,%ebx
  je     L49
L69:
  movzbl 0x1(%r9),%edi
  mov    %dil,(%r11)
  cmp    $0x1,%edx
  je     L49
  movzbl 0x2(%r9),%edi
  mov    %dil,0x1(%r11)
  cmp    $0x2,%edx
  je     L49
  movzbl 0x3(%r9),%edi
  mov    %dil,0x2(%r11)
  cmp    $0x3,%edx
  je     L49
  movzbl 0x4(%r9),%edi
  mov    %dil,0x3(%r11)
  cmp    $0x4,%edx
  je     L49
  movzbl 0x5(%r9),%edi
  mov    %dil,0x4(%r11)
  cmp    $0x5,%edx
  je     L49
  movzbl 0x6(%r9),%edi
  mov    %dil,0x5(%r11)
  cmp    $0x6,%edx
  je     L49
  movzbl 0x7(%r9),%edx
  mov    %dl,0x6(%r11)
L49:
  lea    (%rax,%rcx,1),%rdx
  movslq %r10d,%r10
  add    %rsi,%rcx
  movzbl 0x1(%rdx),%ebx
  add    $0x2,%r10
  add    %r10,%rax
  neg    %bl
  sbb    %dl,%dl
  add    %r10,%rsi
  and    $0x2e,%edx
  mov    %dl,(%rcx)
  jmp    L47
  nopl   0x0(%rax,%rax,1)
L8:
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L251:
  movzbl 0x1(%rax,%rdx,1),%edi
  mov    %dil,(%rsi,%rdx,1)
  add    $0x1,%rdx
  cmp    %rcx,%rdx
  jne    L251
  jmp    L49
  nopl   0x0(%rax)
L261:
  mov    $0xffffffff,%r8d
  pop    %rbx
  pop    %rbp
  mov    %r8d,%eax
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L267:
  mov    %rax,%r9
  mov    %rsi,%r11
  xor    %edi,%edi
  jmp    L92
L230:
  add    $0x1,%rax
  pop    %rbx
  pop    %rbp
  sub    %r13,%rax
  test   %r8d,%r8d
  pop    %r12
  pop    %r13
  cmovs  %eax,%r8d
  pop    %r14
  pop    %r15
  mov    %r8d,%eax
  ret
```

assistant: ```c
int __dn_expand(const unsigned char *base, const unsigned char *end, const unsigned char *src, char *dest, int space) {
  const unsigned char *p = src;
  int len = -1, j;
  if (space > 256)
    space = 256;
  if (p == end || !*p)
    return -1;
  for (;;) {
    if (*p & 0xc0) {
      if (p + 1 == end)
        return -1;
      j = ((p[0] & 0x3f) << 8) | p[1];
      if (len < 0)
        len = p + 2 - src;
      if (j >= end - base)
        return -1;
      p = base + j;
    } else if (*p) {
      j = *p + 1;
      if (j >= end - p || j > space)
        return -1;
      while (--j)
        *dest++ = *++p;
      *dest++ = *++p ? '.' : 0;
    } else {
      if (len < 0)
        len = p + 1 - src;
      return len;
    }
  }
}
```