user: Converte this assembly snippet into its equivalent C code:

```asm
<OPENSSL_asc2uni>:
  endbr64
  push   %r13
  push   %r12
  mov    %rcx,%r12
  movslq %esi,%rcx
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  test   %esi,%esi
  jns    L153
  call   <strlen@plt>
  mov    %rax,%rcx
L153:
  lea    0x1(%rcx),%r13
  xor    %edi,%edi
  mov    $0x2,%edx
  mov    %r13,%rsi
  call   <reallocarray@plt>
  test   %rax,%rax
  je     L177
  mov    D2(%rip),%rdx
  lea    0x0(%r13,%r13,1),%rcx
  cmp    %rcx,(%rdx)
  jb     L114
  mov    %rcx,%rsi
  sub    $0x2,%rsi
  je     L116
  lea    -0x3(%rcx),%r9
  mov    %r9,%rdi
  shr    %rdi
  lea    0x1(%rdi),%r8
  lea    (%rax,%r8,2),%rdx
  lea    (%rbx,%r8,1),%r10
  cmp    %rdx,%rbx
  setae  %dl
  cmp    %r10,%rax
  setae  %r10b
  or     %r10b,%dl
  je     L143
  cmp    $0x1d,%r9
  jbe    L143
  mov    %r8,%rdi
  xor    %edx,%edx
  pxor   %xmm1,%xmm1
  and    $0xfffffffffffffff0,%rdi
  nopw   0x0(%rax,%rax,1)
L266:
  movdqu (%rbx,%rdx,1),%xmm0
  movdqa %xmm1,%xmm2
  punpcklbw %xmm0,%xmm2
  movups %xmm2,(%rax,%rdx,2)
  movdqa %xmm1,%xmm2
  punpckhbw %xmm0,%xmm2
  movups %xmm2,0x10(%rax,%rdx,2)
  add    $0x10,%rdx
  cmp    %rdi,%rdx
  jne    L266
  mov    %r8,%rdi
  and    $0xfffffffffffffff0,%rdi
  add    %rdi,%rbx
  lea    (%rdi,%rdi,1),%rdx
  cmp    %rdi,%r8
  je     L262
  movb   $0x0,(%rax,%rdi,2)
  movzbl (%rbx),%edi
  mov    %dil,0x1(%rax,%rdx,1)
  lea    0x2(%rdx),%rdi
  cmp    %rsi,%rdi
  jae    L262
  movb   $0x0,0x2(%rax,%rdx,1)
  movzbl 0x1(%rbx),%edi
  mov    %dil,0x3(%rax,%rdx,1)
  lea    0x4(%rdx),%rdi
  cmp    %rdi,%rsi
  jbe    L262
  movb   $0x0,0x4(%rax,%rdx,1)
  movzbl 0x2(%rbx),%edi
  mov    %dil,0x5(%rax,%rdx,1)
  lea    0x6(%rdx),%rdi
  cmp    %rdi,%rsi
  jbe    L262
  movb   $0x0,0x6(%rax,%rdx,1)
  movzbl 0x3(%rbx),%edi
  mov    %dil,0x7(%rax,%rdx,1)
  lea    0x8(%rdx),%rdi
  cmp    %rdi,%rsi
  jbe    L262
  movb   $0x0,0x8(%rax,%rdx,1)
  movzbl 0x4(%rbx),%edi
  mov    %dil,0x9(%rax,%rdx,1)
  lea    0xa(%rdx),%rdi
  cmp    %rdi,%rsi
  jbe    L262
  movb   $0x0,0xa(%rax,%rdx,1)
  movzbl 0x5(%rbx),%edi
  mov    %dil,0xb(%rax,%rdx,1)
  lea    0xc(%rdx),%rdi
  cmp    %rdi,%rsi
  jbe    L262
  movb   $0x0,0xc(%rax,%rdx,1)
  movzbl 0x6(%rbx),%edi
  mov    %dil,0xd(%rax,%rdx,1)
  lea    0xe(%rdx),%rdi
  cmp    %rdi,%rsi
  jbe    L262
  movb   $0x0,0xe(%rax,%rdx,1)
  movzbl 0x7(%rbx),%edi
  mov    %dil,0xf(%rax,%rdx,1)
  lea    0x10(%rdx),%rdi
  cmp    %rdi,%rsi
  jbe    L262
  movb   $0x0,0x10(%rax,%rdx,1)
  movzbl 0x8(%rbx),%edi
  mov    %dil,0x11(%rax,%rdx,1)
  lea    0x12(%rdx),%rdi
  cmp    %rdi,%rsi
  jbe    L262
  movb   $0x0,0x12(%rax,%rdx,1)
  movzbl 0x9(%rbx),%edi
  mov    %dil,0x13(%rax,%rdx,1)
  lea    0x14(%rdx),%rdi
  cmp    %rdi,%rsi
  jbe    L262
  movb   $0x0,0x14(%rax,%rdx,1)
  movzbl 0xa(%rbx),%edi
  mov    %dil,0x15(%rax,%rdx,1)
  lea    0x16(%rdx),%rdi
  cmp    %rdi,%rsi
  jbe    L262
  movb   $0x0,0x16(%rax,%rdx,1)
  movzbl 0xb(%rbx),%edi
  mov    %dil,0x17(%rax,%rdx,1)
  lea    0x18(%rdx),%rdi
  cmp    %rdi,%rsi
  jbe    L262
  movb   $0x0,0x18(%rax,%rdx,1)
  movzbl 0xc(%rbx),%edi
  mov    %dil,0x19(%rax,%rdx,1)
  lea    0x1a(%rdx),%rdi
  cmp    %rdi,%rsi
  jbe    L262
  movb   $0x0,0x1a(%rax,%rdx,1)
  movzbl 0xd(%rbx),%edi
  mov    %dil,0x1b(%rax,%rdx,1)
  lea    0x1c(%rdx),%rdi
  cmp    %rdi,%rsi
  jbe    L262
  movb   $0x0,0x1c(%rax,%rdx,1)
  movzbl 0xe(%rbx),%edi
  mov    %dil,0x1d(%rax,%rdx,1)
L262:
  add    %rax,%rsi
L244:
  movb   $0x0,(%rsi)
  movb   $0x0,-0x1(%rax,%rcx,1)
  test   %r12,%r12
  je     L48
  mov    %ecx,(%r12)
L48:
  test   %rbp,%rbp
  je     L177
  mov    %rax,0x0(%rbp)
L177:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L143:
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L68:
  movb   $0x0,(%rax,%rdx,2)
  movzbl (%rbx,%rdx,1),%r8d
  mov    %r8b,0x1(%rax,%rdx,2)
  mov    %rdx,%r8
  add    $0x1,%rdx
  cmp    %r8,%rdi
  jne    L68
  jmp    L262
  nopl   0x0(%rax)
L116:
  mov    %rax,%rsi
  jmp    L244
  nopl   (%rax)
L114:
  mov    %rax,%rdi
  call   <free@plt>
  xor    %eax,%eax
  jmp    L177
```

assistant: ```c
unsigned char *OPENSSL_asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen) {
  size_t ulen, i;
  unsigned char *unitmp;
  if (asclen < 0)
    ulen = strlen(asc);
  else
    ulen = (size_t)asclen;
  ulen++;
  if (ulen == 0)
    return NULL;
  if ((unitmp = reallocarray(NULL, ulen, 2)) == NULL)
    return NULL;
  ulen *= 2;
  if (ulen > INT_MAX) {
    free(unitmp);
    return NULL;
  }
  for (i = 0; i < ulen - 2; i += 2) {
    unitmp[i] = 0;
    unitmp[i + 1] = *asc++;
  }
  unitmp[ulen - 2] = 0;
  unitmp[ulen - 1] = 0;
  if (unilen)
    *unilen = ulen;
  if (uni)
    *uni = unitmp;
  return unitmp;
}
```